Is this a problem in the long term to multiply scripts?
And something else, where should I put my nose first to prevent flying objects not following the lift moves?
Here's the descending script:
void main()
{
int nValue;
object oTarget;
object oSpawn;
object oAll;
// Get the creature who triggered this event.
object oPC = GetLastUsedBy();
// Have the PC perform a sequence of actions.
AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND)));
AssignCommand(oPC, ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND)));
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 2.0));
// Activating pulleys.
oTarget = GetWaypointByTag("WP_DTC_P_5001s");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southpull_02", GetLocation(oTarget));
oTarget = GetWaypointByTag("WP_DTC_P_5002s");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southpull_22", GetLocation(oTarget));
// Find the location to which to teleport.
oTarget = GetWaypointByTag("WP_DTC_LP_3911s_down");
// Moving the lift down.
oTarget = GetWaypointByTag("WP_DTC_L_3911s");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_01", GetLocation(oTarget));
oTarget = GetWaypointByTag("WP_DTC_L_3912s");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_02", GetLocation(oTarget));
oTarget = GetWaypointByTag("WP_DTC_L_3913s");
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "dtc_southlift_03", GetLocation(oTarget));
// Adjusts lift height.
SetLocalInt(oSpawn, "LV_DTC_Southernliftheight", 1);
// Get everything/one who is on the lift
object oTrigger=GetNearestObjectByTag("Trigger_DTC_LP_a");
object oInTrigger=GetFirstInPersistentObject(oTrigger, OBJECT_TYPE_CREATURE | OBJECT_TYPE_ITEM);
// Confirms PC is on the lift.
SetLocalInt(oInTrigger, "LV_DTC_isonsouthernlift", 1);
while (GetIsObjectValid(oInTrigger))
{
// Teleport everything/one
DelayCommand (2.0, AssignCommand(oInTrigger, ClearAllActions()));
DelayCommand (2.5, AssignCommand(oInTrigger, JumpToObject(oTarget)));
oInTrigger=GetNextInPersistentObject(oTrigger, OBJECT_TYPE_CREATURE | OBJECT_TYPE_ITEM);
}
// Stops pulleys (not fully effective until this script ends).
DelayCommand (5.0, DestroyObject(GetObjectByTag("DTC_Southernpulley_02")));
DelayCommand (5.0, DestroyObject(GetObjectByTag("DTC_Southernpulley_22")));
// Destroy the lift up.
DelayCommand (2.0, DestroyObject(GetNearestObjectByTag("DTC_Southernlift_01")));
DelayCommand (2.0, DestroyObject(GetNearestObjectByTag("DTC_Southernlift_02")));
DelayCommand (2.0, DestroyObject(GetNearestObjectByTag("DTC_Southernlift_03")));
}
Modifié par Ribouldingue, 21 février 2013 - 09:49 .