Announcement

Collapse
No announcement yet.

Reducing monster gib size?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Reducing monster gib size?

    I have a mutator that makes monsters randomly different, larger, faster, etc...

    Problem: when the monster is made larger (especially the ones that are already big, like warlord) the gibs are really huge, way too huge, very annoying.

    I have tried but cannot figure out how to override the spawngib function, so that I can reduce the displayscale... (or if that is even what I need to do)

    Help...

    #2
    You need to alter the monster code itself. This is how I did it, in the SpawnGiblet function:
    Code:
    Giblet.SetDrawScale(Giblet.DrawScale * (CollisionRadius + CollisionHeight) / 69); //Monster.uc multiplies collisionheight/radius instead of adding -> unbelievably huge gibs! wtf?!

    Comment


      #3
      Mr. Evil, do you have monsters? Which ones are yours?

      I am using monsters from many different packages, so, unless I am going to recreate all of the monsters code I am screwed?

      The ones that seem to create the biggest problem are the skaarjpack monsters... but I have searched the code for giblet.setdrawscale and found that there are other monsters that use multiplication instead of addition as well.

      I can't just detect and override this value someway?

      Comment


        #4
        Can I Create a class that extends monster and only override the SpawnGiblet function. Then reassign the new class to the existing monster. Can that be done?

        Comment


          #5
          Originally posted by obscenery
          Can I Create a class that extends monster and only override the SpawnGiblet function. Then reassign the new class to the existing monster. Can that be done?
          Unfortunately not. You can write a class extending Monster, but then you have to create new monsters subclassing that, you can't change the inheritance of existing classes.

          I'm afraid I can't think of any practical way to have this work with any monster; it's only easy if you write your own monster classes (well, you don't really need to 'write' new classes, the code can just be copied from the original monsters).

          Comment


            #6
            Thanks!

            Guess it wouldn't be that much work, but for such a little return, a whole new set of monsters that are exactly like the stock monsters from epic, only they don't gib as big.... hmmm... Just doesn't seem worth it...

            Maybe I need to think of something creative to do to the monsters that would make them different... hmmmm...


            By the way Mr Evil, you mentioned your monsters, what are your monsters?


            [edit]

            I just had another thought... Is there anyway to detect/alter GIBs once they are actually spawned? Are they still part of the monster class? I mean I am changing the size of monsters after they spawn. Are gibs part of their own class that I could do this type of thing with?

            Comment


              #7
              Originally posted by obscenery
              ...By the way Mr Evil, you mentioned your monsters, what are your monsters?
              The normal Invasion monsters, plus I ported the Titan, Queen, Mercenary and some extra Skaarj skins from Unreal.

              Originally posted by obscenery
              ...I just had another thought... Is there anyway to detect/alter GIBs once they are actually spawned? Are they still part of the monster class? I mean I am changing the size of monsters after they spawn. Are gibs part of their own class that I could do this type of thing with?
              They are spawned client-side only, which means you can't get at them with a mutator. You could do a foreach dynamicactors every tick to look for them as they spawn, but that would suck up CPU cycles.

              Comment


                #8
                I am probably beating a dead horse here, but... (and dang if I aint tryin hard to figure out replication but its just a bit complex!)

                I have had some success. I created my own xPawnGibGroup and in my mutator on CheckReplacement (where I change various other monster attributes like speed, size, etc) I have put this line:
                Monster(Other).GibGroupClass = class<xPawnGibGroup>(DynamicLoadObject("MonsterMan ager_1_0.xTinyGibGroup",class'class'));

                This works fine in single player mode.

                However, while everthing else seems to get replicated to the client machines, the GibGroupClass doesn't. Is there anyway to force this to replicate? Or help me understand why it can't be (just need to learn this stuff!).

                One last question, if the above stuff just won't work, you also mentioned using a foreach dynamicactors check. I would like to play with that idea, but I have no idea where I would put this code. And, does it have to be in a tick? I know when a monster is killed, would it be possible to tie the check for GIBs when a monster is killed?

                Thanks!

                Comment


                  #9
                  If you using a mutator you can set the gibs size,collision,skins, etc,etc.

                  Code:
                  class BigGibs extends Mutator;
                  
                  function bool CheckReplacement(Actor Other, out byte bSuperRelevant){
                  	bSuperRelevant = 0;
                  	if (Gib(Other) != None){
                  		Gib(Other).SetDrawScale(2);
                  		Gib(Other).SetCollisionSize(Gib(Other).CollisionRadius*2,Gib(Other).CollisionHeight*2);
                  		}
                  	return true;	
                  	}
                  
                  defaultproperties{
                       FriendlyName="Big Giblets"
                       Description="Just massive Giblets."
                  }
                  This sets any Gib and SubClassed Gib with these settings.

                  Next . . .

                  Also, instead of using Checkreplacement() in your mutator, add this to your mutator:

                  Code:
                  simulated function PostBeginPlay(){
                  
                  class'Skaarj'.default.GibGroupClass = class'MonsterManager_1_0.xTinyGibGroup';
                  class'IceSkaarj'.default.GibGroupClass = class'MonsterManager_1_0.xTinyGibGroup';
                  
                  }
                  This will replace the default GibGroupClass for these actors within the game, before it starts. I'm not sure if this works on servers.

                  As for replication: http://www.ataricommunity.com/forums...hreadid=406419

                  The function DynamicLoadObject() is client side, not server, so thats why only the client sees it and not the other clients on the server, as far as I know, I maybe wrong.

                  Comment


                    #10
                    Thanks for these ideas, both worked in single user but nothing happens on the client side of a served game (unless its server playing in a hosted game).


                    Apparently when a GIB is spawned it doesn't do a checkreplacement call, nor can the GibGroupClass be overriden on client machines.


                    I read the thread on Replication, and I have been digging through the wiki, but ugh, I think I need a little more exposure to feel anything less that queezy.

                    Any other suggestions about how I can get this to work. I hate to be this close and yet not quite get it...

                    Comment


                      #11
                      You can always try setting the mutator to bAlwaysRelevant and RemoteRole=ROLE_SimulatedProxy, then in a simulated PostBeginPlay (or PostNetBeginPlay whatever you want) you can set the monster's default gib group to something else.

                      Comment


                        #12
                        WORKED!!!!!!!:heart:

                        Thanks!

                        OK, but since I obviously don't know what the hail I'm doing, what does the bAlwaysRelevant do? Is there a performance hit, can it/should it be set back to false after I get my GibGroupClasses reset?

                        Comment


                          #13
                          There wont be any performance difference worth noting. Anyway, youve got an Invasion mutator. If there was, it would go largely unnoticed once the projectiles start flying

                          It works because when you flag it as bAlwaysRelevant the game will make sure the client is aware of it. With the SimulatedProxy RemoteRole you're allowing it to run simulated functions that get told to run, thus simulating the PostBeginPlay function assures that when the client gets the mutator it will run your PostBeginPlay code... which then makes sure that every client changes the GibGroupClass on their side.

                          Comment


                            #14
                            Thanks for the info, that makes perfect sense.

                            Comment

                            Working...
                            X