Page 1 of 1

How to make spiral missiles in DECORATE without a billion lines of code.

Posted: Thu Apr 30, 2015 8:16 am
by nambona890
I decided to make a tutorial based around the fact that Zandronum FINALLY added user variables into DECORATE, which can reduce the size of the DECORATE lump by quite a bit. I'll just be making a basic DoomImpBall spiral.

First off, make your monster (except for the missile part).

Before you make the states though, you will have to add this to your monster initiation part.

Code: Select all

var int user_angle;
Then, for the missile part, just modify this to your liking.

Code: Select all

//SPRI A = Your Sprite
//DEL = Delay of projectile firing
//SPHEIGHT = Height of projectile spawning
//DIVIDE = Chooses how many projectiles you want spawned in the spiral. (360/DIVIDE amount of projectiles)
//PROJ = Your Projectile


Missile:
	SPRI A 0 a_setuservar(user_angle,0)
	//add something like an animation on this line if you want
Missile2:
	SPRI A DEL a_custommissile("PROJ",SPHEIGHT,0,user_angle,cmf_aimdirection,0)
	SPRI A 0 a_setuservar(user_angle,user_angle+DIVIDE)
	SPRI A 0 a_jumpif(user_angle <3 60,"Missile2")
	//add another animation if you want
	goto See
And if you want an instant circle, change DEL to 0. Thank you, and good night.

RE: How to make spiral missiles in DECORATE without a billion lines of code.

Posted: Thu Apr 30, 2015 7:52 pm
by TerminusEst13
It's worth pointing out if you change the delay to 0, this has a chance of wonking Z& online due to being a 0-tic loop.

Otherwise, this works wonderfully.

RE: How to make spiral missiles in DECORATE without a billion lines of code.

Posted: Thu Apr 30, 2015 9:33 pm
by ZZYZX
I had similar script somewhere WITHOUT using uservars.
Oh right this: http://pastebin.com/5CbJd1yK

Why do you need to make a variable if the only thing you are modifying is angle, and it's a variable by itself.

RE: How to make spiral missiles in DECORATE without a billion lines of code.

Posted: Mon Sep 28, 2015 4:56 am
by ZzZombo
Wut. That's the most inefficient way of doing that...