Using MAPINFO SpawnNums for item replacement

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
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Using MAPINFO SpawnNums for item replacement

Post by JPL »

I've made a basic "Doom weapons in Heretic" mod, and am trying to replace ammo dropped by monsters. My first take on this was to subclass each monster type and alter its DropItem line in DECORATE, then replace all places instances. This works but it's a fair amount of new data for something so simple. I discovered the concept of SpawnNums overrides in MAPINFO and that seems like a way more elegant way to do this - just spawn a Clip (Doom pistol ammo) instead of a GoldWandAmmo when a mummy dies, for example - but I don't think it's working correctly.

I stripped this example down to its most basic, leaving aside the concept of Doom items entirely, just a PK3 with only mapinfo.txt containing the following:

Code: Select all

SpawnNums
{
        11 = CrystalVial
}
This should cause mummies to (according to the normal drop %) drop health vials instead of wand ammo. However when I jump into Heretic E1M2 and kill a few, they still drop wand ammo. Any idea why? It's possible I've misunderstood how SpawnNum declarations work.
User avatar
phantombeta
Posts: 2184
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Using MAPINFO SpawnNums for item replacement

Post by phantombeta »

Pretty sure ZDoom uses actor names internally and the Spawn Numbers are just for compatibility with old maps. (Including some IWAD maps, I think.)
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by Ed the Bat »

JPL wrote:This should cause mummies to (according to the normal drop %) drop health vials instead of wand ammo.
No, it should not. This should only cause actions such as Thing_Spawn to spawn a crystal vial if SpawnID 11 is used.
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by JPL »

Ah okay, thanks for the correction. For doing monster ammo drop item replacements, is the method I originally described (subclassing monsters and remapping their DoomEdNums) still the best way?
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by Ed the Bat »

I would say that using the 'replaces' command is a better method, as this ensures that the monster subclass appears in ALL instances, not just map-spawned variants of that monster.
Something like:

Code: Select all

ACTOR NewMummy : Mummy replaces Mummy
{
	DropItem CrystalVial
}
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by JPL »

Ed the Bat wrote:I would say that using the 'replaces' command is a better method, as this ensures that the monster subclass appears in ALL instances, not just map-spawned variants of that monster.
Something like:

Code: Select all

ACTOR NewMummy : Mummy replaces Mummy
{
	DropItem CrystalVial
}
I didn't know about the "replaces" parameter, that should simplify what I'm doing a bit - I'd already done the subclasses of monsters that drop Doom ammos, but was using DoomEdNums to substitute the monsters instead of doing it directly from decorate. Thanks!
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Using MAPINFO SpawnNums for item replacement

Post by Gez »

The simplest approach would be not to replace the mummy to change what it drops, but instead to directly replace the drops.

Code: Select all

Actor ClipInHeretic : Clip replaces GoldWandAmmo {}
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by Ed the Bat »

Assuming you want the WandAmmo items on the floor to also be replaced by clips, yes. Otherwise, no, this would not be the best approach.
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by JPL »

Gez wrote:The simplest approach would be not to replace the mummy to change what it drops, but instead to directly replace the drops.

Code: Select all

Actor ClipInHeretic : Clip replaces GoldWandAmmo {}
Even better! I do indeed want to replace all instances. It's also way more readable than DoomEdNums.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Using MAPINFO SpawnNums for item replacement

Post by Gez »

Ed the Bat wrote:Assuming you want the WandAmmo items on the floor to also be replaced by clips, yes. Otherwise, no, this would not be the best approach.
Yeah but I don't see any way it could make sense to replace dropped items but not spawned items for JPL's use case, because what would the player -- who is given Doom's weapons, but not Heretic's -- do with the utterly useless, unusable, and of no use gold wand ammo on the floor?
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Using MAPINFO SpawnNums for item replacement

Post by Ed the Bat »

Nothing in the first post said that Heretic's weapons were gone, and I don't make assumptions about what someone wants to do.
Locked

Return to “Editing (Archive)”