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

Classes/Items Equipment and Hunger systems v1.16

A structure for creating equipments, with additional starving.

  1. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    Rayne submitted a new resource:

    Equipment and Hunger systems - A structure for creating equipments, with additional starving.

    Read more about this resource...
     
    dual_chiecken, 16th, Haste and 3 others like this.
  2. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
  3. startselect3

    startselect3 Arsonist

    Messages:
    261
    this is really awesome, makes singleplayer actually fun
     
  4. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
  5. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
  6. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
  7. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    If anyone is looking to see some of the features of the mod, check out the "RPG CTF". I'll have the server up for at least a week.
     
    startselect3 likes this.
  8. duke54

    duke54 Catapult Fodder

    Messages:
    27
    Got it running, but how do I add new items? Is there a GUI for it or what? Or am I just supposed to copy/paste your code? And what are the new items I'm seeing in the inventory for the knight?

    Looks like this is great work, I just need a little more guidance how to use this, thanks!
     
    Last edited: Jan 18, 2015
  9. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    You'll have to look at how I have the current equips set up to get an idea for it, also you might need to attach EquipmentGUI.as to the knight.cfg, not sure if I remembered to fix that or not in the dl.

    basically the most important thing is to name all your sprite layers and icons after your equip's blobname, iron_sword, so iron_sword.png and iron_sword_layer.png are the names you'd need for the sprites. if you don't do this, the icons in the equip menu won't work, and sprite layers wouldn't either.
     
  10. duke54

    duke54 Catapult Fodder

    Messages:
    27
    Lets say I don't want to add any more, but I simply want to use the current equips in game. How can I do that?
     
  11. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    set up shops to sell the equips, the ones included should work. but note that only knight equips are included, they wont work for other classes without additional code, they're only meant as examples afterall
     
  12. duke54

    duke54 Catapult Fodder

    Messages:
    27
    I setup knight shop, and it doesn't have anything new to buy in it. I do see the additional equipment slots in my knight inventory, but that's it.

    Do you mean I should code new shop types to sell the new items?
     
  13. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    you can add them to the knightshop.. look in knightshop.as, and look at the crafting stations I included as an example.
     
  14. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    you need to find the blob names of the items you want in the shop, in the knight shop you should see something like:

    {
    ShopItem@ s = addShopItem(this, "Keg", "$keg$", "keg", descriptions[4], false);
    AddRequirement(s.requirements, "coin", "", "Coins", cost_keg);
    }

    just replace the 4'th parameter, "keg", with the blob name you want to spawn, and the cost_keg variable to whatever price you want it to be sold for.
     
  15. duke54

    duke54 Catapult Fodder

    Messages:
    27
    Thanks makmoud, I'm trying to piece this all together so I can understand it better in my head.

    I made a mod restoring the old archer triple shot, and the 2nd/3rd shots dont go as far, just like the current archer shotgun. (check it out at Legend CTF *OP Archer Kingdom*. You need non-vanilla set to green to see it in the list)

    What I'm hoping to do is use this mod to enable archers to buy items that will either give them the shotgun shot, or the triple shot, so players can pick their own game style.

    All I would need to do is set the var in ArcherCommon.as that sets the triple shot, which is here:

    const ::s32 legolas_arrows_count = 3;

    So, is it possible to use this mode to change that variable during gameplay?
     
  16. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    re: any "is this possible?" questions: yes, please look at the code I have provided as an example, you just check the equipment slot for the name of the equipment.
     
  17. duke54

    duke54 Catapult Fodder

    Messages:
    27
    I've have looked at the code, but I don't have an over-all understanding of how the system works, since there's a lot of interrelated files.

    Do I copy all the files named Eqip, to create my own item, or do I copy the entire folder? After that, do I then update the workbench files, and finally update the characters so they can obtain the item?

    I need help understanding the general process of what files would need to be copied and updated, and what would be a good order to work through the file creation process.

    Thanks!
     
  18. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    anything that's not included in the "equipment" folder is example code and files, if you had looked at the code, you should've been able to figure this out. justsayin.

    Items are just blobs with equip.as attached to them, they set a string on your player blob when you equip it, you check the string and apply the code you want the item to do. this is not meant for beginners who do not know how to code, as the only functionality provided is basic damage modification and bad sprite layering(spoilers that's the only real modification to knightlogic.as).

    I'm sorry for not wanting to explain it in greater detail, but it's not hard to check for a string and provide follow up code depending on what the string returns. Besides, I want people to learn from this rather than copypaste code around.
     
  19. duke54

    duke54 Catapult Fodder

    Messages:
    27
    Yeah I get it, you've said "look at the code" every post, but game engines are unique, (especially KAG) and require more than just the ability to read the language.

    Anyway, I'll figure it out, and once I'm done I'll post how it works for everybody else. Cheers.
     
  20. FunATuns

    FunATuns Builder Carry Donator

    Messages:
    114
    This may be a noob question, but how do I build the smelter? Also do ores spawn on the map automatically, or is there a palette I have to use?
    -FunATuns