Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-08-2002, 10:40 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
creating array variables like the built-in ones

What if we could make variables that are set up like players[].x/y/dir/hearts/soon? This would make so many things so much easier. Instead of looping through all of the npcs or players looking for something that must be in common for player-made bombs or such. We could just loop through the correct array variable. It could used with the putnpc command, and work the same as in java. You would put the variables of an npc in the .txt file and you could access them through filename[index].variable. For instance, a new bomb;

newbomb.txt-
NPC Code:

if (created) {
fuse = 5;
power = 2;
radius = 2;
timeout = .1;
}
and_the_bomb_script;



the x and y would be automatic, since they are set when you put the npc.

then lets say that you want to do something with the bomb, no problem! Just access the bomb's variables;
newbombscount
newbombs[index].x
newbombs[index].y
newbombs[index].fuse
newbombs[index].radius
and go to town!
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:07 AM.


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