Why isnt this working?
vonstorm
Member Posts: 66
I have a conversation with a realtor that sells properties. When the realtor sells a property it gives the deed and marks the item as sold.
Then each property in the conversation tree checks to see if its available to show up in the conversation
Problem is that the property is still showing up after its sold -
What am I doing wrong?
void main() { // Get the PC who is in this conversation. object oPC = GetPCSpeaker(); string pcname = GetName (oPC); // Give deed to the PC. CreateItemOnObject("deedwork003", oPC); // mark property as sold SetCampaignInt ("housing","workshop3",1,oPC); // debug int itest = GetCampaignInt("housing","workshop3",oPC); string stest = IntToString (itest); FloatingTextStringOnCreature ("Int is now "+stest, oPC); // assign name for sign SetCampaignString ("housing","workshop3",pcname,oPC); // Take 10000 gold from the PC. TakeGoldFromCreature(10000, oPC, TRUE); }
Then each property in the conversation tree checks to see if its available to show up in the conversation
int StartingConditional() { // Inspect local variables object oPC = GetPCSpeaker (); if(GetCampaignInt("housing", "workshop3",oPC) > 0) return FALSE; return TRUE; }
Problem is that the property is still showing up after its sold -
What am I doing wrong?
0
Comments
Have you tried getting and setting your campaign ints without passing the oPC but passing OBJECT_INVALID instead? In your script as it is now I'm thinking that if PC Tom buys the property and then later PC Bob comes by the call to GetCampaignInt("housing", "workshop3",oPC) in StartingConditional will return 0 because oPC at that time will be Bob rather than Tom whom the variable was attached to in the SetCampaignInt command.
Ill play with it and see if it makes a difference. Thanks for taking the time, its the small things like this that are killing me