0 of 0

File information

Last updated

Original upload

Created by

CrEaToXx

Uploaded by

CrEaToXx

Virus scan

Safe to use

Tags for this mod

48 comments

  1. CaptainStarlight
    CaptainStarlight
    • member
    • 1 kudos
    Doesn't seem to work for me in 1.9.6...    Looking at the script it may have a dependency on a console mod.   Or something else may be
    interfering with it.  Having the same problem w/ the waystone mod.  No other issues, just no exp gain.
    1. asteriasennall
      asteriasennall
      • member
      • 54 kudos
      I am seeing the same thing on my side.
  2. Dishschion
    Dishschion
    • member
    • 0 kudos
    Nice mod!
    Btw, i saw some people wanted only player shots counted, so I added a simple ifelse to check it. The game even has a code for this, but it doesn't work properly

    Only condition:
    if(g_localActor.id == hit.attackerId) then
            player.soul:AddSkillXP('weapon_bow', 1)
    end;

     Full code with some modifications:
    function ShootingTarget.Client:OnHit(hit)

        if(g_localActor.id == hit.attackerId) then

            local vectorTemp=g_Vectors.temp;
            SubVectors(vectorTemp,self:GetPos(),hit.pos);
            local distance=LengthVector(vectorTemp);
            distance=((1-(distance*2))+0.08)*10;
            SubVectors(vectorTemp, player:GetPos(), self:GetPos());
            local distancePlayerToTarget = LengthVector(vectorTemp);
            local experience = 0;
               
            experience = distancePlayerToTarget*distance*0.03;
            player.soul:AddSkillXP('weapon_bow', experience);

        end;    

    end

    Experience you get depend on distance to target and zones you shoot. More distance - more exp, high accuracy - also more exp

    0.03 - exp multiplier, with this number you get about 3 exp for shot in the black area with distance 10 game unit

    Also i deleted notifications, cause i tired of "ding" sound
    1. ZeroedZombie
      ZeroedZombie
      • member
      • 0 kudos
      very nice, using this without issue
    2. hoskope
      hoskope
      • premium
      • 10 kudos
      Very nice. I've modded my game to slown down leveling extremely, so this fits perfectly! Thank you for the mod creator as well as this tweak!
    3. Lupus001
      Lupus001
      • member
      • 0 kudos
      Well i am doing something wrong, since i can sadly not get this to work for some reason
    4. Eagmati
      Eagmati
      • supporter
      • 0 kudos
      fixed it by editing code with your full modification instead of only condition and it fixed it
    5. M4DMAXX27
      M4DMAXX27
      • member
      • 1 kudos
      I installed the Original mod, and make your Change... dunno if its the Original Mod or your modifications... for me, there is no Target.... all Bow Targets stands, just empty. Only the Wooden stand is there.
    6. uxt7
      uxt7
      • member
      • 0 kudos
      Same as above. So I reverted the code and the targets came back. However, now they have no collision and my arrows just go right through them. Even after removing the mod altogether. No clue how, but this mod seems to have completely broken archery targets for me. Only the Neuhof targets still have collision, but they have a different model from the standing ones. And also they still gave no EXP either

      Edit: I'm 99% certain the issue I'm having isn't related to the mod itself. I think my game is just broken and the archery targets themselves are non-functional as they work in earlier saves in my play-through, but in later saves, they have no collision. Even after removing all mods and uninstalling/reinstalling the game. Very unfortunate for me.
    7. FaPaThY
      FaPaThY
      • member
      • 0 kudos
      @uxt7
      Did you ever manage to figure this out? My targets also have no collision, so now I can't do the archery contest for the wine or money. Luckily, I can just steal the wine, but I hope it doesn't mess up any future quests.

      Gotta be a save issue though. Went back to a save just after getting to Rattay and it's not bugged there, so goodbye 20hrs of progress on my HC playthrough
  3. Vylayan
    Vylayan
    • member
    • 17 kudos
    Can confirm it works marvelously. I included the shooting-distance modifier from Dishschion's post below and it works perfectly as well.

    The only way I can see this mod not working is if something else is modifying the script later in the load order. If you're having issues, try putting it as the last mod loading -- no guarantee it won't mess something else up but you can at least confirm this mod is working.
  4. uxt7
    uxt7
    • member
    • 0 kudos
    Don't seem to work. Same with trying to edit it like the comments below say
  5. Rlc84
    Rlc84
    • member
    • 0 kudos
    Disculpa por las molestias, parece que no me funciona el Mod lo instale por medio del Vortex y según el programa esta bien instalado lo reinstale y nada no veo que funcione e probado con diferentes distancias y quince tiros y nada.

    No se que hago mal
  6. kuronekosays
    kuronekosays
    • member
    • 0 kudos
    Seems to not be working, or at least not at the Rattay archery range
  7. Arlinthedwarf
    Arlinthedwarf
    • member
    • 0 kudos
    installed into my mod folder, and doesnt seem to be working at the ledetchko targets. an update or clarification would be nice, I feel like shooting targets "SHOULD" give xp and improve archery since that is realistic.
    1. Arcanaiel
      Arcanaiel
      • supporter
      • 1 kudos
      Problem is distance to close, maybe. Or try code from comment. Edit for distance if hard.
  8. SL4D33R
    SL4D33R
    • member
    • 0 kudos
    Brilliant mod! Simple yet essential :) If someone want I created two modifications of this mod with distance check. Experience is rewarded only from distance of 10 in-game units or greater (distance from shooting targets to shooting position fence in Rattay). Distance 20 or greater doubles experience rewards.

    Like original, only dead center counts (10 units distance = 1EXP, 20 units distance = 2EXP):
    function ShootingTarget.Client:OnHit(hit)
        local vectorTemp=g_Vectors.temp
       
        SubVectors(vectorTemp, self:GetPos(), hit.pos)
        local distanceFromCenter = LengthVector(vectorTemp)
        local accuracy = ((1-(distanceFromCenter*2))+0.08)*10

        SubVectors(vectorTemp, player:GetPos(), self:GetPos())
        local distance = LengthVector(vectorTemp)

        if (accuracy < 10.5) then
            return
        end

        if (distance < 10) then
            return
        elseif (distance < 20) then
            player.soul:AddSkillXP('weapon_bow', 1)
        else
            player.soul:AddSkillXP('weapon_bow', 2)
        end

        RPG.NotifyLevelXpGain('weapon_bow')
    end

    Easier version where white area gives 1 EXP, black area 2 EXP and exact center 3EXP (doubled at distance greater than 20):
    function ShootingTarget.Client:OnHit(hit)
        local vectorTemp=g_Vectors.temp
       
        SubVectors(vectorTemp, self:GetPos(), hit.pos)
        local distanceFromCenter = LengthVector(vectorTemp)
        local accuracy = ((1-(distanceFromCenter*2))+0.08)*10

        SubVectors(vectorTemp, player:GetPos(), self:GetPos())
        local distance = LengthVector(vectorTemp)

        local experience = 0

        if (accuracy > 10.5) then
            experience = 3
        elseif (accuracy > 8.2) then
            experience = 2
        elseif (accuracy > 4) then
            experience = 1
        else
            return
        end

        if (distance > 20) then
            experience = experience * 2
        elseif (distance < 10) then
            return
        end

        player.soul:AddSkillXP('weapon_bow', experience)
        RPG.NotifyLevelXpGain('weapon_bow')
    end

    If you want different difficulty then change experience amount, accuracy and distance check accordingly:

    • (accuracy > 10.5) = dead center
    • (accuracy > 8.2) = whole black area
    • (accuracy > 4) = white area
    • (accuracy > 0) = outer ring
    • distance of 10 = distance from shooting targets to shooting fence in Rattay

    I would upload these updated versions but don't want to steal CrEaToXx credit. CrEaToXx if you don't want to or don't have time I can upload these versions of mod myself with your permission :)
    1. TheVigilantWolf2
      TheVigilantWolf2
      • supporter
      • 9 kudos
      I also have modified versions both including different target size options (exact center or black area) as well as variations in XP gain you can pick (x1, x3, x5). I haven't heard back regarding permissions for posting.
    2. kjellove97
      kjellove97
      • premium
      • 0 kudos
      Could you make this a thing and upload it?
    3. renzo158
      renzo158
      • member
      • 0 kudos
      Could you teach us how you edited this like you did? I think I'm not the only one with no experience doing this.
    4. conninator2000
      conninator2000
      • member
      • 0 kudos
      Just found out how to do this myself so ill put my findings down below for those that are less comfortable programming or altering mods.

      - download and install the mod as normal
      - open up the mod file and find the .pak file - rename that to a .zip file
      - open up its contents (after extracting it) and find the only .lua file inside 
      - open the lua in notepad and copy the code for the version you want and use it to replace the function:function ShootingTarget.Client:OnHit(hit)  - for those not computer savvy, the function means the line where it says function all the way down to the line that has "end" - it should be easily noticeable by looking at the indentation
      - once that function is replaced, save the file and go back to the top folder you extracted (Scripts)
      - zip that back up and have it match the name of the original zipped file we changed (should be STargetsGiveXP.zip) - id assume the naming isnt really required, just the file extension but i dont know all the working parts about KCD mods so best to play it safe
      - take that zip file that has been repackaged and change its extension back to a .pak file

      and voila! It should be working after that
    5. Drapsheik
      Drapsheik
      • supporter
      • 2 kudos
      When I replace the function in the lua for the second function in this post, my targets disappear.
    6. GregariousJB
      GregariousJB
      • member
      • 0 kudos
      This is way better than the original mod of only 1 xp and only for a perfect bullseye. To me that doesn't solve the problem of training archery at all. Thank you.
    7. manlyMAN0890
      manlyMAN0890
      • supporter
      • 6 kudos
      Furthermore, if you don't have any program installed for modifying the file extension of .pak to a .zip format and then back to .pak, there is a workaround:

      1. Right-click on the .pak and try to "open with" the .zip app (such 7z), "just once".
      2. Navigate to the .lua file and then click and drag the .lua to copy it somewhere else.
      3. Open the .lua with Notepad, find and make the modifications as explained in the previous posts, then save it as-is. This should preserve the .lua file extension.
      4. Drag the changed file BACK 7z to replace the old .lua in the zip path. It will ask you to overwrite, say yes.
      5. Close 7z. The changes should be properly applied in the .pak file. Enjoy leveling at the archery ranges.
    8. BobTJack
      BobTJack
      • member
      • 0 kudos
      I've tried all this, still not seeing an increase in my bow skill. A shame, oh well.
    9. Arcanaiel
      Arcanaiel
      • supporter
      • 1 kudos
      Thx SL4D33R for code update and CrEaToXx for mod.
  9. GigaByteWide
    GigaByteWide
    • premium
    • 1 kudos
    Doesn't seem to be working with the latest build atm
  10. Donasparagus
    Donasparagus
    • supporter
    • 9 kudos
    The archery targets now have no more colision. when i shoot against them, the arrows fly through the targets. in the archery competition, the npcs just stand there and no longer shoot at the targets.