Modifying the THZ Goo

Status
Not open for further replies.

Chaofanatic

Member
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:
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:
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:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top