Results 1 to 17 of 17
  1. #1
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default 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?
    You can discover more about a person in an hour of play than in a year of conversation.

  2. #2
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    193
    Gamer IDs

    Gamertag: Pfhoenix0

    Default

    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.
    Fleet Wars
    Jetpack for UT3
    Raggy Weapons
    SpeedBump
    Mod Exemplar Project
    Official Proelium Site
    Official UnrealScript IRC Channel - #unrealscript on irc.enterthegame.com

  3. #3
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

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

    I've made some basic tutorial mutators though.
    You can discover more about a person in an hour of play than in a year of conversation.

  4. #4
    MSgt. Shooter Person
    Join Date
    Apr 2007
    Posts
    292

    Default

    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.
    Anthony McCulley

    President & Founder SAVGARD UMD, College Park
    Student Association for Video Game Awareness, Research, and Development

  5. #5
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Location
    Hollywood, CA
    Posts
    56

    Default

    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
    Last edited by Aksen; 12-07-2007 at 03:39 PM.

  6. #6
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    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.
    You can discover more about a person in an hour of play than in a year of conversation.

  7. #7
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    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?
    You can discover more about a person in an hour of play than in a year of conversation.

  8. #8

    Default

    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.

  9. #9
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    167

    Default

    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')

  10. #10
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    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.
    You can discover more about a person in an hour of play than in a year of conversation.

  11. #11

    Default

    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.

  12. #12
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    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.
    You can discover more about a person in an hour of play than in a year of conversation.

  13. #13

    Default

    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.

  14. #14
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    So does anything what that message means? Anyone?
    You can discover more about a person in an hour of play than in a year of conversation.

  15. #15
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    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?
    You can discover more about a person in an hour of play than in a year of conversation.

  16. #16
    Iron Guard
    Join Date
    Oct 2007
    Posts
    537

    Default

    Hmm, about 17 days ago.
    Anyway, parameter 1 is looking for UTWeap_BioRifle_Content (or UTGameContent.UTWeap_BioRifle_Content), since the non _Content version is abstract.

  17. #17
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    Thanks for your response. I thought I had more chance getting help making a new topic so I made this one:
    http://utforums.epicgames.com/showth...=593159&page=2
    Last page last post is my current problem.
    You can discover more about a person in an hour of play than in a year of conversation.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.