Back here again for something a little weird. I'm working on making a chargeable plasma gun with three levels of charge. It seems to work alright with one level, but... well, when I add in any more levels, GZDoom crashes. It doesn't even show the error reporting window. Here's all the relevant code:
Code: Select all
ACTOR ChargeCounter : Inventory
{
Inventory.MaxAmount 30
Inventory.InterHubAmount 0
+ INVENTORY.INVBAR
}
ACTOR ChargeBeam : PowerBeam
{
Tag "Charge Beam"
States
{
Fire:
MISG B 0 A_PlaySound("vile/firestrt")
MISG B 2
MISG B 2
MISG B 0 A_JumpIfInventory("ChargeCounter", 10, "Charge1")
MISG B 0 A_GiveInventory("ChargeCounter", 1)
MISG B 0 A_ReFire
MISG B 8 A_FireCustomMissile("ChargeShot")
MISG B 0 A_TakeInventory("ChargeCounter", 9999)
goto Ready
Charge1:
MISG B 0 A_JumpIfInventory("ChargeCounter", 20, "Charge2")
MISG B 0 A_GiveInventory("ChargeCounter", 1)
MISG B 0 A_ReFire("Charge1")
MISG B 2 A_FireCustomMissile("ChargeShot1")
MISG B 0 A_TakeInventory("ChargeCounter", 9999)
goto Ready
Charge2:
MISG B 0 A_JumpIfInventory("ChargeCounter", 30, "Charge3")
MISG B 0 A_GiveInventory("ChargeCounter", 1)
MISG B 0 A_ReFire("Charge2")
MISG B 2 A_FireCustomMissile("ChargeShot2")
MISG B 0 A_TakeInventory("ChargeCounter", 9999)
goto Ready
Charge3:
MISG B 0 A_ReFire("Charge3")
MISG B 4 A_FireCustomMissile("ChargeShot3")
MISG B 0 A_TakeInventory("ChargeCounter", 9999)
goto Ready
}
}
actor ChargeShot : PlasmaBall
{
Translation "192:207=168:191", "241:241=189:189"
Scale 1.1
Damage 2
}
actor ChargeShot1 : ChargeShot
{
Translation "192:207=208:223", "241:241=234:234"
Scale 1.4
Damage 6
}
actor ChargeShot2 : ChargeShot
{
Translation "193:198=226:231", "199:207=161:164", "241:241=164:164"
Scale 1.6
Damage 10
}
actor ChargeShot3 : ChargeShot
{
Translation "192:207=192:197", "241:241=197:197"
Scale 2
Damage 15
}
Is this something that I'm doing wrong, or am I just looking at a GZDoom bug? (I've only just started on Decorate, so I haven't a clue.)
Edit: After taking a closer look, it happens exactly when I jump to the "Charge1" state after charging 10 units of the ChargeCounter item. If the fire button is immediately let go of, the ChargeShot1 projectile is fired, but if the A_Refire command is reached, GZDoom crashes.
Edit2: I got this working using the depreciated A_JumpIfInventory, using just an integer value. Even so, I'd like to have the code be as clean and up-to-date as possible. Plus, if it's a bug...