Heyho.
Is there a way that your Shields also block enemies themselves (not only their attacks), like in Link's Awakening and the other Game Boy games?
I want this function, because I use the GBshield-globalscript.
Is it possible (and not too difficult) for someone of you, to make a itemscript for the shields in that way?
Thank you for your answers.
(sorry for my bad english)
Shield can "push away" (block) enemies
Started by
Rastael
, Apr 15 2011 04:57 AM
5 replies to this topic
#1
Posted 15 April 2011 - 04:57 AM
#2
Posted 15 April 2011 - 07:55 AM
Here is an idea for willing coders:
CODE
(Psuedocode)
if (Link->Dir==DIR_RIGHT){
if ({enemy}->X == Link->X + 9){
{enemy}->X = Link->X + 10
}
}
And so on...
if (Link->Dir==DIR_RIGHT){
if ({enemy}->X == Link->X + 9){
{enemy}->X = Link->X + 10
}
}
And so on...
Edited by MoscowModder, 15 April 2011 - 07:55 AM.
#3
Posted 15 April 2011 - 09:08 PM
It's actually not that simple MoscowModder...
The idea is to check whether Link touches an npc or a eweapon while using the shield, then making him move backward depending on his direction, while making sure Link doesn't end on solid combos.
I might take a deeper look into it tomorrow, but now I got to sleep.
The idea is to check whether Link touches an npc or a eweapon while using the shield, then making him move backward depending on his direction, while making sure Link doesn't end on solid combos.
I might take a deeper look into it tomorrow, but now I got to sleep.
#4
Posted 15 April 2011 - 09:47 PM
That pretty hard to make that to push enemy away. I have no idea how to do it myself because I never make a quest.
#5
Posted 16 April 2011 - 08:12 PM
Zeldaman23: I would suggest not to post in a scripting request topic unless your post can actually help the topic author.
Anyway, try this one:
I'm too tired to test this now... :S
EDIT- Hmm, this one is not pushing Link, but making him invincible while not be able to put out his sword... Aww it's not that easy...
Anyway, try this one:
CODE
const int LINK_MISC_SHIELD = 0;
const int LINK_SHIELD_SOUND = 45;
const int LINK_SHIELD_ID = 90;
item script GB_shield
{
void run(int equip_sound)
{
Link->Misc[LINK_MISC_SHIELD] = !Link->Misc[LINK_MISC_SHIELD];
Game->PlaySound(equip_sound);
}
}
global script activeScript
{
void run()
{
Link->Misc[LINK_MISC_SHIELD] = 0;
float previous_hp = Link->HP;
int previous_action = Link->Action;
while(true)
{
if(Link->Misc[LINK_MISC_SHIELD] && Link->HeldItem == LINK_SHIELD_ID)
{
float previous_hp = Link->HP;
int previous_action = Link->Action;
Link->InputA = false;
Waitdraw();
if(Link->HP < previous_hp && (Link->Action == LA_GOTHURTLAND || Link->Action == LA_GOTHURTWATER ) )
{
Link->HP = previous_hp;
Link->Action = previous_action;
Game->PlaySound(LINK_SHIELD_SOUND);
}
}
else
Link->Misc[LINK_MISC_SHIELD] = 0;
Waitframe();
}
}
}
const int LINK_SHIELD_SOUND = 45;
const int LINK_SHIELD_ID = 90;
item script GB_shield
{
void run(int equip_sound)
{
Link->Misc[LINK_MISC_SHIELD] = !Link->Misc[LINK_MISC_SHIELD];
Game->PlaySound(equip_sound);
}
}
global script activeScript
{
void run()
{
Link->Misc[LINK_MISC_SHIELD] = 0;
float previous_hp = Link->HP;
int previous_action = Link->Action;
while(true)
{
if(Link->Misc[LINK_MISC_SHIELD] && Link->HeldItem == LINK_SHIELD_ID)
{
float previous_hp = Link->HP;
int previous_action = Link->Action;
Link->InputA = false;
Waitdraw();
if(Link->HP < previous_hp && (Link->Action == LA_GOTHURTLAND || Link->Action == LA_GOTHURTWATER ) )
{
Link->HP = previous_hp;
Link->Action = previous_action;
Game->PlaySound(LINK_SHIELD_SOUND);
}
}
else
Link->Misc[LINK_MISC_SHIELD] = 0;
Waitframe();
}
}
}
I'm too tired to test this now... :S
EDIT- Hmm, this one is not pushing Link, but making him invincible while not be able to put out his sword... Aww it's not that easy...
#6
Posted 18 April 2011 - 05:00 AM
Thank you.
But I get an error on this line:
Pass4: Error T17: "Cannot cast from bool to float"
But I get an error on this line:
QUOTE
Link->Misc[LINK_MISC_SHIELD] = !Link->Misc[LINK_MISC_SHIELD];
Pass4: Error T17: "Cannot cast from bool to float"
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users