Spawning Things FROM Decorate

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Spawning Things FROM Decorate

Post by solarsnowfall »

I finally got around to adding the monsters to my wad. I want to spawn in Fast Imps. So in Decorate I gave fast imp SPAWNID 200 (as was demonstrated to me in another thread). I tried using Thing_Spawn, and SpawnSpot, and neither seem to work....

Code: Select all

SpawnSpot(200, 177, 181, 1); 


and

Code: Select all

 
Thing_Spawn(177, 200, 1, 181); 



The Decorate entry looks like this.

Code: Select all

ACTOR FastImp 3126 
{ 
      //$Category "ZDoom Monster pack" 
      SPAWNID 200 
      (rest of scirpt)...

And yes, the monsters work properly otherwise, just can't seem to spawn them. How are folks counting and spawning things from decorate these days?
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Post by Ryan Cordell »

I'm sure that isn't exactly the correct way, but I'll let the others to find out..
Darkhaven
Posts: 29
Joined: Tue Jul 12, 2005 2:55 am

Post by Darkhaven »

Try using Thing_Move(...); and place the DECORATE monster in a dummy sector.
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Post by Siggi »

Wiki wrote:Thing_Spawn (tid, type, angle, new tid)

tid: Thing ID of the map spot to spawn the thing at
type: Type of thing to spawn
angle: Byte angle for the thing to face
new tid: TID to give spawned thing
First thing you do, place the map spot, give it a Thing ID.
Then use Thing_Spawn like this...

Code: Select all

Thing_Spawn (1337, 3126, 0 ,0)
As I understand it, this will spawn a fast imp at the map spot with the Thing ID of 1337, the imp will be facing north and will not have a Thing ID of its own.

Also, you can remove the "SPAWNID 200" line from the DECORATE, I don't see it serving any purpose.
Last edited by Siggi on Fri Jul 15, 2005 7:06 pm, edited 2 times in total.
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Post by Siggi »

Darkhaven wrote:Try using Thing_Move(...); and place the DECORATE monster in a dummy sector.
This is a waste of time considering it also uses a map spot.
Thing_Spawn will do it without a dummy sector, and its less work.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

This does not work, or doesn't seem to anyway.

Code: Select all

{
int d;
d=ThingCount(T_Demon, 50);
while (d < 30)
{
Thing_Spawn(55, 3110, 1, 50);
Thing_Hate (50, 49, 6);
Delay(80);
}
Restart;
}
Where thing 3110 is the Blood Demon Clone. If I switch the number out with T_Demon the script works fine and demons are spawned.

Code: Select all

{
int d;
d=ThingCount(T_Demon, 50);
while (d < 30)
{
SpawnSpot(3110, 55, 50, 1);
Thing_Hate (50, 49, 6);
Delay(80);
}
Restart;
}
This also does not work. So I'm afraid it's not as simple as some might think. Surely somebody has attempted something similar to this...
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Post by Siggi »

Ok.
Thing_Count cannot be used in this case because AFAIK the Blood Demon Clone doesn't have a Spawn number. So your int d will allways be 0.
Wiki wrote:Spawn numbers are the numbers used by specials such as Thing_Spawn to spawn actors in the game once the user has started playing the map. Although DoomEd numbers and spawn numbers both describe actors, they are not interchangeable—you must not use a spawn number on a map thing, and you must not use a DoomEd number for instance as a Thing_Spawn parameter.
However, we can work around this. I'm now assuming you want to create 30 Blood Demons: This code should work.

Code: Select all

{
	for (int i = 0 ;i< 30;i++)
	{
		SpawnSpot ("BloodDemonClone", 55, 50, 0);
		Thing_Hate (50, 49, 6);
		Delay(80);
	}
}
55 being the MapSpot thing tag, 50 being the Demon's thing tag and 0 being the angle.

The problem with your spawning code was that you were using the Blood Demon's DoomEd number instead of its class name.

I originally said you should use Thing_Spawn, however I was mistaken as that too requires a spawn number.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

I can count them with T_None and tag number if I wanted to, but there are already demons there.

And thanks a million for clearing that up for me.
Locked

Return to “Editing (Archive)”