Altering variables in a script

Started by Scoville, Thu 19/02/2004 04:22:49

Previous topic - Next topic

Scoville

I made a variable using the drop down menu commands, but I need to access it in the script in a couple places. The variable name is GUNdistract, so I typed "GUNdistract = 1;" in the spot it should fit in the script, but when I save I get an error saying they don't know what GUNdistract is. This happens if I make it a global variable or local to a room. I tried declaring the variable in the global script as well, and that didn't work either. Any suggestions?

Hinders

you have to declare it too!
put :
int GUNdistract;

in room script.
----

Wolfgang Abenteuer

If you're changing a global variable in a room script, you need to export it from the global script and then into that room script first.  Just put export GUNdistract; at the end of your global script, and then import int GUNdistract; into the room file (if you only want it for that one room), or the script header (if you want it for more than just one room).

~Wolfgang

Scoville

Importing/exporting fixed it! Thanks!

SMF spam blocked by CleanTalk