1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

KAG.as

Discussion in 'Modding Help' started by Geti, Jul 9, 2014.

  1. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    While I was talking with @Rayne recently I discovered a lot of modders have been unaware of why their gamemodes cause broken icons, build menu and the like.

    A while back we added a file called KAG.as to the game, which holds a lot of common code to initialise icons for menus, set a few common constants, that sort of thing. The affected gamemodes do not include this file in their scripts.

    The reason for this is those modes were started before KAG.as existed, and were not updated when KAG.as was added to the game. We should not "force" this script on everyone, because the engine is meant to be more or less game agnostic - including KAG.as by default would mean that everyone would be stuck with its contents even if they wanted to make a total conversion or completely new game.

    To fix the affected mod gamemodes, add KAG.as as the first script to gamemode.cfg - like so

    Code:
    # config file for game rules
    # rules name: CTF   
    # rules description:
       
        teams                              = team1.cfg; team2.cfg;
       
        gamemode_name                      = CTF
        gamemode_info                      = Capture the Flag
       
        scripts                            = KAG.as;
    
    ... (more scripts and variables here)
    If you could share this around with modders that don't read the forums often, that'd be great. Would be nice to have old mods updated so that we have fewer reports of "BROKEN MODDING" when it's simply a missing script.
     
    Fernegulus, Asu and Rayne like this.
  2. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
  3. acromatic

    acromatic Catapult Fodder

    Messages:
    13
    KAG.as is already added to my mods gamemode.cfg, it's the recent version. I made a mod where it adds guns based off the M16 example and reworked into CTF. But after I made a shop, I go to buy from the shop and everything works fine except the first time my shop items are displayed the icons are all wrong. I don't know if other mods have this problem or if I'm missing something. After buying one of each item their icons display correctly. I don't know if that's a global connection being made in memory or if it's unique to each players display. Any idea what shop code I'm missing?

    [Solved]
    I have resolved the issue by adding icon tokens.
     
    Last edited: Jan 6, 2015