Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-06-2006, 07:06 PM
Fox1545 Fox1545 is offline
Registered User
Join Date: Jul 2004
Posts: 78
Fox1545 is on a distinguished road
Scripting collab!

So as the dudes in all the other development forums are doing awesome collaborations, the scripting forums should have something similar!

I am going to post a snippet of code, and someone else contributes by adding another snippet. I suppose we should try to keep the code valid at all times, regarding clean formatting and KSI-GS conformance, and actual functionality.

Sorry about the old-GS usage, but I am not exactly experienced with the newer dialect!
NPC Code:

if (created) {
showcharacter;
// fill in look here

rupees = 1000;

message Hello there, visitor of the forums!;
}

if (playertouchsme) {
// fill in code here
if (rupees == 0)
destroy;
}


oh god i have no idea where this is going
Reply With Quote
  #2  
Old 02-06-2006, 07:32 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Eh, I haven't done GScript in a REALLY LOOOONG time, lets see if this works.

if (forumuser == "Fox1545"){
message "This is stupid..."
deleteaccount;
}
__________________
Reply With Quote
  #3  
Old 02-06-2006, 07:48 PM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
I'd like to contribute a semi colon.

;

I'm interested in seeing how this turns out. :P
Reply With Quote
  #4  
Old 02-06-2006, 07:54 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
eh... remember when survivor came out.. and it was really big.. and then they made another one.. and it was .. OKAY.. and then 100 more came out and they suck and now you cant turn on TV without seeing a reality show?
lets not turn graal forums into that.. if you get my similie
Reply With Quote
  #5  
Old 02-06-2006, 08:21 PM
Silent Silent is offline
<3
Silent's Avatar
Join Date: Mar 2005
Location: England
Posts: 132
Silent is on a distinguished road
Send a message via AIM to Silent Send a message via MSN to Silent
function onCreated() {
destroy();
}

// Thread over? o_O level and GFX collabs work, this thread really doesn't.
__________________
Quote:
Originally Posted by MilkyWay0016
The Bible also says things like...

"Stone disobedient children" (Deuteronomy 21:18-21)
Quote:
Originally Posted by Loriel
Disobedient children are likely enough to get stoned already, I think.
Reply With Quote
  #6  
Old 02-06-2006, 09:00 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
This might work, if it had a set goal that you wanted to accomplish. Something like a CVS project or so. But if no one knows where they're going with it, I think it will just turn out to be a big mess of random crap that probably won't work in the end.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #7  
Old 02-06-2006, 11:57 PM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
I am gonna have to agree with the majority here;
the first reason to write code should be becasue you have a series of steps that you want to accomplish, and they have been layed out in detail for a human to understand them before you try and make the machine understand them.
In other words, first make the algorithm, and then turn it into whatever programming language you want.
A random tacking on of code by the masses, with no defined algorithm, will not be pretty.
Perhaps conceive of a big enough process and see who can make the most efficient way of doing it.

One question: CVS project? Around this part of the country, CVS is a chain of drug stores that have nothing to do with graal or computers.
Reply With Quote
  #8  
Old 02-07-2006, 02:33 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Prozac
One question: CVS project? Around this part of the country, CVS is a chain of drug stores that have nothing to do with graal or computers.
Concurrent Versioning System, I think.

System where a lot of developers can callaborate.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #9  
Old 02-07-2006, 06:26 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by napo_p2p
Concurrent Versioning System, I think.

System where a lot of developers can callaborate.
Indeed, more information can be found here
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #10  
Old 02-07-2006, 10:50 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
NPC Code:
function onCreated() 
destroy();

__________________
Reply With Quote
  #11  
Old 02-07-2006, 06:53 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by xAndrewx
NPC Code:
function onCreated() 
destroy();

Quote:
Originally Posted by Silent
function onCreated() {
destroy();
}

// Thread over? o_O level and GFX collabs work, this thread really doesn't.

Someone beat you to it >:P
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #12  
Old 02-07-2006, 07:01 PM
Fox1545 Fox1545 is offline
Registered User
Join Date: Jul 2004
Posts: 78
Fox1545 is on a distinguished road
Shadowless, your semicolon is appreciated.

Silent, you are about as clever as filling up the graphics collabs with flood-filled green tiles.

CVS is pretty silly.

darcs is a lot more awesome, and the programming language it is written in is likely more awesome than the one C is written in.

These might be fine for regular cooperation, but for more intensive purpose you would want to use Gobby.

Also, this collab could totally have worked out if you guys were not a bunch of needlessly hostile cretins. If the dudes in the graphics forum can piece together some random picture without stepping on each others' toes, we should be able to do something correlating as well.

Of course there needs to be a common goal that everybody is working towards, but the graphics dudes did not plan it all out in advance either, they just added piece for piece. I would have assumed that scripters, who are inherently cleverer than graphics dudes, could do so as well without derailing the thread towards foreign drug stores.

why did i even try to post something cool in this forums.
also, if (created) { if (strequals(#a,Goboom)) { say2 Go back to your retarded pixelling ok; serverwarp unholy; } }
Reply With Quote
  #13  
Old 02-07-2006, 07:39 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Fox1545
Shadowless, your semicolon is appreciated.

Silent, you are about as clever as filling up the graphics collabs with flood-filled green tiles.

CVS is pretty silly.

darcs is a lot more awesome, and the programming language it is written in is likely more awesome than the one C is written in.

These might be fine for regular cooperation, but for more intensive purpose you would want to use Gobby.

Also, this collab could totally have worked out if you guys were not a bunch of needlessly hostile cretins. If the dudes in the graphics forum can piece together some random picture without stepping on each others' toes, we should be able to do something correlating as well.

Of course there needs to be a common goal that everybody is working towards, but the graphics dudes did not plan it all out in advance either, they just added piece for piece. I would have assumed that scripters, who are inherently cleverer than graphics dudes, could do so as well without derailing the thread towards foreign drug stores.

why did i even try to post something cool in this forums.
also, if (created) { if (strequals(#a,Goboom)) { say2 Go back to your retarded pixelling ok; serverwarp unholy; } }
Set some guidelines, then.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #14  
Old 02-07-2006, 09:19 PM
Tom Tom is offline
Grraaaaaw
Tom's Avatar
Join Date: May 2005
Posts: 2,037
Tom is on a distinguished road
lol, My collabs injection to the graal forums has gone even further, i should so badly get a cookie.
Reply With Quote
  #15  
Old 02-08-2006, 12:01 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
NPC Code:

for(i=0;i<1000;i++){
blah();
}
function blah(){
for(i=0;i<1000;i++){
blah();
}
}



haha =D
Reply With Quote
  #16  
Old 02-08-2006, 12:11 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
I'm not so sure about this thread.
Reply With Quote
  #17  
Old 02-09-2006, 03:01 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally Posted by Fox1545
if (created) { if (strequals(#a,Goboom)) { say2 Go back to your retarded pixelling ok; serverwarp unholy; } }
Well Fox, you see there is a difference between you and me, I can pixel, you, you can't code for ****. =]
__________________
Reply With Quote
  #18  
Old 02-09-2006, 03:27 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Goboom
Well Fox, you see there is a difference between you and me, I can pixel, you, you can't code for ****. =]
Considering the source, I laughed.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #19  
Old 02-09-2006, 03:40 PM
Silent Silent is offline
<3
Silent's Avatar
Join Date: Mar 2005
Location: England
Posts: 132
Silent is on a distinguished road
Send a message via AIM to Silent Send a message via MSN to Silent
Quote:
Originally Posted by Fox1545
Silent, you are about as clever as filling up the graphics collabs with flood-filled green tiles.
Don't you mean sand tiles?

Quote:
Originally Posted by Fox1545
Of course there needs to be a common goal that everybody is working towards, but the graphics dudes did not plan it all out in advance either, they just added piece for piece. I would have assumed that scripters, who are inherently cleverer than graphics dudes, could do so as well without derailing the thread towards foreign drug stores.
I was going to write a long-ass paragraph here, but it basically boils down to: GScript is not as modular as a flat black and white grid.
__________________
Quote:
Originally Posted by MilkyWay0016
The Bible also says things like...

"Stone disobedient children" (Deuteronomy 21:18-21)
Quote:
Originally Posted by Loriel
Disobedient children are likely enough to get stoned already, I think.
Reply With Quote
  #20  
Old 02-09-2006, 03:58 PM
petro1212 petro1212 is offline
Angelus
petro1212's Avatar
Join Date: Mar 2003
Location: The Moon
Posts: 445
petro1212 is on a distinguished road
Send a message via AIM to petro1212 Send a message via MSN to petro1212
.. a code contribution *thinks*

Quote:
for (i=0;i<4000;i++){
biatchslap(Fox);
}
Don't pick on Goboom, that's like laughing at Forest Gump you just don't laugh at iconic people =O!
__________________
Reply With Quote
  #21  
Old 02-09-2006, 04:08 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
somebody delete EVERY post in this thread, and let us try this again

if (playerchats) {
if (strcontains(#c,"name")){
message "My name is Bob";
}
}
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #22  
Old 02-09-2006, 04:15 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by adam
somebody delete EVERY post in this thread, and let us try this again

if (playerchats) {
if (strcontains(#c,"name")){
message "My name is Bob";
}
}
Let's start in GS2 too.

NPC Code:
function onCreated()
message("Start Here");

__________________
Reply With Quote
  #23  
Old 02-09-2006, 04:52 PM
petro1212 petro1212 is offline
Angelus
petro1212's Avatar
Join Date: Mar 2003
Location: The Moon
Posts: 445
petro1212 is on a distinguished road
Send a message via AIM to petro1212 Send a message via MSN to petro1212
NPC Code:
function onCreated()
{
message("You'r too big to fit in here, too big to fit in here, too big to fit in here");
openurl(http://www.youtube.com/?v=ybFVvvGuRiM);
}



Hey I tried !
__________________
Reply With Quote
  #24  
Old 02-09-2006, 07:10 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by adam
somebody delete EVERY post in this thread, and let us try this again

if (playerchats) {
if (strcontains(#c,"name")){
message "My name is Bob";
}
}
And this is exactly why things like this won't work. If you're using old gscript, you do not put strings in quotes.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #25  
Old 02-09-2006, 09:41 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by petro1212
.. a code contribution *thinks*
If you want to subject him to an eternal 'biatch slap' of death:

PHP Code:
while (true) {
  
biatchslap(Fox);

__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #26  
Old 02-09-2006, 11:26 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
This thread is the scripting forum at its worst

Not because of Fox, no, the idea is great.

It started going sour at like the second post, much like all potiential threads do, then it followed when people who dont normally script came by to deposit their much unneeded opinion about the idea.

One of the main reasons something like this wouldnt work is because people would contribute solely to mess it up, and make things unorganized. Plus people who just dont script properly, look an xAndrewx and his post, that drives me crazy ;[ (Not to pick on anyone, but thats the easiest one i see to hit up for not following some kind of good style).

I would guess a couple of guidelines would have helped out
Ex: Adding like 5 lines of code to the initial 5 lines of code, and just let the next people figure out what kind of goal they are all working towards.

Oh well, this thread has already gone further south then im willing to go, i still say it could have worked.
Reply With Quote
  #27  
Old 02-10-2006, 12:23 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Collaboration lacking abstraction of a problem is a very very bad idea in scripting. You can't just be random. I'd suggest starting with what you want to make. Ex. Chess
Then you work as a group to determine what functions and objects you will make (in our case an object will always be an npc).

What would you want for a chess script?
Board NPC with
board_x[] array for setting the xs where the pieces go
board_y[] array

Pawn NPCs
Knight NPCs
Bishop NPCs
Rook NPCs
Queen NPCs
King NPCs
Self-Check test/move unsetter
Stalemate test
Checkmate test
movement controller

Each piece will have a team var.
They will need to check to see if their move is valid
I can tell you by experience, that for the pieces, pawns will be the hardest and knights will be the easiest. You would want to start with specifying the chessboard class though, since it's relevant to all other classes and functionality.

Last edited by jake13jake; 02-10-2006 at 12:46 AM..
Reply With Quote
  #28  
Old 02-10-2006, 06:31 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
something like a chess game would be a great excersize in algorithm writing.
especially with the player turn control built in somehow through the server etc.
Then once the algoritm is sufficient, express it in gs2
Reply With Quote
  #29  
Old 02-10-2006, 06:35 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
I believe a knight can only move if the board distance it is being moved is equal to the square root of five.

It cannot move onto a board coordinate that another piece of it's own team occupies.

If it lands on another team's piece, that piece is set aside.

But yes, if there's going to be a collaboration thread, we'd all have to discuss the functionality and then assign certain objects and tasks to people. Programmers/Scripters are generally the one's that have to collaborate the most. You should be ashamed if you're not able to do so.

Last edited by jake13jake; 02-10-2006 at 07:01 AM..
Reply With Quote
  #30  
Old 02-10-2006, 08:51 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
I like how you all have no idea you're actually talking to Loriel.

You silly people who aren't paying attention, you.
Reply With Quote
  #31  
Old 02-10-2006, 11:12 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Just because he's Loriel, should they change their opinions on him?
__________________
Reply With Quote
  #32  
Old 02-10-2006, 11:16 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by xAndrewx
Just because he's Loriel, should they change their opinions on him?
What?

Edit: I have absolutely no idea why you PMed this to me instead of clarifying it here, but whatever:

Quote:
You've basically asked for them to change their opinions on him, because he's Loriel. If not, what message was you trying to bring?
No, I didn't. I just said in as many words that I thought people's replies have been pretty funny considering his true identity. I especially like the one that says Ben cannot code!
Reply With Quote
  #33  
Old 02-10-2006, 04:39 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally Posted by Lance
No, I didn't. I just said in as many words that I thought people's replies have been pretty funny considering his true identity. I especially like the one that says Ben cannot code!

Yeah, If people knew who it was they may have taken the thought seriously.

But since it's just a 'noob' he's free to be bashed away.

Prime example of the scripting forums at it's very very best.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #34  
Old 02-10-2006, 05:20 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Lance
What?

Edit: I have absolutely no idea why you PMed this to me instead of clarifying it here, but whatever:



No, I didn't. I just said in as many words that I thought people's replies have been pretty funny considering his true identity. I especially like the one that says Ben cannot code!
Great, I PM you something expecting for it not to be 'seen' by other members, as it's a PRIVET MESSAGE.
__________________
Reply With Quote
  #35  
Old 02-10-2006, 05:26 PM
Antago Antago is offline
Banned
Antago's Avatar
Join Date: Mar 2001
Location: Akron, Ohio
Posts: 1,488
Antago is on a distinguished road
Quote:
Originally Posted by Warcaptain
eh... remember when survivor came out.. and it was really big.. and then they made another one.. and it was .. OKAY.. and then 100 more came out and they suck and now you cant turn on TV without seeing a reality show?
lets not turn graal forums into that.. if you get my similie
I think we should. It's awesome to have people working together, and we can end up making awesome material. It's better than having no new material and people whining all the time, don't you agree?

Why do people hate good things and want to put an end to them? They are secretly taking on the archetype of the Suicidal, I think.
Reply With Quote
  #36  
Old 02-10-2006, 08:17 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally Posted by Antago
I think we should. It's awesome to have people working together, and we can end up making awesome material. It's better than having no new material and people whining all the time, don't you agree?

Why do people hate good things and want to put an end to them? They are secretly taking on the archetype of the Suicidal, I think.
I enjoy good things when they are for making good things.. not for making people look better.
Reply With Quote
  #37  
Old 02-11-2006, 12:41 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by xAndrewx
Great, I PM you something expecting for it not to be 'seen' by other members, as it's a PRIVET MESSAGE.
Perhaps you will refrain from putting words in my mouth in the future!

also:
priv·et
n.

1. Any of several shrubs of the genus Ligustrum, especially L. vulgare or L. ovalifolium, having opposite leaves and clusters of white flowers and widely used for hedges.
2. Any of several similar or related plants.

-

The proper spelling is right in front of you at the top of nearly every page served by these forums. There's no excuse for that misspelling.
Reply With Quote
  #38  
Old 02-11-2006, 12:45 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by adam
Yeah, If people knew who it was they may have taken the thought seriously.
Maybe, maybe not. Can you prove it?

Quote:
But since it's just a 'noob' he's free to be bashed away.
What? Who said that? Where or how is this true?

Quote:
Prime example of the scripting forums at it's very very best.
Stupid replies are the best of the scripting forums? Please put some thought into your posts instead of senselessly bashing this forum and its users.
Reply With Quote
  #39  
Old 02-11-2006, 01:22 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by adam
Yeah, If people knew who it was they may have taken the thought seriously.
The thought was taken seriously. The problem is that a scripting collab just will not work as expected without a set objective. Also, I knew who the poster in question was, and my opinion stayed the same as it would have for any other person posting this.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #40  
Old 02-11-2006, 03:15 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
The thought was taken seriously. The problem is that a scripting collab just will not work as expected without a set objective. Also, I knew who the poster in question was, and my opinion stayed the same as it would have for any other person posting this.
Oh, so I take it that nobody's going to take my objective.

Let me start you off since I actually started making a chess script a long long time ago (but since it's old, it might not be as good).

Class Knight:
PHP Code:
function check_move(newx,newy,oldx,oldy) {
  return 
dist(oldx,newx,oldy,newy) == 5^0.5;

Class King:
PHP Code:
function check_move(newx,newy,oldx,oldy) {
  return 
dist(oldx,newx,oldy,newy) <= 1.5;

Class Pawn (as I said, the hardest):
PHP Code:
function check_move(newx,newy,oldx,oldy) {
  
this.dist dist(oldx,newx,oldy,newy);
  if (
this.dist 2) return 0;
  else if ((
newy oldy) * this.test_a 0) return 0;
  else if (
oldx != newx) {
    if (
this.dist != 2^0.5) return 0;
    else return 
level.chessboard[oldy][oldx] * level.chessboard[newy][newx] != 0;
  } else if (
level.chessboard[oldy+this.test_a][oldx] != 0) return 0;
  else if (
this.dist == 2) {
    if (
level.chessboard[newy][newx] != 0) return 0;
    else return 
oldy == this.test_a 3.5 * (this.test_a 1);
  } else return 
1;
}
//I don't even remember what this.test_a is anymore. 
Useful functions for queen/bishop/rook:
PHP Code:
function check_jump(newx,newy,oldx,oldy) {
  
newx;
  
newy;
  while (
!= oldx || != oldy) {
    
+= attdir(oldx newx);
    
+= attdir(oldy newy);
    if (
== oldx && == oldy) return 1;
    else if (
level.chessboard[j][i] != 0) return 0;
  }
}

function 
check_diagonal(newx,newy,oldx,oldy) {
  if (
abs(newx oldx) != abs(newy oldy)) return 0;
  else return 
check_jump(newx,newy,oldx,oldy);
}

function 
check_straight(newx,newy,oldx,oldy) {
  if (!(
newx == oldx || newy == oldy)) return 0;
  else return 
check_jump(newx,newy,oldx,oldy);

I believe level.chessboard saves booleans for whether the square on the board is occupied?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.