Page 1 of 1

[ACS / DECORATE] GFD's Moving Platform Library

Posted: Wed Mar 12, 2014 7:52 pm
by GFD
While taking a break from redoing a lot of code in my Mario mod, I made some moving platforms. Check 'em out!



Features:
• Pure DECORATE and ACS, no mapping required
• Easy to implement; just add a couple lines of code here and there
• Players and monsters do not need to be edited to use platforms that use this library
• Can work with platforms that use Actor Mover and Interpolation Point things, but not as well
• Actors will move with velocity-based platforms perfectly
• Actors realistically maintain momentum if they jump off a platform using this library
• Lots of comments in the code; might be hard to understand, but I hope they're useful

The example platform actors are very low-function, but that's not the point of this library. You should be creating your own platform actors to your liking! This library is intended to make it easy to have your platform actors carry things around.

Caveats:
• Platform actors can only carry one actor at a time for 35 tics
• Platforms must all have unique TIDs
• Completely untested with netgames
• No compensation for gravity; actors will not stay on platforms that are moving downward, but instead constantly fall onto them. I've tried my best to get this to work, but without reasonable success
TimeFreezer powerups don't really work with platforms. If they don't have NOTIMEFREEZE set, the power makes them behave irrationally with unfrozen actors. However, if an actor is frozen while already on a platform, it will stop moving, even if the platform is not frozen
• Because platforms modify an actor's velocity, players standing still on one will appear to be running
• Sprite clipping isn't adjusted on platforms, so anything with its legs sticking into the ground normally will still do that on these platforms. This is particularly noticeable if you're used to GZDoom intelligently pushing sprites out of the ground a bit, because it won't do that at all here
• Actors on platforms using Actor Mover and Interpolation Point things will lag behind the platform by 1 tic. This is more obvious on platforms that use a curved path. This is because those things do not actually give the platform any velocity, so we cannot observe their current movement, but only their previous displacement
• Because the script reactivates after every 35 tics the actor is on the platform, it is possible, if the actor is on multiple platforms at once when this reactivation occurs, that a platform with a higher priority than the one the actor was previously being influenced by will suddenly be the one the actor is considered to be standing on. I call this "snagging," and I've tried my best to fix it, but none of my ideas were maintainable
• Actors may be thrusted slightly incorrectly when running from one platform directly onto another
• Bugs??? I've spent a lot of time squashing them, but if you find any more, let me know

Please credit me in your mods if you use this. You can shoot me a message too; I'd be interested to see where this is getting used!

The comments in the files should tell you everything you need to know about how to use this in your own mods. I'll also say what's necessary in here, though.
Spoiler: How to use GFD_PlatformLib in your own mods

Re: [ACS / DECORATE] GFD's Moving Platform Library

Posted: Wed Mar 12, 2014 10:28 pm
by The Zombie Killer
Don't let Jimmy see this :p

Seriously though, this is really cool!

Re: [ACS / DECORATE] GFD's Moving Platform Library

Posted: Mon Mar 17, 2014 9:46 am
by Batandy
hm, this could be useful for Doom: The Golden Souls, awesome work!

Re: [ACS / DECORATE] GFD's Moving Platform Library

Posted: Mon Mar 17, 2014 7:54 pm
by TheMisterCat
er, I made something similar that requires a lot less to implement

https://dl.dropboxusercontent.com/u/109 ... m-test.pk3

simply place doomed num 12500, and set its args:

[0] - byte angle
[1] - speed (map units per tic)
[2] - full move distance (map units)


admittedly the code would need to be cleaned up a little in order to work with other projects, but meh

Re: [ACS / DECORATE] GFD's Moving Platform Library

Posted: Tue Mar 18, 2014 11:15 pm
by GFD
@The Zombie Killer: Let him see it, I say! I'd love for more people to be using this.
Thank you!

@Batandy: I'm a fan of The Golden Souls! I'd be honoured to have assisted its creation.

Re: [ACS / DECORATE] GFD's Moving Platform Library

Posted: Fri Mar 21, 2014 4:42 am
by Nordevai
Man, I'm imagining all the crazy fun possibilities you could have if one mixed this with Xaser's Parkour mod.