Trying to make the player roll, but it doesnt works
Posted: Wed May 18, 2016 8:00 pm
Im trying to make the player roll when he has a certain ammount of ammo(which regenerates automatically) and he presses a key button, however by some reason that i cant decipher it doesnt works, this is all the coding i have atm:
DECORATE
KEYCONF
ACS
any idea on how to solve this? im trying first to make it work before putting the ammo requirement
DECORATE
Code: Select all
States
{
Spawn:
PLA1 B -1
PLA1 B 0 A_JumpifInventory("RollLeftInv",1,"RollLeft")
PLA1 B 0 A_JumpifInventory("RollRightInv",1,"RollRight")
loop
RollLeft:
//TNT1 A 0 A_JumpIf("DodgeAmmo"<100, "CancelRoll")
TNT1 A 0 A_ChangeFlag ("NOPAIN", 1)
PRAL A 0 A_TakeInventory("RollLeftInv")
PRAL A 0 A_TakeInventory("RollRightInv")
PRAL A 0 ThrustThing(angle*256/360+64, 30, 0, 0)
PRAL ABCDE 4
TNT1 A 0 A_ChangeFlag ("NOPAIN", 0)
PRAL A 0 A_TakeInventory("RollLeftInv")
PRAL A 0 A_TakeInventory("RollRightInv")
PRAL A 0 A_TakeInventory("DodgeAmmo",100)
Goto Spawn
RollRight:
//TNT1 A 0 A_JumpIf("DodgeAmmo" < 100, "CancelRoll")
TNT1 A 0 A_ChangeFlag ("NOPAIN", 1)
PRAL A 0 A_TakeInventory("RollLeftInv")
PRAL A 0 A_TakeInventory("RollRightInv")
PRAL A 0 ThrustThing(angle*256/360+192, 30, 0, 0)
PRAL EDBCA 4
TNT1 A 0 A_ChangeFlag ("NOPAIN", 0)
PRAL A 0 A_TakeInventory("RollLeftInv")
PRAL A 0 A_TakeInventory("RollRightInv")
PRAL A 0 A_TakeInventory("DodgeAmmo",100)
Goto Spawn
CancelRoll:
TNT1 A 0 A_TakeInventory("RollLeftInv")
TNT1 A 0 A_TakeInventory("RollRightInv")
Goto Spawn
Code: Select all
addmenukey "Roll Left" roleft
alias roleft "puke 500"
defaultbind Z roleft
addmenukey "Roll Right" roright
alias roright "puke 501"
defaultbind C roright
Code: Select all
#library "commands"
#include "zcommon.acs"
Script 500 (VOID) NET
{
GiveInventory("RollLeftInv", 1);
}
Script 501 (VOID) NET
{
GiveInventory("RollRightInv", 1);
}