Thanks a lot for taking this job up, CouchcaptainCharles! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid="" border="0" alt="w00t.gif" />
The format you show seems pretty good to me. It might not be perfect in every way, but I don't think it's possible to figure out a perfect format. Each format will have it's pros and cons. I think this format is good for first-time users. InternalSettings.h can have a column-like format for the more advanced users.
<!--quoteo(post=170928:date=Nov 11 2006, 06:55 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 11 2006, 06:55 PM) [snapback]170928[/snapback]</div><div class='quotemain'><!--quotec-->
So the goal of this "cleaning up" is to make the file more comprehensible and easier to use, especially for first time users, right? So all settings that go too much into the details, and those that require some modding knowledge shall be moved into InternalSettings.h, right?
Though I would move at least one setting back from internal: IMHO the surrendering of ships happens too often, and often without apparent cause, spoiling the battle for me. There may be others with the same view, and for those I'd move the surrender chance scalar into the Sea Battle section.
<!--QuoteEnd--></div><!--QuoteEEnd-->
Exactly! I agree with this wholeheartedly! <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid="" border="0" alt="yes.gif" />
<!--quoteo(post=170943:date=Nov 11 2006, 07:45 PM:name=IncredibleHat)--><div class='quotetop'>QUOTE(IncredibleHat @ Nov 11 2006, 07:45 PM) [snapback]170943[/snapback]</div><div class='quotemain'><!--quotec-->
Oh... and btw... NO_THEFT LOCKOPEN etc settings have got to be the worst setup settings in the lot. '60.0' turns it off? Eh?! '33.0' reduces change to just you ?!?!?!
<!--QuoteEnd--></div><!--QuoteEEnd-->
About the NO_THEFT LOCKOPEN etc settings: Please don't go changing the workings of these settings just yet. I have rewritten that code for Build 14 with the addition of the lockpicks, but it still works exactly the same as it always did. If this code is to be changed, it would be better if my new code is changed, otherwise I'll have to rewrite it again. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
See the bottom of this post for my rewritten code.
<!--quoteo(post=170943:date=Nov 11 2006, 07:45 PM:name=IncredibleHat)--><div class='quotetop'>QUOTE(IncredibleHat @ Nov 11 2006, 07:45 PM) [snapback]170943[/snapback]</div><div class='quotemain'><!--quotec-->
Man. Talk about confusing <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid="" border="0" alt="wink.gif" /> I don't know if you could clean those up somehow, maybe do a mass find and see where they are used and how, and see if simply toggles and then proper percentage floats can be used...
<!--QuoteEnd--></div><!--QuoteEEnd-->
Don't worry: CCC does know where these settings are used. He and Nathan <i>made</i> the mod. <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid="" border="0" alt="whistling.gif" />
From itemLogic.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// PB: Rewritten -->
int lock;
bool OpenLock = false;
if(chr.location == "Tutorial_Deck" || bDeckStarted || bCrewStarted) OpenLock = true;
// If you are on your own ship, all locks are open
if(REMEMBER_OPEN && CheckAttribute(Locations[locidx],"openboxes."+atrName)) OpenLock = true;
// If the lock has already been opened, it will stay open
if(CheckAttribute(Locations[locidx],"jammed."+atrName))
// If the lock is jammed, it will not open
{
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"This lock will not open. There seems to be a lockpick stuck in it."));
return;
}
if(!OpenLock)
// If the lock is not yet open, try to open the lock
{
lock = rand(100) + 3 * makeint(chr.skill.sneak) + LOCK_OPEN;
// Chance to open the lock
if(CheckCharacterItem(chr,"lockpick")) lock = 2 * lock;
// Having a lockpick doubles your chance of opening a lock
if(lock + NO_MINES < 20 && !CheckAttribute(Locations[locidx],"trapboxes."+atrName))
// Boobytrap: If the boobytrap already exploded, don't explode again
{
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Boobytrapped") + "!");
Explosion (chr, rand(20));
if(ONE_TRAP) Locations[locidx].trapboxes.(atrName) = true;
return;
}
if(lock < 33 && !CheckCharacterItem(chr,"lockpick"))
// Hurt yourself: You never hurt yourself if you have a lockpick
{
if(chr.sex == "woman") PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom4.wav");
else PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Your prying knife slips from the lock... into your hand!"));
AddPartyExp(chr, 50 + Rand(100));
LAi_ApplyCharacterDamage(chr, 10);
if (sti(LAi_GetCharacterHP(chr)) < 11) Lai_KillCharacter(chr);
return;
}
if(lock < 66)
// Fail to open the lock
{
if(CheckCharacterItem(chr,"lockpick"))
{
PlaySound("AMBIENT\JAIL\chains.wav");
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You failed to open the lock with your lockpick. Better try again."));
}
else
{
PlaySound("AMBIENT\JAIL\jail_door1.wav");
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You try to pick the lock with your knife... in vain!"));
}
AddPartyExp(chr, 50 + Rand(100));
return;
}
if(CheckCharacterItem(chr,"lockpick") && rand(100) < 10)
// Lockpick fails
{
PlaySound("AMBIENT\JAIL\sigh.wav"); // Player sighs because his lockpick failed
TakeItemFromCharacter(chr,"lockpick"); // One lockpick is taken away
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Your lockpick broke and got stuck in the lock!"));
Locations[locidx].jammed.(atrName) = true; // The lock can't be opened anymore
AddPartyExp(chr, 50 + Rand(100)); // You get some experience
return;
}
OpenLock = true;
}
if(OpenLock)
{
if(REMEMBER_OPEN) Locations[locidx].openboxes.(atrName) = true;
LaunchItemsBox(&ar);
}
// PB: Rewritten <--<!--c2--></div><!--ec2-->
The format you show seems pretty good to me. It might not be perfect in every way, but I don't think it's possible to figure out a perfect format. Each format will have it's pros and cons. I think this format is good for first-time users. InternalSettings.h can have a column-like format for the more advanced users.
<!--quoteo(post=170928:date=Nov 11 2006, 06:55 PM:name=CouchcaptainCharles)--><div class='quotetop'>QUOTE(CouchcaptainCharles @ Nov 11 2006, 06:55 PM) [snapback]170928[/snapback]</div><div class='quotemain'><!--quotec-->
So the goal of this "cleaning up" is to make the file more comprehensible and easier to use, especially for first time users, right? So all settings that go too much into the details, and those that require some modding knowledge shall be moved into InternalSettings.h, right?
Though I would move at least one setting back from internal: IMHO the surrendering of ships happens too often, and often without apparent cause, spoiling the battle for me. There may be others with the same view, and for those I'd move the surrender chance scalar into the Sea Battle section.
<!--QuoteEnd--></div><!--QuoteEEnd-->
Exactly! I agree with this wholeheartedly! <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid="" border="0" alt="yes.gif" />
<!--quoteo(post=170943:date=Nov 11 2006, 07:45 PM:name=IncredibleHat)--><div class='quotetop'>QUOTE(IncredibleHat @ Nov 11 2006, 07:45 PM) [snapback]170943[/snapback]</div><div class='quotemain'><!--quotec-->
Oh... and btw... NO_THEFT LOCKOPEN etc settings have got to be the worst setup settings in the lot. '60.0' turns it off? Eh?! '33.0' reduces change to just you ?!?!?!
<!--QuoteEnd--></div><!--QuoteEEnd-->
About the NO_THEFT LOCKOPEN etc settings: Please don't go changing the workings of these settings just yet. I have rewritten that code for Build 14 with the addition of the lockpicks, but it still works exactly the same as it always did. If this code is to be changed, it would be better if my new code is changed, otherwise I'll have to rewrite it again. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
See the bottom of this post for my rewritten code.
<!--quoteo(post=170943:date=Nov 11 2006, 07:45 PM:name=IncredibleHat)--><div class='quotetop'>QUOTE(IncredibleHat @ Nov 11 2006, 07:45 PM) [snapback]170943[/snapback]</div><div class='quotemain'><!--quotec-->
Man. Talk about confusing <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid="" border="0" alt="wink.gif" /> I don't know if you could clean those up somehow, maybe do a mass find and see where they are used and how, and see if simply toggles and then proper percentage floats can be used...
<!--QuoteEnd--></div><!--QuoteEEnd-->
Don't worry: CCC does know where these settings are used. He and Nathan <i>made</i> the mod. <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid="" border="0" alt="whistling.gif" />
From itemLogic.c:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// PB: Rewritten -->
int lock;
bool OpenLock = false;
if(chr.location == "Tutorial_Deck" || bDeckStarted || bCrewStarted) OpenLock = true;
// If you are on your own ship, all locks are open
if(REMEMBER_OPEN && CheckAttribute(Locations[locidx],"openboxes."+atrName)) OpenLock = true;
// If the lock has already been opened, it will stay open
if(CheckAttribute(Locations[locidx],"jammed."+atrName))
// If the lock is jammed, it will not open
{
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"This lock will not open. There seems to be a lockpick stuck in it."));
return;
}
if(!OpenLock)
// If the lock is not yet open, try to open the lock
{
lock = rand(100) + 3 * makeint(chr.skill.sneak) + LOCK_OPEN;
// Chance to open the lock
if(CheckCharacterItem(chr,"lockpick")) lock = 2 * lock;
// Having a lockpick doubles your chance of opening a lock
if(lock + NO_MINES < 20 && !CheckAttribute(Locations[locidx],"trapboxes."+atrName))
// Boobytrap: If the boobytrap already exploded, don't explode again
{
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Boobytrapped") + "!");
Explosion (chr, rand(20));
if(ONE_TRAP) Locations[locidx].trapboxes.(atrName) = true;
return;
}
if(lock < 33 && !CheckCharacterItem(chr,"lockpick"))
// Hurt yourself: You never hurt yourself if you have a lockpick
{
if(chr.sex == "woman") PlaySound("OBJECTS\VOICES\DEAD\female\dead_wom4.wav");
else PlaySound("OBJECTS\VOICES\DEAD\male\dead6.wav");
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Your prying knife slips from the lock... into your hand!"));
AddPartyExp(chr, 50 + Rand(100));
LAi_ApplyCharacterDamage(chr, 10);
if (sti(LAi_GetCharacterHP(chr)) < 11) Lai_KillCharacter(chr);
return;
}
if(lock < 66)
// Fail to open the lock
{
if(CheckCharacterItem(chr,"lockpick"))
{
PlaySound("AMBIENT\JAIL\chains.wav");
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You failed to open the lock with your lockpick. Better try again."));
}
else
{
PlaySound("AMBIENT\JAIL\jail_door1.wav");
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"You try to pick the lock with your knife... in vain!"));
}
AddPartyExp(chr, 50 + Rand(100));
return;
}
if(CheckCharacterItem(chr,"lockpick") && rand(100) < 10)
// Lockpick fails
{
PlaySound("AMBIENT\JAIL\sigh.wav"); // Player sighs because his lockpick failed
TakeItemFromCharacter(chr,"lockpick"); // One lockpick is taken away
Log_SetStringToLog(LanguageConvertString(tmpLangFileID,"Your lockpick broke and got stuck in the lock!"));
Locations[locidx].jammed.(atrName) = true; // The lock can't be opened anymore
AddPartyExp(chr, 50 + Rand(100)); // You get some experience
return;
}
OpenLock = true;
}
if(OpenLock)
{
if(REMEMBER_OPEN) Locations[locidx].openboxes.(atrName) = true;
LaunchItemsBox(&ar);
}
// PB: Rewritten <--<!--c2--></div><!--ec2-->