Aller au contenu

Photo

Neutral alignment check?


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Xeneize

Xeneize
  • Members
  • 133 messages

Hello again!

 

I am wondering if there is a way to create a script that checks for all three Neutral alignments, instead of having to create three different scripts for Lawful Neutral, True Neutral and Chaotic Neutral?

 

It would really save some space to learn how. Thanks in advance.



#2
Tchos

Tchos
  • Members
  • 5 072 messages

What about Neutral Good or Neutral Evil?  If you don't care about those, then in conversations, you could use the two gc_ script that check for good or evil, and set them to "not" and "and".  That will return "true" for the three you cite.



#3
Xeneize

Xeneize
  • Members
  • 133 messages

No, I am looking for things that are neither evil or good, that checks for all those three alignments I mentioned above. Is it possible?

 

Apparently, putting Any Good or Any Evil and then toggling them both as 'Not' doesn't seem to be working :S



#4
4760

4760
  • Members
  • 1 213 messages

You're looking for something like this?

int GetAlignment(object oCreature)
{
	/*
	IP_CONST_ALIGNMENT_LG = 0
	IP_CONST_ALIGNMENT_LN = 1
	IP_CONST_ALIGNMENT_LE = 2
	IP_CONST_ALIGNMENT_NG = 3
	IP_CONST_ALIGNMENT_TN = 4
	IP_CONST_ALIGNMENT_NE = 5
	IP_CONST_ALIGNMENT_CG = 6
	IP_CONST_ALIGNMENT_CN = 7
	IP_CONST_ALIGNMENT_CE = 8
	*/
	int intGoodEvilPC = GetAlignmentGoodEvil(oCreature);
	int intLawChaosPC = GetAlignmentLawChaos(oCreature);
	if (intLawChaosPC == ALIGNMENT_LAWFUL) intLawChaosPC = 0;
	else if (intLawChaosPC == ALIGNMENT_CHAOTIC) intLawChaosPC = 2;
	else intLawChaosPC = 1;
	if (intGoodEvilPC == ALIGNMENT_GOOD) intGoodEvilPC = 0;
	else if (intGoodEvilPC == ALIGNMENT_EVIL) intGoodEvilPC = 2;
	else intGoodEvilPC = 1;
	return intLawChaosPC * 3 + intGoodEvilPC;
}
void main() // or startingconditional
{
    object oPC = GetFirstPC() // change to GetEnteringObject, GetItemActivator, GetPCSpeaker etc. depending on what fires the script
    if ((GetAlignment(oPC) == 1) || (GetAlignment(oPC) == 4) || (GetAlignment(oPC) == 7))
    {
        // conditions met, code for Neutral characters goes here
    }
    else
    {
        // character is good or evil
    }
}


#5
Loki_999

Loki_999
  • Members
  • 430 messages

int iAlign = GetAlignmentGoodEvil(oCreature);

if (iAlign == ALIGNMENT_EVIL || iAlign == ALIGNMENT_GOOD)

{

 // we are not neutral

}

else

{

// we are not neutral

}



#6
Xeneize

Xeneize
  • Members
  • 133 messages

I guess to specify a little further, I am trying to add a script to a specific part of a conversation that will only shoot up if you are Neutral aligned.



#7
andysks

andysks
  • Members
  • 1 652 messages

This comes from Lilacs.

 

int StartingConditional()
{
    // Get the PC who is involved in this conversation
    object oPC = GetPCSpeaker();

    // The PC's alignment must be true neutral.
    if ( GetAlignmentGoodEvil(oPC) != ALIGNMENT_NEUTRAL  ||
         GetAlignmentLawChaos(oPC) != ALIGNMENT_NEUTRAL )
        return FALSE;

    // If we make it this far, we have passed all tests.
    return TRUE;
}
 



#8
Loki_999

Loki_999
  • Members
  • 430 messages

And name the script something like gc_is_ge_neutral

 

If you don't start the script name with gc_ it will not show in the script list for convo conditions.  Still works, you just need to type in the full script name in.



#9
andysks

andysks
  • Members
  • 1 652 messages
I really think it shows up...

#10
Tchos

Tchos
  • Members
  • 5 072 messages

He means that it doesn't show up in the filtered script list in the conversation dropdown at first, because it automatically adds a "gc_" prefix into the filter to show only those scripts.  If you remove the filter, all scripts appear.



#11
Loki_999

Loki_999
  • Members
  • 430 messages

Yup, that's what i meant.



#12
Xeneize

Xeneize
  • Members
  • 133 messages

Thanks for the help with this guys, really appreciated :)