Results 1 to 19 of 19

Having Munition slowly drain away.

  1. #1
    Member Zupadupadude's Avatar
    Join Date
    Apr 2011
    Location
    Holland

    Having Munition slowly drain away.

    So, what I'm trying to accomplish is that when any unit reloads, tank, AT-gun, infantry, etc. 1 Munition point will be taken away. Can you do this and how?


  2. #2
    Member I_am_a_Spoon's Avatar
    Join Date
    Jan 2010
    Location
    Western Australia
    Not per reload, but per shot/burst yes.

    Go to the weapon RGDs, you'll see a "fire" section within each. Inside you'll be able to set up on_fire actions (in your case, a munition modifier).

  3. #3
    This is interesting.

    Is it possible to have each unit have its own ammunition supply?

    So for example, each tank might start with 10 rounds. Then there would be either a certain amount of time for it to automatically reload, or perhaps it could "pick up" more ammo from dropped crates.

    Or maybe place a limit of how many grenades a rifleman squad can use. So each squad has 3 grenades you can use when ever, after that there would be a 5 minute wait.

  4. #4
    Member Zupadupadude's Avatar
    Join Date
    Apr 2011
    Location
    Holland
    I have no idea how, and that's a good thing because when I implent stuff like that everyone will accuse me of stealing their ideas. It is possible though, Ask I_am_a_Spoon, he made a system like that.

  5. #5
    Member I_am_a_Spoon's Avatar
    Join Date
    Jan 2010
    Location
    Western Australia
    It's possible, but there are a few major problems. It's still a WiP.

    Your way is definitely easier.

  6. #6
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    @noway12
    It is definitely possible. We have had a working per-entity ammunition system in Fortress Europe for quite some time. However, it requires a lot of knowledge of SCAR to implement. I can give some tips or even write a tutorial if needed.

  7. #7
    Dude, that would be awesome!

    When you refer to SCAR, do you mean editing Lua? Is that a lot harder then editing by just using the mod studio and opening up .rgd files?

    If it is, and it is particularly hard, then it may not be worth your time writing a tutorial. It is a big ask and I would want to be sure that I can get things done before I let you use your own time to write a tutorial.

    If by SCAR you just mean editing rgd files, then that would be great! Perhaps some basic tips as to where I could start, rather than a tutorial. It would help me learn and save you time.

    I really apreciate that you offered to write a tutorial! Especially as I have never helped you in anyway (I would if I was ever in a position too).

    Thanks

  8. #8
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    @noway12
    Well, SCAR is also known as SCripting At Relic, which is a derived form of Lua that Relic uses as their scripting language. Although Lua is also used for game data files, this is entirely different. You would need to know how to program or write code in Lua. It is difficult if you have no programming experience, but it is an easy language to learn in my opinion.

    http://www.lua.org/

    http://lua-users.org/wiki/TutorialDirectory

  9. #9
    Well, I intend to start learning it. When I get a better understanding of it, i'll post here and ask you for some tips in implementing unit specific ammo.

    Do you have any suggestions for learning? Any of those tutorials not too important, while others very important in regards to COH?

    I have only ever coded in python before... several years ago.

    Thanks dude.

    Love the look of your mod!

  10. #10
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    If you do not have a lot of programming experience, I would recommend going through both the official Lua documentation and as many of the tutorials as needed to get an understanding. I use pseudo-Classes in my code which I have written a tutorial for, but if you are not familiar with C++ or similar Classes it might be difficult to follow: [SCAR Tutorial] Classes, Rules, cURL, IO and more!

  11. #11
    Member Zupadupadude's Avatar
    Join Date
    Apr 2011
    Location
    Holland
    So what modifier or action should I put into on_fire actions? Because putting -25 for example in the modify_resources action doesn't seem to work.

  12. #12
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    Keep in mind that the on_fire_actions only affect the entity that is firing. So, you will not be able to issue player commands or abilities.

  13. #13
    Member Zupadupadude's Avatar
    Join Date
    Apr 2011
    Location
    Holland
    Well, what I meant is that it actually adds 25 munitions instead of taking 25 munitions away. :V

  14. #14
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    Edit: Nevermind, I misread your post.
    Last edited by eliw00d; 30th Jun 12 at 11:21 AM.

  15. #15
    Hi eliwood,

    Is it possible that you could write a tutorial afterall?

    Things are harder than I first thought.

    If your to busy now, that's okay. Thank you anyway for the thought.

  16. #16
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    @noway12
    Well, what are you struggling with?

  17. #17
    I am unable to make the connection between what I'm learning and modding coh.

    I am eager to learn it, believe me, I have a few ideas for making tables.

    It's just that I can't link any of it back to what I'm doing.

    I spent years modding Command and Conquer games and have learn't to think in that way. I think Lua would be beneficial for me because its seems more like what I'm use too (than RGM editing).

    Very frustrating.

  18. #18
    Getting a little further a head. Do you have any hints as to which scar files I should focus on?

    Which one deals with the resources?
    Last edited by noway12; 15th Jul 12 at 4:07 AM.

  19. #19
    Member eliw00d's Avatar
    Join Date
    Jul 2008
    Location
    USA
    @noway12
    Well, I write all my own code. Here is the SCARDOC. It has nearly all Relic SCAR functions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •