ReplaceActor skill property

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: ReplaceActor skill property

Re: ReplaceActor skill property

by Gez » Fri Jun 26, 2009 8:44 pm

Odd, what happened to the newlines? It's not important anyway.
ThatOneZDoomer wrote:I thought to myself "I hope I don't make the mistake of getting the skill and decorate actor defining mixed up" and with just this example alone, I already made that mistake :| . Well, I'm sure the wiki page will make it clear that skill replacements are applied before decorate replacements to avoid threads asking why they couldn't get the feature to work correctly.
You tell me.

Re: ReplaceActor skill property

by ThatOneZDoomer » Fri Jun 26, 2009 12:50 pm

I thought to myself "I hope I don't make the mistake of getting the skill and decorate actor defining mixed up" and with just this example alone, I already made that mistake :| . Well, I'm sure the wiki page will make it clear that skill replacements are applied before decorate replacements to avoid threads asking why they couldn't get the feature to work correctly.

Re: ReplaceActor skill property

by Gez » Fri Jun 26, 2009 12:40 pm

Skill replacements are applied before DECORATE replacement, so in your example what you'll want is this:

Code: Select all

skill leet
{
   spawnfilter = 4
   name = "No n00bs allowed!!"
   ReplaceActor = "DoomImp", "ImpSpawnerHard"
}

Re: ReplaceActor skill property

by ThatOneZDoomer » Fri Jun 26, 2009 12:27 pm

Finally, it's here, a non-hacky way of changing actors based on skill level! No more buggy way of doing it with A_SpawnThingEx that breaks scripts. I know I'll be using this for sure. Just a quick question...

Will this work in combination with your Random Spawner while still keeping scripts functional? In a way, it'll be like a double replacement or something like that. Something like this...

Code: Select all

Actor ImpSpawner : RandomSpawner replaces DoomImp
{
   DropItem "WimpyImp"
   DropItem "RedShirtImp"
}

Actor ImpSpawnerHard : RandomSpawner
{
   DropItem "UberImp"
   DropItem "1337Imp"
}

Code: Select all

skill leet
{
   spawnfilter = 4
   name = "No n00bs allowed!!"
   ReplaceActor = "ImpSpawner", "ImpSpawnerHard"
}
Or would I have to do it this way, if it works at all?

Code: Select all

skill leet
{
   spawnfilter = 4
   name = "No n00bs allowed!!"
   ReplaceActor = "WimpyImp", "UberImp"
   ReplaceActor = "RedShirtImp", "1337Imp"
}

Re: ReplaceActor skill property

by Gez » Fri Jun 26, 2009 11:50 am

What, already? Damn that was fast. I revised it to handle erroneous actor definitions more gracefully.

Re: ReplaceActor skill property

by .+:icytux:+. » Fri Jun 26, 2009 10:28 am

i like :D

ReplaceActor skill property

by Gez » Fri Jun 26, 2009 9:46 am

As discussed in the Additions to skill definition thread. This patch adds a new skill property to skill definitions: ReplaceActor.

Example of use:

Code: Select all

skill test
{
	spawnfilter = 4
	name = "Massive upgrade!"
	ReplaceActor = "ZombieMan", "ShotgunGuy"
	ReplaceActor = "ShotgunGuy", "ChaingunGuy"
	ReplaceActor = "Demon", "Spectre"
	ReplaceActor = "Fatso", "BaronOfHell"
	ammofactor = 2
	dropammofactor = 1
}
Skill-based replacements are not transitive: zombies are replaced by sergeants, and sergeants by commandos, but zombies aren't replaced by commandos.

The implementation has the skill replacements applied first, followed by any DECORATE replacement. For example, if the above MAPINFO code is combined with this DECORATE code...

Code: Select all

Actor Imp : DoomImp replaces ChaingunGuy {}
Actor FirstAid : Medikit replaces ShotgunGuy {}
... then in the level the sergeants will be replaced by imps, not with medikits. But the former humans will end up being replaced by medikits.

This implementation only changes the FActorInfo::GetReplacement and GetReplacee functions, instead of altering many other functions. As such it is I think the cleanest it can be.

Top