I apologize in advance if such questions have already been asked here, I am a Russian guy who can only communicate through an interpreter, it is difficult for me. If you know where I can find answers to them, send a link. Thanks!
Begin. I’m just starting to learn scripts, so far I use already created ones. I want to create an emerging Rest Area trigger. The player speaks with NPCs, the dialogue triggered the script “Activate\the Occurrence of a trigger Rest Zone”, the conversation ends, the player goes to the lounge, resting, it turns out, the script runs “Off\the disappearance of the trigger Rest Zone”.
I already have scripts for working Rest Area (entry\exit). Help to write a script Activation. Thanks!
At first I tried to make it myself. Used two Waypoints, one in a place inaccessible to the player, the other is in the right place of occurrence. Drew a Rest Area trigger in an inaccessible location.
Created a script for the dialogue.
void main()
{
object oRe = GetObjectByTag("TRIG_REST_ZONE");
object oRePoint1 = GetWaypointByTag("REST_ZONE_POINT_1");
AssignCommand(oRe,JumpToObject(oRePoint1));///the trigger arrives in the desired zone
}
Add to the entry in the trigger script.
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC))
return;
SetLocalInt(oPC, "RESTZONE", 1);
FloatingTextStringOnCreature("Вы в зоне отдыха. Можно отдыхать.", oPC);
string sMess = GetName(OBJECT_SELF);
if (sMess != "")
DelayCommand(1.4, AssignCommand(oPC, SpeakString(sMess)));
}
I add a script to exit the trigger.
void main()
{
object oPC = GetExitingObject();
object oRePoint2 = GetWaypointByTag("REST_ZONE_POINT_2");
if (!GetIsPC(oPC))
return;
SetLocalInt(oPC, "RESTZONE", 0);
FloatingTextStringOnCreature("Вы покинули зону отдыха. Отдых невозможен.", oPC);
AssignCommand(oRe,JumpToObject(oRePoint2)); ///the trigger flies into the inaccessible zone
}
What am I doing wrong? Maybe you don’t need to use AssignCommand? Just Jump To an Object or ActionJunpToObject? I need the Zone to appear through dialogue with the NPC and disappear when leaving it. Thanks!