Skip to content

Using an NPC to trigger an area transition.

MuttleyMuttley Member Posts: 65
I know it can be done I just don't know how.

Basically I want an NPC 'ship captain' to have a conversation where if the player selects 'yes' then the player gets transported to a new area.

Comments

  • ProlericProleric Member Posts: 1,281
    My Travel Builder package does that.

    It might be OTT for your purposes,but it does ensure that everyone and everything on the ship travels to the new location.

    ...or, for a minimal approach, the Captain's Action Taken script can use AssignCommand to give the PC an ActionJumpToLocation. If the Captain needs to be at the new location, too, give them an ActionJumpToLocation as well.
  • Pixel_MayhemPixel_Mayhem Member Posts: 61
    I just know I'm going to embarrass myself again but what the heck I'll give you the minimal script that you put on the "ActionsTaken" tab to achieve what you need. Although Proleric's Travel Builder is way more fancy ;)
    void main()
    {
    	object oPC = GetPCSpeaker();
    	location oTarget = GetLocation(GetWaypointByTag("WP_TAG"));
    	{
    	AssignCommand(oPC, ActionJumpToLocation(oTarget));
    	}
    }
    
  • MuttleyMuttley Member Posts: 65
    Thanks for the replies. The travel builder looks a little convoluted but will have a look at it.

    I copied that script into action taken and added in the waypoint name but it does noithing.

    void main()
    {
    object oPC = GetPCSpeaker();
    location oTarget = GetLocation(GetWaypointByTag(wizardsrespitejumppoint));
    {
    AssignCommand(oPC, ActionJumpToLocation(oTarget));
    }
    }
  • Pixel_MayhemPixel_Mayhem Member Posts: 61
    edited September 2019
    You forgot the quotation marks for the Tag
    void main()
    {
    	object oPC = GetPCSpeaker();
    	location oTarget = GetLocation(GetWaypointByTag("wizardsrespitejumppoint"));
    	{
    	AssignCommand(oPC, ActionJumpToLocation(oTarget));
    	}
    }
    
    Post edited by Pixel_Mayhem on
  • Old_GithOld_Gith Member Posts: 152
    Just before your AssignCommand to Jump, I would also add the line:
    AssignCommand(oTarget, ClearAllActions());
    

    While not a deal-breaker, I've found it to be good practice just in case.
  • MuttleyMuttley Member Posts: 65
    Thanks for the help guys. It's working perfectly now.
  • Pixel_MayhemPixel_Mayhem Member Posts: 61
    And there was much rejoicing .... yay. :p
  • TarotRedhandTarotRedhand Member Posts: 1,481
    @Pixel_Mayhem While not a game-breaker you have some unnecessary braces there. This -
    void main()
    {
    	object oPC = GetPCSpeaker();
    	location oTarget = GetLocation(GetWaypointByTag("wizardsrespitejumppoint"));
    
            AssignCommand(oPC, ActionJumpToLocation(oTarget));
    }
    

    will work identically to your original.

    TR
  • Pixel_MayhemPixel_Mayhem Member Posts: 61
    edited September 2019
    I'm quite aware of that but I add them cause it makes the script look nice to me so... *shrugs* That and I got in the habit of doing it that way anyway.
Sign In or Register to comment.