1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Fixed Blocking worst weapons from everyone

Discussion in 'Bug Archive' started by Tingyun, Sep 29, 2016.

  1. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    It seems from conversation here: Unconfirmed Bug - Navy Soldiers not blocked from inappropriate weapons | PiratesAhoy!

    That it might be true that people don't want any enemies ever using the worst weapons (knives, tools, etc).

    If that is the case, the attached files will remove any chance of them being used.

    If that isn't the case, and people want them just not on nationality ships other than pirates, then we can pursue simply fixing the function in the linked thread.

    Either way, that one will need to be fixed to block the wrong types of nationality weapons, but it seems like people might also want this too, as they don't seem to like knives and tools as weapons on enemies.

    program/items and program/loc_ai

    EDIT: note, incorperates changes to Tizona from other thread.

    Will need playtesting and possible tweaking to make sure it is working right. It is just a matter of setting the min level for proper swords at 2, keeping the tools and knives at 1, and then clamping the min level for npcs at 2 (but not for guns, just for swords).

    EDIT2: didn't work sadly, as Ansel confirms, now thinking instead we should just add a itm.skipequip to each item we don't want, see bottom post.
     
    Last edited: Sep 30, 2016
  2. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,628
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I personally do think the "tools" should be used somewhere somehow, otherwise they might as well not exist. :facepalm
     
  3. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Tools is use by treasure hunting. Maybe the carpenter should have specific tools, to do
    his job well. And the doctor need tools and so on.
     
  4. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    Technically they can still be used in combat when the player fights someone during digging, happens often in the maltese crypt when something pops out and attacks.

    BTW, this "needs testing" most certainly. It might need tweaking to work right anyway, and I no longer have the luxury of being able to playtest.

    And maybe we don't want to do this after all. I don't know, the choices seem to be:

    1) Just fix the function in the other thread, meaning pirates can end up with the terrible weapons, but only them

    2) Fix the function in the other thread, AND make some seperate code to block everyone but bandits from these worst weapons

    3) Fix the function in the other thread and use this sort of min level thing here (probably with the files fixed up after testing), and just make them basically player only.

    I have no strong opinions, but @ANSEL makes a good point about Pirates liking good weapons, just since I'm going to disappear again and not be able to provide support, I wanted to offer this alternate stronger solution if it ends up being desired.
     
    Pieter Boelen likes this.
  5. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,628
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Two tools are used for Treasure Hunting as @ANSEL points out.
    If the other ones won't show up in random use, I reckon they should be given an alternate purpose at least.
     
    Tingyun likes this.
  6. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    Barfights could be given the possibility of giving only bread knives or daggers at a random chance instead of fists. That is a possibility for some of them.

    The axes and hatchets could be moved to min level 2, if we think they are appropriate weapons for general use.

    That might take care of almost all of them.

    Sorry really have to run now, I look forward to seeing everyone soon!:)
     
    Pieter Boelen likes this.
  7. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    I think @Jack Rackham use a lot of tools and items in his work,in a different and
    original way. I will like to hear what he could say about the use of tools.
     
    Pieter Boelen likes this.
  8. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    @Grey Roger @Tingyun : Tinguyn your fix dont work on the tools problem, it's still
    there. But it brings the officers back to join the boarding , and the dialog , if the should
    join you or not, is working well now. This is odd, but I think it's the way it works.
     
    Tingyun likes this.
  9. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    @ANSEL It shouldn't have done anything to boarding! Literally all I did was switch the min weapon term and a couple of designations.

    Perhaps some very specific conditions determine whether they join you on boardings or not, ie whether the bug happens.

    Thanks for the report, I have a quick moment and there is something else I can try. Holdon and let me see if I can fix it another way.
     
  10. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    Ok, since @ANSEL confirms this did not fix it, the best option seems to be to add a

    itm.skipequip

    designation to each weapon we don't want to be equiped normally--tools and knives basically.

    There doesn't seem to be an option for that in the weapon array for normal weapons, but many special weapons have it defined, so it seems like it should be easy to do.

    Going to have to run, sorry I can't do a completed version of that myself right now. If someone else can't do it, but can give me some guidance as to how, I can get it it for sure in about 2 weeks when the project wraps up.
     
  11. Levis

    Levis Find(Rum) = false; Staff Member Programmer Creative Support Storm Modder

    Joined:
    Oct 6, 2013
    Messages:
    6,711
    Gender:
    Male
    Occupation:
    ICT
    Location:
    University Twente (Netherlands)
    @Tingyun no problem you don't have to rush it. this is a low priority bug :).
     
    Tingyun likes this.
  12. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    I think the main issue is my own incompetence, in that I don't know how to make an itm.skipequip entry for weapons that appear in the main array in items_init, rather than being listed seperately. The array doesn't haven't a column for that.

    If I knew how to do that, it would be an easy thing to just include that entry for all the tools and knives. Someone must know?
     
  13. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,628
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    It isn't exactly obvious if you don't already know, so no "incompetence" on your part there. :no

    Luckily, I do know. You need to add to this section of code in initItems.c:
    Code:
      switch(id)
      {
         case "bladelead":     blade.stun = 0.10;               // Stun enemies
                     blade.skipequip = NO_SPECIALWEAPONED_NPC;   // Random characters don't use them
                     blade.skiptrade = true;             // Not sold from regular traders
                     blade.sneaky = true;     break;       // PB: Sneaky Trader
         case "bladeclub":     blade.stun = 0.75;               // Stun enemies
                     blade.skipequip = NO_SPECIALWEAPONED_NPC;   // Random characters don't use them
                     blade.skiptrade = true;             // Not sold from regular traders
                     blade.sneaky = true;             // PB: Sneaky Trader
                     blade.sound = "OBJECTS\DUEL\club2.wav";   break;   //JRH
         case "blade1" :       blade.param.time  = 0.05;   break;       // special case
         case "blade24":       blade.param.time  = 0.05;   break;       // special case
         // PB: Who would want to buy this? -->
         case "Barmansknife":   blade.skipsell = true;     break;
         case "Guestsknife":     blade.skipsell = true;     break;
         case "MerchantsBlade":   blade.skipsell = true;     break;
         case "Merchantsdagger":   blade.skipsell = true;     break;
         case "Minersaxe":     blade.skipsell = true;     break;
         case "Minerscrow":     blade.skipsell = true;     break;
         case "Piratesdagger":   blade.skipsell = true;     break;
         case "Machete":       blade.skipsell = true;     break;   //JRH
         case "MinersSpade":     blade.sound = "PEOPLE\spade.wav";break; //JRH
         // PB: Who would want to buy this? <--
      }
    
     
    Tingyun likes this.
  14. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    @Pieter Boelen

    Maybe this can be a last bit of work for the community before my forced sabbatical. :)

    Code:
         
        case "Barmansknife":   blade.skipsell = true;
                     blade.skipequip = true;     break;  //TY begin excluded weapons
         case "Guestsknife":     blade.skipsell = true;
                     blade.skipequip = true;     break;
         case "MerchantsBlade":   blade.skipsell = true;     break;
         case "Merchantsdagger":   blade.skipsell = true;
                     blade.skipequip = true;     break;
         case "Minersaxe":     blade.skipsell = true;
                     blade.skipequip = true;     break;
         case "Minerscrow":     blade.skipsell = true;
                     blade.skipequip = true;     break;
         case "Piratesdagger":   blade.skipsell = true;
                     blade.skipequip = true;     break;
         case "Machete":       blade.skipsell = true;     break;   //JRH
         case "MinersSpade":     blade.sound = "PEOPLE\spade.wav";
                     blade.skipequip = true;     break; //JRH
         case "Minerspick"     blade.skipequip = true;     break;
         //case ""bladeaxe3"     blade.skipequip = true;    break;    //TY Begin questionable blocks- hatchet?
         //case "blade5"       blade.skipequip = true;     break;      // dagger?
    
    I've added blocks for the hatchet and the dagger too, but not sure if we want that, so those are commented out. Other than that, I've blocked all knives and tools.

    Does that look right?

    If it does and we want to try this for now, someone please post to New Content when the decision is made, since I may not be around to post it there.

    @ANSEL You might enjoy this, it hopefully will block all the knives and tools from everyone. :) If you also want to block the dagger and the hatched, you can uncoment those two lines in the attached file.

    File attached.

    EDIT: quick correction
     

    Attached Files:

    Last edited: Sep 30, 2016
    Pieter Boelen likes this.
  15. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    I have this "bladestool" that could be used for barfights.
     
  16. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,628
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    :shock :rofl
     
  17. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    Ah and here I go again, looking like an addict to the board by not staying away. ;)

    Though with good reason sadly--before starting work today I finally was able to boot up my game to test the above file, which I hadn't been able to do previously. A syntax error appeared for that block of code in the error log.

    So something must be wrong with the code I posted above. I can't see a mistake though.

    Just didn't want this going anywhere before someone can look at it to fix it, so had to stop by to let you know. Sorry to leave it to someone else to complete the fix here.
     
  18. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    Line 3695, there should be a colon after case "Minerspick"
     
    Tingyun and Pieter Boelen like this.
  19. Tingyun

    Tingyun Corsair Storm Modder

    Joined:
    Aug 8, 2016
    Messages:
    1,445
    Gender:
    Male
    I took another look at it, and in addition to @Jack Rackham 's fix above (and the same fix for the commented out lines), the block of code probably needs to be repeated above where it is currently placed, so for the case of both enable weaponsmod and the else line (I only added it to the else so far it seems)). Easy to find, the blocks look the same.

    Sorry I can't upload a file, silly mobile devices and view only, I feel bad leaving it to someone else, sorry about that.

    By the way, I noticed both the normal sabre and the english officer's sabre have blade.param.time or something like that specially set to 0.05 in the top part of this same block of code. No other sword has that, everything else is set to 0.1 as far as I can tell, including all the other sabres and higher end stuff. I take it this makes them somewhat faster?

    Just wanted to draw that weirdness to your attention, in case it is leftover from something and should be removed.

    Thanks everyone, best wishes to all of you!
     
  20. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    66,628
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I think that blade parameters thing is something graphical.
    Might be wrong though.
     
    Tingyun likes this.

Share This Page