Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-07-2003, 09:44 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: Teaching: for()

Quote:
Originally posted by Mal1core
for those of you who are new like me and dont know how the for command it used, its like saying:


if (i=0)//if the index is equil to zero it will perform the command
while(i<#)//this is like adding to the if(), saying the index must be less then 64.
and then the last section is adding or subtracting forom the index.
so all together it looks like:

for(i=0; i<64; i+=2{
in here u may put commands. i will also give one example of how this may be used.

if(created){toweapons test;
}
if(weaponfired){
for(explosionx=playerx; explosionx<64 explosionx+=1.5
putexplosion 1,explosionx,playery+1;
}
}

this script is a little messed up but does show a little how to use for.

note: props to jagen for teaching me what for's are, and also if someone can show me how to put in a scriting section to make this easier to read it would be greatly apreciated.
you misunderstood me x_X its
i=0;
while(i<#) i++;
not if(i=0)
Reply With Quote
 


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 04:05 PM.


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