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

Modding Guide Needed

Discussion in 'Requests' started by joshua12131415, Apr 30, 2016.

?

What is the 3rd letter of the alphabet?

  1. A) c

  2. B) a

  3. C) b

Results are only viewable after voting.
  1. joshua12131415

    joshua12131415 Bison Rider Tester

    Messages:
    190
    Can someone make a complete guide how to mod kag?
     
  2. an_obamanation

    an_obamanation The boss Donator

    Messages:
    392
    You posted this request on the latest build and Geti actually responded to you with a small but useful guide.
    If this guide is too confusing for you then you either shouldn't try modding at all or you need someone to walk you through every step, not just a guide on how to start.
     
  3. 8x

    8x Elimination Et Choix Traduisant la Realité Forum Moderator Staff Alumni Tester
    1. The Young Blood Collective - [YB]

    Messages:
    1,325
    I recommend you first get a clear idea of what you would like to make or modify:
    do you want to make a new mode?
    do you want to make a new class?
    do you want to modify vanilla content?
    do you want to make items to add into a specific game mode or other's mod?
    do you only want to make a few head sprites?
    do you want to modify the sounds?

    For any of these you would surely need either to write or modify code or to make sprites, maps and sounds. From there, we don' have a clear path, and we ask each others on the modding sections of the forums, or in the IRC channel #kag.modding Generally by having a check at the vanilla files you can imagine what things you can modify without knowing much: values, script list (there's a script called FallDamage.as inside thte scriptt listt of every class, if you remove it from there your characters won't have fall damage f.i.), etc.
    I usually start checking the files I would like to modify, and I make a copy of them, paths included, in a folder inside the Mods folder, instead of copying all the things and only modifying a few. Then I modify them
     
    Geti, joshua12131415 and daskew87 like this.
  4. JaytleBee

    JaytleBee Ballista Bolt Thrower
    1. [Server] Sandbox Reborn

    Messages:
    117
    This is probably the most important thing you'll learn in modding: Ask the people on #kag.modding (especially Verra and Asu)
     
  5. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    Have you read this?
     
    JaytleBee likes this.
  6. daskew87

    daskew87 Legendary corpse humper Donator

    Messages:
    447
    this is sound advice
     
    epsilon likes this.
  7. joshua12131415

    joshua12131415 Bison Rider Tester

    Messages:
    190
    I want a make a mod, that if a builder presses a button, it will make a ball that costs 10 stone. I have already made the ball entity.

    I added this code to the end of BuilderLogic.as but it doesn't work
    Code:
    if (CBlob.isKeyJustReleased(AK_PARTY))
    {
    if (CBlob.hasBlob(mat_stone,10))
       {
       CBlob.TakeBlob(mat_stone,10)
       CBlob.server_CreateBlob(ball)
        }
      }
    I know about these https://doc.kag2d.com/files/Juxta/juxta_blob_bindings-cpp.html , but i don't know how to put them together into code.
     
  8. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    instead of CBlob, you need to use the name of the CBlob variable. In your case it is this. it should look like this.isKeyJustReleased
    mat_stone is supposed to be a string so it should be "mat_stone" same with ball
     
    joshua12131415 likes this.
  9. JaytleBee

    JaytleBee Ballista Bolt Thrower
    1. [Server] Sandbox Reborn

    Messages:
    117
    Also, it needs to be "ball" (with quotes) and I'm pretty sure server_CreateBlob is a global function
    --- Double Post Merged, May 1, 2016, Original Post Date: May 1, 2016 ---
    Oh, also you can't just add it at the end of the file, you have to add it at the end of onTick.
     
    joshua12131415 and makmoud98 like this.
  10. joshua12131415

    joshua12131415 Bison Rider Tester

    Messages:
    190
    Would this be better?
    Code:
    void onTick(CBlob@ this)
    {
    
    blablabla default code...
    
    
    if (this.isKeyJustReleased(KEY_KEY_Q))
    {
    if (this.hasBlob("mat_stone",10))
       {
       this.TakeBlob("mat_stone",10)
       this.server_CreateBlob("ball")
       }
    }
    
    
    }
     
    Last edited: May 2, 2016
  11. JaytleBee

    JaytleBee Ballista Bolt Thrower
    1. [Server] Sandbox Reborn

    Messages:
    117
    Yes, except for two things:
    1. "this.server_CreateBlob("ball")" needs to be "server_CreateBlob("ball")", since server_CreateBlob is actually a "global" function, which means you don't call it on any object.
    2. You need some semicolons. As a general rule of thumb, if the next thing isn't a code block (most the time in {}), you need a semicolon (do look up the exact rules though)
    Here's a working version (excluding the default code):
    Code:
    if (this.isKeyJustReleased(KEY_KEY_Q))
    {
    if (this.hasBlob("mat_stone",10))
       {
       this.TakeBlob("mat_stone",10);
       this.server_CreateBlob("ball");
       }
    }
    
    
     
    joshua12131415 likes this.