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-02-2002, 09:30 AM
Will45 Will45 is offline
Banned
Join Date: Jan 2002
Location: San Diego, California
Posts: 59
Will45 is on a distinguished road
Send a message via AIM to Will45
For command?

Could someone teach me this? Thanks.
Reply With Quote
  #2  
Old 02-02-2002, 09:43 AM
Lomgren Lomgren is offline
Senior Member, Anti-Spam
Join Date: Mar 2001
Location: Missouri
Posts: 196
Lomgren will become famous soon enough
Post

Simple, wel once you have it figured out atleast, heh.

take this;

for (i=0; i<20; i++) {
x = i;
sleep .5;
}

it starts by setting the variable 'i' to 0,
then it does the enclosed script, (setting the npc's x to i, and sleeping so the progress can be watched) then
it adds 1 to i and repeats, it will repeat operating this way untill
the flag, i<20, is not true. Meaning it will stop when the npc's x is 20. There are quite a number of things that the for command can be used for, most common is going through indexes. If you want to know about that, just ask, I may even forget the service charge
__________________
Lomgren - devoted to classic, even though I may be gone for months on end
Reply With Quote
  #3  
Old 02-02-2002, 09:51 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
better example, i think, you can see what happens.
NPC Code:

for (i=0; i<11; i++; ) {
showimg i,@#v(i),5,100+(i*20);
changeimgvis i,4;
}



try it.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #4  
Old 02-02-2002, 10:08 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 will become famous soon enough
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
your mind is too complex for me
__________________
Reply With Quote
  #5  
Old 02-02-2002, 10:22 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by zell12
your mind is too complex for me
??? lol ???

i saw in the other thread u posted RaWr...u trying to up ur post count? lol :o
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #6  
Old 02-02-2002, 10:43 AM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 will become famous soon enough
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
yes... Thats why I was posting the nw and new improvments forums...lol
__________________
Reply With Quote
  #7  
Old 02-02-2002, 11:55 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Also:

for (i=0;i<20;i++) {
}

Is basically:

i=0;
while (i<20) {
i++;
}

Why use for ? Cause you can incorporate actions into it ...

for (i=0; i<11; i++; ) {
showimg i,@#v(i),5,100+(i*20);
changeimgvis i,4;
}

So, while, i, is adding to itself it will show text for each
number represented by i ...
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 10:03 PM.


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