SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 06-16-2015   #1
"Lat'"
Stop it
 
"Lat'"'s Avatar
Default Spawning an object with the player's angle?

Sorry if that sounds dumb, but I tried this

Code:
local chargedust1 = P_SpawnMobj(mo.x, mo.y, mo.z, MT_PARTICLE)
chargedust1.angle = mo.angle
(mo is player.mo)
But the object in question never spawns with the right angle, it always faces the same direction. How can I make it spawn with the player's angle?
__________________
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 online now   Reply With Quote
Old 06-16-2015   #2
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Question is, what direction does it face instead?
__________________
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record. Also, it's pronounced "Yes-tin".
Monster Iestyn is online now   Reply With Quote
Old 06-16-2015   #3
"Lat'"
Stop it
 
"Lat'"'s Avatar
Default

It faces the direction it would face if its angle was 0, as this gif can tell (look at the player's angle.)



I also tried P_SPMAngle, with mo.angle as the angle value with the exact same result.
In case that matters too, here's the other things besides the angle setting:

Code:
		local chargedust1 =  P_SpawnMobj(mo.x, mo.y, mo.z, MT_PARTICLE)
		chargedust1.angle = mo.angle
		chargedust1.fuse = 10
		chargedust1.momx = -6*FRACUNIT
		chargedust1.momy = 3*FRACUNIT
		chargedust1.momz = 3*FRACUNIT
__________________
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 online now   Reply With Quote
Old 06-16-2015   #4
fickleheart
gender collector
 
fickleheart's Avatar
Default

Setting momx/momy on an object doesn't adjust to the object's angle. Try P_Thrust(mobj, angle, speed) instead.
__________________
Quote:
<@toaster> '"sonic robot explosion 2", the hot new sensation for teens looking for a good time, tempts many children away from god each year'
av src
fickleheart is offline   Reply With Quote
Old 06-27-2015   #5
SSG3
A big fan of Amy rn
 
SSG3's Avatar
Default

I just grabbed this from the wiki. Maybe this should help:

Quote:
mobj_t P_SpawnPlayerMissile(mobj_t source, int type, [int flags2])
Functionally identical to P_SPMAngle, except with the missile's angle always being the source's angle, and the player's vertical aiming angle will always be used. This returns the Object spawned by the function.
__________________
Quote:
<Lat> people thought moonjump and chaos control were OP
<Lat> screw jump is the new meta
SSG3 is offline   Reply With Quote
Old 06-27-2015   #6
"Lat'"
Stop it
 
"Lat'"'s Avatar
Default

Oh don't worry I found my way through it, it's just because I used momx and momy that are not adjusted to the angle of the player.
Also I was not willing to send a missile, this was for Sylveon's quickattack charging dust. (Like a spindash dust trail.)
__________________
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 online now   Reply With Quote
Old 06-28-2015   #7
SSG3
A big fan of Amy rn
 
SSG3's Avatar
Default

Oh, ok. Glad you found your way around it.
__________________
Quote:
<Lat> people thought moonjump and chaos control were OP
<Lat> screw jump is the new meta
SSG3 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 05:08 PM.


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