Might I sugest you make this easier by just having the check in CheckCoastGuard:
and change it into this:Code:if(PChar.location == PChar.quest.contraband.CurrentPlace) { float chance_get_caught = GetEventData(); if(Rand((100*SMUGGLING_TIME_CHANCE_MULT))<=chance_get_caught) { if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Coastguard found you!"); Lai_QuestDelay("Rand_ContrabandInterruption",1.0); StopCoastGuardCheck(); } if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING caught chance is "+chance_get_caught+" in "+(100*SMUGGLING_TIME_CHANCE_MULT)); if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Evaded the Coastguard (for now)"); } if(dialogRun || dialogSelf){ SetEventHandler("PauseCoastGuardCheck","PauseCoastGuardCheck",1); PostEvent("PauseCoastGuardCheck",5000,"f",chance_get_caught); } else PostEvent("CheckCoastGuard",5000,"f",chance_get_caught);
Code:if(PChar.location == PChar.quest.contraband.CurrentPlace && (!dialogRun || !dialogSelf)) { float chance_get_caught = GetEventData(); if(Rand((100*SMUGGLING_TIME_CHANCE_MULT))<=chance_get_caught) { if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Coastguard found you!"); Lai_QuestDelay("Rand_ContrabandInterruption",1.0); StopCoastGuardCheck(); } if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING caught chance is "+chance_get_caught+" in "+(100*SMUGGLING_TIME_CHANCE_MULT)); if(DEBUG_SMUGGLING>1) TraceAndLog("SMUGGLING Evaded the Coastguard (for now)"); } PostEvent("CheckCoastGuard",5000,"f",chance_get_caught);
yeah I tried keeping it in the function but I couldnt make it work what it does now works, but apart from the &&|| thing it looks like a solid plan, so definitly feel free to optimize it!
alright, gonna see what I can doThe random number generator from POTC isn't that good with numbers under 10. The distribution isn't really random. I'd sugest multiplying your numbers a bit so instead of doing a D3 you do a D30, your changes will stay the same but the random number generator of potc will work better with numbers of 10 and higher.
would something like this work?
Code:
// DeathDaisy: 3d6 persuasion system based on leadership and luck so far
int PersuadeInt;
int ThreeDice;
int pLeadership = CalcCharacterSkill(PChar,SKILL_LEADERSHIP);
int pLuck = CalcCharacterSkill(PChar,SKILL_SNEAK);
int PersuasionChance = 3+(rand(pLuck*10)/10)+pLeadership-(getSmugglingState(smugisland)-1);
if(CheckCharacterPerk(PChar,"Trustworthy")) PersuasionChance = PersuasionChance+1;
if(CheckCharacterPerk(PChar,"IronWill")) PersuasionChance = PersuasionChance+1;
PersuasionChance = iClamp(4,16,PersuasionChance);
Code:
// DeathDaisy: Roll 3 six-sided dice to determine success for a nice bell curve
ThreeDice = round(((rand(50)+10)+(rand(50)+10)+(rand(50)+10))/10);
youre very right, the stats and costs are pretty much just placeholders, they dont actually do anything other than exist rn was planning on locking the second one for later levels and increasing the costs somewhat. and deffo gotta go through and add more uses for them in dialogs all around before they make sense I'll make a thread for help with what they should do and balancing if/when theyre a bit better implementedIt's a good start for these perks, do check if you also assigned them for the right officerroles so officers can also have them .
But personally I prefer to have perks not serve a single purpose but have them expand more. But we can maybe find some more place where there is a attempt of persuation in sidequests etc, and add a check for this here , I'll leave that up to you. One thing which comes mind is the haggling for the officer price. You can sometimes talk this down. Maybe this perk could help you here. Also Persuading a captain to give up instead of fight migth be a good place to add these perks.
Personally I would only add 1 perk but that's up to you , altough I do think having 10% more leadership can cost you more than just 1 perk point .