Before you ask the lost souls does indeed spawn, the problem is the revenants not spawning at all. Been trying to do a script where if one gets killed it automatically spawns another but i got a runaway script error so i gave upn on this ideaScript 4 (void)
{
Line_SetBlocking (14, 0, BLOCKF_EVERYTHING);
Floor_LowerToNearest (25, 32);
SpawnSpot ("lostsoul", 28);
SpawnSpot ("lostsoul", 29);
SpawnSpot ("lostsoul", 30, 0, 90);
SpawnSpot ("lostsoul", 31, 0, 270);
Delay(1);
if(thingcountname("revenant",34) > 0)
{
SpawnSpot ("revenant", 32);
}
Delay(1);
if(thingcountname("revenant",35) > 0)
{
SpawnSpot ("revenant", 33);
}
}
[ACS] Bit of an issue with spawning things
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Bit of an issue with spawning things
Hey so i decided to try to make a code that if certain monstes have been killed prior to this script being activate, the very same monsters are respawned at the spot, but when the script is called after the monsters being dead it doesn't do jack shit. Here's the script:
-
- Retired Staff / Community Team Member
- Posts: 2558
- Joined: Sat Jun 02, 2012 2:44 am
[ACS] Re: Bit of an issue with spawning things
A few things could be happening here. Either you have revenants spawned but they don't have the tid's 34 and 35 or you don't have spawnspots with the tid's of 32 and 33. My suggestion is to add a print inside the if statements to see if that part is even being ran. If it does print then it means you are lacking spawnspots with the appropriate TID's.
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: Bit of an issue with spawning things
Well i just found a weird thing, it does the opposite of what its supposed to do. It spawns extra revenants if they are alive and not if they are dead... I'm not sure how to fix this.Catastrophe wrote:A few things could be happening here. Either you have revenants spawned but they don't have the tid's 34 and 35 or you don't have spawnspots with the tid's of 32 and 33. My suggestion is to add a print inside the if statements to see if that part is even being ran. If it does print then it means you are lacking spawnspots with the appropriate TID's.
-
- Retired Staff / Community Team Member
- Posts: 2558
- Joined: Sat Jun 02, 2012 2:44 am
[ACS] Re: Bit of an issue with spawning things
Sounds like script 4 is being triggered elsewhere.FranckyFox2468 wrote:Well i just found a weird thing, it does the opposite of what its supposed to do. It spawns extra revenants if they are alive and not if they are dead... I'm not sure how to fix this.Catastrophe wrote:A few things could be happening here. Either you have revenants spawned but they don't have the tid's 34 and 35 or you don't have spawnspots with the tid's of 32 and 33. My suggestion is to add a print inside the if statements to see if that part is even being ran. If it does print then it means you are lacking spawnspots with the appropriate TID's.
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: Bit of an issue with spawning things
No the script does trigger but it does the opposite of what its supposed to do. The intention of this script is to make revenants spawn IF the one assigned are dead. Otherwise it does nothing.Catastrophe wrote:Sounds like script 4 is being triggered elsewhere.FranckyFox2468 wrote:Well i just found a weird thing, it does the opposite of what its supposed to do. It spawns extra revenants if they are alive and not if they are dead... I'm not sure how to fix this.Catastrophe wrote:A few things could be happening here. Either you have revenants spawned but they don't have the tid's 34 and 35 or you don't have spawnspots with the tid's of 32 and 33. My suggestion is to add a print inside the if statements to see if that part is even being ran. If it does print then it means you are lacking spawnspots with the appropriate TID's.
What the script currently does is that it spawns the replacement revenants only if the current revenants are already alive and not when they are dead.
[ACS] Re: Bit of an issue with spawning things
I think I see your logic error. Try replacing this:
if(thingcountname("revenant",34) > 0)
with this:
if(thingcountname("revenant",34) = 0)
and do the same for the other one.
It is doing what you are telling it to do, spawn a revenant if there are more than zero of them, when you want it to spawn one if there are exactly zero of them.
if(thingcountname("revenant",34) > 0)
with this:
if(thingcountname("revenant",34) = 0)
and do the same for the other one.
It is doing what you are telling it to do, spawn a revenant if there are more than zero of them, when you want it to spawn one if there are exactly zero of them.
"For the world is hollow, and I have touched the sky."
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: Bit of an issue with spawning things
Gzdoom builder refuses to compile the script with =. Good thinking but it sadly doesn't workEmpyre wrote:I think I see your logic error. Try replacing this:
if(thingcountname("revenant",34) > 0)
with this:
if(thingcountname("revenant",34) = 0)
and do the same for the other one.
It is doing what you are telling it to do, spawn a revenant if there are more than zero of them, when you want it to spawn one if there are exactly zero of them.
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[ACS] Re: Bit of an issue with spawning things
Been trying to ask some help around Zdoom.org, matters only got progressively worse at every attempts. I have no fucking clue why something this simple can't work correctly.
[ACS] Re: Bit of an issue with spawning things
You're supposed to use double '=' signs when comparing like this. That's why the script isn't compiling.
<Dynamo_>uh
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread
<Dynamo_>did you just take the thread away
<FusedQyou>Dunno
<FusedQyou>ask the thread
[ACS] Re: Bit of an issue with spawning things
Oh yeah: = is assigning a value, and == is comparing 2 values. My C-style coding is sooo rusty.
"For the world is hollow, and I have touched the sky."