How i can shot a missile without that shots me?

Status
Not open for further replies.

GLide KS

Sometimes I sprite "things"
Well, idk if u understand the title, but im making a Gaster Blaster weapon (weapon that uses Sans in Undertale), and well, idk how i can make him a rail ring shoot, so i used a simple missile that is eggmobile shoot attack, so i made these states (it replaces infinity ring):

State S_GASTERBLAST_APPEAR
SPRITEFRAME = A
SPRITENAME = SPR_BLST
DURATION = 20
NEXT = S_GASTERBLAST_SHOOT

State S_GASTERBLAST_SHOOT
SPRITEFRAME = B
SPRITENAME = SPR_BLST
DURATION = 30
ACTION = A_FIRESHOT
NEXT = S_NULL
VAR1 = MT_EGGMOBILE_FIRE
VAR2 = 0

Im using a SOC script.

But it does not shot where i want, it shoots at me, heres a GIF:


dkTmHmh.gif


EDIT: Well other problem is that the gaster blaster´s shoot attack affects me, and i dont want that.
 
Last edited:
you are using the Egg Mobile's shooting state, the Egg Mobile FACES you when it's gonna shoot you.

State S_GASTERBLAST_SHOOT
SPRITEFRAME = B
SPRITENAME = SPR_BLST
DURATION = 30
ACTION = A_FIRESHOT
NEXT = S_NULL
VAR1 = MT_EGGMOBILE_FIRE
VAR2 = 0


No, the MT_EGGMOBILE_FIRE is the PROJECTILE that shoots eggman, not eggman state.

EDIT: But well i will try with other projectile.

---------- Post added at 09:57 AM ---------- Previous post was at 09:54 AM ----------

Eh, just make it's target you.

Well actually, show me how you're spawning it :o

1: what do u mean with that?
2: its just modifying the MT_THROWNINFINITY object and changing the speed and states
 
SRB2 WIKI said:
A_FireShot is an action that makes the actor fire an Object at the target.

The problem here is that FireShot is an action that will aim the fired projectile to the spawned mobj's target. So, that means your object to has the player acquired as target, and so it shoots at it.
If you want a projectile to go straightforward, you would have to use A_SpawnObjectAbsolute to spawn a neutral object target-wise, or to use Lua for more flexibility with the whole thing in general.
 
Well thanks Lat´ for helping me, now it does not shoot me anymore, and i suck at lua, im a begginer, this is the result:

J4hKOt7.gif


(ignore the gaster blaster´s rightside, that was my error, i will fix it)

But another problem, it does not shoot the projectile, i have seen the A_SpawnObjectAbsolute Definition, but the next example i cant understand:


Attributes Use
Var 1 Upper 16 bits: X position
Lower 16 bits: Y position
Var 2 Upper 16 bits: Z position
Lower 16 bits: Object number
 
As far as I remember, just set Var2 to MT_something and ignore VAR1.
 
Still does not work, heres the code if u want check out:

State S_GASTERBLAST_SHOOT
SPRITEFRAME = B
SPRITENAME = SPR_BLST
DURATION = 30
ACTION = A_SpawnObjectAbsolute
NEXT = S_NULL
VAR1 = 0
VAR2 = MT_REDRING //idk how to put the rail ring shoot, so i used red ring

Well... anyways thanks, i will try to fix it myself.
 
Still does not work, heres the code if u want check out:

State S_GASTERBLAST_SHOOT
SPRITEFRAME = B
SPRITENAME = SPR_BLST
DURATION = 30
ACTION = A_SpawnObjectAbsolute
NEXT = S_NULL
VAR1 = 0
VAR2 = MT_REDRING //idk how to put the rail ring shoot, so i used red ring

Well... anyways thanks, i will try to fix it myself.

If you're using A_SpawnObjectAbsolute, you want to give the exact position of the player for it to work like you intended.
In the current state, it will spawn a MT_REDRING at position X=0, Y=0, Z=0!
And about those upper and lower bits: I'm too lazy right now to explain it thoroughly, but, if you want it to spawn stuff exactly at the player's position you can do something like this...

Var1 = player.mo->x*65536+player.mo->y
Var2 = (player.mo->z+player.mo->height/3)*65536+MT_REDRING

Note that I'm just showing you an approximation of how would I done it in C, you'll probably have to implement this in your own way (Lua, maybe?).
 
Last edited:
Status
Not open for further replies.

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

Back
Top