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 Does anybody have separated arrow scripts?

Discussion in 'Modding [KAG]' started by Shadowblitz16, Mar 25, 2017.

  1. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    Does anybody have arrow scripts that are separated? for modification purposes?

    I would like to have separate scripts for the plain_arrow, fire_arrow, bomb_arrow, and water_arrow.
    so that I can tell what is what.

    Its really hard to learn modding when all the stuff is massed together in one script.
  2. Eluded

    Eluded Haxor Official Server Admin

    If I remember rightly @Blue_Tiger made some custom arrows like a heart arrow which heals teammates. He may be able to help.
  3. Blue_Tiger

    Blue_Tiger Bison Rider Tester

    I never seperated the scripts - I just kept them how they were. It is kind of needless to do it too, there is only a few lines of code for each arrow in arrow.as and a few for each in a couple archer scripts.

    The problem with seperating it all is that special arrows are treated like regular arrows, except in the script when it hits something it asks what arrow it was, and then does something simple like "if fire, burn shit it hit", "if water, stun and splash", "if bomb, explode".
  4. Geti

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

    @Verrazano mentioned yesterday he was possibly interested in working on this; there's a bunch of other code that checks for the blob name being "arrow" though that'd need to be adjusted (from the look of it, archerlogic, climbarrows, onhitfailed, basehit, and some achievement code engine-side).

    I personally don't see a reason to split it, as you'd have to pretty extensively refactor things to avoid massive code duplication. All arrows would want to use basically the same update function and just have their own behaviour on hitting a target or dying.
  5. Verrazano

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

    Re: above, it is a quite a big endeavor for very little bit of functional benefit. But the idea would be more about clarity and extensibility for future modders (The rework, if I do it, would also hopefully split bombs).
  6. Blue_Tiger

    Blue_Tiger Bison Rider Tester

    While arrows are meh, please do bombs! The bomb code is really confusing for water bombs.
  7. Shadowblitz16

    Shadowblitz16 Ballista Bolt Thrower

    I agree it would be nice for this to be done with bombs as well.
    however you can create new bombs easily by editing KnightLogic.as, KnightCommon.as, and KnightAutoPickup.as. however adding new explosion types look hard right now since all bombs appear to have the same explosion code.

    I would love to see bombs and arrows to have a lot more flexible properties, similar to what bombs have already.