Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Can't get anywhere!

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

  • Can't get anywhere!

    Right so I'm making a mod while learning how to make a mod, I have a book with a lot of information (the book is still for UT2004 but lots of information still validates). And I'm kinda stuck. The book is just giving me hard information and I know I will never remember it all and when I start coding I will just look it up in the book again. So I decided to have a little start on my mod. And things that should normally work, won't work. Got a little frustrated and deleted everything to start over again. But I think you guys might be able to help me.

    Code:
    // Made by Dirk 'Taboen' Broenink
    // TFM stands for Team Flag Master. There are two ways to win a round, either cap the flag or completely kill the enemy team untill they don't have any lives left. The first team that wins a certain amount of rounds wins the game.
    // Version 0.1
    
       class TFM extends UTgame.UTCTFGame;
    
    defaultproperties;
    {
       DefaultPawnClass=Class'TFMPawn'
       PlayerControllerClass=Class'TFMPlayerController'
       bAllowTranslocator=False
       bAllowHoverboard=False
       HUDType=Class'TFMHUD'
       MapPrefixes(0)="TM"
    }
    Code:
    // Made by Dirk 'Taboen' Broenink
    // This is the HUD for TFM.
    
       class TFMHUD extends UTgame.UTCTFHUD;
    
    
    defaultproperties
    {
    }
    Code:
    // Made by Dirk 'Taboen' Broenink
    // This is the Pawn for TFM.
    
       class TFMPawn extends UTgame.UTPawn;
    
    
    defaultproperties
    {
    }
    Code:
    // Made by Dirk 'Taboen' Broenink
    // This is the PlayerController for TFM.
    
       class TFMPlayerController extends UTgame.UTPlayerController;
    
    
    defaultproperties
    {
    }
    Yes I realize this is just basic CTF. This way everything is set to start modifying things. I want people to start with 100 hp and 100 shield when they spawn. And I want to add weapons to the inventory they spawn with, and make the ammo configurable in like an ini file. My question is: how?

  • #2
    Since you admitted to just starting out, I advise you to start with a project more appropriate to learning how UT3 does things. Start with a mutator, especially since what you want to do can be done via a mutator anyways.

    Comment


    • #3
      Well doesnt putting it in a mutator require the same code as in this case?

      I've made some basic tutorial mutators though.

      Comment


      • #4
        For the changes you mentioned in your original post, there is no need to extend any of the classes with the exception of UTMutator.

        Now, if you plan on adding a bunch of other changes that you haven't specified yet, then yes, you may (maybe) need to extend Pawn, Controller, etc.

        Comment


        • #5
          Taboen, this might help you.


          From LastManStanding

          Code:
          function AddDefaultInventory( pawn PlayerPawn )
          {
              local Weapon weap;
              local int i;
              local inventory Inv;
              local float F;
          
              if ( PlayerPawn.IsA('Spectator') || (bRequireReady && (CountDown > 0)) )
                  return;
              Super.AddDefaultInventory(PlayerPawn);
          
              GiveWeapon(PlayerPawn, "Botpack.ShockRifle");
              GiveWeapon(PlayerPawn, "Botpack.UT_BioRifle");
              GiveWeapon(PlayerPawn, "Botpack.Ripper");
              GiveWeapon(PlayerPawn, "Botpack.UT_FlakCannon");
          
              if ( PlayerPawn.IsA('PlayerPawn') )
              {
                  GiveWeapon(PlayerPawn, "Botpack.SniperRifle");
                  GiveWeapon(PlayerPawn, "Botpack.PulseGun");
                  GiveWeapon(PlayerPawn, "Botpack.Minigun2");
                  GiveWeapon(PlayerPawn, "Botpack.UT_Eightball");
                  PlayerPawn.SwitchToBestWeapon();
              }
              else
              {
                  // randomize order for bots so they don't always use the same weapon
                  F = FRand();
                  if ( F < 0.7 ) 
                  {
                      GiveWeapon(PlayerPawn, "Botpack.SniperRifle");
                      GiveWeapon(PlayerPawn, "Botpack.PulseGun");
                      if ( F < 0.4 )
                      {
                          GiveWeapon(PlayerPawn, "Botpack.Minigun2");
                          GiveWeapon(PlayerPawn, "Botpack.UT_Eightball");
                      }
                      else
                      {
                          GiveWeapon(PlayerPawn, "Botpack.UT_Eightball");
                          GiveWeapon(PlayerPawn, "Botpack.Minigun2");
                      }
                  }
                  else
                  {
                      GiveWeapon(PlayerPawn, "Botpack.Minigun2");
                      GiveWeapon(PlayerPawn, "Botpack.UT_Eightball");
                      if ( F < 0.88 )
                      {
                          GiveWeapon(PlayerPawn, "Botpack.SniperRifle");
                          GiveWeapon(PlayerPawn, "Botpack.PulseGun");
                      }
                      else
                      {
                          GiveWeapon(PlayerPawn, "Botpack.PulseGun");
                          GiveWeapon(PlayerPawn, "Botpack.SniperRifle");
                      }
                  }
              }
                          
              for ( inv=PlayerPawn.inventory; inv!=None; inv=inv.inventory )
              {
                  weap = Weapon(inv);
                  if ( (weap != None) && (weap.AmmoType != None) )
                      weap.AmmoType.AmmoAmount = weap.AmmoType.MaxAmmo;
              }
          
              inv = Spawn(class'Armor2');
              if( inv != None )
              {
                  inv.bHeldItem = true;
                  inv.RespawnTime = 0.0;
                  inv.GiveTo(PlayerPawn);
              }
          }

          it's old code, but i think the concept is still relevant

          Comment


          • #6
            In the future this will be a very big mod, im just starting on the little things. What I mentioned can be done with a simple mutator. But my modicafications will be so big that I don't want it as an mutator. I want it as a whole gametype. Especially because I will use the maps in this gametype with TM- prefix for more gametypes than just this one. I have many plans and ideas written down and this is just a start.

            Thanks for that code Aksen.

            Comment


            • #7
              Got this now:

              Code:
              // Made by Dirk 'Taboen' Broenink
              // TFM stands for Team Flag Master. There are two ways to win a round, either cap the flag or completely kill the enemy team untill they don't have any lives left. The first team that wins a certain amount of rounds wins the game.
              // Version 0.1
              
                 class TFM extends UTgame.UTCTFGame;
              
              // When player starts give them some weapons!
              function AddDefaultInventory(Pawn p)
              {
              	local Inventory Inv;
              
              	Super.AddDefaultInventory(p);
              
              	p.CreateInventory("UTGame.UTWeap_BioRifle");
              	p.CreateInventory("UTWeap_FlakCannon");
              	p.CreateInventory("UTWeap_LinkGun");
              	p.CreateInventory("UTWeap_Stinger");
              	p.CreateInventory("UTWeap_RocketLauncher");
              	p.CreateInventory("UTWeap_ShockRifle");
              	p.CreateInventory("UTWeap_SniperRifle");
              
              	if ( bFullAmmo )
              	{
              		For ( Inv=P.Inventory; Inv!=None; Inv=Inv.Inventory )
              		{
              			if ( Weapon(Inv) != None )
              				Weapon(Inv).MaxOutAmmo();
              		}
              	}
              }
              
              defaultproperties;
              {
                 bAllowTranslocator=False
                 bAllowHoverboard=False
                 HUDType=Class'UTCTFHUD'
                 MapPrefixes(0)="TM"
              }

              As you can see, I removed the references to a new pawn and playercontroller etc, I will add that when I need it. Leaving it out for now.

              Problem is, it says:
              'Error, Type mismatch in Call to 'CreateInventory', parameter 1'

              What to change?

              Comment


              • #8
                Nowhere is it (correctly) written that a gametype mod is (necessarily) more complex than a mutator mod. The one gametype I ever wrote was a couple dozen lines of code, but some of the mutators... thousands.

                Comment


                • #9
                  the declaration is
                  event final Inventory CreateInventory( class<Inventory> NewInvClass, optional bool bDoNotActivate )

                  so its expecting a inventory (or sub)class so try

                  p.CreateInventory(class'UTWeap_FlakCannon')

                  Comment


                  • #10
                    Xyx, sure I can make a mutator for this. I just think its better to make a gametype for this. Why? This mutator would be a mutator to CTF so it would use CTF maps, and the maps will need special design for this, a normal CTF map can't do the trick.. That means it would show up in the CTF list between normal servers, and I change so much I don't its responsible for doing so. That's why I will start using the TM- prefix and want to put in its own Tab. The TM- maps will be made in such a way that people will be able to use these maps for more gametypes I will create, of which I have some ideas for.

                    Sarcen, adding class to it didn't do the trick
                    I feel like I'm missing something simple here.
                    Thanks for your time.

                    Comment


                    • #11
                      I'm not saying you should make a mutator. I'm just saying that complexity is not the deciding factor. I've read a lot of claims that mutators are small and easy and that gametypes are the next step on the ladder to the almighty total conversion. I think that's nonsense. A mutator simply does not alter the game in such a way that it requires a custom gametype object.

                      Your mod is a gametype. It contains specific game rules and requires specific maps. Of course you're not making a mutator.

                      I'd reconsider the specific maps part, though. Writing a gametype is one thing, adapting/creating half a dozen maps is another.

                      Comment


                      • #12
                        Well that was exactly what I thought about mutators and gametypes aswell.

                        Anyway, I was thinking. If I can let the gametype search the middle point between the red flag and the blue flag, it could be possible that you don't need TM maps. But CTF maps too. Though my plan is to make the free flag spawn randomly on tactically decided points. For example on and underneath the bridge. Or left and right of the map (if the map is completely symetrical). So that can't be down with a script, and if it was possible you would get flags on spots I don't want them.
                        I just don't know if a script like that would be possible, how it would work out and how to make something like that.

                        Comment


                        • #13
                          UT2004's Gem Feeder had a special configuration "gametype" in which you could run around a map and configure it by dropping various markers. Worked great. It allowed players to set up Onslaught maps for Gem Feeder without ever touching an editor or hacking an .ini file.

                          Comment


                          • #14
                            So does anything what that message means? Anyone?

                            Comment


                            • #15
                              Got this now:

                              Code:
                              // Made by Dirk 'Taboen' Broenink
                              // TFM stands for Team Flag Master. There are two ways to win a round, either cap the flag or completely kill the enemy team untill they don't have any lives left. The first team that wins a certain amount of rounds wins the game.
                              // Version 0.1
                              
                                 class TFM extends UTgame.UTCTFGame;
                              
                              // When player starts give them some weapons!
                              function AddDefaultInventory(Pawn p)
                              {
                              	local Inventory Inv;
                              
                              	Super.AddDefaultInventory(p);
                              
                              	p.CreateInventory("UTGame.UTWeap_BioRifle");
                              	p.CreateInventory("UTWeap_FlakCannon");
                              	p.CreateInventory("UTWeap_LinkGun");
                              	p.CreateInventory("UTWeap_Stinger");
                              	p.CreateInventory("UTWeap_RocketLauncher");
                              	p.CreateInventory("UTWeap_ShockRifle");
                              	p.CreateInventory("UTWeap_SniperRifle");
                              
                              	if ( bFullAmmo )
                              	{
                              		For ( Inv=P.Inventory; Inv!=None; Inv=Inv.Inventory )
                              		{
                              			if ( Weapon(Inv) != None )
                              				Weapon(Inv).MaxOutAmmo();
                              		}
                              	}
                              }
                              
                              defaultproperties;
                              {
                                 bAllowTranslocator=False
                                 bAllowHoverboard=False
                                 HUDType=Class'UTCTFHUD'
                                 MapPrefixes(0)="TM"
                              }

                              As you can see, I removed the references to a new pawn and playercontroller etc, I will add that when I need it. Leaving it out for now.

                              Problem is, it says:
                              'Error, Type mismatch in Call to 'CreateInventory', parameter 1'

                              What to change?

                              Comment

                              Working...
                              X