Jump to content

Hexen Thing_Projectiles


Rycky91

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...