SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 05-01-2014   #1
StarmakerJasper
Hey, that's my pudding!
 
StarmakerJasper's Avatar
Default Lua Help: Spawning different debris with A_RingExplode

If you've seen Jasper in Great Divide, he uses an attack that uses A_RingExplode to cause damage. I want to simply duplicate the effects of A_RingExplode except using a different object to spawn instead of MT_NIGHTSSPARKLE (the object is essentially the same, just different sprites). I did look at the page for the action on the Wiki, but I definitely can't read C well enough to understand what is going on. Is there a way to simply change the debris of the action when certain conditions are met, or do I have to recreate the action entirely with P_SpawnParaloop?
StarmakerJasper is offline   Reply With Quote
Old 05-02-2014   #2
wolfs
Watch Symphogear
Developer
 
wolfs's Avatar
Default

A_OldRingExplode allows you to select your own objects, but it's probably not the effect you were looking for.
__________________
Quote:
[23:56:36] <SM-MaxX> prisma illya is a gift to this impure earth and a shining beacon for all anime
wolfs is offline   Reply With Quote
Old 05-02-2014   #3
StarmakerJasper
Hey, that's my pudding!
 
StarmakerJasper's Avatar
Default

Yeah, A_OldRingExplode ends up putting the objects in a different formation than the regular A_RingExplode and kills off said objects in a very short time. I could use it as a ~last resort~ kind of thing but even then I'd probably stick to A_RingExplode.
StarmakerJasper is offline   Reply With Quote
Old 05-05-2014   #4
Monster Iestyn
Fangtastic
Administrator
 
Monster Iestyn's Avatar
Default

Yeah, you're going to have to recreate the action entirely with Lua, with a different object in place of MT_NIGHTSPARKLE.

Just a note while we're here, P_SpawnParaloop only spawns one loop of objects directed away at a particular vertical angle around the coordinates; it has to be used multiple times in one go for a more spherical arrangement, as done in A_RingExplode itself (the action in question does that 16 times there for 16 multiples of ANGLE_22h, as 22.5 * 16 = 360).

To recreate THAT particular bit at least in Lua you can do this:
Code:
for d = 0,15
	P_SpawnParaloop(actor.x, actor.y, actor.z+actor.height,
		FixedMul(actor.info.painchance, actor.scale), 16,
		MT_TYPEYOUWANT, d*ANGLE_22h, S_NULL, true)
end
Line breaks included to stop the line being too long. Also, Lua swaps around the angle and state for the function, if you're confused by that at all.
__________________
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".

Last edited by Monster Iestyn; 05-06-2014 at 10:43 AM. Reason: Turns out it's "MT_NIGHTSPARKLE", with only one S
Monster Iestyn is offline   Reply With Quote
Old 05-06-2014   #5
StarmakerJasper
Hey, that's my pudding!
 
StarmakerJasper's Avatar
Default

Fission Mailed.



I ended up changing actor to player.mo, since that was the only object I had as a reference (and the fact that I'm not sure what actor represents here). I just used MT_NIGHTSPARKLE in this gif as I haven't finished up the alternate sparkle.
StarmakerJasper is offline   Reply With Quote
Old 05-06-2014   #6
Monster Iestyn
Fangtastic
Administrator
 
Monster Iestyn's Avatar
Default

...huh, that's odd then. Should probably try and recreate that thing myself when I can.
__________________
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 offline   Reply With Quote
Old 05-06-2014   #7
Monster Iestyn
Fangtastic
Administrator
 
Monster Iestyn's Avatar
Default

AHA, should have realised before that using the player's painchance thing wouldn't do any good. It works fine when I replaced player.mo.info.painchance with 192*FRACUNIT.

Link to my own little test script which I made just now.
__________________
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 offline   Reply With Quote
Old 05-06-2014   #8
StarmakerJasper
Hey, that's my pudding!
 
StarmakerJasper's Avatar
Default

Works perfectly now. I've already implemented the "exploding" part of the ability with P_RadiusAttack so it looks like smooth sailing from here. Thanks again!
StarmakerJasper 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 12:34 AM.


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