Edit weapon values in mod?



  • Subject headlines says it all. Got problems figuring out how to edit the codes and make it used in the mod I’m making.



  • The way it’s currently makes it painful to reach certain parts of their code, and others are simply out of reach.
    You need to subclass a Gameinfo class (in this case extends from AOCGame or its subclasses).
    You can’t simply go to their code and change value x to y.
    Ironically, it’s actually easier to create a new weapon than change a current one, code wise at least.

    For instance, if you want to change something in the Maul and bind it to the Knight Family:

    First subclass AOCWeapon_Maul and AOCWeaponAttachment_Maul, then make your changes to the new classes.
    Now subclass AOCFamilyInfo_Knight or, AOCFamilyInfo_Agatha_Knight and AOCFamilyInfo_Mason_Knight for their team related changes. With the new subclasses, alter the NewPrimaryWeapons entry for the maul with your new Maul subclass.
    Now comes the annoying part, hooking your code into the game.

    In this case, subclass AOCPawn, and on DefaultProperties:

    DefaultProperties
    {
    
        AllClasses[ECLASS_Knight] = NEW_AGATHA_KNIGHT_SUBCLASS
        AllClasses[ECLASS_Knight + 5] = NEW_MASON_KNIGHT_SUBCLASS
    
    }
    

    And now on your Gameinfo (from AOCGame extend) subclass:

    DefaultProperties
    {
    
        DefaultPawnClass = NEW_PAWN_SUBCLASS
    
    }
    


  • Take a look at this: viewtopic.php?f=97&t=15753

    It’s an example mod I made which demonstrates a number of things, including how to essentially modify classes and weapons.



  • @NabsterHax:

    Take a look at this: http://tornbanner.com/forums/viewtopic.php?f=97&t=15753

    It’s an example mod I made which demonstrates a number of things, including how to essentially modify classes and weapons.

    Lol, now I’m curious. Why did both of us use the Maul as an example? Is there some subtle message on the weapon that says “test weapon”? :p



  • @Cthulhu:

    Lol, now I’m curious. Why did both of us use the Maul as an example? Is there some subtle message on the weapon that says “test weapon”? :p

    Haha, it’s probably the most iconic and memorable weapon in the game. :)


Log in to reply