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

Read this first! Modding Resources

Discussion in 'Modding Help' started by Verrazano, Oct 31, 2013.

  1. Verrazano

    Verrazano Flat Chested Haggy Old Souless Witchy Witch Witch THD Team Global Moderator Forum Moderator Tester
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    477
    Here are a few resources that may be helpful for understanding and editing code. Angel Script is a scripting language heavily derived from c++ with a small hint of java and it's own unique twist on multiple inheritance. The functions found inside of Angel Script are unique to KAG but the syntax is not. So for one to truly begin to understand Angel Script one must understand c++ and c like syntax. The deeper your knowledge of syntaxing and program structure the more you can accomplish. Here are some online/offline tools and resources.

    Text Editors
    In order to be an effective modder you need a text editors that support unix line endings an example of a bad text editor would be notepad this will jumble files into an unreliable mess. The other key component of a good text editor is light weight syntax highlighting. This helps you organize and understand code. The third element that is not necessary but sometimes helpful is completion of variable names. Fourth is the ability to have multiple tabs open at once.

    Sublime Text editor fits all of these requirements + it has a sleek nice looking skin that is easily customization. There are many different syntaxing schemes available. However the first thing you should do is setup Sublime to read .as files with c++ syntaxing. This will aid you greatly. I prefer Sublime Text for editing Angel Script files. However there are other choices!

    Geany basically has all the same features as Sublime Text. I only prefer Sublime Text because I have eye strain problems staring at a black on white editor. So Sublime Text with it's nice dark default theme is good for me.

    • Wordpad (If you have windows you have this)
    Wordpad is basically the dumbed down free version of open office, the one good thing it offers is reading unix line endings. I use Wordpad to read and edit .cfg files. (this can be done by pretty much anything.)

    C++ & Angel Script Documentation
    This is pretty self explanatory this may be quite the heavy task to read through these documents if you don't have a background knowledge of programming. But it is the most important thing to do in order to become a modder. I recommend that you read the c++ tutorial before reading the Angel Script documentation as the Angel Script documentation is written for application writers (people implementing Angel Script in their program) So it's very difficult to understand without the knowledge, but none the less helpful when applied to KAG's modding.

    I use cplusplus.com very frequently it is a c++ standards documentation website, which has implementation, usage, and documentation on all up to date c++ functions and classes. Now you may be asking why would that be important to me. Well they also provide sufficiently in depth guide to learning c++. I recommend that if you are a beginner you read the chapters called: "Basics of C++" and "Controls Structures" if you are feeling adventurous you can read "Compound Data Types" as some of the stuff found in that section or very important into understanding how KAG interfaces with Angel Script (i.e. pointers). If you someday wish to become modder extraordinaire I suggest reading the entire thing and just becoming a c++ programmer it translates well into Angel Script.

    It is important that before you read this documentation that you have a half decent working knowledge of c++. These documents are meant for application writers intending to use Angel Script in their programs. However they contain useful references to certain data types, structures and how Angle Script is integrated and called.

    Misc.
    You can join us at #kag and #kag.modding. It is important to be part of an ever growing community of modders and to surround your self with knowledgeable people who can help you. The best of the modding community is on irc nearly 24/7 and some one can help you. Although I my sometimes be grumpy and irritable I will always respond to your questions pertaining to modding. (There are also others.) The worst thing to do is to get stuck on a problem and sit on it by yourself. Bring it up with others so you can get help and solve your problems! Plus we like to see snippets of what people are working on.

    • KAG Angel Script API (KAG-Beta>Manual>interface)
    In the root folder of KAG-Beta you can find interface files called Objects.txt, Enums.txt, Functions.txt, Variables.txt these give you a rough idea of everything that is available and at your disposal to use. The best documentation of all these things are found directly in the Base folder of KAG inside of all .as files just do some digging and you will find what you need.

    I'm not a particular fan of this resource even though it is official, it is highly outdated since the devs have not had time to post examples and usages, or even keep up to date with the current functions. I suggest you avoid using KAG wiki for documentation on functions as it will show you old signatures and no longer valid examples. However if you feel confident in your skills feel welcome to edit the wiki and fix entries this is welcomed and appreciated by the devs.
    --
    KAG Modding API Documentation is now available although it's not complete it is being updated when the devs have time, it is accurate as it is directly from the devs. https://doc.kag2d.com
     
    Last edited: Jan 4, 2014
  2. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    Do you have any example codes? As in, either KAG's code or some of it, such as the barrel etc...
    If the answer is "go find it", please tell me where it is, at least.
    Also, that helped me greatly, so yeah, thanks :D!
     
  3. VanHuek

    VanHuek KAG Guard Tester

    Messages:
    751
    Steam/steamapps/common/King Arthur's Gold/Base/Entities is where everything is, well nearly everything. E.g. Items/Explosives
     
    ZeroZ30o likes this.
  4. ZeroZ30o

    ZeroZ30o Haxor

    Messages:
    119
    Tyvm, that was quick! Anyway, I'll get on working now :P.
    --- Double Post Merged, Nov 8, 2013, Original Post Date: Nov 7, 2013 ---
    [Edit for the sake of sanity]
     
    Last edited: Nov 9, 2013
    VanHuek likes this.
  5. VanHuek

    VanHuek KAG Guard Tester

    Messages:
    751
    Best place to ask is on IRC, #kag,modding
     
    ZeroZ30o likes this.
  6. Verrazano

    Verrazano Flat Chested Haggy Old Souless Witchy Witch Witch THD Team Global Moderator Forum Moderator Tester
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    477
    It's cool to see you are doing this stuff. But ye it's best if we keep this thread clean please come to kag.modding in irc and I will help you when I'm available.
     
  7. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    There's also an AngelScript syntax package for Sublime Text. I'm using it all time.
    Also, if you need to find some "real cases" of functions/methods/etc. you've seen in the Manual folder, you can press Ctrl + Shift + F in Sublime Text and search what you need.
    [​IMG] (I have a theme but the way is the same)

    Also, you can drag&drop folders in Sublime Text to keep open them in a "project". It's useful and I'm usually loading the Base folder, the Manual folder and my mod folder when editing.

    I overall like a lot Sublime Text because of its comfortable text editor and themes/plugins mostly.
     
    Last edited: Apr 26, 2015
  8. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    A little confusing with the different sources of documentation. Even after working a bit on my mod, I kinda prefer the Wiki over the other documentation, even if it's pretty outdated. Both sources are lacking however. Neither describe the available hooks for instance. I created an account on the Wiki and added some minor stuff, but it's a big job to get things up to date, and I'm not allowed to create new templates either, so I doubt I'll spend much time on it. I think this is as big a frustration as any difficulty working with the engine/game itself. Often I find myself looking at existing code to try to figure out things work, but people haven't really been good at commenting their code either (something I'm too familiar with). For my own sake, I'm writing as verbosely as I can, to make sure that whoever (including myself) reads it understands everything it does. Hopefully, even if I haven't solved everything in the best way possible, it could serve as some help for future modders.
     
  9. VaderCraftGamer

    VaderCraftGamer Ballista Bolt Thrower

    Messages:
    87
    So I uploaded 2 resources. One is a head pack, the other is a few kag files.

    I can't update my files I uploaded as it won't let me. I want to keep on updating the files so they are available from time to time and you can download them as I update them. One pack I finished and the download works well. But for the head pack I uploaded, I try to download it and it only shows the image of the head pack, not the download.

    Could you please help. If you can only upload a resource once please tell me so I can try to delete the thread I posted and keep on reposting. I would really like to know as every 2 days I update my head pack and I don't want this problem to keep on getting in the way.

    Thanks for trying to help.
     
  10. @Verranzo I just went on the IRC (there are 2 other people there, not sure if they're chatting or not - didn't see anything) and I keep getting the following message when I type anything in the #kag.modding channel:

    == Cannot send to channel: #kag.modding

    What's up? I'm also guessing that no one is on IRC anymore because of Discord. Also, sorry if there is an obvious answer - new to IRC... :ehh:
     
  11. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    It's #THD.Testing now. Don't bother though, IRC is absolutely dead.
     
  12. @Asu oh XD figured though :rollseyes: just wondering