Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Mivalekan

Thing_Spawn

Recommended Posts

Ok, I just don't understand this script. I've read over all the tutorials and whatnot I could find, and look through the scripts of several maps, but STILL don't understand how this script works.

I know that I need the Mapspot thing where the thing will spawn, but the script has me baffled.

Here's an example of what I mean from one of AgentSpork's maps:

Thing_SpawnFacing(14,T_IMP,0,101);

T_IMP is obviously the thing ID I need, but why the 14? Sector Tag? What? I don't see any link whatsoever to the script and the mapspot, yet things stlil spawn.

Share this post


Link to post

It works like this:

Thing_SpawnFacing(A, B, C, D);

A is the mapspot where the thing appears. If you look around enough, you'll find the mapspot with a tag of 14. That's where the thing will appear.
B is the number or name of the thing that will appear.
C is either 0 or 1, and that determines whether it uses the green spawn effect or just appear silently.
D will be the tid number of the thing that just spawned.

Share this post


Link to post
Ichor said:

A is the mapspot where the thing appears. If you look around enough, you'll find the mapspot with a tag of 14. That's where the thing will appear.



Uhh... what?

Share this post


Link to post
Mivalekan said:

I have it set to Doom (Doom in Hexen format), considering this one of the only formats I can script in.



That's the same. Somewhere in the things properties dialog you should find a field called 'tid', 'tag' or something similar. There you must enter the value.

Share this post


Link to post

Is there a way to set it to spawn monsters as I enter a sector?

This is how my current script is set up:

script 2 (VOID)
{
//Monster Spawn - Red Key
ACS_Execute (2, 0);
Thing_SpawnFacing (1, T_HELLKNIGHT, 1, 102);
}

It doesn't work yet, because evidentally I'm missing something. ;/

Share this post


Link to post
Mivalekan said:

Is there a way to set it to spawn monsters as I enter a sector?

This is how my current script is set up:

script 2 (VOID)
{
//Monster Spawn - Red Key
ACS_Execute (2, 0);
Thing_SpawnFacing (1, T_HELLKNIGHT, 1, 102);
}

It doesn't work yet, because evidentally I'm missing something. ;/



First, starting script 2 from script 2 is redundant and won't do anything. Second, if it doesn't work it doesn't need to be the script's fault. Are you sure you set the linedef correctly so that the script gets started? Or did you assign this to a thing? The least I need to know is how you intend to start it before I can help you.

Share this post


Link to post

This is what I want to happen:

The player enters some sector which contains some item, which sets off the script that spawns 4 monsters which surround the player. (Cliche script, but oh well. :D )

Share this post


Link to post

You'll need 4 map spot things with a tid of 1 according to the below example. The monsters will teleport to those map spots. I don't think they have to be map spots though, any thing with a tid of 1 will have monsters spawn on them.

Mivalekan said:

script 2 (VOID)
{
//Monster Spawn - Red Key
ACS_Execute (2, 0);
Thing_SpawnFacing (1, T_HELLKNIGHT, 1, 102);
}

Share this post


Link to post
Mivalekan said:

This is what I want to happen:

The player enters some sector which contains some item, which sets off the script that spawns 4 monsters which surround the player. (Cliche script, but oh well. :D )


In that case it is best to assign the action to the item itself. Just set its special to start script 2 and as long as the map spots with the correct tid are there it should work.

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
Sign in to follow this  
×