Birds fly. Sun shines. And brother? Brutes shoot people.

Mutator to turn odds of appearing to 100% for all actors

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar TheIronKnuckle
Gilded Claw Gilded Claw
Posts: 1967
Joined: 12 Nov 2007, 07:21
Location: Riding my bicycle from the highest hill in Sydney to these forums

Subject: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 16 Jun 2013, 02:13

Is it possible to load a mutator which scans the map and makes all actors appear on all difficulties with 100% odds of appearing? Sounds simple enough: Is it possible? If I had/when I have the time I'd love to write one myself.

I know this would break some maps (the first ice level in rtnp comes to mind, the one where it's either mercs or ice skaarj depending on difficulty), but I'd love to see EXU2 and TLF for example, kitted out with ALL the monsters. Just see what a clusterf**k results
ImageIgnorance is knowing anything
And only idiots know everything

User avatar []KAOS[]Casey
Skaarj Berserker Skaarj Berserker
Posts: 426
Joined: 25 Sep 2008, 07:25

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 16 Jun 2013, 07:03

Code: Select all

Class FuckOddsOfAppearing extends Mutator;

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
        bSuperRelevant = 1;
   return true;
}

Should do it. Keep in mind some mutators may set it to 0 for some reason after it. For best mileage, set as last mutator.

User avatar MrLoathsome
Skaarj Lord Skaarj Lord
Posts: 151
Joined: 01 Jan 2009, 08:24
Location: MrLoathsome fell out of the world!

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 17 Jun 2013, 05:29

I thought you said the order didnt matter.
Mooo !

redeye
Banned Banned
Posts: 1393
Joined: 08 Dec 2007, 06:55

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 17 Jun 2013, 07:49

I never understood this, odds of appearing, how can it when I set a pawn in a map, or set a creature factory to 10 and spits out 10, there is no "odds".
Just ban everyone

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 17 Jun 2013, 14:17

redeye wrote:I never understood this, odds of appearing, how can it when I set a pawn in a map, or set a creature factory to 10 and spits out 10, there is no "odds".


All Actors have the OddsOfAppearing variable under Filters. Set it less than 1.0, and it becomes a percent chance of that actor being preserved in the level after you start the game. If you put it at 0.5, there's a 50% chance the actor will be removed every time you load the map. GameInfo/the BaseMutator/an external mutator can modify the IsRelevant call that handles this.

Basically at the start of the level, the GameInfo calls IsRelevant and does a random check on every actor in the level based on its OddsOfAppearing. If the random check returns greater than the OddsOfAppearing, it will be deleted for that instance of the level. Otherwise it's left alone. Since an actor that's been deleted can't be undeleted (well at least not in most cases), you have to modify this function immediately before the GameInfo can get to it.
Image

User avatar []KAOS[]Casey
Skaarj Berserker Skaarj Berserker
Posts: 426
Joined: 25 Sep 2008, 07:25

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 18 Jun 2013, 19:55

MrLoathsome wrote:I thought you said the order didnt matter.

It depends on a million things. If you're just spawning garbage in postbeginplay who cares. IF you're overriding DMMutator it damn well matters. If you're only running one mutator that does one thing who cares. If you're running 398473209423 mutators and you have no idea what each of them exactly does, putting that particular one last,because ANY mutator can just arbitarily change bSuperRelevant and I know that I've seen that stupid variable flipped for no apparent reason since I guess no one knew what it did.. it can matter, but not all of the time. Mutators can also arbitrarily Destroy things, change things, do what the fuck ever and there are problem mutators and probably will be more. Not to mention there are some functions like MutateTakeDamage that simply don't matter where they are in the chain unless you're running 2 mutators that may do the same thing and make one ineffectual.

tl;dr it's not black and white it's shades of grey.

Bug Horse wrote: you have to modify this function immediately before the GameInfo can get to it.


Orrrrrrrrr you could use that mutator I posted.

Code: Select all

function bool IsRelevant( actor Other )
{
   local byte bSuperRelevant;

   // let the mutators mutate the actor or choose to remove it
   if ( BaseMutator.AlwaysKeep(Other) )
      return true;
   if ( BaseMutator.IsRelevant(Other, bSuperRelevant) )
   {
      if ( bSuperRelevant == 1 ) // mutator wants to override any logic in here
         return true;
   }
...
        {Garbage filter code}


As you can see, BaseMutator's IsRelevant is called.

Code: Select all

function bool IsRelevant(Actor Other, out byte bSuperRelevant)
{
   local bool bResult;

   // allow mutators to remove actors
   bResult = CheckReplacement(Other, bSuperRelevant);
   if ( bResult && (NextMutator != None) )
      bResult = NextMutator.IsRelevant(Other, bSuperRelevant);

   return bResult;
}

this function goes down the whole mutator chain and any mutator can change bSuperRelevant. If by the end of the chain, bSuperRelevant is 1.. It will return true and block any OddsOfAppearing filtering garbage. Hence me saying for best mileage put that particular mutator at the end of the chain. You never know exactly what is going on. Especially since it's so easy to remove your code and save and not change functionality. Also don't touch alwayskeep since it will break all other mutators if used. gg.

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 18 Jun 2013, 20:52

[]KAOS[]Casey wrote:Orrrrrrrrr you could use that mutator I posted.


Aye, that was what I meant. Run that mutator first thing before the GameInfo can do anything.
Image

redeye
Banned Banned
Posts: 1393
Joined: 08 Dec 2007, 06:55

Subject: Re: Mutator to turn odds of appearing to 100% for all actors

Post Posted: 19 Jun 2013, 22:20

Ok so that odds is only dependant on if the mapper changes the actor settings ?
I never understood those filters since default takes care of it all, don't think I ever see those changed if you place an actor those filters are always the same.

So could one say it is only for those trying to make the actors work different than stock default difficulties ?
Like making easy super hard to play, ?
Just ban everyone


Who is online

Users browsing this forum: No registered users and 26 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited