Repeating (almost) the same decorate code
Posted: Sat Nov 17, 2012 6:11 am
Is there a way to cut down this decorate code? I mean, I would like something like for loop in acs. Is there an option for it in decorate, so that you don't have to write lots of lines with the same (or almost the same) code.
Substituting Loop for Stop is not a good idea, because I want A_PotteryExplode to be executed only once and I'd like to spawn clouds finite times not in a Loop. Otherwise how do you stop a Loop if you don't want to run it forever? In acs it would be much easier.
Code: Select all
actor cloudpot : Pottery1 11003
{
States
{
Spawn:
POT1 A -1
Loop
Death:
POT1 A 0 A_PotteryExplode
POT1 A 0 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 0 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 0 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 0 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 0 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 0 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 1 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 1 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 1 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
NULL A 35
POT1 A 1 A_SpawnItemEx("PoisonCloud", frandom(-30.0, 30.0), frandom(-30.0, 30.0), 40.0, frandom(0.0,10.0), frandom(0.0,10.0), 0.0, 0.0, SXF_NOCHECKPOSITION, 0)
Stop
}