Heart container
#1
Posted 29 November 2008 - 11:56 AM
#2
Posted 29 November 2008 - 12:17 PM
#3
Posted 29 November 2008 - 12:19 PM
#4
Posted 29 November 2008 - 12:32 PM
Don't use Waitframe(). It's the same as Quit() in item scripts, since they only run for one frame.
Unless you put it in a while() loop, in which case it'll stop the game from freezing. So yeah, take the Waitframe()out, and I'd say you should probably put the HP statement before the message statement.
Even better, edit the item itself to completely fill your HP when you pick it up. Just change "Increase Counter" on the Pickup tab to 384.
#5
Posted 29 November 2008 - 02:11 PM
#6
Posted 29 November 2008 - 02:47 PM
item script HeartContainer{ void run(){ Link->HP = Link->MaxHP; Screen->Message(S_PICKUP);
}//end of void run
}//end of script
Didn't compile for me unless it was arranged like that. Easier to read too.
#7
Posted 29 November 2008 - 02:51 PM
#8
Posted 29 November 2008 - 02:53 PM
I'm assuming you didn't actually arrange it like that when you wrote it drz (dyumind if I call you drz?)?
It's obviously really quite difficult to read when you put it out on one line like that.
And you do need Waitframe() in an infinite while loop to stop it crashing Sillycat, but for that reason you can't have an infinite while loop in an item script (unless you just wanna crash the system).
Once it hits Waitframe(), the script ends.
#9
Posted 29 November 2008 - 02:57 PM
void run(int m){
Link->HP = Link->MaxHP;
Screen->Message(m);
}
}
And I'm assuming that this one will do that same thing, but with Magic.
void run(int m){
Link->MP = Link->MaxMP;
Screen->Message(m);
}
}
Edited by Lithium, 29 November 2008 - 09:57 PM.
#11
Posted 29 November 2008 - 03:12 PM
#12
Posted 29 November 2008 - 06:34 PM
item script HeartContainer{
void run(int s){
Link->HP = Link->MaxHP;
Screen->Message(s);
}//End of void run
}//End of script
there, it's all fixed up and ready to go..just set D0 to the message it will play when the heart container is picked up and it will heal your health completely after it
set the script in the item pick-up tab.
Edited by drzchulo973, 29 November 2008 - 09:48 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users