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

Trying to spawn monsters with map spots

Recommended Posts

Im using GZDoom Builder with Doom 2 UDMF, I have four map spots and used this script:
 

#include "zcommon.acs"

script 1 (void)
{
   Thing_SpawnFacing(1, 2, 0, 0);
   Delay(30);
   Thing_SpawnFacing(2, 2, 0, 0);
   Delay(30);
   Thing_SpawnFacing(3, 2, 0, 0);
   Delay(30);
   Thing_SpawnFacing(4, 2, 0, 0);
}

what I'm doing wrong? I looked for tutorials and in the wiki but could not fix that...

Share this post


Link to post

Well, the parameter of the action are not correct at all.

 

The function works in this way:

Thing_spawnfacing followed by 4 data:

 

The first one is the TID of the MapSpot. So in your case you are spawning your monster in four different spots, tagged with 1, 2, 3 and 4. If you don't have these 4 mapspots on your map (or if they are not tagged correctly)  your script will not work. 

However, if you want to spawn the same monster in more than one spot you can simply write the function only one time. It will spawn a monster in every spot that as the given TID.

 

The second one is the name of the thing that you want to spawn. You have to write the name of the thing, not the number (that one is used for linedef's actions, not ACS' ones).

 

The third one has to be TRUE or FALSE. If it is TRUE, a Teleportfog will be spawned with the enemy, if FALSE not.

 

The fourth is the TID that you want to assign to the spawned enemy, just in case you want to use it later for another script.

 

So, for example, I you want to spawn a demon with TID 23 in the MapSpot number 1, you will have to write 

 

Thing_SpawnFacing (1, T_DEMON, TRUE, 23);

 

If you have more than one MapSpot with that tag, a demon will appear on the top of everyone.

 

Here you have the list of actor names:

https://zdoom.org/wiki/Doom_spawn_numbers

Share this post


Link to post
5 hours ago, Simomarchi said:

Well, the parameter of the action are not correct at all.

 

The function works in this way:

Thing_spawnfacing followed by 4 data:

 

The first one is the TID of the MapSpot. So in your case you are spawning your monster in four different spots, tagged with 1, 2, 3 and 4. If you don't have these 4 mapspots on your map (or if they are not tagged correctly)  your script will not work. 

However, if you want to spawn the same monster in more than one spot you can simply write the function only one time. It will spawn a monster in every spot that as the given TID.

 

The second one is the name of the thing that you want to spawn. You have to write the name of the thing, not the number (that one is used for linedef's actions, not ACS' ones).

 

The third one has to be TRUE or FALSE. If it is TRUE, a Teleportfog will be spawned with the enemy, if FALSE not.

 

The fourth is the TID that you want to assign to the spawned enemy, just in case you want to use it later for another script.

 

So, for example, I you want to spawn a demon with TID 23 in the MapSpot number 1, you will have to write 

 

Thing_SpawnFacing (1, T_DEMON, TRUE, 23); 

 

If you have more than one MapSpot with that tag, a demon will appear on the top of everyone.

 

Here you have the list of actor names:

https://zdoom.org/wiki/Doom_spawn_numbers

Thank you ♥
Now it's work and I understand how to continue

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
×