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

Looking for Resources for your mod/project? Want to share some of your creations so others can use them? Post them here!
Post Reply
User avatar
nambona890
Banned
Posts: 31
Joined: Sat Aug 02, 2014 9:38 am
Location: Australia
Clan Tag: [BAF]
Banned: Permanently

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

#1

Post by nambona890 » Thu Apr 30, 2015 8:16 am

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.

TerminusEst13
Retired Staff / Community Team Member
Posts: 865
Joined: Tue Jun 05, 2012 11:06 pm

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

#2

Post by TerminusEst13 » Thu Apr 30, 2015 7:52 pm

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.
The Ranger - New class for HeXen.
ZDoom Wars - I drew some pictures.
Samsara - Some class-based mod I guess?
Metroid: Dreadnought - I am a dumb fanboy.
DemonSteele - ~come with me to anime world~

User avatar
ZZYZX
Posts a lot
Posts: 742
Joined: Thu Jun 07, 2012 5:56 pm
Location: Ukraine
Clan: A3
Clan Tag: [A3]

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

#3

Post by ZZYZX » Thu Apr 30, 2015 9:33 pm

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.
Last edited by ZZYZX on Thu Apr 30, 2015 9:39 pm, edited 1 time in total.

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

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

#4

Post by ZzZombo » Mon Sep 28, 2015 4:56 am

Wut. That's the most inefficient way of doing that...
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

Post Reply