The int &crap part
I've always wondered what the int &crap part means Can someone please tell me? Thanks
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.
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.
Not that we mind answeing questions, but let me point you to a very good refernce for this stuff:
DinkC Reference v3.1 by Ted Shutes
It's in the Development files section.
It's a HUGE file but you can find what you need fast by using the search command. And if you put a # before what you search for (eg #int) it will take you right to the main description of that command.
DinkC Reference v3.1 by Ted Shutes
It's in the Development files section.
It's a HUGE file but you can find what you need fast by using the search command. And if you put a # before what you search for (eg #int) it will take you right to the main description of that command.
Hehe, here's the link, Paul
.

Ok, thanks.... I guess i do need it
I don't wanna be a pain in the butt, I understand what ya mean, no hard feelings ....



I don't wanna be a pain in the butt, I understand what ya mean, no hard feelings ....


About local variables. I have found these aren't read by custom procedures (unless created in the custom procedure itself)
ie - in a sample trader script which is usually attached to a bench and generates a trade dude which he shall call &trader so he talks to Dink instead of the bench... then if you create a custom procedure - say like "getDinkDrunk()" then the &trader variable doesn't seem to be recognised.
I got around this by using the tempholder global variables that the original game uses - &temphold, &temp1hold... etc
ie - in a sample trader script which is usually attached to a bench and generates a trade dude which he shall call &trader so he talks to Dink instead of the bench... then if you create a custom procedure - say like "getDinkDrunk()" then the &trader variable doesn't seem to be recognised.
I got around this by using the tempholder global variables that the original game uses - &temphold, &temp1hold... etc