Beautiful pics, Petros <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid="
" border="0" alt="onya.gif" /> As for the etherbottle, I'd prefer the white one (more translucent = etheric <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="
" border="0" alt="smile.gif" /> )
As for where to put them you'd better rely on Cat or Alan, who did the facelift for the SWAK. Graphics are not my strong point <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid="
" border="0" alt="icon_mrgreen1.gif" />
<!--`QuoteBegin-Pieter` Boelen+--><div class='quotetop'>QUOTE(Pieter Boelen)</div><div class='quotemain'><!--QuoteEBegin-->Another question: Why does using "makeint(pchar.rank)" in LAi_events.c cause trouble (errors so the game won't start)? ..[/quote]
Did you define pchar as object ?
The error log usually gives you a hint what's wrong, even if the game doesn't even start. In this case it would have said something like "undeclared variable "pchar" "
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->What must be defined is the object(reference) that the attribute .wealth belongs to. If you work in a dialogfile there should already be something like ref pchar = getmaincharacter() on top. If you work in another file check if there is already another reference to the maincharacter and use that. (pchr, mchar, mc ... )
Should there be no reference at all you must define your own.<!--QuoteEnd--></div><!--QuoteEEnd-->
Here is my review of the code you posted earlier:
Nice work, Pieter. That shows that you have the necessary way of logical thinking that a coder needs. Only a few details need to be changed:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if( CheckAttribute(weapon, "disarm" ) && LAi_IsFightMode(enemy) && !bAbordageStarted && enemy.nodisarm != 1)<!--c2--></div><!--ec2-->
enemy.nodisarm != 1 will create an errormessage if the enemy character doesn't have that attribute. The program will waste some time searching in vain for that attribute in order to check if it is 1 . Missing attributes are often the cause for lurches in the game.
Better use !CheckAttribute(enemy, "nodisarm" ) instead. The program will then continue without delay if enemy has no "nodisarm" attribute, and abort the disarming procedure if you assigned one.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{
if(rand(100)< sti(weapon.disarm) +sti(attack.skill.Fencing)/2)
{
PlaySound("OBJECTSduelsword_fallen.wav");
string enemy_blade = GetCharacterEquipByGroup(enemy,BLADE_ITEM_TYPE);
RemoveCharacterEquip(enemy, BLADE_ITEM_TYPE );
TakeItemFromCharacter(enemy, enemy_blade);
GiveItem2Character(attack, enemy_blade);<!--c2--></div><!--ec2-->
You can move that whole block here cause it is the same no matter if you, your officers or someone else is being disarmed. Saves eight lines of code and two variable definitions (all costing a tiny little bit of performance).
Left is now only the code that is different for player, officers and NPCs
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> if ( enemy.chr_ai.group != LAI_GROUP_PLAYER )
{
LAi_SetCitizenTypeNoGroup(enemy);
Log_SetStringToLog("You disarmed your opponent!");
}
else
{
if ( enemy.chr_ai.group = LAI_GROUP_PLAYER && enemy.chr != PLAYER)<!--c2--></div><!--ec2-->
Must be enemy.chr_ai.group == LAI_GROUP_PLAYER. "==" for checking conditions, "=" to set a value or variable
But you can skip the whole check for LAI_GROUP_PLAYER cause you already checked != LAI_GROUP_PLAYER before the "else"
An easy check for the player would be enemy.id != "blaze"
A way to force the officer to put his imaginary sword away would be to give him a new AI task.
LAi_tmpl_afraid_SetAfraidCharacter(enemy, attack, true);
makes the officer flee from the attacker. IMHO the most realistic behaviour. To turn the panicked guy into a fighting follower again you must only talk to him and order him to follow you again. (and give him a sword)
So here is my proposal for the disarm code:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
if( CheckAttribute(weapon, "disarm" ) && LAi_IsFightMode(enemy) && !bAbordageStarted && !CheckAttribute(enemy, "nodisarm" ) )
{
if(rand(100)< sti(weapon.disarm) +sti(attack.skill.Fencing)/2)
{
PlaySound("OBJECTSduelsword_fallen.wav");
string enemy_blade = GetCharacterEquipByGroup(enemy,BLADE_ITEM_TYPE);
RemoveCharacterEquip(enemy, BLADE_ITEM_TYPE );
TakeItemFromCharacter(enemy, enemy_blade);
GiveItem2Character(attack, enemy_blade);
if ( enemy.chr_ai.group != LAI_GROUP_PLAYER )
{
LAi_SetCitizenTypeNoGroup(enemy);
Log_SetStringToLog("Opponent disarmed !");
}
else
{
if ( enemy.id != "blaze" ) // if NOT player
{
Log_SetStringToLog("One of your officers was disarmed!");
LAi_tmpl_afraid_SetAfraidCharacter(enemy, attack, true); // makes officer flee
LAi_SetAfraidDead(enemy);
}
else
{
Log_SetStringToLog("You were disarmed!");
}
}
}
} <!--c2--></div><!--ec2-->
I love the fistfight idea. An nice punching sound would be the one that the sandbag makes (see initItems.c )