Edited by MoscowModder, 03 May 2012 - 11:00 PM.
Assigning items to button?
Started by
ABH15
, Apr 27 2012 04:10 PM
18 replies to this topic
#16
Posted 03 May 2012 - 10:59 PM
So, just to be clear on this... you just want it set up that you can't have the sword and hammer equipped at the same time? By the method I'm thinking of, the script will need to know how many different swords (and hammers) you have in your game.
#17
Posted 04 May 2012 - 05:43 AM
Yes that is correct. And I have:
Four swords (wooden, white, magic, master) and one hammer(just the regular one)
Four swords (wooden, white, magic, master) and one hammer(just the regular one)
Edited by ABH15, 04 May 2012 - 05:44 AM.
#18
Posted 04 May 2012 - 10:08 AM
Give this a shot. It disables the B button when both hammer and sword are equipped.
CODE
global script noSwordAndHammer{
void run(){
while(true){
if ( GetEquipmentA() == I_HAMMER ){
if ( GetEquipmentB() == I_SWORD1
|| GetEquipmentB() == I_SWORD2
|| GetEquipmentB() == I_SWORD3
|| GetEquipmentB() == I_SWORD4 )
Link->InputB = false;
}
else if ( GetEquipmentB() == I_HAMMMER ){
if ( GetEquipmentA() == I_SWORD1
|| GetEquipmentA() == I_SWORD2
|| GetEquipmentA() == I_SWORD3
|| GetEquipmentA() == I_SWORD4 )
Link->InputB = false;
}
Waitframe();
}
}
}
void run(){
while(true){
if ( GetEquipmentA() == I_HAMMER ){
if ( GetEquipmentB() == I_SWORD1
|| GetEquipmentB() == I_SWORD2
|| GetEquipmentB() == I_SWORD3
|| GetEquipmentB() == I_SWORD4 )
Link->InputB = false;
}
else if ( GetEquipmentB() == I_HAMMMER ){
if ( GetEquipmentA() == I_SWORD1
|| GetEquipmentA() == I_SWORD2
|| GetEquipmentA() == I_SWORD3
|| GetEquipmentA() == I_SWORD4 )
Link->InputB = false;
}
Waitframe();
}
}
}
#19
Posted 04 May 2012 - 02:35 PM
Just to clarify, I have to make the A button a selectable item now right? Because otherwise if I don't then the hammer can not be used.
Can't test right now, but I will in a few hours.
Can't test right now, but I will in a few hours.
Edited by ABH15, 04 May 2012 - 02:36 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users

