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

Ending map after enemy is killed?

Recommended Posts

If you saw in my last post, you know I imported the MotherDemon into one of my maps (Thank god I figured that out), but I now have a question. How do I edit my Mapinfo so that the map will end once you kill the Mother Demon?

Share this post


Link to post

Alright, so, for my custom Mother Demon enemy, would I put in:

SpecialAction = "Motherdemon"

SpecialAction_ExitLevel

?

Also, I must thank you for helping me with this.

Share this post


Link to post

You can also just script it in UDMF. Assign the monster in question action 80, script 1. Then put the following into the script editor:

 

#include "zcommon.acs"

script 1 (void)

{

Delay(140); // this is so it doesn't insta end and gives the death animation time to play out, adjust if needed

Exit_Normal(0);

}

Share this post


Link to post
29 minutes ago, Dokta Whawee said:

Okay, how do you access the script editor in question?

In GZDoom Builder, it's in the top left and hovering over it will say Script Editor. It only appears in map formats that support scripting.

Share this post


Link to post

Make sure that after saving scripts (pressing Ctrl+S in the script editor) the statur bar says: "compiled without errors".

 

If you happen to have some errors, scripts will not be available and you need to check against any typos.

Share this post


Link to post
3 hours ago, Dokta Whawee said:

Okay, I did copy it into the script editor, but it says "P_Startscript: Unknown Script 1".

That sounds like the BEHAVIOR was not compiled or had an error compiling and the game can't find the script.

 

Post what is inside the script editor for the map.

Share this post


Link to post

This is all that is inside the script:

 

#include "zcommon.acs"

script "1"
{
Delay(140);
Exit_Normal(0);
}

Share this post


Link to post

You can use script 1 or script "1", but you must also indicate the type of script, for example

 

script 1 (void) // numbered script

which is the traditional way,

or

script "1" (void) // named script

but, using numbers in a named script is selfdefeating, since you should really use a name which makes sense, like

script "opendoor1" (void)

something which descibes what the script will do.

 

Share this post


Link to post
12 hours ago, Kappes Buur said:

using numbers in a named script is selfdefeating, since you should really use a name which makes sense, like

script "opendoor1" (void)

something which descibes what the script will do.

I sort of disagree that it's self defeating. A numbered script is a bad idea in a gameplay mod because maps may use numbers.

 

In a mapping environment however, I usually imagine script numbers corresponding to map events (i.e. the first ambush event is script 1) and the script would have a comment above it explaining what the script does.

 

Since map scripts only have map scope it's very easy to just use numbers as you design a map and let specially named scripts be for gameplay stuff exclusively.

 

But everyone has their preference...

Share this post


Link to post

I am getting the same errors, my script looks like this:

 

#include "zcommon.acs"
script 1 (void)
{
Delay(140);
Exit_Normal(0);
}

 

I should say that this is the first script editing I have ever done, so I do not have something called "ACC.EXE" or "ACS.EXE" installed yet...

Do I need them?

Share this post


Link to post

You can't compile scripts without a compiler. When you install/download GZDoom Builder, it should already include the needed files to compile scripts and it should automatically know that the compiler is there. Make sure you are on GZDB and are in the UDMF format.

Share this post


Link to post

For Slade3 you have to download ACC.exe separately and then link to the installation via

Edit - Preferences...

Spoiler

RyTN2jz.png

You may have to update zdefs.acs and zspecial.acs

 

Then create a New Entry, name it SCRIPTS.

Highlight SCRIPTS and select View As Text.

Enter the scripts and compile.

 

GZDoom Builder (DB2, DBX, GZDB, GZDBBF) already come with the compiler included.

However, only the latest DBX and GZDBBF have the latest files for the compiler. For the

other editor see above to update.

To open the script editor use F10 (default).

Enter the script(s) and compile.

 

Share this post


Link to post

It worked! Eureka! Thank you all so much for the help! Sorry for the delayed responce... But this is so great! Thanks!

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
×