Armor unequipped when loading a saved game
#1
Posté 05 juillet 2015 - 07:26
I suppose this comes from the OnEquip/OnUnequip scripts (depending on what other pieces of armor - necklace or belt - the character wears, the default appearance is changed to reflect the presence or absence of these other parts. This works well in game, so I'm sure the scripts are fine).
Question: without changing any module script (to make the armor useable everywhere), is there a way to force the OnEquip script upon loading a save?
#2
Posté 05 juillet 2015 - 10:15
Is the PC with the armor the only party member in the save? that makes things simpler when debugging because if there's other party members, messages for the PC get hidden for whatever reason. (at least on my system)
I'm thinking you should try something like this in the onPlayerEquip:
object oDebug = GetPCItemLastEquippedBy();
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oDebug);
if (GetIsObjectValid(oArmor))
SendMessageToPC(GetFirstPC(FALSE), "armor = " + GetTag(oArmor));
else
SendMessageToPC(GetFirstPC(FALSE), "no armor on Chest");you can also look in the save folder at the .IFO ( or .ROS ) file of the character ( w/ TlkEdit2 ) to see if the armor was even *saved* in the slot
but, uh, if you really want to force the onEquip script to run,
ExecuteScript("the_on_equip_script", GetModule());
#3
Posté 05 juillet 2015 - 12:40
#4
Posté 05 juillet 2015 - 01:54
I already added SendMessage statements in the OnEquip/OnUnequip scripts, and the conclusion is that they don't fire when the saved game is loaded.
try PrintString() to the logfile, if it's set up in your .Ini
#5
Posté 05 juillet 2015 - 02:09
you can also look in the save folder at the .IFO ( or .ROS ) file of the character ( w/ TlkEdit2 ) to see if the armor was even *saved* in the slot
Yep, it was saved in the armor slot, as expected.
try PrintString() to the logfile, if it's set up in your .Ini
Thanks, will try tonight.
#6
Posté 05 juillet 2015 - 05:17
try PrintString() to the logfile, if it's set up in your .Ini
Thanks a lot KevL, that gave me the information I needed (namely: if an OnEquip script calls another OnEquip script, there's no guarantee the called OnEquip script will finish BEFORE the calling script gets the focus again [too much VB programming I guess]).
Now solved, thanks again.
#7
Posté 05 juillet 2015 - 05:53
that sounds oddly like something I was banging my head against for 2hr yesterday .....
<g>





Retour en haut






