Announcement

Collapse
No announcement yet.

A New Powerup

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

    A New Powerup

    Well ok, this time i'm trying to make a powerup, a very special one, and i think I'll Need some help.
    To Adster, I'm posting it on these boards cause i want this, once it is done, be to be of some use for lots of other people.
    I wanna make a powerup, that makes the person who takes it, invulnerable against all instant hit attacks, for 30 seconds.
    I already got the seconds, and some new skin (model, if i get time too) but now the trouble starts: Where to find something about invulnerability?

    #2
    I have no idea how to go about making it only instant-hit weaponry, but for damage in general you could probably just set the pawn's bCanBeDamaged to false.

    Comment


      #3
      Hi ThanadoS,
      I'm just off to play some Live for Speed, so I'll have a think about it while I blast round the track and post some thoughts later.

      Comment


        #4
        kk, curious about what your brain will spit out this time :P
        Cause imo, that's kinda tough idea :>
        ::edit1:: alright as far as i've figured things out by now, that one will require some serious scripting, not just extending work. Because i didn't find any invulnerabilty stuff, and don't understand the
        "When player comes, touches the powerup, he gets the properties listed in some class" process
        ::edit2:: The nice thing is though, that i found the "WeaponDamageType" properties

        Comment


          #5
          I think using a custom Game Rules class will do what you want, I'm just looking into it now...

          Comment


            #6
            Hm i think everything would work, if i knew how to make the pickup work for a player pawn... cause then i could make several if statements, like
            if (DamageType == DamTypeShockBeam)
            ... pawn& player stuff....
            bcanbedamaged=false
            or something...

            Comment


              #7
              I've got too much of a headache right now to look any further, but I've done a pickup mutator that uses a custom Game Rules class.  You can intergate the damage type from NetDamage, so just do it from there.  I'll look into it tomorrow for you matey.

              Comment


                #8
                So far this is what I've come up with (for UT2003 don't forget!)

                Code:
                Taken from your custom GameRules class:
                =======================================
                function int NetDamage(
                	int originalDamage,
                	int damage,
                	pawn injured,
                	pawn instigatedBy,
                	vector hitLocation,
                	out vector momentum,
                	class<DamageType> damageType
                )
                {
                	local int nextDamage;
                
                	nextDamage = damage;
                	if( NextGameRules != None )
                		nextDamage = NextGameRules.NetDamage(
                								originalDamage,
                								damage,
                								injured,
                								instigatedBy,
                								hitLocation,
                								momentum,
                								damageType
                								);
                
                	if( ( damageType.Name == 'DamTypeMinigunBullet' )
                		|| ( damageType.Name == 'DamTypeAssaultBullet' )
                		|| ( damageType.Name == 'DamTypeShockBeam' )
                		|| ( damageType.Name == 'DamTypeSniperShot' ) )
                	{
                		// Do your stuff here!!!
                	}
                	return nextDamage;
                }
                I'll mail my custom pickup stuff to you privately as it was co-developed by SPDT and DragonRider (I said I'd never publish the code as it was his project and I was just working on it with him, but feel free to look at, and change, any of it).&nbsp;&nbsp;There is way more to that project than you'll probably need, but it's good to know how to change the way pickup spawners work, that way you can get your mutator to work with any map, not just the ones you design.

                The biggest limitation I can see with this code is if you use any custom weapons, as they will not work with the above if statement.&nbsp;&nbsp;If Epic had used bInstantHit in DamageType properly you could have just done a check on that (all of the DamageTypes come back as False).

                Hope that helps.

                Comment


                  #9
                  Hmm what do you mean by custom gamerules class? Do you mean i shuldn't extend the actual pickup?
                  Help plz ;D

                  Comment


                    #10
                    All will become clear when I send you this UT2004 project...

                    Comment


                      #11
                      Alright thanks for the code... but what i've seen so far (I'm a bit tired), that's some numbrs too big for me :P All i understand is the pickup, timer and inventory class ~~
                      But alright i'll check it out tomorrow^^

                      Comment


                        #12
                        Okay i took a look through that code now, Adster, have corrected mine so far. But now i've a question (sorry for the load of questions, but i'm learning, and it's very important to ask them ) concerning the TD_Message
                        what are the optionalobject, the 2 relatedPRI's and the switch supposed to do?
                        and why to make a clientrecieve and a getstring function?
                        Help plz
                        ::edit:: and in the "Getfontsize" function... what exactly do all these if's do? I mean for me that's just a bunch of numbers^^
                        ::edit2:: And what exactly does a wildcardbase?
                        ::edit3:: and yet another questions is... why are there 7 pickupclasses in the wildcardbase?

                        Comment


                          #13
                          Originally posted by ThanadoS
                          Okay i took a look through that code now, Adster, have corrected mine so far. But now i've a question (sorry for the load of questions, but i'm learning, and it's very important to ask them ) concerning the TD_Message
                          what are the optionalobject, the 2 relatedPRI's and the switch supposed to do?
                          and why to make a clientrecieve and a getstring function?
                          Help plz
                          ::edit:: and in the "Getfontsize" function... what exactly do all these if's do? I mean for me that's just a bunch of numbers^^
                          ::edit2:: And what exactly does a wildcardbase?
                          ::edit3:: and yet another questions is... why are there 7 pickupclasses in the wildcardbase?
                          Don't worry about wanting more information, as there are no stupid questions, only stupid answers.&nbsp;&nbsp;If I didn't want to help you I wouldn't, but since I'm a nice guy I'll do my best to explain things for you.

                          TD_Message: this is a subclass of local message and is used to display text on the client's screen during the game.&nbsp;&nbsp;The given example only has one message defined in it (the noSnag message), but you can have multiple messages, each meaning a different thing.&nbsp;&nbsp;To decide which message is displayed you pass in a number as the switch parameter and the functions (GetString, ClientReceive and GetFontSize) decide what actions to take depending on what value it holds.&nbsp;&nbsp;Another one of my projects does have multiple messages, as is quoted below:
                          Code:
                          static function String GetString(
                          	optional Int switch, // Type of message.
                          	optional PlayerReplicationInfo relatedPRI_1, // Killer.
                          	optional PlayerReplicationInfo relatedPRI_2, // Victim.
                          	optional Object optionalObject // Unused.
                          )
                          {
                          	Switch( switch )
                          	{
                          		case 0:
                          			// Message for the killer.
                          			return default.revengeOne$default.revengeTrailer;
                          		break;
                          		case 1:
                          			// Message for the victim.
                          			return relatedPRI_1.PlayerName@default.revengeDone$default.revengeTrailer;
                          		break;
                          		case 2:
                          			// Message for hangers-on.
                          			return relatedPRI_1.PlayerName@default.revengeNote@relatedPRI_2.PlayerName
                          				$default.revengeTrailer;
                          		break;
                          		case 3:
                          			// Message for the killer (beyond).
                          			return default.revengeOne@default.revengeBeyond$default.revengeTrailer;
                          		break;
                          		case 4:
                          			// Message for the victim (beyond).
                          			return relatedPRI_1.PlayerName@default.revengeDone@default.revengeBeyond
                          				$default.revengeTrailer;
                          		break;
                          		case 5:
                          			// Message for hangers-on (beyond).
                          			return relatedPRI_1.PlayerName@default.revengeNote
                          				@relatedPRI_2.PlayerName@default.revengeBeyond
                          				$default.revengeTrailer;
                          		break;
                          		default : return ""; break;
                          	}
                          }
                          N.B. the use of the '@' symbol seems to fool this message board in to thinking they're valid email addresses, but they're not.&nbsp;&nbsp;It simply means append what's on the right of it to what's on the left, including a space between them (the '$' sign does the same thing, except without the space).

                          optionalObject, relatedPRI_1 and relatedPRI_2 are all optional parameters, meaning you can leave them blank if you wish.&nbsp;&nbsp;They are mainly used to add things like a player's name to the end of a message.

                          ClientReceive can play sounds to a client, GetString displays a text message, and GetFontSize returns how big the message's font size should be.&nbsp;&nbsp;I have actually changed that function now to look like this:
                          Code:
                          static function Int GetFontSize(
                          	Int switch,
                          	PlayerReplicationInfo relatedPRI1,
                          	PlayerReplicationInfo relatedPRI2,
                          	PlayerReplicationInfo localPlayer
                          )
                          {
                          	return 0;
                          }
                          That way the messages are always in a small font, regardless of what value you pass in as switch (this came from another project, as some messages were big, while some were small).

                          WildCardBases: these are pickup spawners that can produce more than one type of pickup, and because of the way Triple Damage allows the user to define the respawn time for these pickups I was forced to subclass, and replace, any found in the current level.&nbsp;&nbsp;This, as I say, is purely so I could alter the respawn time for Triple Damage relics, nothing more (look at the Transmogrify function to see how I do it).&nbsp;&nbsp;There are 7 PickupClasses because these will be set by the level designer to hold whatever pickups they want, and during the game the spawner will either produce them sequentially, or randomly.&nbsp;&nbsp;When I replace a WildCardBase I also set these to what the original ones were, replacing the normal UDamage with my custom one of course.

                          Hope that helps.

                          Comment


                            #14
                            Thank you Adster... the only thing i need now is the actual function of this mut. I don't know how to tell it not to hurt the player, when he's instigated by a certain weapon...

                            Comment


                              #15
                              Originally posted by the Adster
                              So far this is what I've come up with (for UT2003 don't forget!)

                              Code:
                              Taken from your custom GameRules class:
                              =======================================
                              function int NetDamage(
                              	int originalDamage,
                              	int damage,
                              	pawn injured,
                              	pawn instigatedBy,
                              	vector hitLocation,
                              	out vector momentum,
                              	class<DamageType> damageType
                              )
                              {
                              	local int nextDamage;
                              
                              	nextDamage = damage;
                              	if( NextGameRules != None )
                              		nextDamage = NextGameRules.NetDamage(
                              								originalDamage,
                              								damage,
                              								injured,
                              								instigatedBy,
                              								hitLocation,
                              								momentum,
                              								damageType
                              								);
                              
                              	if( ( damageType.Name == 'DamTypeMinigunBullet' )
                              		|| ( damageType.Name == 'DamTypeAssaultBullet' )
                              		|| ( damageType.Name == 'DamTypeShockBeam' )
                              		|| ( damageType.Name == 'DamTypeSniperShot' ) )
                              	{
                              		// Do your stuff here!!!
                              	}
                              	return nextDamage;
                              }
                              I'll mail my custom pickup stuff to you privately as it was co-developed by SPDT and DragonRider (I said I'd never publish the code as it was his project and I was just working on it with him, but feel free to look at, and change, any of it).&nbsp;&nbsp;There is way more to that project than you'll probably need, but it's good to know how to change the way pickup spawners work, that way you can get your mutator to work with any map, not just the ones you design.

                              The biggest limitation I can see with this code is if you use any custom weapons, as they will not work with the above if statement.&nbsp;&nbsp;If Epic had used bInstantHit in DamageType properly you could have just done a check on that (all of the DamageTypes come back as False).

                              Hope that helps.
                              I already posted most of it (albeit in a rather rough-n-ready state).

                              Comment

                              Working...
                              X