The Dink Network

Reply to Re: The int &crap part

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
October 27th 2003, 08:20 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
int &crap;

means you create a local variable which can hold a value which you can use in that script. For example:

int &crap = 5;
//&crap = 5
int &crap = &story;
//&crap = the value of the variable story
int &crap = sp(13);
//&crap = the in-game value of editorsprite 13
int &crap = save_x(1, -1);
//&crap = value of x-coordinate of Dink

Take note that it's a local variable and can therefore only be used in that script. If you want a variable that can be used in various scripts, make a global one. Place a line like this in main.c:

make_global_int("&var", 0);

where &var is the name of the variable. Using &crap or &junk as a global isn't a good idea because various scripts already use those variables as locals.