Jump to content

GZDoom Script Problem


Frisky

Recommended Posts

I'm making a map in GZDoom Builder for my new WAD, but for some reason, a script won't work.

#include "zcommon.acs"

script 1 (void)
{
    //Open door
    Door_Open(1, 20);
}
It's supposed to make a specific door open when an enemy with a Script Execute is killed. I'm not sure what the error to this problem is and it says it's working fine in GZDoom Builder.
Please help. :(

Share this post


Link to post

-Make sure that you write the script into the SCRIPTS window and not the DIALOGUE window.

-Make sure that the script gets compiled - change the script text slightly, hit the Compile button and save the wad.

-Make sure that the door actually has tag 1 and the enemy actually has action ACS_Execute with first argument set to 1.

-Make sure that your door doesn't have neighboring sectors with low ceilings. Doors always raise up to 4 units below the lowest neighboring sector's ceiling.


If none of these helps, post your wad.

Share this post


Link to post

That's a common mistake. One thing I sometimes do with scripts when I can't tell if the code is wrong is add something like print("test1"); after a line I think might be trouble. Sometimes I pepper a script with different printouts, especially printouts of different variables. If the script fails before the print() call the print() function won't execute and I'll have an idea where the failure is. In your script it would have executed anyway and then it would point you to checking your sector tags.

Share this post


Link to post
Aliotroph? said:

That's a common mistake. One thing I sometimes do with scripts when I can't tell if the code is wrong is add something like print("test1"); after a line I think might be trouble. Sometimes I pepper a script with different printouts, especially printouts of different variables. If the script fails before the print() call the print() function won't execute and I'll have an idea where the failure is. In your script it would have executed anyway and then it would point you to checking your sector tags.

Use printbold() instead of print().

I've seen a few times people claiming a script wasn't working, even though it actually was, because the print() statements showed nothing. That's because print() only works if the script's activator is the player (so that in multiplayer, it only displays for the player who activated the script) and when the activator isn't a player at all, nothing happens. Printbold displays the text for all players so it's guaranteed to work even when the script is activated by a monster or something.

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...