Jump to content

Teleporting


Ruadhan2300

Recommended Posts

ok, so for my vault, I plan to have an elevator system. to do that, I have the elevator directly controlled by the vault's Zax computer. so you talk to the Zax via a screen inside the elevator.

My planned event path is that you walk up to the elevator door, use it, and you're teleported into the Elevator cell. inside that cell (which is tiny and essentially contains only the zax screen) you can talk to the zax and tell it where you want to go. This system lets me limit players to areas of the vault which they'd be allowed to go to at that point and suggest that the vault is larger than it appears.

after you tell the zax where you want to go, you're immediately teleported to the outside of the elevator on the floor you want to go to.

 

my problem is that I'm not really sure how to make a scripted teleport system like this. I'm certain its possible, there was a mod related to robco robots in Fallout 3 which had a multi-destination teleport system sorta like this. my problem is purely the script itself. not the dialog or structuring. if anyone can advise..that'd be helpful.

Link to comment
Share on other sites

I'd suggest looking at the lucky scripts. I ported mine from vault 22, but the rub is if you have a companion mod that is outside of the vanilla your screwed.

 

First I can;t account for all the different companions people have made. Second. I really dont care about mulitple companions more then the normal 2 you get. I just tell people leave them outside. I know have 2 elevator systems in my place, and what you do is get an Xtravel marker, and rename the reference. Heres a script, just modify the names. This one is for 4 floors.

You also need a message name it something unique. And you use the != for the floor your on, so you don;t have it on your menu when you go to use it. Then make your door reference the script.

 

Heres a script

 

scn FLBARCElevatorDoorScript 

short clevelselect 
short celevactive 
;short distillkey                 ;Not used yet

Begin OnActivate 

       showmessage FLBARcelvselect 
       set celevactive to 1 

End 



Begin gamemode 

       if celevactive == 1 

               Set celevactive to 0 
               Set clevelselect to GetButtonPressed 
	   if clevelselect == 0                       ; Do Nothing
                     	Elseif  clevelselect == 1
		        player.MoveTo FLBARcelMarkerOutsidePlayer


			if VNPCFollowers.bBooneHired
		CraigBooneRef.MoveTo FLBARcelMarkerOutsideComp
	elseif VNPCFollowers.ArcadeHired
		ArcadeRef.MoveTo FLBARcelMarkerOutsideComp
	elseif VNPCFollowers.bCassHired
		RoseofSharonCassidyRef.MoveTo FLBARcelMarkerOutsideComp
	elseif VNPCFollowers.RaulHired
		RaulRef.MoveTo FLBARcelMarkerOutsideComp
	elseif VNPCFollowers.bLilyHired
		LilyRef.MoveTo FLBARcelMarkerOutsideComp
	elseif VNPCFollowers.bVeronicaHired
		VeronicaRef.MoveTo FLBARcelMarkerOutsideComp
	endif

	if VNPCFollowers.RexHired
		RexRef.MoveTo FLBARcelMarkerOutsideBot
	elseif VNPCFollowers.bEDEHired
		if EDE1Ref.GetDisabled == 0
			EDE1Ref.MoveTo FLBARcelMarkerOutsideBot;
		elseif EDE2Ref.GetDisabled == 0
			EDE2Ref.MoveTo FLBARcelMarkerOutsideBot;
		elseif EDE3Ref.GetDisabled == 0
			EDE3Ref.MoveTo FLBARcelMarkerOutsideBot;
		endif
	endif

				
		Elseif clevelselect == 2
		        player.MoveTo FLBARcelMarkerBednBPlayer


	if VNPCFollowers.bBooneHired
		CraigBooneRef.MoveTo FLBARcelMarkerBednBComp
	elseif VNPCFollowers.ArcadeHired
		ArcadeRef.MoveTo FLBARcelMarkerBednBComp
	elseif VNPCFollowers.bCassHired
		RoseofSharonCassidyRef.MoveTo FLBARcelMarkerBednBComp
	elseif VNPCFollowers.RaulHired
		RaulRef.MoveTo FLBARcelMarkerBednBComp
	elseif VNPCFollowers.bLilyHired
		LilyRef.MoveTo FLBARcelMarkerBednBComp
	elseif VNPCFollowers.bVeronicaHired
		VeronicaRef.MoveTo FLBARcelMarkerBednBComp
	endif

	if VNPCFollowers.RexHired
		RexRef.MoveTo FLBARcelMarkerBednBBot
	elseif VNPCFollowers.bEDEHired
		if EDE1Ref.GetDisabled == 0
			EDE1Ref.MoveTo FLBARcelMarkerBednBBot;
		elseif EDE2Ref.GetDisabled == 0
			EDE2Ref.MoveTo FLBARcelMarkerBednBBot;
		elseif EDE3Ref.GetDisabled == 0
			EDE3Ref.MoveTo FLBARcelMarkerBednBBot;
		endif
	endif


		Elseif clevelselect == 3
			player.MoveTo FLBARcelMarkerTourPlayer


			if VNPCFollowers.bBooneHired
		CraigBooneRef.MoveTo FLBARcelMarkerTourComp
	elseif VNPCFollowers.ArcadeHired
		ArcadeRef.MoveTo FLBARcelMarkerTourComp
	elseif VNPCFollowers.bCassHired
		RoseofSharonCassidyRef.MoveTo FLBARcelMarkerTourComp
	elseif VNPCFollowers.RaulHired
		RaulRef.MoveTo FLBARcelMarkerTourComp
	elseif VNPCFollowers.bLilyHired
		LilyRef.MoveTo FLBARcelMarkerTourComp
	elseif VNPCFollowers.bVeronicaHired
		VeronicaRef.MoveTo FLBARcelMarkerTourComp
	endif

	if VNPCFollowers.RexHired
		RexRef.MoveTo FLBARcelMarkerTourBot
	elseif VNPCFollowers.bEDEHired
		if EDE1Ref.GetDisabled == 0
			EDE1Ref.MoveTo FLBARcelMarkerTourBot;
		elseif EDE2Ref.GetDisabled == 0
			EDE2Ref.MoveTo FLBARcelMarkerTourBot;
		elseif EDE3Ref.GetDisabled == 0
			EDE3Ref.MoveTo FLBARcelMarkerTourBot;
		endif
	endif
	
	
	Elseif clevelselect == 4
			player.MoveTo FLBARcelMarkerAgingPlayer


			if VNPCFollowers.bBooneHired
		CraigBooneRef.MoveTo FLBARcelMarkerAgingComp
	elseif VNPCFollowers.ArcadeHired
		ArcadeRef.MoveTo FLBARcelMarkerAgingComp
	elseif VNPCFollowers.bCassHired
		RoseofSharonCassidyRef.MoveTo FLBARcelMarkerAgingComp
	elseif VNPCFollowers.RaulHired
		RaulRef.MoveTo FLBARcelMarkerAgingComp
	elseif VNPCFollowers.bLilyHired
		LilyRef.MoveTo FLBARcelMarkerAgingComp
	elseif VNPCFollowers.bVeronicaHired
		VeronicaRef.MoveTo FLBARcelMarkerAgingComp
	endif

	if VNPCFollowers.RexHired
		RexRef.MoveTo FLBARcelMarkerAgingBot
	elseif VNPCFollowers.bEDEHired
		if EDE1Ref.GetDisabled == 0
			EDE1Ref.MoveTo FLBARcelMarkerAgingBot;
		elseif EDE2Ref.GetDisabled == 0
			EDE2Ref.MoveTo FLBARcelMarkerAgingBot;
		elseif EDE3Ref.GetDisabled == 0
			EDE3Ref.MoveTo FLBARcelMarkerAgingBot;
		endif
	endif
				

	         Endif	
				
	Endif
End

Link to comment
Share on other sites

One more thing, make sure your cell names in the message are uninuqe. I had a problem with that first time around.

 

I had one room called FLBARDISTILLERY and another called FLBARDISTILLERYBOTTOM

 

THe game engine couldnt tell the two apart.

Link to comment
Share on other sites

i have done this in my mod as well, its really simple. make your elevator cell ( the small one) link a door that will take u "inside" the elevator. Then, for actual movement of the player from place to place, you could use "player.MoveTo YourRefID" I used a trigger box as my reference where the player will teleport, but you can use anything really, but for a more precise location, a trigger box or maker is much better.

 

This is an example of the script i used in my mod, where when you click on a switch, it teleports the player into another identical interior elevator cell, and then the door in the elevator cell leads out into a different location. I placed these elevator cells outside of the cell that i want the player teleported too, but this isnt completely necessarily.

 

 

scn aaaSTBunkerCityCell1ElevatorSwitchScript

begin onactivate

player.MoveTo aaaSTBunkerCityCell2ElevatorTriggerRef
playsound AMBElevatorBell
end

 

or if you want to get really intricate and detailed, you could just look at the comment above mine xD

Edited by stealthtank91
Link to comment
Share on other sites

so if I don;t have all the other companion stuff, then they move with the player?

 

If so I'll drop all that crap

 

yes they will move with the player, but at least they do for me. not instantly, but they teleport to you as soon as you go through a door, which in this case would be the elevator door. so youd be in the elevator cell without the companion, but you can just write a script that moves everything within a trigger box instead of just the player. i don't remember how to do that exactly though. if you can understand the long script you have, then id go with that, because i think it should work, but my example is just a simple concept of what you can do with only a few functions.

 

additionally adding a timed script that plays a elevator move sound, and then unlocking the doors, could add more realism and immersion.

 

scn YourScript

int timer

begin gamemode
if timer > 0
set timer to timer - getsecondspassed
endif
end

begin gamemode
if timer == 1
YourElevatorDoorRef.unlock
playsound AMBElevatorBell
endif
end

begin onactivate
player.MoveTo YourElevatorTriggerRef
playsound YourElevatorMoveSound
set timer to 10
end

 

this will move the player and companions to the "second" elevator cell and unlock the door after 9 seconds, which you can set to however much you want. depending on how long the elevator move sound will be. just make sure its not a looped sound, or it will keep going on forever.

 

you can check what sounds you can use in the sound section of the geck interface.

Edited by stealthtank91
Link to comment
Share on other sites

man ive typed this like 3 times now, soo to be sure i post it this time im gonna make it short.

 

use doors

 

elevator cell will have overlapping doors that you will disable with script with the exception of the one leading to the floor the player selects..

 

this should fix the companion issue as its related to the inability of the companions to route through a navmesh because there are no with doors finalized into it.

 

you can use moveto but then you will need to use a script similar to the lucky38 script above to move the listed companions..however this will not work with mods that add companions sooo best be is to go the door route.

 

i DO have a refwalking solution to the moveto issue that works with all followers by checking the cell for followers and adding them all to a moveto list to work with other companions outside of the original vanilla companions BUT this will absolutely require NVSE and is a LOT more complicated in the way of script than anything discussed here. also it deals with several scripts working together in tandem.. so if these scripts are any bit confusing to you that most certainly is not the best route.

Link to comment
Share on other sites

hm...lots of useful thoughts here, thank you for the responses.

 

the part I actually needed was the player.moveto function, I wasn't sure what it'd be.

thanks for that :P

I hadn't thought of companions though, especially non-vanilla companions.

the method I planned to use is basically a dialog based teleporter. you talk to the Zax and when you tell it where you want to go, it runs something akin to the player.moveto command on you and moves you to the floor of your choice :P

straightforward, but harder to combine with companions... I'll probably just use aspects of the V22 script for that, and accept that it'll only partially work with non-vanilla companions.

 

the multiple door's method sounds much more simple, but part of the immersion may be broken by the elevator apparently not moving. that is unless I run a timer and sound-effect for that...but who wants to deal with a compulsory wait like that every time they change floors?

 

 

Edit: just a minor update to the plan, rather than having a dedicated cell specifically for the elevator, it seems simpler to have an elevator interior at each level, and be able to open the door and go in each time. perhaps also have randomised delays on the door opening time for the elevators :P

this removes the need for another system to decide which door to link to at any time for leaving the elevator (should you realise you didn't want to change floors after all)

 

to distinguish which floor the player is on for limiting the options so you can't go to the floor you're currently on, I plan to simply check which cell the player is in. that will provide the necessary data much more easily.

Edited by Ruadhan2300
Link to comment
Share on other sites

hm...lots of useful thoughts here, thank you for the responses.

 

the part I actually needed was the player.moveto function, I wasn't sure what it'd be.

thanks for that :P

I hadn't thought of companions though, especially non-vanilla companions.

the method I planned to use is basically a dialog based teleporter. you talk to the Zax and when you tell it where you want to go, it runs something akin to the player.moveto command on you and moves you to the floor of your choice :P

straightforward, but harder to combine with companions... I'll probably just use aspects of the V22 script for that, and accept that it'll only partially work with non-vanilla companions.

 

the multiple door's method sounds much more simple, but part of the immersion may be broken by the elevator apparently not moving. that is unless I run a timer and sound-effect for that...but who wants to deal with a compulsory wait like that every time they change floors?

 

 

Edit: just a minor update to the plan, rather than having a dedicated cell specifically for the elevator, it seems simpler to have an elevator interior at each level, and be able to open the door and go in each time. perhaps also have randomised delays on the door opening time for the elevators :P

this removes the need for another system to decide which door to link to at any time for leaving the elevator (should you realise you didn't want to change floors after all)

 

to distinguish which floor the player is on for limiting the options so you can't go to the floor you're currently on, I plan to simply check which cell the player is in. that will provide the necessary data much more easily.

 

if there is a stair case that alternatively links the levels so the NPCs can route that'll work perfectly... was actually thinking of suggesting it but i figured that the levels were not connected

 

as for them not knowing theyre moving:

 

player.playgroup Stagger

playsound AMBElevatorBell

 

no wait

 

or put the bell sound then a 1 second timer, then this code

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...