Announcement

Collapse
No announcement yet.

how to catch a string?

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

    how to catch a string?

    Is it possible with a mutator to grab a certain string appearing in the code and replace it with another? (before the code is executed?)

    Because if it was...

    #2
    Mmm... you mean in the code itself or in a string defined by the code? In the code itself is impossible as UT scripts are pseudo compiled to binary format. It should be possible to redefine a string with a mutator if you know where the string resides. As to the specifics on how exactly, I don't know.

    Comment


      #3
      For getting:
      Well, it seems that with "GetPropertyText(class'anyClass'.default.anyProper ty)" i can access default properties - of classes.
      Couldn't figure out yet what if the property is tied to a mesh for example...

      For setting:
      Didn't try SetPropertyText yet, but i think it should work. Tell you next time.

      And yeah, it's for a mutator.

      Comment


        #4
        You don't need to use GetPropertyText(class'anyClass'.default.anyPropert y) !!!!

        Just:

        var float Health;

        Health = class'xGame.xPawn'.default.health;
        class'xGame.xPawn'.default.health = 9;

        Keep in mind, that if you did the above in a mutator, all pawns will have 9 health when they start... LOL. For example:
        Code:
        simulated function PostBeginPlay(){
        	class'xGame.xPawn'.default.health = 1;
        	Super.PostBeginPlay();
        	}
        Put this in your mutator and everyone has 1 health, for the whole match.


        GetPropertyText() will tell you if the property your looking for isn't there, but why would you need to do that?

        Comment


          #5
          I know, done that.
          Originally posted by Morphias
          GetPropertyText() will tell you if the property your looking for isn't there, but why would you need to do that?
          Just to figure things out. I'm not an experienced programmer so finding the way round the syntax is one reason...

          Of course I can just
          Log(class'xGame.xPawn'.default.health)
          to stay with your example

          Problem still is: What if the property is tied to a mesh or texture or whatever?
          And can they be replaced?
          ---------
          Well, never mind, I gotta try out some before clogging the forum any more.
          Later!

          Comment

          Working...
          X