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

Hexen Thing_Projectiles

Recommended Posts

I have another dumb question
Okay, to start I am trying to make a wall that shoots fireballs at the player.
I got it right only It shoots once then stops. I want it to continuously shoot fireballs, like in the guardian of ice, the room to the left when you enter.
I used the while expression and inserted a delay but the script is still a runaway.
Then when I put the delay below the while the fireballs shot once.
I may be stupid or not understand what I am doing wrong

Here is the code

#include "common.acs"

int mapvar0;

script 4 (void)

{    

    Door_Open(4,60);
    
    int var0;

   var0 = 1;
   
   while (var0 < 3)  
  
    Delay(2);
   
   Thing_ProjectileGravity(15, T_FIREBALL1, 270, 32, 32);
        thingsound(15, "FireDemonAttack", 127);
        Thing_ProjectileGravity(16, T_FIREBALL1, 90, 32, 32);
        thingsound(16, "FireDemonAttack", 127);
}
Can someone please help?

Share this post


Link to post

Close the code tags by using [/code].

As for your problem, wrap in curly braces everything that should be in the while loop. Like this:

#include "common.acs"

int mapvar0;

script 4 (void)

{    

   Door_Open(4,60);
   
   int var0;

   var0 = 1;
   
   while (var0 < 3)
   {
       Delay(2);
       Thing_ProjectileGravity(15, T_FIREBALL1, 270, 32, 32);
       ThingSound(15, "FireDemonAttack", 127);
       Thing_ProjectileGravity(16, T_FIREBALL1, 90, 32, 32);
       ThingSound(16, "FireDemonAttack", 127);
   }
}

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
×