Script Problem and some questions.
In my Milder D-Mod, I have a scene where Quackers gives Milder some magic for some money. But the script won't work. I think there's some problem with the local variable. I made a local variable called &gimme. But Milder doesn't get the magic, nor does Quackers do anyting after the void main script.
void main( void) { int &gimme; &gimme = 0; if(&story == 1) { freeze(1); freeze(¤t_sprite); say_stop("Hey, Quackers!", 1); wait(2500); move_stop( ¤t_sprite, 4, 166, 1); say_stop("`3 What is the meaning of this?", ¤t_sprite); say_stop(" Terribly sorry to disturb you sir, but I need help.", 1); say_stop(" I need some magic to slay a Bonca", 1); say_stop("`3 Use you fists. You have such fat hands", ¤t_sprite); wait(2000); say_stop("`3 I will give it to you, in return for 20 gold pieces.", ¤t_sprite); &gold -= 20; say("Hey! You didn't give me any magic!", 1); &gimme = 1; unfreeze(1); unfreeze(¤t_sprite); } } void talk( void); { if( &gimme == 1) { say_stop("`3 All right. Here you go", ¤t_sprite); add_magic("item-fb", 437, 1); &gimme = 2 } if(&gimme == 2) { say("`3 Get lost!", ¤t_sprite); } } ]
Please note that as a rule of the thumb local variable does not survive screen changes. So you will continue to get the magic every time you leave the screen and ask for it again. Also note that in the void talk(void) both the &gimme == 1 and &gimme == 2 will be executed. Perhaps this is intentional, but I thought I'd just remind you.
As for your problem, replace this:
with this:
Procedures such as void talk, void main or void hit should not have a semicolon!

As for your problem, replace this:
void talk(void);
with this:
void talk(void)
Procedures such as void talk, void main or void hit should not have a semicolon!
It might be the space, too.
should be
And if it is intentional, that last thing metatarasal metioned, then there's no need for the &gimme == 2 at all, you could just do this if you like:
if( &gimme == 1)
should be
if(&gimme == 1)
And if it is intentional, that last thing metatarasal metioned, then there's no need for the &gimme == 2 at all, you could just do this if you like:
void talk(void) { if(&gimme == 1) { say_stop("`3 All right. Here you go", ¤t_sprite); add_magic("item-fb", 437, 1); &gimme = 2; //don't forget semicolon here! } say("`3 Get lost!", ¤t_sprite); }
Thanks you both! I'll try it. By the way, how do you copy the map from another D-Mod? (ALL screens) I found a file called FreeMap and decided to use it instead of creating everything. I copy the map.dat file into my D-Mod directory but only one screen shows up.
Oh, and I'll make the &gimme a global variable instead of a story variable! That way it WILL survive screen changes
Oh, and I'll make the &gimme a global variable instead of a story variable! That way it WILL survive screen changes
FreemMap? Sounds... Lazier than any other Dmodder...
You honestly can't expect to use someone elses map and get away with small modifications when they'll have their own sprites, hardness, and even scripts set up for things. You'll have enemy sprites that just sit there if you attempt it, I reckon.
And if it is only one screen that shows up, then that's the only screen on this so-called free map.
EDIT: After reading through a second thread this post has become redundant.

You honestly can't expect to use someone elses map and get away with small modifications when they'll have their own sprites, hardness, and even scripts set up for things. You'll have enemy sprites that just sit there if you attempt it, I reckon.
And if it is only one screen that shows up, then that's the only screen on this so-called free map.
EDIT: After reading through a second thread this post has become redundant.

No. It has no sprites, it is basically just the map with no interactive stuff. And if you play the FreeMap itself it has 350+screens.