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.

Tutorial MODDING TIP - How to Remove Equipment from Officers and Give Them New Weapons

Discussion in 'TheBlackKnight's Mods and Guides' started by TheBlackKnight, Apr 4, 2014.

  1. TheBlackKnight

    TheBlackKnight Corsaire Flibustier Storm Modder

    Dec 2, 2013
    Professional Engineer Retired Army Officer

    This came up recently by a player who wanted to upgrade his officers equipment to something completely different in CoAS but could not do so as the game intelligence "chooses" the best equipment, and you cannot force them to unequip weapons after you give them weapons in game.
    This commonly happens when a weapon may have a wider weapon damage range, and lowest damage is smaller than the weapon you want him/her to use.

    This is generally true for most officer models and many hero models, and can also be overridden via code (and always allow you to unequip them yourself), but that is another topic altogether.

    SO, here is another mystery of the Akella script game code revealed for Storm Modders and Players...

    This requires creating a console.c script to override the game.
    This is not a "bug" fix, but gives you some more control over your character's officers.
    Open up your text editor and use the following text:

    void ExecuteConsole()
    ref chr = GetCharacter(sti(pchar.Fellows.Passengers.navigator));
    int i;
    int limit;

    Log_SetStringToLog("Executed Console");

    TakenItems(chr, "pistol31", -1)

    Log_SetStringToLog("Officer Item Removed!!!");

    This is ONLY an example of removing 1 Corsaire Captain's Pistol from the Navigator Officer (on land only) from GOF Eras.

    Save the file as console.c

    Key Points in the script code:
    1) chr = <<<Defines the character you want to check

    2) pchar.Fellows.Passengers.navigator <<< Defines which Player Officer you want to check
    The following codes and titles are used for the default game officers:
    fighter1, fighter2, fighter3, navigator, boatswain, cannoner, doctor, treasurer, carpenter
    Insert the one you want to access in the code

    3) TakenItems(chr, "pistol31", -1) <<<Defines which character (that you established above), the item you want to modify or add from items_describe.txt from the resources/text/russian, and quantity to add or remove
    You need to know the item code from its description properly from the mod you are using and it must be able to be generated "in world", in order for this to work.

    Start your game, load your game, press "F4".

    If you write the console.c script as described, the console will report the action as completed, "Officer Item Removed!!!"

    Then check the inventory and the item/weapon will be gone from the officer character, and you can continue the game normally with no ill effects and give him/her new equipment that you want.

    Due to the way the the console actions works, the game will not recognize the new weapon as added to officer's inventory as a weapon until you give and take the weapon TWICE, because you removed the weapon from the officer's inventory out of game world engine context.
    After you give him/her the weapon the SECOND time, the officer will then re-equip the weapon as their new "effects".

    This code should NOT be used with Humphrey Douglas or any musketoon officer as this WILL break your game due to animation file errors with the loss of a weapon.

    Last edited: Apr 4, 2014

Share This Page