Stopping multiple giftings

Discuss the creation and scripting of new fan-made games and mods for the Fallout series of games.
Post Reply
pillbrain
SDF!
SDF!
Posts: 8
Joined: Tue Jan 27, 2004 6:23 pm

Stopping multiple giftings

Post by pillbrain »

Hey, im back with another pretty stupid question, when you finally get round to completing a mission, and you go to get a gift, how in gods name do you stop it being given to you infinite times, the code i currently have that involves this is.

#define LVAR_One_Reward (8)


procedure talk_p_proc
begin
if((not(global_var(GVAR_KILL_MAGE) == QUEST_ACCEPTED)) and (not(global_var(GVAR_KILL_MAGE) == QUEST_COMPLETED))) then begin
start_gdialog(NAME,Self_obj,4,-1,-1);
gSay_Start;
call Node01;
gSay_End;
end_dialogue;
end

else if((global_var(GVAR_KILL_MAGE) == QUEST_COMPLETED) and (not(local_var(LVAR_One_Reward) == 1))) then begin
set_local_var(LVAR_One_Reward,1);
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node06;
gSay_End;
end_dialogue;
end

else if((global_var(GVAR_KILL_MAGE) == QUEST_COMPLETED) and (local_var(LVAR_One_Reward) == 1)) then begin
floater(159);
end
end


procedure Node06
Begin
Reply(154);
NOption(157,Node999,004);
Item := create_object(PID_BRASS_KNUCKLES,0,0);
add_mult_objs_to_inven(dude_obj,item,1);

end


which the stuff relating to one reward is more or less copied directly from the shamen ( with appropriate changes for anything that needs changing ), ive also tried doing this with a map variable rather than a local var, and im also aware that its kinda stupid to have plants give you brass knucks, its just practice, honest.

So once again, if anyone has any ideas why it might keep giving the gift everytime you talk to them and how to stop it, id appreciate it.

Thanks
Pill
Temaperacl
Vault Veteran
Vault Veteran
Posts: 292
Joined: Fri Apr 19, 2002 11:51 am

Post by Temaperacl »

I can't see what the problem is- probably too tired. Anyways, one thing you could try doing is condensing it all down to one variable..

Something along the lines of this (Yes, I realize this isn't actually working Code, but..):

Code: Select all

if GVAR_KILL_MAGE==QUEST_KNOWN 
 --Has Heard about, but neither accepted nor declined
endif

if GVAR_KILL_MAGE==QUEST_COMPLETED
 --Give Reward. Increment/Change GVAR_KILL_MAGE
endif

if GVAR_KILL_MAGE==QUEST_DEFAULT_SOLVE --(or if GVAR_KILL_MAGE>QUEST_COMPLETED)
 --Already given reward
 
endif
pillbrain
SDF!
SDF!
Posts: 8
Joined: Tue Jan 27, 2004 6:23 pm

Post by pillbrain »

yeah, i managed to get it working, by changing the global var to inactive, and it seems to work now, but id still like to know why the local var wasnt working, i mean at the moment, it seems like you can pretty much always use a global to do it, but there might arise a time where i need a local and it throws a wobbler, so you know im still trying to figure that out.

but at least it finally worked, and all it took was 2 days to get the plants to get you to kill the shamen, and give you knucks for doing it :p ( with some poorly written dialog ), wasnt that quick <rolls eyes>

thanks though.
Pill
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

I checked this code and it looks good.
Local variable may not work if they are not properly initialised.
Check if in scripts.lst # local_vars number for your script is 8 or more(since your local var has number 8).
pillbrain
SDF!
SDF!
Posts: 8
Joined: Tue Jan 27, 2004 6:23 pm

Post by pillbrain »

ahh, I should have seen that, <slaps self>, the perils of trying to learn this by copying already done scripts :p, yeah, I only upped it by 1, thinking "well theres one extra local var, so it needs to go up one" so its only on 6 or 7 i think.

thanks a lot, ill try that next time, but that would make sense.

pill
Post Reply