Announcement

Collapse
No announcement yet.

[UT2004]A little problem with replacing Powernodes

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

    [UT2004]A little problem with replacing Powernodes

    Hi there,

    I've written a class that extends ONSPowerNode. I've searched the web a bit (BU Wiki and such). But I can't get my mutator to replace the old Powernode with my own. It just doesn't do anything.

    Code:
    function bool CheckReplacement( Actor Other, out byte bSuperRelevant ){
    	if(ONSPowerNode(Other) != None){
    		//If Other is a ONSPowerNode we need to replace it with our own
    		if(MyPowerNode(Other) == None){
    			ReplaceWith(Other,"MyMut.MyPowerNodeNeutral");
    			return false;
    		}
    		return true;
    	}
    
    	return true;
    }
    I know it hits the bit at ReplaceWith because I put a line there that writes something into the log. So afaik it should be replaced.

    Any ideas ?

    O, and I was also wondering what gets called when a player walks over a PowerNode, I want to be able to do something when that happens.

    #2
    There's something about powernodes that won't let you replace them. I couldn't get it done either, but you can still mutate them by altering their properties.

    What exactly are you trying to accomplish?

    Comment


      #3
      I want them to respond to a player walking over them in another manner then a normal PowerNode is doing.

      As example(but not something I'm trying to do) When a node is a neutral and not locked a player walking over it would activate the node being build. I would like to give the player a bonus. (I would like to do stuff even when the node is not neutral but for instance friendly) As long as I can get access to the Pawn walking over the node.

      Sorry for being so vague though. This is like my 2nd day of working in UnrealScript and I'm just trying to make some stuff happen. (I do have programming experience so I know the basics :P)

      Comment


        #4
        Hmmm... well, a super lazy hack would be just to spawn a separate actor in the same spot as every power node, and have it respond to players walking over it as well. Probably not the cleanest way to do things.

        Maybe you want to extend the GameRules instead? (like ScoreObjective?)

        Comment


          #5
          Originally posted by UT2004Addict View Post
          Hmmm... well, a super lazy hack would be just to spawn a separate actor in the same spot as every power node, and have it respond to players walking over it as well. Probably not the cleanest way to do things.

          Maybe you want to extend the GameRules instead? (like ScoreObjective?)
          Whatever works, I'll give it a go :P.

          Comment


            #6
            Powernode actors are bNoDelete and thus cannot be destroyed. You should, however, be able to disable their collision and hide them.

            Comment


              #7
              Hmm, is it possible to make a volume arround the Powernode. Preferably way larger then the radius of a Powernode. And that I can do something with players who are in this volume?

              Comment


                #8
                By all means don't be specific about what you really want to accomplish. Someone might offer a valid suggestion.

                Comment


                  #9
                  You can't place volumes, but the general actor collision shape is a cylinder. If you make the CollisionHeight and CollisionRadius properties large enough, you'll get an actor with the shape of a large cylindric volume. This is a real cylinder, btw, unlike any shape you'd be able to create with a volume model.
                  I'm using this approach for a TAM-based gametype with a goal like counter-strike's de maps: BombSite actors with large collision cylinders are spawned at the domination points in a double domination map to mark the area where the bomb can be planted.


                  But yeah, if you actually stated what you are trying to achieve, you would get much more helpful responses.

                  Comment


                    #10
                    Originally posted by Xyx View Post
                    By all means don't be specific about what you really want to accomplish. Someone might offer a valid suggestion.
                    I'm trying different things. The actor spawn on a PowerNode worked . Now I want something where I can toy with Pawns within a certain range of a powernode.


                    @Wormbo:
                    It's already helpfull . Thanks a lot.

                    Comment


                      #11
                      Originally posted by Lennie View Post
                      I want something where I can toy with Pawns within a certain range of a powernode.
                      You could use the same collision Actor approach or make a single Actor that compares the distances between each player and each node in Tick. You can probably get to the node collection through ONSOnslaughtGame(Level.Game).

                      Comment


                        #12
                        Thanks, I'll get started on it today .

                        Comment


                          #13
                          Okay, now I've run into another problem. I tried to turn on the node shielding when a certain amount of players are in the vincinity. The shield raises but, the node can still be attacked from certain angles and the Shield isn't visible in Online games. I've tried to read up on replication/simulated functions but I can't get it to work. Any ideas?

                          Code:
                          simulated function ShieldUp(){
                          	PowerNode.Shield.bHidden = false;
                          	PowerNode.Shield.SetCollision(true);
                          	PowerNode.Shield.SetTeam(PowerNode.DefenderTeamIndex);
                          Is called via Tick only if the shield is down.

                          Comment


                            #14
                            Could it be that the node turns its own shield back off? Have you checked ONSPowerCore.CheckShield()? It gets called in ONSPowerCore.PostNetReceive() and turns the shield off if the node is powered by the team that doesn't own it (meaning by both teams, so it must be open).

                            You could try to make the node not powered by the other team by setting its bPoweredByRed or bPoweredByBlue to false.

                            Comment


                              #15
                              Originally posted by Xyx View Post
                              Could it be that the node turns its own shield back off? Have you checked ONSPowerCore.CheckShield()? It gets called in ONSPowerCore.PostNetReceive() and turns the shield off if the node is powered by the team that doesn't own it (meaning by both teams, so it must be open).

                              You could try to make the node not powered by the other team by setting its bPoweredByRed or bPoweredByBlue to false.
                              Still find it strange that you do hear the sound when you shoot through the shield, you just don't see it. And in Local play I do see it. It's just when playing via a dedicated server the clients don't seem to draw the shield on the screen.

                              Comment

                              Working...
                              X