Got two scripts for you code monkeys to look at. My code-fu is dicey at best…
Ok. I’ll try to make this succinct.
I want the script below to check the PC’s body size and then create some floaty text input.
That part of the script is firing well so far.
#include "x3_inc_string"
void ClearAndJumpToObject(object oDestination);
void ClearAndJumpToObject(object oDestination)
{
ClearAllActions();
JumpToObject(oDestination);
}
void main()
{
effect eVFX;
object oTarget;
// Get the creature who triggered this event.
object oPC = GetClickingObject();
// Set a local integer.
SetLocalInt(oPC, "APPEARANCE_SET__", 1);
// If the PC is a certain class.
if ( GetCreatureSize(oPC) == CREATURE_SIZE_LARGE ||
GetCreatureSize(oPC) == CREATURE_SIZE_MEDIUM )
{
// Have text appear over the PC's head.
string sTalk = "It would appear you're too fat to fit through the creviced bramble...!";
string sRGB = StringToRGBString(sTalk, STRING_COLOR_GREEN);
FloatingTextStringOnCreature(sRGB, oPC, FALSE);
}
// Else, if the PC's appearance.
else if ( GetAppearanceType(oPC) == APPEARANCE_TYPE_KOBOLD_B ||
GetAppearanceType(oPC) == APPEARANCE_TYPE_GOBLIN_B||
GetAppearanceType(oPC) == APPEARANCE_TYPE_GNOME_NPC_FEMALE ||
GetAppearanceType(oPC) == APPEARANCE_TYPE_BAT ||
GetAppearanceType(oPC) == APPEARANCE_TYPE_BADGER||
GetAppearanceType(oPC) == APPEARANCE_TYPE_WILL_O_WISP)
{
// Find the location to which to teleport.
oTarget = GetWaypointByTag("LOK_LOK");
// Teleport the PC.
eVFX = EffectVisualEffect(VFX_IMP_UNSUMMON);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC);
DelayCommand(3.0, AssignCommand(oPC, ClearAndJumpToObject(oTarget)));
}
}
and the second bit of code -
type or paste code here
void main()
{
object oPC = GetPCSpeaker();
SetLocalInt(OBJECT_SELF, GetName(oPC), TRUE);
switch ( d6(1) )
{
if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) )
return;
SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
case 1: SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_KOBOLD_B); break;
case 2: SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GOBLIN_B); break;
case 3: SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_GNOME); break;
case 4: SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_BAT); break;
case 5: SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_BADGER); break;
case 6: SetCreatureAppearanceType(oPC, APPEARANCE_TYPE_WILL_O_WISP); break;
}
}
It’s the next part where I check the conditional for the PC’s appearance that is holding everything up.
The idea is to check to see if the PC’s appearance is set to the desired effect. There is a second script where, from a conversation file the PC’s appearance is changed. All appearances types are of the small variety (I believe),