Spoiler:With this configuration, when you altfire, it takes away the ammo - but apparently not the Dagger inventory item, unless TakeInventory() is placed above the JumpIfInventory.
Can anybody see what's wrong with this?
Spoiler:With this configuration, when you altfire, it takes away the ammo - but apparently not the Dagger inventory item, unless TakeInventory() is placed above the JumpIfInventory.
Code: Select all
A_JumpIfInventory("DaggerAmmo", 1, "ThrowDagger")Ok, originally, I had a dagger. You picked it up and you could use it - without using ammo, and you could altfire it. The altfire spawned a dagger projectile and removed the dagger from the player's inventory. When the projectile died, it spawned a new dagger weapon. This works perfectly if all you want the player to have is ONE dagger.edward850 wrote:Don't you want to jump 2 frames, not 1?
I figured this was how it was acting - because if you altfire or fire, it acts like it cycles through and it removes the weapon from the inventory. Could you point how out it is doing this? I don't see it.edward850 wrote:Will land on A_TakeInventory("Dagger",1), not A_TakeInventory("DaggerAmmo",1).Code: Select all
A_JumpIfInventory("DaggerAmmo", 1, "ThrowDagger")
Also, the current configuration will mean you will always have at least one "DaggerAmmo" left after taking "Dagger".
Yeah - that stop was in there just because I was trying anything to get things to work.edward850 wrote:Actually I'm misreading what you were doing there. I'm not entirely sure why you have a random stop statement there for and it's throwing me off.
Code: Select all
AltFire:
KNIF C 1 A_FireCustomMissile("DaggerProjectile", 0, 0, 0, 0, 0, 0)
KNIF C 1 A_TakeInventory("DaggerAmmo",1)
KNIF C 1 A_JumpIfInventory("DaggerAmmo", 1, "Ready")
KNIF C 1 A_TakeInventory("Dagger",1)
StopCode: Select all
Obituary ""
Weapon.SlotNumber 1
//Weapon.AmmoUse 1
Weapon.AmmoGive 1
Weapon.AmmoType "DaggerAmmo"
+WEAPON.NOAUTOFIRE
+WEAPON.WIMPY_WEAPON
+WEAPON.MELEEWEAPON
+WEAPON.AMMO_OPTIONAL
Inventory.PickupMessage "Got a Dagger!"
Tag "Dagger"