Aller au contenu

Photo

Can triggers work this way?


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

#1
elkwolf

elkwolf
  • Members
  • 54 messages
Through the wiki tutorial I successfully made a trigger to transport me to another area.  What I want to do now is make a trigger that will transport me to another part of the same area.  I tried doing this by setting:


TRIGGER_AT_DEST_AREA_TAG - to the same area 
    TRIGGER_AT_DEST_TAG- to a waypoint somewhere else in the area

when I try out the module and i walk over the trigger the hud dissapears and the game pauses like it is going to load (no loading screen) and then my guy just continues walking where he was when the game paused.  I don't get transported anywhere.  Any ideas? 

#2
elkwolf

elkwolf
  • Members
  • 54 messages
I couldn't find it on wiki...anywhere else I should search?

#3
BioSpirit

BioSpirit
  • Members
  • 261 messages
I am pretty sure that it can be done but you may need to use a scripts. There are functions like CommandJumpToLocation(), SetLocation(). I can give it a try in my area.

#4
BioSpirit

BioSpirit
  • Members
  • 261 messages
Run this script with a trigger and you party will be teleported into a new location.

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "sys_ambient_h"

void main()
{
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
  
    switch(nEventType)
    {
        ////////////////////////////////////////////////////////////////////////
        // Sent by engine when trigger spawns into the game. Occurs once,
        // regardless of save games.
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_SPAWN:
        {
            break;
        }

        ////////////////////////////////////////////////////////////////////////
        // Sent by engine when a creature enters the trigger
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_ENTER:
        {
            object oCreature = GetEventCreator(ev);
            object oPC = GetMainControlled();
           
            if(oPC == oCreature)
            {
                location lLocation = GetLocation(GetObjectByTag("jump_test_wp"));
                command Cmd1 = CommandJumpToLocation(lLocation);
                AddCommand(oPC, Cmd1);
            }

            break;
        }

        ////////////////////////////////////////////////////////////////////////
        // Sent by engine when creature exits the trigger
        ////////////////////////////////////////////////////////////////////////
        case EVENT_TYPE_EXIT:
        {
            break;
        }

    }
}


#5
dncollins64

dncollins64
  • Members
  • 9 messages
I tried running this script, but it's not working for me. I assume the jump_test_wp is your waypoint tag. Since I'm not able to get a trigger running by entering into a certain area (not through a door or transitioning into a new area, but just moving along and pass into the trigger area), I've been trying to run it with a placeable. I know I'm getting the trigger to work because I'm using a cutscene script on the trigger and not with the placeable, and the cutscene is going off. But that's not what I'm looking for; what I want is to activate a trigger and be teleported to a different area. I have the script above for the trigger script, the variable 2DA set to var_trigger, and the variables TRIGGER_AT_DEST_AREA_TAG and TRIGGER_AT_DEST_TAG set to the areas resource name and the waypoints tag.

I know this thread is old, but I'm getting a little desperate at this point. Really hope you can help me out if you see this.