Soc screwing up in wierd ways

Status
Not open for further replies.

SpaceKGreen

Neon Knight
So I have this idea for a thokitem soc that I'm messing around with. An object would spawn, fire a missile, and then disappear.

First, I tried setting A_CapeChase for a split second to make the object match the character's angle. That worked, but the subsequent firing action, A_FireShot, caused it to turn back towards the player and shoot at them.

So I tried setting the firing action to A_ShootBullet, and set the RaiseState to the number of the missile object. However, the object stopped matching the character's angle, and refused to shoot anything at all. A_JetgShoot gave the same effect.

Am I doing something wrong?

My goal is to have the thokitem spawn, match the character's angle, shoot straight in that direction after a short delay, and finally disappear.

Current Soc Contents
Code:
Thing 337
MAPTHINGNUM = -1
SPAWNSTATE = 742
SPAWNHEALTH = 1
SEESTATE = 0
SEESOUND = 0
REACTIONTIME = 32
ATTACKSOUND = 0
PAINSTATE = 0
PAINCHANCE = 200
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 1615
DEATHSOUND = 0
XDEATHSTATE = 744
SPEED = 1048576
RADIUS = 262144
HEIGHT = 524288
MASS = 100
DAMAGE = 1
ACTIVESOUND = 0
RAISESTATE = 743
FLAGS = 66064








FRAME 2300
SPRITENUMBER = 16
SPRITESUBNUMBER = 0
DURATION = 16
NEXT = 2301
ACTION A_CapeChase
VAR1 = 0
VAR2 = 0

FRAME 2301
SPRITENUMBER = 16
SPRITESUBNUMBER = 1
DURATION = 16
NEXT = 1641
ACTION A_JetgShoot
VAR1 = 0
VAR2 = 0


Thing 338
MAPTHINGNUM = -1
SPAWNSTATE = 2300
SPAWNHEALTH = 999
SEESTATE = 0
SEESOUND = 0
REACTIONTIME = 8
ATTACKSOUND = 0
PAINSTATE = 0
PAINCHANCE = 0
PAINSOUND = 0
MELEESTATE = 0
MISSILESTATE = 0
DEATHSTATE = 0
DEATHSOUND = 0
XDEATHSTATE = 0
SPEED = 8
RADIUS = 1048576
HEIGHT = 1048576
MASS = 0
DAMAGE = 0
ACTIVESOUND = 0
RAISESTATE = 337
FLAGS = 4624
 
Both A_FireShot and A_ShootBullet require a target mobj to shoot at. Since all you want is the projectile to be fired forward in the player's current direction, use A_CapeChase to match the player's angle and then spawn your "missile mobj" and set its spawn state to have the action use A_SnowBall in the next state (var1 defines the duration in seconds before disappearing).
 
Last edited:
Thanks, but I have one last question... Does an object spawned by A_SpawnObjectRelative automatically have the object that spawned it set as its target? (like the way the thokobject automatically targets the player)
 
Well rats. 'Twas hoping to avoid A_FindTarget since that causes consfails... it's either that or dump some animation frames.

Thanks for the help anyways.
 
Status
Not open for further replies.

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

Back
Top