Spoiler:
Help with DECORATE?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Help with DECORATE?
I'm trying to combine 2 types weapons into one using A_GiveInventory. Without the inventory, it'll fire a projectile. When Alt-fire is pressed, the weapon will "check" the inventory and will "give" inventory: "Expander Mode" meaning the weapon has changed to a hit-scanner. Then when Alt-fire is pressed again, it'll "check" and "take" the inventory and it'll return to projectile attack. But I'm stuck and cofused at the Alt-Fire state when it "gives","takes", and "checks" inventory. Help please? Thanks.
-
Blue Shadow
- Posts: 5046
- Joined: Sun Nov 14, 2010 12:59 am
Re: Help with DECORATE?
Try this...
Code: Select all
AltFire:
SHRG A 0 A_JumpIfInventory("ExpanderMode", 1, 2)
SHRG A 1 A_GiveInventory("ExpanderMode", 1)
Goto Ready
SHRG A 1 A_TakeInventory("ExpanderMode", 1)
Goto Ready
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Help with DECORATE?
Code: Select all
AltFire:
SHRG A 0 A_JumpIfInventory("ExpanderMode", 1, "RemoveExpanderModeFlag")
SHRG A 0 A_GiveInventory("ExpanderMode", 1)
SHRG A 0 A_Refire
Goto Ready
RemoveExpanderModeFlag:
SHRG A 0 A_TakeInventory("ExpanderMode", 1)
SHRG A 0 A_Refire
Goto Ready
AltHold:
SHRG A 1 A_WeaponReady(WRF_NOFIRE)
SHRG A 0 A_Refire
Goto Ready