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

Monster Generator

Recommended Posts

I am trying to make a 3 stage generator in GZDoom Builder, UDMF like so:

Stage 3 150 Health
Spawns Chaingunner

Stage 2 100 Health
Spawns Former Sergeant

Stage 1 50 Health
Spawns Former Trooper

My problem is that only the first generator works but when I place a second generator, that one never works no matter I do.

Here is the script I am using:

Script "GenA1" OPEN
{
Delay(50);
SpawnSpot("ZombieScientist", 10000, 0, 190);
Restart;
}

Script "GenDth1" (VOID)
{
ACS_NamedTerminate("GenA1", 0);
}

Script "GenA2" OPEN
{
Delay(1);
SpawnSpot("ZombieScientist", 10001, 1, 190);
Restart;
}

Script "GenDth2" (VOID)
{
ACS_NamedTerminate("GenA2", 0);
}

Share this post


Link to post

Please elaborate, because I don't understand it at all. How is your "generator" supposed to work? What it even is? What is a stage? What Map Spots with what TIDs are you putting in your map? (I can see 10000 and 10001 in the script.)

Share this post


Link to post

A level 3 generator that when it is destroyed, it spawns a level 2 generator and spawns a different, weaker monster. The first generator works but the second one, which is a Level 1 Generator does not spawn anything at all.

Share this post


Link to post

Huh, this will be hard, you seem to know your terminology, but I don't know it, generators are nothing common at all in Doom.

How is the generator represented in the map editor? Is it a map spot? A custom DECORATE actor? A solid thing? What TID did you assign to it (to both of them)? Can you post an example map?

Share this post


Link to post

The generator is a Headstone with no tag but will execute a script that terminates the script the spawns the monsters next to it. The Map Spot does have a tag however.

Share this post


Link to post

After reading your descriptions, I have this rough image in my mind: You have a destroyable thing (which you call "generator") and a map spot (with TID 10000) next to each other. Script "GenA1" runs from the beginning and causes monsters to be spawned from the map spot. The generator thing itself only acts as a bullet sponge (=has a certain amount of health), and it will launch script "GenDth1" upon its death. This script will terminate the spawning.

Now you've placed another generator + map spot in another place in your map. The difference is that this new (2nd) generator will launch script "GenDth2" upon its death, and the new (2nd) map spot has a TID 10001. Script "GenA2" is running (=haven't yet been terminated by a killed 2nd generator), but no monsters are spawning from map spot 10001.

Am I right or completely wrong?

If you've posted the map, things would be much clearer, as well as finding a solution.

Share this post


Link to post

I have now fixed the second generator but now the Level 2 Generator, which is the third generator so far. I would have posted the map but I had a problem with the scripting. (I don't know why). The level 2 generator goes something like this, it doesn't work and I am not completely sure how to code this bit.

Script "GenB1" (VOID)
{
SpawnSpot("ZombieScientist2", 10003, 0, 190);
Delay(25);
Restart;
}

Script "GenDth4" (VOID)
{
ACS_NamedTerminate("GenB1", 0);
Delay(1);
{
SpawnSpot("NTomb4", 10004, 10005, 190);
ACS_NamedExecute("GenA5", 0);
}
}

Script "GenA5" (VOID)
{
While(GetActorProperty(10005, APROP_Health)>0.0)
{
If(GetActorProperty(10005, APROP_Health)<0);
{
Terminate;
}
Else
{
SpawnSpot("ZombieScientist", 10003, 0, 190);
Delay(25);
Restart;
}
}
}

Script "GenDth5" (VOID)
{
ACS_NamedTerminate("GenA5", 0);
}

Share this post


Link to post

All these scripts are (VOID). That means that they'll not be launched automatically upon startup. They'll be launched via an action "ACS:Execute" (maximum of 1 instance at a time) or "ACS:Execute Always" (as many instances as you want at a time), and you need to assign this action to a linedef or thing, and then activate it (press/walk over/kill/grab, as you define). Do the scripts actually get launched? Consider making control outputs using Print. Also, are all the appropriate things and map spots actually in the map, and do they have correct TIDs and actions assigned?

Even if you have non-functional scripting, posting the map would be helpful, so that I can see which things are actually placed in the map, what are their TIDs and what actions are they having assigned.

Share this post


Link to post

I would try that with invisible decorate actors instead of scripting. Something like:

actor generator1

{
health 50
+SHOOTABLE
+NOBLOOD

states
{
spawn:
NULL A 25
NUll A 1 spawnitemex ("Zombieman", etc, etc);
loop

death:
NULL A 1
NULL A 1 spawitemex ("generator2")
stop

actor generator2

{
health 50
+SHOOTABLE
+NOBLOOD

states
{
spawn:
NULL A 25
NUll A 1 spawnitemex ("Shotgunguy", etc, etc);
loop

death:
NULL A 1
NULL A 1 spawitemex ("generator3")
stop

actor generator3

{
health 50
+SHOOTABLE
+NOBLOOD

states
{
spawn:
NULL A 25
NUll A 1 spawnitemex ("chaingunguy", etc, etc);
loop

death:
NULL A 1
stop

Share this post


Link to post

I'm sorry scifista42, I really appreciate your help but Darch's reply was the better solution because it saves having to keep putting map spots in and keep typing up the scripts. Thank you so much Darch and scifista42, I really appreciate your help!

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
×