Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
arch129_

Need help implementing delays in DECORTAE

Question

I've been struggling to figure out how to achieve an attack pattern that makes bullets spawn delayed from each other.

 

Right now when my imp attacks all the bullets are fired at the exact same time, I want a single tick of time to pass before another bullet is fired.

 

I've looked, but I can't find any functions that work in decorate that delay time. I'm not even sure if the way i'm trying to implement delays are possible.

 

I would appreciate it if you can tell me what I should do.

 

My current DECORATE code:

Spoiler

ACTOR DoomImp1 replaces DoomImp
{

  var int user_i;
  var int user_a;
  Health 60
  Radius 20
  Height 56
  Mass 100
  Speed 8
  PainChance 200
  Monster
  +FLOORCLIP
  SeeSound "imp/sight"
  PainSound "imp/pain"
  DeathSound "imp/death"
  ActiveSound "imp/active"
  HitObituary "$OB_IMPHIT"
  Obituary "$OB_IMP"
  States
  {
  Spawn:
	TROO A 0 {
	A_SetUserVar(user_i, 0);
	A_SetUserVar(user_a, 24);
	}
    TROO AB 10 A_Look
    Loop
  See:
    TROO AABBCCDD 3 A_Chase
    Loop
  Melee:
  Missile:
	TROO EF 2
	TROO F 0
	{
	while (user_i < user_a)
	{
    	A_CustomMissile("BrownImpBall",32,0,user_i*(360/user_a));
		A_SetUserVar(user_i, user_i + 1);
		//WAIT FOR 1 FRAME HERE                                            <----------------------------
	}
	A_SetUserVar(user_i, 0);	
	}
	TROO G 20
	Goto See
  Pain:
    TROO H 2
    TROO H 2 A_Pain
    Goto See
  Death:
    TROO I 8
    TROO J 8 A_Scream
    TROO K 6
    TROO L 6 A_NoBlocking
    TROO M -1
    Stop
  XDeath:
    TROO N 5
    TROO O 5 A_XScream
    TROO P 5
    TROO Q 5 A_NoBlocking
    TROO RST 5
    TROO U -1
    Stop
  Raise:
    TROO ML 8
    TROO KJI 6
    Goto See
  }
}

 

 

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 1

do explicit loop with frames instead, kinda like this:

 

Missile:
    TROO EF 2

ShootOneMissile:
    TROO F 1 A_CustomMissile("BrownImpBall",32,0,user_i*(360/user_a))

    TNT1 A 0 A_SetUserVar(user_i, user_i + 1)

    TNT1 A 0 A_JumpIf(user_i < user_a, "ShootOneMissile")

    TNT1 A 0 A_SetUserVar(user_i, 0)
    TROO G 20
    Goto See

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×