add_exp display issue
O.K, I'm using add_exp in the die sequence for my monsters for my monsters because the spells I'm using use the hurt command. For my slimes and pillbugs the experience number displays appear above the monster. For the boncas, however, it seems to show up at a seemingly random place on the screen whenever I kill one. Anyone know what might be causing this? I can post the scripts up if anyone thinks it might help.
Addendum - on closer inspection, it isn't even granting the amount of experience it's supposed to (30), instead pulling a seemingly random number between 4 and 20 out of the air. On even closer inspection, I have a strong suspicion that this number may actually be the number of active sprites on screen. I get the feeling this ought to tell me more about what is causing the bug than it does.
Apologies - i hadn't used the command properly. Argh.
Now if only I can figure out what the hell's going on with my magic then I'll be rocking.
Now if only I can figure out what the hell's going on with my magic then I'll be rocking.
i dont know if it will help you at all or not but i used the hurt command to deal damage with my barbeque flamethrower thing
I don't know if this will help, but you could use a small trick, to avoid using the sp_exp command.
int &monsterx = sp_x(&missile_target,-1);
int &monstery = sp_y(&missile_target,-1);
int &bang = create_sprite(&monsterx,&monstery,0,0,0);
sp_nodraw(&bang,1);
sp_strength(&bang,20);//set here the damage
sp_brain(&bang,17);
This will create an invisible projectile, that will hurt the monster, and if the monster is hurt by this, he will know dink hit him.
int &monsterx = sp_x(&missile_target,-1);
int &monstery = sp_y(&missile_target,-1);
int &bang = create_sprite(&monsterx,&monstery,0,0,0);
sp_nodraw(&bang,1);
sp_strength(&bang,20);//set here the damage
sp_brain(&bang,17);
This will create an invisible projectile, that will hurt the monster, and if the monster is hurt by this, he will know dink hit him.
Sorry I didn't make it clear in my last post - I fixed the experience error, it was a pretty dumb typo.
Of course, if anyone is able to think of why a fireball would detonate right next to you without apparently hitting anything if you, say, map it to the attack button and start chucking them all over the place (generally it happens after killing something), let me know! I'm going to be AFK for about a week though.
Of course, if anyone is able to think of why a fireball would detonate right next to you without apparently hitting anything if you, say, map it to the attack button and start chucking them all over the place (generally it happens after killing something), let me know! I'm going to be AFK for about a week though.