So, I'm making this player class that loses a bunch of random weapons when he enters a new map.
To do this, I'm making multiple actor, one for each weapon, that actually take the weapon from you.
I tried with something like this:
Spoiler
Actor SSGtaker : CustomInventory
{
Inventory.PickupMessage "\cGWho said that break action \cFSAWED OFF \cGSHOTGUNS never break? I think someone said that. Well he was wrong. Especially when it gets crushed by demons."
States
{
Spawn:
TNT1 A 0
TNT1 A 1
Loop
Pickup:
TNT1 A 0
TNT1 A 0 A_TakeInventory("SSG",1)
TNT1 A 0 A_TakeInventory("SSGAmmo",2)
TNT1 A 0 A_GiveInventory("AmmoShell",2)
Stop
}
}
And everything works like a charm, but I don't quite like it. This way I should spawn the items right under the player's feet, and make him pick them up. Furthermore, the message will show whether the player has the weapon or not.
So I tried this:
Spoiler
Actor Shotguntaker : CustomInventory
{
+INVENTORY.QUIET
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 1 A_JumpIfInventory("Shot_Gun",1,"Loss")
Loop
Loss:
TNT1 A 0
TNT1 A 0 A_Log("\cGYour trusted \cFSHOTGUN \cGfailed you. With it malfunctioning, You'll have to find another one...")
TNT1 A 0 A_TakeInventory("Shot_Gun",1)
TNT1 A 0 A_TakeInventory("SlugShotgun",1)
TNT1 A 0 A_TakeInventory("ShotgunAmmo",9)
Stop
}
}
But it seems like the jump is not performed even If I have the shotgun in inventory. What did I do wrong?
So, I'm making this player class that loses a bunch of random weapons when he enters a new map.
To do this, I'm making multiple actor, one for each weapon, that actually take the weapon from you.
I tried with something like this:
Actor SSGtaker : CustomInventory
{
Inventory.PickupMessage "\cGWho said that break action \cFSAWED OFF \cGSHOTGUNS never break? I think someone said that. Well he was wrong. Especially when it gets crushed by demons."
States
{
Spawn:
TNT1 A 0
TNT1 A 1
Loop
Pickup:
TNT1 A 0
TNT1 A 0 A_TakeInventory("SSG",1)
TNT1 A 0 A_TakeInventory("SSGAmmo",2)
TNT1 A 0 A_GiveInventory("AmmoShell",2)
Stop
}
}
And everything works like a charm, but I don't quite like it. This way I should spawn the items right under the player's feet, and make him pick them up. Furthermore, the message will show whether the player has the weapon or not.
So I tried this:
Actor Shotguntaker : CustomInventory
{
+INVENTORY.QUIET
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 1 A_JumpIfInventory("Shot_Gun",1,"Loss")
Loop
Loss:
TNT1 A 0
TNT1 A 0 A_Log("\cGYour trusted \cFSHOTGUN \cGfailed you. With it malfunctioning, You'll have to find another one...")
TNT1 A 0 A_TakeInventory("Shot_Gun",1)
TNT1 A 0 A_TakeInventory("SlugShotgun",1)
TNT1 A 0 A_TakeInventory("ShotgunAmmo",9)
Stop
}
}
But it seems like the jump is not performed even If I have the shotgun in inventory. What did I do wrong?
Share this post
Link to post