Jump to content

Change/Remove Gear Scripts?


Recommended Posts

I am trying to redress some npcs and Eleanor Cousland is giving me grief. I have her in a hat to start hoping when it cut to night scene she'd remove it when she changed gear—but of course she didn't. Are these scripts? does anyone know where or what causes these "change or remove gear" actions?

Edited by HollownessDevoured
Link to comment
Share on other sites

I would check before the scripts if there might be a copy of the NPC in use for the night scenes.

(The new setting also does not affect prerendered cutscenes in case there might be one in this context.)

Link to comment
Share on other sites

Yes, the scripts handle equipping/unequipping characters for cutscenes. Such as the scene where Soris rescues you in the City Elf origin, except this scene is a bit bugged in vanilla game and so the weapons Duncan gives him simply end up in your inventory and you have to manually equip them (the code that would equip you with the weapons already exist but they call the wrong objects - whether this is an actual bug or not is up for debate).

 

In Eleanor's case, the script you'd want to look into is named bhn200ar_castle_after_siege. If I'm not mistaken, anyway; I haven't actually played with it.

Edited by DLuf
Link to comment
Share on other sites

Yeah, I was looking at the human noble scripts last night but it was before bed so I didn't get to look thoroughly enough. Thanks!

 

edit: hmm, I still don't see the script that seems to define Eleanor's re-equipping.

Edited by HollownessDevoured
Link to comment
Share on other sites

edit: hmm, I still don't see the script that seems to define Eleanor's re-equipping.

It is in bhn200ar_castle_after_siege (the area load script) under the case for EVENT_TYPE_AREALOAD_PRELOADEXIT

 

The script gets references for the boots, gloves, and armor in her inventory and then equips them.

 

Since she is wearing a hat you wish to remove, you can add this:

 

    object oHat = GetItemInEquipSlot(INVENTORY_SLOT_HEAD,oMother);
    UnequipItem(oMother,oHat);

in that section, recompile it, and it should remove the hat.

Link to comment
Share on other sites

Ok, now trying to remove the items from inventory but it keeps saying:

E: 13:39:53 - bhn200ar_castle_after_siege.nss - bhn200ar_castle_after_siege.nss(248): Variable defined without type (while compiling var_constants_h.nss)

Original:

                UT_RemoveItemFromInventory(rGEN_IM_CTH_NOB_AF0,1,oMother);  

Mine (a custom UTI):

                UT_RemoveItemFromInventory(rLADYS_DARK_FORMAL_DRESS,1,oMother);  
Link to comment
Share on other sites

 

Ok, now trying to remove the items from inventory but it keeps saying:

E: 13:39:53 - bhn200ar_castle_after_siege.nss - bhn200ar_castle_after_siege.nss(248): Variable defined without type (while compiling var_constants_h.nss)

Original:

                UT_RemoveItemFromInventory(rGEN_IM_CTH_NOB_AF0,1,oMother);  

Mine (a custom UTI):

                UT_RemoveItemFromInventory(rLADYS_DARK_FORMAL_DRESS,1,oMother);  

 

When you see something in all caps, it's probably a constant. They threw a lower case r in front of it to indicate that its data type is resource. Constants must be defined somewhere, and are often in header files (header filenames typically end with _h).

 

Notice the script bhn200ar_castle_after_siege has this at the top:

#include "bhn_constants_h"

 

 

 

... which includes the header file for that origin (bhn is background human noble), and in that included file, this constant is defined:

const resource rGEN_IM_CTH_NOB_AF0 = R"gen_im_cth_nob_af0.uti";

When source code is compiled, a preprocessor goes through and replaces all of the constants with their actual values before the compile takes place. You can either define constants for your custom things or just use the actual resource names.

 

This:

UT_RemoveItemFromInventory(rGEN_IM_CTH_NOB_AF0,1,oMother);

 

 

 

works identically to this:

UT_RemoveItemFromInventory(R"gen_im_cth_nob_af0.uti",1,oMother);

in actual practice.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...