Radiation Suits check is ignored (or maybe not)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Miami_vice
Posts: 33
Joined: Thu Oct 21, 2010 3:05 pm

Radiation Suits check is ignored (or maybe not)

Post by Miami_vice »

In my wad I have such action:

There is a player or there are players. There are lava sectors with TID=2. If player enters
lava sector and is without radiation suit he dies. Radiation suits are randomly spawned at dead monster
corpses before removing that corpse.(edited)
However sometimes monster is killed within lava sector and radion suit is spawned there. The player cannot go there.
I'm trying to create a script that spawns radion suits after checking whether this item is inside forbidden
sector with TID=2:

Code: Select all

if(Thingcount(T_IRONFEET, 0)-ThingCountSector(T_IRONFEET, 0, 2)<PlayerCount()) 
Thing_SpawnNofog(tag, T_IRONFEET, 0, 0);
If some radiation suits that are not in lava pools less than all players then spawn more.
But something is wrong. In the game it spawns more suits than players. I'm alone but I see more
suits in unrestricted areas.

Check what is wrong - my logics - or deep in the code, check for rad suits is omitted.

You might think that there are more monsters with the same tag is spawned. But I doubt it.
Spawn mechanism (aka algorithm) is this:
Spoiler:
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Radiation Suits check is ignored (or maybe not)

Post by _mental_ »

Post runnable example please.
User avatar
Miami_vice
Posts: 33
Joined: Thu Oct 21, 2010 3:05 pm

Re: Radiation Suits check is ignored (or maybe not)

Post by Miami_vice »

Ok I'm adding the wad and a video how to play:


Demo how to use frequiencer. Green light is used to set corpses remove rate of outside monsters. Blue light is used to set the rate of corpses within base perimeter to be removed. Powerful scripts that react whenever how fasat and in whatever order you press buttons. As you can see there are still more than one Radiation suit. Why?

In scripts text lump there are 30th and 25th scripts that are rersponsible for corpses remove. There I've written under what circumstances to spawn T_IRONFEET. It should not spawn more than there are players. But it does. I don't know what is wrong.
Maybe deep inside ZDoom libraries there is omitted check for radiation suits. Maybe some devs would check and tell me what's wrong.

Runnable example (click to start download): Survivors_HQ for sharing2

P.S. If you will open the wad with doom builderII and start to test then there you will see that the button for sphere spawn doesn't work. I don't know why but it seems that in this way the program doesn't read data from BEHAVIOR but compiles from within text itself. If you will play the wad itself just with gzdoom then it should work. Besides, some buttons or lines still won't work properly. This is because I did a copy from original wad and removed many stuff that would take a lot of place.
User avatar
Miami_vice
Posts: 33
Joined: Thu Oct 21, 2010 3:05 pm

Re: Radiation Suits check is ignored (or maybe not)

Post by Miami_vice »

Ok folks.

I have found my mistake on my own.

ThingCount(T_Ironfeet, 0) works fine. I haven't checked ThingCountSector(T_IRONFEET, 0, 2) but I think it works ok too.

In scripts 25 and 30 I did debugging. I checked how many radiations suits are there for real using ACS command "Print". Code fragment looks like this:
Spoiler:
On the screen and in console I was able to see real actual data like:
Spoiler:
It's clear that somewhere else this was spawning.

Actually it was 1 line above:

Code: Select all

else if(item_chance>193 && item_chance<200+1) Thing_SpawnNofog(tag, powerup[random(0, 10)], 0, 0);
And "powerup" array is defined at the beginning having "T_IRONFEET" inside as a member:
Spoiler:
I have removed that member from the array and changed indexes at all checking loops. Now everything is ok.

Please forgive me for your time waste.

P.S. I have added one really useful actors check right after successful spawn at script 74:
Spoiler:
It really works and checks whether more than one actors with the same tag has spawn at once.
And it never shows that in the way it is made. I have to specifically do some extra loop to spawn more at once.
Only then text is printed on the screen specifying how many and what class spawned. And tids.

That's all.

You can remove this post from "Bugs" section.
Post Reply

Return to “Closed Bugs [GZDoom]”