I then found a problem, what if, in situations where the variable would be increase by 5 and this would push it ABOVE 30 (which is the max)... how could I find my way around it. I decided to test the current value of the variable to see if its above 25, in which case, instead of adding 5 to it, I'd just set it to 30 to stop it from going over.
Wasn't sure how to put it in a frame, so I put the code in a quote.
void main()
{ int nValue;
// The PC //
object oPC = GetPCSpeaker();
// If the local integer is more than 25. //
if ( GetLocalInt(oPC, "npc_elf_fatherRS") > 25 )
{
// Set local integer. //
SetLocalInt(oPC, "npc_elf_father", 30);
} else
{
// Set local integer. //
nValue = GetLocalInt(oPC, "npc_elf_father") + 5;
SetLocalInt(oPC, "npc_elf_father", nValue);}
But now I run into my next pitfall, which I probably should have found out first... As I stated, some of things the father could say is dependant on what type of relationship the PC shares with him. However, these values are intergers not strings. Therefore, my question: Is it possible to test for a value inbetween 2 values? For example, to test for a loveful relationship, a value between 30-21. If this is not possible, could I work around it somehow?
Modifié par simomate2, 22 mars 2013 - 10:45 .





Retour en haut






