SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Help

Reply
 
Thread Tools Search this Thread
Old 06-24-2016   #1
-CG7244-
"Welcome to my Schoolhouse"
 
-CG7244-'s Avatar
Default How i can shot a missile without that shots me?

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:




EDIT: Well other problem is that the gaster blasterīs shoot attack affects me, and i dont want that.
__________________
"The more detail that I put in the sprite, means the effort that I put into it."

Last edited by -CG7244-; 06-24-2016 at 02:10 AM.
-CG7244- is offline   Reply With Quote
Old 06-24-2016   #2
ManicTH14
The Underground Wad Editor
 
ManicTH14's Avatar
Default

Eh, just make it's target you.

Well actually, show me how you're spawning it :o
ManicTH14 is offline   Reply With Quote
Old 06-24-2016   #3
Spike HedgeFox
Known as Chase The HedgeFox
 
Spike HedgeFox's Avatar
Default

you are using the Egg Mobile's shooting state, the Egg Mobile FACES you when it's gonna shoot you.
Spike HedgeFox is offline   Reply With Quote
Old 06-24-2016   #4
-CG7244-
"Welcome to my Schoolhouse"
 
-CG7244-'s Avatar
Default

Quote:
Originally Posted by Spike HedgeFox View Post
you are using the Egg Mobile's shooting state, the Egg Mobile FACES you when it's gonna shoot you.
Quote:
Originally Posted by CarlosGamer72 View Post
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 ----------

Quote:
Originally Posted by ManicTH14 View Post
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
__________________
"The more detail that I put in the sprite, means the effort that I put into it."
-CG7244- is offline   Reply With Quote
Old 06-24-2016   #5
"Lat'"
Stop it
 
"Lat'"'s Avatar
Default

Quote:
Originally Posted by SRB2 WIKI
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.
__________________
Quote:
Originally Posted by Bronydude2k5 View Post
If you make me a Sash Lilac wad, I'll make you a sonic sprite hack of any choice.
"Lat'" is offline   Reply With Quote
Old 06-24-2016   #6
-CG7244-
"Welcome to my Schoolhouse"
 
-CG7244-'s Avatar
Default

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:



(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
__________________
"The more detail that I put in the sprite, means the effort that I put into it."
-CG7244- is offline   Reply With Quote
Old 06-24-2016   #7
"Lat'"
Stop it
 
"Lat'"'s Avatar
Default

As far as I remember, just set Var2 to MT_something and ignore VAR1.
__________________
Quote:
Originally Posted by Bronydude2k5 View Post
If you make me a Sash Lilac wad, I'll make you a sonic sprite hack of any choice.
"Lat'" is offline   Reply With Quote
Old 06-24-2016   #8
-CG7244-
"Welcome to my Schoolhouse"
 
-CG7244-'s Avatar
Default

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.
__________________
"The more detail that I put in the sprite, means the effort that I put into it."
-CG7244- is offline   Reply With Quote
Old 06-25-2016   #9
~Confusion~
 
~Confusion~'s Avatar
Default

Quote:
Originally Posted by CarlosGamer72 View Post
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?).
__________________
Quote:
*Chaos*Aries*ASD* renamed to hms
<hms> im the real one
<hms> nice try aries
<~Despicable Me> Lol 2 hms
Despicable Me renamed to hms
Back then we all had windows xp... Lucky we were =S

Last edited by ~Confusion~; 06-25-2016 at 09:07 AM.
~Confusion~ is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.