Spawn() failure
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.
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.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Spawn() failure
What would cause Spawn() to fail in an open space? I'm using Spawn() to have my ED-209 monster spawn it's parts. It works fine in stock Doom 2 maps, but when I summon the monster in a custom map, it fails.
[EDIT] I did a little testing, and I know Spawn() is getting the right coordinates, it just refuses to spawn the actors in any of the custom maps I've tried.
[EDIT] I did a little testing, and I know Spawn() is getting the right coordinates, it just refuses to spawn the actors in any of the custom maps I've tried.
Re: Spawn() failure
Does it have enough room to spawn?
- Demolisher
- Posts: 1749
- Joined: Mon Aug 11, 2008 12:59 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Winchester, VA
- Contact:
Re: Spawn() failure
ZDG wrote:Does it have enough room to spawn?
Do you have the coordinates in fixed point, ie 720.0 instead of 720?LilWhiteMouse wrote:What would cause Spawn() to fail in an open space?
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Spawn() failure
A snippet of the ACS that the main actor runs:
GetFreeTID() works, and the GetActor positions are working, it just refuses to spawn when in any custom map I've tried. I just don't understand why it would work on Doom 2 maps, but not any custom maps. The script itself is executes just fine on custom maps, it's just the spawn()s that fail.
A look at the leg, though none of the actors spawn:
Code: Select all
function int GetFreeTID (int start)
{
//while (ThingCount (0, start) != 0){start++;}
while (GetActorViewHeight(start) + ThingCount (0, start) != 0){start++;}
return start;
}
script 500 (void) {
if (ActivatorTID() != 0){terminate;}
if (ActivatorTID() == 0){Thing_ChangeTID(0, GetFreeTID(500));}
int LegL = GetFreeTID(500);
Spawn ("ED209_Leg1", GetActorX(0), GetActorY(0), GetActorZ(0), LegL, 0);
A look at the leg, though none of the actors spawn:
Spoiler:[EDIT] I tried replacing Spawn ("ED209_Leg1", GetActorX(0), GetActorY(0), GetActorZ(0), LegL, 0) with SpawnSpot("ED209_Leg1", 0, LegL, 0) and SpawnSpot("ED209_Leg1", ActivatorTID(), LegL, 0) but no change. It worked on a stock map, but failed on a custom map.
Re: Spawn() failure
are you sure it's reaching the spawn line?
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Spawn() failure
Yes, the whole script runs as expected, it's just the parts won't spawn outside of stock maps. I wrote in printbold()s to check each step of the script.Isle wrote:are you sure it's reaching the spawn line?
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Spawn() failure
Did you remember to declare the script as a library?
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Spawn() failure
YAY! No, I didn't. That fixed it. So why does it work in stock maps? Because they don't have any scripts?XutaWoo wrote:Did you remember to declare the script as a library?
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: Spawn() failure
Exactly.LilWhiteMouse wrote:YAY! No, I didn't. That fixed it. So why does it work in stock maps? Because they don't have any scripts?XutaWoo wrote:Did you remember to declare the script as a library?
-
JohnnyGoodTimes
- Posts: 8
- Joined: Sun May 23, 2010 8:52 pm
Re: Spawn() failure
Here's a trick I like to use when testing the success of Spawn().
Code: Select all
int test = Spawn(class, x, y, z, new_tid, angle);
if (!test)
{
//do stuff if Spawn() failed
PrintBold(s:class, s:" failed to spawn at coordinates ", f:x, s:", ", f:y, s:", ", f:z);
}