Reply to A bit of scripting help needed!
If you don't have an account, just leave the password field blank.
Ok, I have come across yet another problem. I will try to explain is as briefly as possible. Now I made a script which summons creatures taking a lot of ideas from rabidwolf9's Summon Spell. Now if this summoned creature kills an enemy how do you add experience to Dink's pocket. I have tried using the method rabid used in his file but with no success. Using a local variable, say:
int &mtarget = get_sprite_with_this_brain(9, ¤t_sprite);
int &ehp
int &my_exp;
&ehp = sp_hitpoints(&mtarget, -1);
&my_exp = sp_exp(&mtarget, - 1);
Now in the atack sommand of the summoned creature's script I use:
void attack(void)
{
int &mcounter;
playsound(31, 18050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
if (&enemy_ehp == 0)
{
add_exp(&my_exp, 1);
&my_exp = 0;
&mtarget = 0;
}
}
Someone please help me by pointing out where exactly I am committing the huge blunder!
int &mtarget = get_sprite_with_this_brain(9, ¤t_sprite);
int &ehp
int &my_exp;
&ehp = sp_hitpoints(&mtarget, -1);
&my_exp = sp_exp(&mtarget, - 1);
Now in the atack sommand of the summoned creature's script I use:
void attack(void)
{
int &mcounter;
playsound(31, 18050,0,¤t_sprite, 0);
&mcounter = random(4000,0);
sp_attack_wait(¤t_sprite, &mcounter);
if (&enemy_ehp == 0)
{
add_exp(&my_exp, 1);
&my_exp = 0;
&mtarget = 0;
}
}
Someone please help me by pointing out where exactly I am committing the huge blunder!






