Eh…I’m trying to read your post several times here, @kevL_s but I’m not following. I’m just confused at the moment.
Uugh, I think I’ll just post my whole script here (even though I don’t like that since now I’m beginning to spoil my module by telling exactly what happens, but nevermind…it’s not a big thing, I guess.):
MINOR SPOILERS FOR MY UPCOMING MODULE (will not be released until a year from now probably)
//kevL_s' version of my script. Shorter and more compact and easier to follow also, I guess.
//I've added and changed stuff now and some additional code that I didn't post on the vault at the time. /andgalf
#include "ginc_item"
const int APPEARANCE_TYPE_YUANTIPUREBLOOD = 40;
const int APPEARANCE_TYPE_ASSIMAR = 563;
const int APPEARANCE_TYPE_TIEFLING = 564;
const int APPEARANCE_TYPE_ELF_SUN = 565;
const int APPEARANCE_TYPE_ELF_WOOD = 566;
const int APPEARANCE_TYPE_ELF_DROW = 567;
const int APPEARANCE_TYPE_GNOME_SVIRFNEBLIN = 568;
const int APPEARANCE_TYPE_DWARF_GOLD = 569;
const int APPEARANCE_TYPE_DWARF_DUERGAR = 570;
const int APPEARANCE_TYPE_HALFLING_STRONGHEART = 571;
const int APPEARANCE_TYPE_ELF_WILD = 1036;
const int APPEARANCE_TYPE_GENASI_EARTH = 1037;
const int APPEARANCE_TYPE_GENASI_FIRE = 1038;
const int APPEARANCE_TYPE_GENASI_AIR = 1039;
const int APPEARANCE_TYPE_GENASI_WATER = 1040;
const int APPEARANCE_TYPE_HALFDROW = 1041;
void Swimming()
{
object oPC1 = GetFirstPC();
object oNelowyn = GetObjectByTag("nelowync");
object oGnome = GetObjectByTag("gnome");
object oLania = GetObjectByTag("leniac");
object oSemaphine = GetObjectByTag("semaphine");
object oTindra = GetObjectByTag("tindra");
object oFleksa = GetObjectByTag("fleksac");
int iApp; //Short for Appearance. I wouldn't have called it this if this were my own code. /andgalf
switch (GetAppearanceType(oPC1))
{
case APPEARANCE_TYPE_DWARF: iApp = 4000; break; // Dwarf_swim
case 4000: iApp = APPEARANCE_TYPE_DWARF; break;
case APPEARANCE_TYPE_ELF: iApp = 4001; break; // Elf_swim
case 4001: iApp = APPEARANCE_TYPE_ELF; break;
case APPEARANCE_TYPE_GNOME: iApp = 4002; break; // Gnome_swim
case 4002: iApp = APPEARANCE_TYPE_GNOME; break;
case APPEARANCE_TYPE_HALFLING: iApp = 4003; break; // Halfling_Swim
case 4003: iApp = APPEARANCE_TYPE_HALFLING; break;
case APPEARANCE_TYPE_HALF_ELF: iApp = 4004; break; // Half_Elf_Swim
case 4004: iApp = APPEARANCE_TYPE_HALF_ELF; break;
case APPEARANCE_TYPE_HALF_ORC: iApp = 4005; break; // Half_Orc_Swim
case 4005: iApp = APPEARANCE_TYPE_HALF_ORC; break;
case APPEARANCE_TYPE_HUMAN: iApp = 4006; break; // Human_Swim
case 4006: iApp = APPEARANCE_TYPE_HUMAN; break;
case APPEARANCE_TYPE_ASSIMAR: iApp = 4007; break; // Assimar_Swim
case 4007: iApp = APPEARANCE_TYPE_ASSIMAR; break;
case APPEARANCE_TYPE_TIEFLING: iApp = 4008; break; // Tiefling_Swim
case 4008: iApp = APPEARANCE_TYPE_TIEFLING; break;
case APPEARANCE_TYPE_ELF_SUN: iApp = 4009; break; // Elf,Sun_Swim
case 4009: iApp = APPEARANCE_TYPE_ELF_SUN; break;
case APPEARANCE_TYPE_ELF_WOOD: iApp = 4010; break; // Elf,Wood_Swim
case 4010: iApp = APPEARANCE_TYPE_ELF_WOOD; break;
case APPEARANCE_TYPE_ELF_DROW: iApp = 4011; break; // Elf,Drow_Swim
case 4011: iApp = APPEARANCE_TYPE_ELF_DROW; break;
case APPEARANCE_TYPE_GNOME_SVIRFNEBLIN: iApp = 4012; break; // Gnome,Svirfneblin_Swim
case 4012: iApp = APPEARANCE_TYPE_GNOME_SVIRFNEBLIN; break;
case APPEARANCE_TYPE_DWARF_GOLD: iApp = 4013; break; // Dwarf,Gold
case 4013: iApp = APPEARANCE_TYPE_DWARF_GOLD; break;
case APPEARANCE_TYPE_DWARF_DUERGAR: iApp = 4014; break; // Dwarf,Duergar_Swim
case 4014: iApp = APPEARANCE_TYPE_DWARF_DUERGAR; break;
case APPEARANCE_TYPE_HALFLING_STRONGHEART: iApp = 4015; break; // Halfling,Strongheart_Swim
case 4015: iApp = APPEARANCE_TYPE_HALFLING_STRONGHEART; break;
case APPEARANCE_TYPE_ELF_WILD: iApp = 4016; break; // Elf_Wild_NX1_Swim
case 4016: iApp = APPEARANCE_TYPE_ELF_WILD; break;
case APPEARANCE_TYPE_GENASI_EARTH: iApp = 4017; break; // Earth_Genasi_NX1_Swim
case 4017: iApp = APPEARANCE_TYPE_GENASI_EARTH; break;
case APPEARANCE_TYPE_GENASI_FIRE: iApp = 4018; break; // Fire_Genasi_NX1_Swim
case 4018: iApp = APPEARANCE_TYPE_GENASI_FIRE; break;
case APPEARANCE_TYPE_GENASI_AIR: iApp = 4019; break; // Air_Genasi_NX1_Swim
case 4019: iApp = APPEARANCE_TYPE_GENASI_AIR; break;
case APPEARANCE_TYPE_GENASI_WATER: iApp = 4020; break; // Water_Genasi_NX1_Swim
case 4020: iApp = APPEARANCE_TYPE_GENASI_WATER; break;
case APPEARANCE_TYPE_HALFDROW: iApp = 4021; break; // Half_Drow_NX1_Swim
case 4021: iApp = APPEARANCE_TYPE_HALFDROW; break;
case APPEARANCE_TYPE_YUANTIPUREBLOOD: iApp = 4022; break; // YuantiPureblood_Swim
case 4022: iApp = APPEARANCE_TYPE_YUANTIPUREBLOOD; break;
default: return;
}
SetCreatureAppearanceType(oPC1, iApp);
if(GetFactionEqual(oPC1,oNelowyn))
{
if(GetAppearanceType(oNelowyn) == 4006)
{
SetCreatureAppearanceType(oNelowyn,APPEARANCE_TYPE_HUMAN);
}
else if(GetAppearanceType(oNelowyn) == APPEARANCE_TYPE_HUMAN)
{
SetCreatureAppearanceType(oNelowyn,4006);
}
}
if(GetFactionEqual(oPC1,oLania))
{
if(GetAppearanceType(oLania) == 4006)
{
SetCreatureAppearanceType(oLania,APPEARANCE_TYPE_HUMAN);
}
else if(GetAppearanceType(oLania) == APPEARANCE_TYPE_HUMAN)
{
SetCreatureAppearanceType(oLania,4006);
}
}
if(GetFactionEqual(oPC1,oFleksa))
{
if(GetAppearanceType(oFleksa) == 4006)
{
SetCreatureAppearanceType(oFleksa,APPEARANCE_TYPE_HUMAN);
}
else if(GetAppearanceType(oFleksa) == APPEARANCE_TYPE_HUMAN)
{
SetCreatureAppearanceType(oFleksa,4006);
}
}
if(GetFactionEqual(oPC1,oTindra))
{
if(GetAppearanceType(oTindra) == 4006)
{
SetCreatureAppearanceType(oTindra,APPEARANCE_TYPE_HUMAN);
}
else if(GetAppearanceType(oTindra) == APPEARANCE_TYPE_HUMAN)
{
SetCreatureAppearanceType(oTindra,4006);
}
}
if(GetFactionEqual(oPC1,oSemaphine))
{
if(GetAppearanceType(oSemaphine) == 4006)
{
SetCreatureAppearanceType(oSemaphine,APPEARANCE_TYPE_HUMAN);
}
else if(GetAppearanceType(oSemaphine) == APPEARANCE_TYPE_HUMAN)
{
SetCreatureAppearanceType(oSemaphine,4006);
}
}
if(GetFactionEqual(oPC1,oGnome))
{
if(GetAppearanceType(oGnome) == 4002)
{
SetCreatureAppearanceType(oGnome,APPEARANCE_TYPE_GNOME);
}
else if(GetAppearanceType(oGnome) == APPEARANCE_TYPE_GNOME)
{
SetCreatureAppearanceType(oGnome,4002);
}
}
}
void main()
{
object oPC = GetEnteringObject();
object oPC1 = GetFirstPC();
object oPC2 = GetFirstPC(FALSE);
if (!GetIsPC(oPC)) return;
SetCutsceneMode(oPC1);
object oFM = GetFirstFactionMember(oPC1,FALSE);
while (GetIsObjectValid(oFM))
{
AssignCommand(oFM,ClearAllActions());
UnequipSlot(oFM, INVENTORY_SLOT_LEFTHAND);
UnequipSlot(oFM, INVENTORY_SLOT_RIGHTHAND);
UnequipSlot(oFM, INVENTORY_SLOT_CLOAK);
oFM = GetNextFactionMember(oPC1,FALSE);
}
SetCutsceneMode(oPC1,FALSE);
DelayCommand(1.0,Swimming());
}
So, the situation is this in detail. We are at a shore. There’s a tiny island. You click on that island to go there, and by going there you pass through a trigger with this script, which turns the characters into swimming characters. I want to make sure that they have no weapons in their hands or cloak on them when they begin swimming. Right now it works, but since I do a ClearAllActions the game doesn’t remember the player clicking on the island.
I have a way of doing it, I suppose, by making the characters moving to a waypoint that’s probably close to where the player clicked, but if that could be avoided I would be happy.