Stuporstar
First time out of the vault
Hi there. I'm pretty new to Fallout 2 modding, but I've been modding Morrowind for almost two decades (and am well familiar with how finicky C-based scripting can be). I've managed to figure out most of the tools and basic syntax already, as well as working with the various header macros. Anyway, I've been working on a mini-mod to extend the timer for Arroyo, using the RPU as a base. I've got the basic mini quests and dialogue all working, but after weeks of figuring out this stuff myself, I'm completely stumped on this problem.
Specifically, this line is returning 0 when it shouldn't be:
I'll add some context. This is the whole bit (everything I'm not currently testing commented out), inside procedure map_update_p_proc:
What happens is I get a "0 exp" message after I give the pelts to the Elder. I've tried all sorts of things, like making a #define for that variable instead, but it just doesn't work.
I tried testing with this instead:
Then in-game I pick the lock, stick some hides in the chest, and then give one to the elder to trigger the map var. I get the right number in the chest in the "x exp" message. So it seems the chest can read its own inventory just fine -- it just refuses to do so with the elder.
I've thought of a few workarounds that involve moving the elder's whole inventory back and forth (and dealing with the UP's anti-stealing bit), which I can try. But would that require making a chest with a unique PID like the trader chests? I'd also just like to know if this (reading other object's inventory) is just something the scripts can't handle or if I'm missing something here.
Specifically, this line is returning 0 when it shouldn't be:
Code:
Item_Added:=(obj_is_carrying_obj_pid(PID_ARROYO_ELDER,PID_GOLDEN_GECKO_PELT));
I'll add some context. This is the whole bit (everything I'm not currently testing commented out), inside procedure map_update_p_proc:
Code:
variable Item_Count;
variable Item_Adjust;
variable Item_Added;
if (map_var(MVAR_Hides_Given) > 0) then begin // this is working in the elder's script
// Item_Count:=self_item_count(PID_GOLDEN_GECKO_PELT);
Item_Added:=(obj_is_carrying_obj_pid(PID_ARROYO_ELDER,PID_GOLDEN_GECKO_PELT)); // BROKEN!
give_xp(Item_Added); // using as a temporary debug message I can see in the message box
set_map_var(MVAR_Hides_Given, 0); // so it doesn't spam
// if (map_var(MVAR_Hides_Given) > Item_Count) then begin // hides have either been given or stolen
// Item_Added := obj_is_carrying_obj_pid(PID_ARROYO_ELDER,PID_GOLDEN_GECKO_PELT);
// if (Item_Added > 0) then begin
// Item_Adjust := rm_mult_objs_from_inven(PID_ARROYO_ELDER, PID_GOLDEN_GECKO_PELT, Item_Added);
// add_mult_objs_to_inven(self_obj, PID_GOLDEN_GECKO_PELT, Item_Adjust);
// Number_Days := (Item_Added * 30);
// inc_global_var_amt(GVAR_ARROYO_RELIEF, Number_Days);
// end
// else begin // hides likely stolen from chest - but it's triggering every time
// Amount_Stolen := (map_var(MVAR_Hides_Given) - Item_Count);
// Number_Days := (Amount_Stolen * 30);
// set_map_var(MVAR_Hides_Given,Item_Count);
// dec_global_var_amt(GVAR_ARROYO_RELIEF, Number_Days);
// call stolen_from;
// end
// end
end
What happens is I get a "0 exp" message after I give the pelts to the Elder. I've tried all sorts of things, like making a #define for that variable instead, but it just doesn't work.
I tried testing with this instead:
Code:
if (map_var(MVAR_Hides_Given) > 0) then begin // this is working in the elder's script
Item_Count:=self_item_count(PID_GOLDEN_GECKO_PELT);
// Item_Added:=(obj_is_carrying_obj_pid(PID_ARROYO_ELDER,PID_GOLDEN_GECKO_PELT)); // BROKEN!
give_xp(Item_Count); // using as a temporary debug message I can see in the message box
set_map_var(MVAR_Hides_Given, 0); // so it doesn't spam
end
Then in-game I pick the lock, stick some hides in the chest, and then give one to the elder to trigger the map var. I get the right number in the chest in the "x exp" message. So it seems the chest can read its own inventory just fine -- it just refuses to do so with the elder.
I've thought of a few workarounds that involve moving the elder's whole inventory back and forth (and dealing with the UP's anti-stealing bit), which I can try. But would that require making a chest with a unique PID like the trader chests? I'd also just like to know if this (reading other object's inventory) is just something the scripts can't handle or if I'm missing something here.