SOC - Trying to work with A_SetFuse

A'Dilla

For The Win!
I've been doing some silly coding stuff lately and I've been needing the use of A_SetFuse. It works almost like it says it does, being that when the action is activated it will act like a ticking bomb. However it will never changes states like it says it will when it reaches the last tic, I also am unable to modify the fuse timer regardless of what my upperbit of Var2 is set to.

Upper and Lower bits of the Vars are not my specialty exactly, so there is a possibility that it could be that, although I've set up uppers and lowers before so I'm not 100% sure its from my end. Is there something I'm doing wrong?

A example code (Action state is highlighted) and gif are attached

Moving Rock Code:
# Rock Projectile
FREESLOT
MT_PROCK
S_PROCK1
S_PROCK2
S_PROCK3
S_PROCK4
S_PROCK5

State S_PROCK1
SpriteName = ROIA
SpriteFrame = A
Next = S_PROCK2
Duration = 1
Action = A_ChangeAngleRelative
Var1 = 1
Var2 = 180

State S_PROCK2
SpriteName = ROIA
SpriteFrame = A
Duration = 0
Next = S_PROCK3
Action = A_Thrust
Var1 = 15
Var2 = 0

State S_PROCK3
SpriteName = ROIA
SpriteFrame = A
Duration = 1
Next = S_PROCK4
Action = A_ZThrust
Var1 = 6
Var2 = 0

State S_PROCK4
SpriteName = ROIA
SpriteFrame = A
Duration = 1
Next = S_PROCK5
Action = A_SetFuse
Var1 = 110
Var2 = (2)|S_SMOKE1

State S_PROCK5
SpriteName = ROIA
SpriteFrame = FF_ANIMATE|A
Duration = 10
Next = S_PROCK5
Var1 = 4
Var2 = 2


Object MT_PROCK
MapThingNum = 2020
SpawnState = S_PROCK1
SpawnHealth = 1000
ReactionTime = 780
DeathState = S_SMOKE1
Speed = 20*FRACUNIT
Radius = 8*FRACUNIT
Height = 16*FRACUNIT
Mass = 4
ActiveSound = sfx_rocks1
Flags = MF_PAIN|MF_BOUNCE|MF_MISSILE|MF_GRENADEBOUNCE|MF_RUNSPAWNFUNC
RaiseState = S_NULL

srb20322.gif
 
Try replacing your Var2 with S_SMOKE1 + 2 << FRACBITS. Upper 16 bits means the value you get when you shift the number 16 bits to the right, which means upper bit values need to be multiplied by FRACUNIT (65536), or 2^16 (which is what << FRACBITS does, it shifts binary digits 16 bits to the left, resulting in *2^16)
 
Try replacing your Var2 with S_SMOKE1 + 2 << FRACBITS.
I tested it out, but it still disappeared instead of jumping into the smoke state. What is also weird is that I also tested it out without the spaces and when spawning in the rocks they seem to not disappear at all.
Also, this seems to be the easiest way to deal with upper and lower bits, thanks for telling me and giving me a rundown on it!
 
I tested it out, but it still disappeared instead of jumping into the smoke state. What is also weird is that I also tested it out without the spaces and when spawning in the rocks they seem to not disappear at all.
Also, this seems to be the easiest way to deal with upper and lower bits, thanks for telling me and giving me a rundown on it!
Dude, try to use XDeathState in SOC, it should work after fuse variable
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top