SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 2 Weeks Ago   #1
CobaltBW
I do things sometimes
 
CobaltBW's Avatar
Default Is there a way to respawn Unidus's orbs?

Basically I want Unidus to throw all of its orbs at the player and then regenerate them back so it can do it again. What's the cleanest way to do this through lua, if there is one?
__________________
~CobaltBW

Check out my soundcloud profile for music stuff
CobaltBW is offline   Reply With Quote
Old 2 Weeks Ago   #2
"Lat'"
AAAAAAAAAAAAAAAAAAA
 
"Lat'"'s Avatar
Default

I believe a clean way to do it would be to remove the Unidus and spawn a new one at the exact same coordinates, since I don't think there is any option to make its spikeballs reappear.
__________________
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 2 Weeks Ago   #3
toaster
トースタちゃん
Developer
 
toaster's Avatar
Default

There's a bit of the spawning code that handles things in hardcode, so if you're willing to wait a few hours whilst I wake up I could help give you a Lua-ported starting point to work off of.
__________________
Quote:
<MonsterIestyn> surely it's good ass though
Quote:
<MonsterIestyn> watch porm to keep warm
toaster is offline   Reply With Quote
Old 2 Weeks Ago   #4
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

This is where the Unidus's orbs are actually spawned in the C code: https://github.com/STJr/SRB2/blob/SR...p_mobj.c#L7740

Using the "MobjSpawn" hook you can recreate everything in Lua.

Some notes though:
* The P_SetTarget function is automatically used when you assign a value to mobj.target, so you don't need it.
* Unlike C, ball.state in Lua gives you the state NUMBER not the state_t structure, so use states[ball.state].action(ball) to call the action for the Unidus's spikeballs. The action call IS needed to make sure the spikeball's position is corrected so I'm aware.
Monster Iestyn 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:09 AM.


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