No announcement yet.

Script Warning: Thievery Message mutator Accessed None!

  • Filter
  • Time
  • Show
Clear All
new posts

  • Script Warning: Thievery Message mutator Accessed None!

    So, I'm trying to create a small mutator that displays a message on a player's screen, like the "Gem has been stolen..." messages in Korman, or the 5 minute warnings. Nothing but problems though.
    • ThieveryMessageTrigger was my first thought. But it is bNoDelete, meaning it cannot be spawned, and has no replication info. It was obviously designed for inclusion in level. So it doesn't work with clients. Result: FAIL.

      ThieveryMessageTrigger causes a player to create a ThieveryMessage and add it to their queue, so that's where I looked next. Problem: Still no replication info. In fact, ThieveryMessage is spawned client-side. Several attempts to get it working later and still no success. Result: FAIL.

    Basic rules: do not subclass ThieveryPPawn to prevent incompatibility with other mutators. (It would take 5 seconds to do otherwise ).

    So, any suggestions?
    Immortius' Forge

  • #2
    Are you trying to make a mutator for something that's already in??...


    • #3
      No, I'm trying to make something that's already in work in a mutator. Because the method used currently doesn't work with mutators. And being able to send the fancy text messages in a mutator would be cool.

      My personal choice would be to add a simple function to ThieveryPPawn that takes a string argument and just generates the message from that, but I already said why I am trying to find another way. Besides, ThieveryPPawn is already longer than most speeches by school headmasters and politicians.
      Immortius' Forge


      • #4
        ThieveryPPawn is scary.

        Yes, there's no replication for the ThieveryTextTriggers, they have a bunch of properties, so to save bandwidth, they're set to bNoDelete (so all their properties are set on clients from the map settings on load).

        Hmm, what you need to do is build a ThieveryMessage clientside and add it to the player's queue... so how do you run code clientside for a particular player?

        Hmm, you probably need a mutator spawned, one for each player (with the player as the owner). Then you could have something like this:

        reliable if (Role==ROLE_Authority && bNetOwner)

        function SendFancyMessage(string s)
        Copy = spawn(class'ThieveryMessage',Owner);
        Copy.MessageTime=.. etc.


        if (ThieveryPPawn(Owner).MessageQueue!=None) {
        } else {

        Then from the server you could call SendFancyMessage on the appropriate player's fancy message mutator.

        How do you spawn a mutator once for each player? I forget, shouldn't be too hard though. The ThieveryMutatorHUD gets spawned once per player, although that uses the HUD class to do that, which I doubt you could easily use.

        P.S. This might be all wrong.

        P.P.S. Is it really worth it?


        • #5
          Sometimes I get really tempted to work through all the classes, thievery or otherwise, and document and tidy them up like anything. But then I regain my sanity. Perhaps when I rescript Pawns for universal gravity.

          Function to add to ThieveryPPawn:=


          replication {
          unreliable if ( (!bDemoRecording || (bClientDemoRecording && bClientDemoNetFunc) || (Level.NetMode==NM_Standalone && IsA('ThieveryPPawn'))) && Role == ROLE_Authority )

          simulated function SendThieveryMessage(string MessageText, int MessageTime, int MessageY) {
          local ThieveryMessage Copy;

          Copy = spawn(class'ThieveryMessage',self);
          Copy.MessageFadeTime=(some default);
          Copy.MessageX=(some default);
          Copy.MessageXMax=(some default);
          Copy.MessageColor=(white I guess);
          Copy.MessageAlignment=(Center would do);
          Copy.bExclusive=(Erm, yeah);

          Copy.LetterFadeTime=(Some Default);
          Copy.LetterDelay=(Some Default);
          Copy.SpaceTag=(Some Default);
          Copy.TextEndEvent=(some default);


          if (MessageQueue!=None) {
          } else {

          Much easier, and who needs most of those options anyway?

          Sorry Chainsaws, I don't think a message on logging onto a server is worth this much trouble.
          Immortius' Forge


          • #6
            Ah yes, any messages other than the standard ClientMessage are PITAs.
            What I would have done if I were you, would be to make a new HUD mutator and draw the text directly on that, completely ignoring everything else.

            But yes, it would be nice if we could have an easily accessible function (in gameinfo maybe) that allows one to draw text anywhere on anyone's screen with any font type/size one wished.

            Oh, and Dalai: Yes, you've created a monster.


            • #7
              Originally posted by immortius
              Perhaps when I rescript Pawns for universal gravity.
              :lol: So, like soon, right?
              It's not my fault everything you like is terrible.


              • #8
                Yeah. Soon. After I finish mechina, and a map (details-pending), and rat-onna-stick. Oh and my fmod wrapper for Eiffel. And my 18-page uni assignment due on Sunday . Oh, and I'll probably try to get this Server Message mutator working a couple more times.

                Edit: Yah! It works! The little bastard works!
                Immortius' Forge