SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 08-11-2017   #1
Chaofanatic
 
Chaofanatic's Avatar
Default Modifying the THZ Goo

I'd like to set up a mechanic where the player jumps into a surface and is catapulted out at a slightly lower speed. The style of behavior I'm after is like the Techno Hill goo, but that doesn't actually launch the player out very much. I'd like to be able to leap off of a higher area, then use the momentum from the goo to send myself somewhere even higher.

Would I be able to use lua to script a custom linedef type for this or anything? It doesn't look like the THZ goo has any special settings that lets me change how it treats vertical momentum.

Edit: A bit of guidance on how to set sector/fof properties using lua would also be very helpful on its own as I've already started figuring out how to make lua scripts on my own!

Last edited by Chaofanatic; 08-11-2017 at 09:10 PM.
Chaofanatic is offline   Reply With Quote
Old 08-14-2017   #2
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Apologies for taking so long to reply, but there's currently no way to adjust the goo speed/acceleration, not even with Lua. You could try recreating the goo physics or something but I wouldn't know how to do that myself.

Getting and modifying sector/FOF properties aren't particularly complicated at least, just search for "sector_t" and "ffloor_t" on the wiki for the list of properties. You can only access FOFs via their target sectors I note.

There are many ways to get sectors themselves on the other hand:

* Getting particular sector indexes from the sectors[] table, such as sectors[0] for sector #0. Sector indexes are not to be confused with sector types.
* If you want to apply effects generally to all sectors in the map (maybe with exceptions) you can use "for sector in sectors.iterate" to iterate through them all.
* If you want to get the sector of an object (or mobj_t), just use mobj.subsector.sector (assuming it's called "mobj" for instance).
* If you want to get a sector for a particular position on the map, use R_PointInSubsector(x,y).sector, where x and y are your chosen x/y coords.
* I believe linedefs (line_t) and sidedefs (side_t) also reference adjacent sectors to them, if necessary.
* FOFs (ffloor_t) themselves have references to both their target and control sectors, if that's useful at all.

Last edited by Monster Iestyn; 08-14-2017 at 01:34 PM.
Monster Iestyn is offline   Reply With Quote
Old 08-20-2017   #3
Chaofanatic
 
Chaofanatic's Avatar
Default

Actually I managed to do it in sort of a hacky way! I store the player's Z speed upon entering the goo, and once they exit I invert that and divide it by about half and add it to the player's current Z momentum to get a proper launch working!
Honestly the hardest part was figuring out the weird lua syntax!

Last edited by Chaofanatic; 08-20-2017 at 12:56 AM.
Chaofanatic 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 01:28 AM.


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