So, I'm trying to create a switching decoration modeled after a scientist with a keycard, and I can't seem to figure out one thing. When the player interacts with the scientist, I'd like the keycard to disappear from the sprite and for the player to get the keycard in their inventory. So far, everything works except for the part where the player gets the keycard. How would I fix this? Here is my code so far:
ACTOR KeycardScientist: SwitchingDecoration 20028
{
Radius 16
Height 100
+SOLID
+USESPECIAL
Activation THINGSPEC_Activate
States
{
Spawn:
SCIK A 1 A_checkproximity("Spook",DoomPlayer,150,1,CPXF_NOZ)
loop
Spook:
SCIK B 20
goto shaken
Shaken:
SCIK CD 3
loop
Active:
SCIK EF 3 A_giveinventory(RedCard)
goto takenkey
Takenkey:
SCIK EF 3
loop
Inactive:
SCIK CD 3
loop
}
}
So, I'm trying to create a switching decoration modeled after a scientist with a keycard, and I can't seem to figure out one thing. When the player interacts with the scientist, I'd like the keycard to disappear from the sprite and for the player to get the keycard in their inventory. So far, everything works except for the part where the player gets the keycard. How would I fix this? Here is my code so far:
ACTOR KeycardScientist: SwitchingDecoration 20028 { Radius 16 Height 100 +SOLID +USESPECIAL Activation THINGSPEC_Activate States { Spawn: SCIK A 1 A_checkproximity("Spook",DoomPlayer,150,1,CPXF_NOZ) loop Spook: SCIK B 20 goto shaken Shaken: SCIK CD 3 loop Active: SCIK EF 3 A_giveinventory(RedCard) goto takenkey Takenkey: SCIK EF 3 loop Inactive: SCIK CD 3 loop } }
Any help is appreciated!
Share this post
Link to post