Issue with RemoteAction.

Status
Not open for further replies.
So this issue could just be me completely misinterpreting what A_RemoteAction is supposed to do. But basically what I'm trying to do is set up a boss fight of mine so that one thing, the actual main boss itself, can tell another thing, which is a separate object used to represent his tail, to perform an action. But everytime I do do this it either ends up with the thing disappearing, not doing anything at all, or the main boss instead just resets back to it's original state.

State S_UNDEEP_DIG
SPRITENAME = DEEP
SpriteFrame = F
Duration = 10
Next = S_UNDEEP_DIG2
Action = A_FaceTarget
Var1 = 1
Var2 = 1

State S_UNDEEP_DIG2
SPRITENAME = DEEP
SpriteFrame = G
Duration = 10
Next = S_UNDEEP_DIG3
Action = A_FaceTarget
Var1 = 1
Var2 = 1

State S_UNDEEP_DIG3
SPRITENAME = DEEP
SpriteFrame = F
Duration = 10
Next = S_UNDEEP_DIG4
Action = A_FaceTarget
Var1 = 1
Var2 = 1

State S_UNDEEP_DIG4
SPRITENAME = DEEP
SpriteFrame = G
Duration = 10
Next = S_UNDEEP_CHOOSETAILSPAWN
Action = A_FaceTarget
Var1 = 1
Var2 = 1

So here the main part of the boss plays his tunneling animation to make it seem like he's burrowing underground. Then he's supposed to randomly pick which spot the Tail should pop up at.

State S_UNDEEP_CHOOSETAILSPAWN
SpriteName = DEEP
SpriteFrame = F
Duration = 1
Next = S_UNDEEP_CHOOSETAILSPAWN
Action = A_RandomState
Var1 = S_UNDEEP_TAILSPAWN
Var2 = S_UNDEEP_TAILSPAWN

Here there's supposed to be two spots the tail can spawn at, but it only has one spot ready at the moment, so I just put the same thing twice so that it would pick the ready one no matter what.

State S_UNDEEP_TAILSPAWN
SPRITENAME = DEEP
SpriteFrame = F
Duration = 1
Next = S_UNDEEP_WAIT
Action = A_RemoteAction
Var1 = 1338
Var2 = S_TAIL_SETTARGET

State S_UNDEEP_WAIT
SPRITENAME = DEEP
SpriteFrame = F
Duration = 5
Next = S_UNDEEP_WAIT
Action = A_FaceTarget
Var1 = 0
Var2 = 0

So there the RemoteAction part is supposed to trigger the Tail to set it's target to the player, then the main part is supposed to just wait until the Tail finished up it's business, which then once I set that part up is supposed to make the main part start attacking again, and it repeats the cycle.

Object MT_TAIL
MapThingNum = 1338
SpawnState = S_TAIL_BURROW
SpawnHealth = 999
SeeState = S_TAIL_BURROW
SeeSound = sfx_None
ReactionTime = 32
AttackSound = sfx_None
PainState = S_NULL
PainChance = 200
PainSound = sfx_None
MeleeState = S_NULL
MissileState = S_NULL
DeathState = S_XPLD1
XDeathState = S_NULL
DeathSound = sfx_pop
Speed = 3
Radius = 24*FRACUNIT
Height = 24*FRACUNIT
DispOffset = 0
Mass = 100
Damage = 0
ActiveSound = sfx_None
Flags = MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE
RaiseState = S_NULL

There's the thing for the Tail, just in case it this might be the thing messing it up.

State S_TAIL_BURROW
SPRITENAME = DEEP
SpriteFrame = F
Duration = 1
Next = S_TAIL_BURROW
Action = A_SetObjectFlags
Var1 = MF_NOCLIPTHING
Var2 = 2

Here's what it spawns as. I kinda assumed setting it to NOCLIPTHING would make it so that the player wouldn't get hit on it, because instead of actually spawning it it's actually just kinda sitting there all hidden waiting to be triggered by the main part. Unfortunately the player still takes damage, so it kinda made it pointless to do this, and I'm gonna have to figure something else out.

State S_TAIL_SETTARGET
SPRITENAME = DEEP
SpriteFrame = F
Duration = 1
Next = S_TAIL_EMERGE
Action = A_FindTarget
Var1 = 3
Var2 = 0

State S_TAIL_EMERGE
SPRITENAME = DEEP
SpriteFrame = F
Duration = 10
Next = S_TAIL_EMERGE2
Action = A_SetObjectFlags
Var1 = MF_NOCLIPTHING
Var2 = 1

State S_TAIL_EMERGE2
SPRITENAME = DEEP
SpriteFrame = G
Duration = 10
Next = S_TAIL_EMERGE3
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_TAIL_EMERGE3
SPRITENAME = DEEP
SpriteFrame = F
Duration = 10
Next = S_TAIL_EMERGE4
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_TAIL_EMERGE4
SPRITENAME = DEEP
SpriteFrame = G
Duration = 10
Next = S_TAIL_ROCKTOMB
Action = A_FaceTarget
Var1 = 0
Var2 = 0

And here's the part where it always messes up. It doesn't go through the SetTarget and Emerge parts like it's supposed to, and it instead just usually stays in it's spawn state. Though sometimes it vanishes altogether but I assume that's because of the noclip thing. And also the main part of the boss instead of going to the Wait state instead just goes back to it's beginning state and redoes all of it's attacks instead of waiting. I'm probably missing something super obvious like having the wrong Next = state or something. But for the most part it seems to me that it would be the A_RemoteAction part.

I'm not sure if this is the right place to post for help on these sorts of issues, but if anyone can figure out what's going wrong, or at the very least explain A_RemoteAction since I'm probably messing that up, then I would be very grateful. Also if this is the wrong place to post for help on these sorts of things I'm sorry, just not really sure where else to ask about this.

Also whenever I say main part I meant the head, since the boss is essentially a giant worm creature.
 
Why are you using a slot number for VAR1 on remote action? If you're telling it to search for a mobj type, you should use the actual mobj name, since you don't necessarily know what order slots will be assigned in.

Haven't given this a full look yet. Generally when an object just disappears in SOC, it's either because it's trying to go to or access a resource that doesn't exist (like a bad state, object, sprite), or because an action like A_CapeChase which kills off its actor if a certain condition is met was used.

That said, as some general advice try to add some markers to the states you're using so you can find out exactly when things go wrong - verify that each step is being performed by tweaking it to have obvious results, extend state durations, put in different sprites, etcetera. The first step to fixing a problem is always to find out what the problem is in as much detail as you can.

As a more long-term thing, try to break into Lua. It is much, much, much more preferable for making custom gamelogic. Just because I and some of the other old timers around here learned and suffered through making rube goldberg machines with SOC doesn't mean you have to!
 
Last edited:
Why are you using a slot number for VAR1 on remote action? If you're telling it to search for a mobj type, you should use the actual mobj name, since you don't necessarily know what order slots will be assigned in.

Haven't given this a full look yet. Generally when an object just disappears in SOC, it's either because it's trying to go to or access a resource that doesn't exist (like a bad state, object, sprite), or because an action like A_CapeChase which kills off its actor if a certain condition is met was used.

That said, as some general advice try to add some markers to the states you're using so you can find out exactly when things go wrong - verify that each step is being performed by tweaking it to have obvious results, extend state durations, put in different sprites, etcetera. The first step to fixing a problem is always to find out what the problem is in as much detail as you can.

As a more long-term thing, try to break into Lua. It is much, much, much more preferable for making custom gamelogic. Just because I and some of the other old timers around here learned and suffered through making rube goldberg machines with SOC doesn't mean you have to!

Oh, did not think of putting the name instead of a number. Thanks.
And I'll probably at the least try to get into Lua, though it probably won't go very well. Thanks for the advice.
 
Status
Not open for further replies.

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

Back
Top