Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004103Zandronum[All Projects] Suggestionpublic2023-02-13 03:572024-04-09 03:01
Reporterarkore 
Assigned ToKaminsky 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformWindows 64-bitOSWindows 10OS Version1903
Product Version3.1 
Target Version3.2Fixed in Version3.2 
Summary0004103: GAMEEVENT_ACTOR_SPAWNED (3.2-alpha): arg1 true if spawned by the level for RandomSpawners
DescriptionThe ''arg1'' value (of ''EVENT'') is false when map monsters are replaced by ''RandomSpawner''

The engine appears to be forgiving with how ''RandomSpawner'' operates on map things, such as monsters, weapons, etc.

It assumed that the engine is doing some magic to handle these replacements so well--replacing a ZombieMan with a RandomSpawner that spawns any one of several monsters, and those monsters remain intact as map monsters, contributing to the map's monster count, and so on.

Many monster mods will typically include a Spawners.txt DECORATE file with RandomSpawners for each of the 18 monster classes in doom2.

Therefore, it is then expected that ''arg1'' should be true in the case of a spawned monster from a RandomSpawner.

Dev quote:
> Actually, by default any ''RandomSpawner'' class shouldn't be triggering ''GAMEEVENT_ACTOR_SPAWNED'' since it has both the ''NOBLOCKMAP'' and ''NOSECTOR'' flags.

Player quote:
> i can only guess that engine changes those flags during the replacement.
Steps To Reproduce- Create new folder: TEST
- Copy zandronum (3.2) and DOOM2.WAD to TEST
- Download sample wad (above), and test.bat, and save to TEST
- Run test.bat
- See console for ''ShotgunGuy (or ACZombieMan) arg1 = false'' (should be ''true'')
Additional InformationDECORATE:
<code c>
ACTOR ACZombieMan : ZombieMan { }

ACTOR ZombiemanSpawner : RandomSpawner Replaces ZombieMan {
    DropItem "ACZombieMan", 256, 50
    DropItem "ShotgunGuy", 256, 50
}
</code>

ACS:
<code c>
#library "TEST"
#include "zcommon.acs"

script "Event" (int type, int arg1, int arg2) EVENT {
    if (type == GAMEEVENT_ACTOR_SPAWNED) {
        if ((ClassifyActor(0) & ACTOR_MONSTER)) {
            Log(s:GetActorClass(0), s:" arg1 = ",i:arg1);
        }
    }
}
</code>
Attached Files? file icon TEST.wad [^] (3,585 bytes) 2023-02-13 03:58
? file icon test.bat [^] (57 bytes) 2023-02-13 03:59

- Relationships

-  Notes
User avatar (0022778)
arkore (reporter)
2023-02-21 01:12

Belphegor raised a good point, in that some mods use replacement solutions as well, which is essentially an actor that is designed for the sole purpose to choose a random monster to spawn, either by A_JumpIf logic, or ACS, etc. Complex Doom does this, and I also have a recent project doing this.

So, perhaps this arg1=true functionality can check for that, or go beyond the scope of it's design and be expanded to check for anything spawned(or "existing") within 0(or 1?) tics of a map starting
User avatar (0023365)
StrikerMan780 (reporter)
2024-03-11 22:18
edited on: 2024-03-11 22:24

Ran into this issue myself. I'm trying to write an enemy multiplier, but since it doesn't work for randomspawners, I'm stuck.

EDIT: Hmm, a temporary workaround is forcing USESPAWNEVENTSCRIPT on the spawner, but that doesn't count for any randomspawners that aren't part of the mod itself.

User avatar (0023366)
Kaminsky (developer)
2024-03-12 02:14

I created a new merge request:'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/53 [^]'
User avatar (0023415)
Kaminsky (developer)
2024-03-17 12:12

This has been merged in:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/b4dc5854a3a082f4bff307bec3d8bf48dcc0dfe3 [^]'

This also changes arg1 of GAMEEVENT_ACTOR_SPAWNED to a bitfield, which can now be used to check if an actor was spawned by the level and/or a random spawner using the flags:

- GAMEEVENT_SPAWN_LEVELSPAWNED (1)
- GAMEEVENT_SPAWN_RANDOMSPAWNED (2)
User avatar (0023567)
Ru5tK1ng (updater)
2024-04-09 03:01

Tested the example wad with the latest 3.2 beta online. The event script fired correctly and the arg1 was printed properly.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2023-02-13 03:57 arkore New Issue
2023-02-13 03:58 arkore File Added: TEST.wad
2023-02-13 03:59 arkore File Added: test.bat
2023-02-21 01:12 arkore Note Added: 0022778
2024-03-11 22:18 StrikerMan780 Note Added: 0023365
2024-03-11 22:24 StrikerMan780 Note Edited: 0023365 View Revisions
2024-03-12 02:14 Kaminsky Note Added: 0023366
2024-03-12 02:14 Kaminsky Assigned To => Kaminsky
2024-03-12 02:14 Kaminsky Status new => needs review
2024-03-12 02:14 Kaminsky Target Version => 3.2
2024-03-17 12:12 Kaminsky Note Added: 0023415
2024-03-17 12:12 Kaminsky Status needs review => needs testing
2024-04-09 03:01 Ru5tK1ng Note Added: 0023567
2024-04-09 03:01 Ru5tK1ng Status needs testing => resolved
2024-04-09 03:01 Ru5tK1ng Resolution open => fixed
2024-04-09 03:01 Ru5tK1ng Fixed in Version => 3.2






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker