[CODE] spawning many warping actors in a pattern - New Demo

Post your example zscripts/ACS scripts/etc here.

[CODE] spawning many warping actors in a pattern - New Demo

Postby scroton » Mon May 11, 2015 12:31 am

This is test/example code for spawning warping actors that adhere to a static pattern. Right now it's just a line that is in front of the player and extends upwards and outwards but it can be used for any number of more complex spawning patterns, from curves to structures around the player, etc. It uses a linear bezier curve to calculate the user vars the warping actors use for their warping, but any continuous function employed in a similar manner would work.

There is a test fist weapon given to the player and selected upon level entry. The primary fire spawns warping actors in the described linear pattern. The altfire spawns non-warping actors in the same described linear pattern for comparison.

ZDoom only.

Free to use for anything as long as credit is given.

Credits:

Ijon Tichy
--commonFuncs.h used in acs

InsanityBringer
--Linear increment spawn code from BlasterPistol.wad served as inspiration.

Other
--Electric arc sprites (all SARC sprites) edited from Doom plasma shot by scroton
--Code by scroton

FILE:
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
Last edited by scroton on Wed May 13, 2015 4:29 pm, edited 1 time in total.
User avatar
scroton
 
Joined: 27 Apr 2013

Re: [CODE] spawning many warping actors in a pattern

Postby scroton » Mon May 11, 2015 1:27 am

While I'm sure others have thought of this before, I just wanted to share some code I wrote to test if a whip made of actors that wouldn't lag when the player moves was possible.

It's also worth noting that if you kept the actors around for longer than 1 tic and stored their tids in an array instead of wiping them after they're spawned you could update each of their user vars and thus animate them according to a function or even by hand-picked values if you wanted, with the between-frames animated too thanks to the wonderful, magic gift to the ZDoom community that is A_Warp.
User avatar
scroton
 
Joined: 27 Apr 2013

Re: [CODE] spawning many warping actors in a pattern

Postby scroton » Wed May 13, 2015 4:28 pm

Since I've got this in a releaseable state (for a test version) now, here it is:

https://drive.google.com/file/d/0BxbbtK ... sp=sharing

This is a whip for another person's WIP Castlevania mod/possibly TC. It uses the animation method described above.

Anybody can use it for anything, check the ABOUT&CREDITS.txt file in the pk3 for more info.
Note that this method for animating a bunch of actors could be used for anything, not just a whip.
Feel free to ask questions about the code here or on irc.
User avatar
scroton
 
Joined: 27 Apr 2013


Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests