@Pieter Boelen, I'm sure you remember how "fun" you and I had with the "noExp problem". For others who want to see, check the posts starting from here: Solved - Rebalancing the Fighting System
We fixed it, but I have found more about it that can be good to know for other cases. The game apparently does not like "else if" even though it supposedly is valid in C and/or C++:
For some reason this caused the problems. It is avoided by doing this instead:
With this "bool noExp = false;" can be on one line.
However, following @Levis' example for ranged weapons, I changed it to be like this instead:
This also avoids the problem and allows for other abilities to modify the chance of scoring a critical hit.
So, it can be good to know that it seems to be best to avoid "else if" with this game and in similar cases instead put the if statement inside the else statement.
Chance of critical hit with abilities also seemed to be too high for ranged weapons, so some changes to that and the ability descriptions are also included.
We fixed it, but I have found more about it that can be good to know for other cases. The game apparently does not like "else if" even though it supposedly is valid in C and/or C++:
Code:
if(IsCharacterPerkOn(attack, "SwordplayProfessional"))
{
if(rand(100) <= 25)
{
critical = damage*2.0;
}
}
else if(IsCharacterPerkOn(attack, "CriticalHit"))
{
if(rand(100) <= 10)
{
critical = damage*2.0;
}
}
else
{
if(rand(100) <= 5)
{
critical = damage*2.0;
}
}
Code:
if(IsCharacterPerkOn(attack, "SwordplayProfessional"))
{
if(rand(100) <= 25)
{
critical = damage*2.0;
}
}
else
{
if(IsCharacterPerkOn(attack, "CriticalHit"))
{
if(rand(100) <= 10)
{
critical = damage*2.0;
}
}
else
{
if(rand(100) <= 5)
{
critical = damage*2.0;
}
}
}
However, following @Levis' example for ranged weapons, I changed it to be like this instead:
Code:
int critchance = 5;
if(IsCharacterPerkOn(attack, "CriticalHit")) critchance += 5;
if(IsCharacterPerkOn(attack, "SwordplayProfessional")) critchance += 15;
if(rand(100) <= critchance)
{
critical = damage*2.0;
}
So, it can be good to know that it seems to be best to avoid "else if" with this game and in similar cases instead put the if statement inside the else statement.
Chance of critical hit with abilities also seemed to be too high for ranged weapons, so some changes to that and the ability descriptions are also included.
Attachments
Last edited: