Author Topic: Mind the Gap - A library for general-purpose Portal-style gaps (+example script)  (Read 1646 times)

Andi

  • World's Gayest Danmaku
  • PlaySE("./se/Nyaa.wav");
    • 2hu blog
For the last week or so I've been working on some functions for gaps that function much like Portal-style portals. Namely, shots go in one and out the other, preserving their speed, angle, position, etcetera relative to the gap. This is one of those things that can potentially save a lot of effort once you've got it working, but takes a lot of effort to get working - and now I have, in fact, got it working. So here it is.

Dropbox link because Bulletforge registration is closed

The attached script (5 spells, 4 nonspells) makes use of these gaps both as tools - actually gapping shots - and as props - creating shots on a gap without actually gapping them. The latter shouldn't be much more intensive than usual, since all the math is done by the ingaps (the outgaps just have to look pretty and tell the ingaps where they are), so they can be used for all purposes without needing a separate function for "fake" gaps.

Documentation for making use of the gaps is included in the library itself. The code isn't 100% cleaned up yet - there are still some things half-implemented (gapping straight lasers), or hooks without functions to set them (which nonetheless work if you set the relevant dictionary values manually) - but it's functional, and hopefully fairly straightforward to use. I'll update this

Current features include:
  • Gapping shots (that was the hard one)
  • Applying an AddPatternA3 to shots after gapping them, as well as setting things like spell resist, alpha, color, blend type...
  • Holding shots in the gap before releasing them
  • Optimizations to cut down on the number of calculations required
  • Functions to move gaps around without breaking everything (since one of the aforementioned optimizations involves not recalculating everything each frame)
  • And probably other things which I've forgotten about at the moment.

Planned features include:
  • Gapping straight lasers (half-implemented at the moment)
  • Shrinking large shots before gapping them and growing them again after (since it looks weird when they disappear before fully entering the gap)
  • And whatever else occurs to me that I feel they ought to be able to do.

Credits: I originally used the mock gaps from Celestial Showdown to render them, although over time I ended up replacing most of the original code (the original used Yangle to close them, which didn't really work when they were rotated). I think TalosMistake did those? Same with the trains, I started with the ones from Celestial Showdown and heavily modified them, especially the hitbox code. I think that's about- huh? There's more? Well, various assets were grabbed from all over the place, but that's - wait, me? Oh, yeah, I guess I should be credited for this. Then, uh, leave in the part where it says "by Andi" if you use them.
« Last Edit: January 15, 2018, 01:10:10 AM by Andi »
Literally everything in this script will crash and burn.
1CC tracker

Andi

  • World's Gayest Danmaku
  • PlaySE("./se/Nyaa.wav");
    • 2hu blog
Reserved since that seems to be a thing people do on threads like this
Literally everything in this script will crash and burn.
1CC tracker