Announcement

Collapse
No announcement yet.

ONSEnergyLevel [BETA2, pic & DL]

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

    ONSEnergyLevel [BETA2, pic & DL]

    Version: BETA2
    Compatibility: UT2004
    Description: adjustable HP for cores and nodes, adjustable autobuild time and link node healing
    Comments: betabetabeta
    Screenshot: see below
    Credits: RedRummy for the idea, ASPoker for the iteration hint/code, me (fftunes), EPIC, WIKI and AtariCommunity
    Homepage: none
    Download: HERE (script included)

    [SHOT]http://www.lebensrad.ch/ff/UT2004_pictures/pic-ONSEnergyLevelBETA.jpg[/SHOT]

    Works flawless in instant action, however on net-clients there's an issue: the health bars of nodes and cores are displayed relative to standard values, not relative to the new values. I think it's not as bad as it sounds, because this way players will actually notice the difference to standard rules. However I'm still trying to fix this. Thanks for all the inputs so far.

    VERSION HISTORY:
    BETA2: I noticed that it's not possible to set node-HP lower than 20, so i adjusted the mutator so far.

    If you'd like to fix it, the script is included in the zip-file. Just add to the credits

    #2
    This is the relevant code, if someone knows how to fix the display issue. First i thought just making it a simulated event would be enough, but no.
    Code:
    event PreBeginPlay()
    {
        local DestroyableObjective DOb;
        local ONSPowerCore PoC;
        
        foreach AllActors(class'DestroyableObjective', DOb)
    	if (ONSPowerNode(DOb) != None)
    		DOb.LinkHealMult=NewLinkMult;
        
        foreach AllActors(class'ONSPowerCore', PoC)
    	if (ONSPowerNode(PoC) != None)
    	{
    		PoC.DamageCapacity=NewNodeHP;
    		PoC.ConstructionTime=NewBuildT;
    	}
    	else		
    		PoC.DamageCapacity=NewCoreHP;
    }
    ...and from the default properties (note: in beta2 i changed it from _SimulatedProxy to _DumbProxy, since it's enough for the way it works) :
    Code:
     
        bAlwaysRelevant=true
        RemoteRole=ROLE_DumbProxy
        bNetTemporary=true
    BTW, would someone want this for assault objectives? In the process I figured it out, but then I decided to make it onslaught only else it would become unneccesarily big...

    Comment


      #3
      Originally posted by fftunes
      BTW, would someone want this for assault objectives?
      YES PLEASE!!!!!!!!!

      Comment


        #4
        ok then... next night i'll be on it

        Comment


          #5
          I redid this (powercore health) for Hunter in his ONS-Maelstrom map, perhaps you should scale it (0%-100%) instead of setting a definite value? (if you have played Mael, you would see that the node health on that map must be less than on other ONS maps )

          Also, to avoid the whitelist you might consider creating this as a serveractor instead (otherwise any server running this will be knocked off the standard servesr list)

          Comment


            #6
            Originally posted by [6pk]Shambler
            perhaps you should scale it (0%-100%) instead of setting a definite value?
            Funny, i thought of this, but then I didn't think that this would BE it.

            Originally posted by [6pk]Shambler
            Also, to avoid the whitelist you might consider creating this as a serveractor instead
            Thanks for the advice, but I have no clue what "making it a serveractor" would mean actually... i'll check the wiki for this topic, but i don't think i'll get it without further help. Except if maelstrom does it all the way, but i'll take a look at it anyway.

            Comment


              #7
              Making it a serveractor is easy...have it subclass Actor/Info or someting other than Mutator, then in the servers UT2004.ini do a search for ServerActors and add:
              ServerActors=MyPackage.MyServerActor

              Comment


                #8
                or you can spawn a ReplicationInfo from the mutator:

                Code:
                function PostBeginPlay()
                {
                   local ONSEnergyLevelReplicationInfo ONSELRI;
                
                   Super.PostBeginPlay();
                
                   foreach DynamicActors(class'ONSEnergyLevelReplicationInfo', ONSELRI)
                      if ( ONSELRI != None ) //is this necessairy? If not, just leave it out
                         return;
                
                   spawn(class'ONSEnergyLevelReplicationInfo');
                }

                Comment


                  #9
                  @ shambler, just scaling it didn't make a difference in display. It's the same on clients as before.
                  Didn't try serveractor yet. Is there a common mutator that works this way, so I could take a look at it?

                  @Nov4, thanks for the code, i'll try it out.

                  BTW, on the assault version I'm working on, i got trouble scaling the sentinel health... hint?

                  Comment


                    #10
                    Originally posted by fftunes
                    @ shambler, just scaling it didn't make a difference in display. It's the same on clients as before.
                    Didn't try serveractor yet. Is there a common mutator that works this way, so I could take a look at it?

                    @Nov4, thanks for the code, i'll try it out.

                    BTW, on the assault version I'm working on, i got trouble scaling the sentinel health... hint?
                    What did you do to scale it? Typically, for scaling health, the code should look something like this: (assume ScaleValue is between 0 and 100)
                    Node.Health = float(Node.default.Health) * float(ScaleValue) * 0.01;

                    I can't remember a commonly used serveractor off-hand but it's really simple to add, judging by your code you don't NEED to subclass mutator (you appear to only be using the PostBeginPlay function....no mutator specific functions) so subclass Info instead.
                    Then change your servers ut2004.ini, find ServerActors= and at the bottom of that list add ServerActors=YourPackage.YourClass

                    It's that simple, run a test server and try it.

                    Comment


                      #11
                      Thank for the quick reply!
                      Well, however I have of course the whole mutator config stuff, but I could leave that out and make it configurable via ini-file editing...

                      Comment


                        #12
                        mutator is better when releasing this into the public, especially when people are gonna use it in Instant Action. MUTS FTW!

                        Comment


                          #13
                          Well, then I'll make a mutator AND serveractor :up: I could even use the mutator to configure the serveractor I guess.

                          Thanks again for opinions and help :up:

                          BTW for offline play this betaversion works, flawless.

                          Comment


                            #14
                            @ Nov4: Couldn't make the replication info spawn on clients (it should, right?). Tried different ways but I'm stuck at the moment. Got one more idea, but no time today... (real life bites my ***).

                            However, slight update to beta2, since I noticed another issue that was easy to solve (note: you can't set node-HP lower than 20).

                            If anyone wants to have a go at it, don't hesitate. Do what you want with it, the script is included. Think I might even put it in the programming/uScript folder later...

                            Comment


                              #15
                              Originally posted by fftunes
                              @ Nov4: Couldn't make the replication info spawn on clients (it should, right?). Tried different ways but I'm stuck at the moment. Got one more idea, but no time today... (real life bites my ***).
                              The ReplicationInfo is spawned on clients when it's (been) spawned on the server. Add this to verify:

                              Code:
                              simulated function PostBeginPlay() //could be PostNetBeginPlay()?
                              {
                                 Super.PostBeginPlay(); //could be PostNetBeginPlay()? 
                              
                                 if ( Role < ROLE_Authority )
                                    log("$$$$$$$$$$$ CLIENTS PWN!");
                              
                              }

                              Comment

                              Working...
                              X