Jump to content

Photo

Teleporter Modding Help

teleporters modding fallout4

  • Please log in to reply
55 replies to this topic

#1
Swat715

Swat715

    Journeyman

  • Members
  • Pip
  • 49 posts

Hello, I'm realitivly new to modding i mainly do map design. I'm currently working on a map that involves teleporters. sense the launch of ck I've tried looking for tutorials on teleporters but haven't been able to locate one. if anyone could point me to the direction on where to find a tutorial or possible help me out I would be grateful sense I've been stuck on this issue sense basically ck launched. Or if somebody could explain to me how to set up a specific way (I'll describe down below) to set up a few teleporters. The Best explanation is the teleporters from call of duty zombies.

 

Here are the steps: (Simplified Version)

1. Turn on Power

2. Like 3 teleporters to mainframe. (OPTIONAL)

3. When 1 of the 3 teleporters are activated you teleport to mainframe.

 

There are 3 teleporters and 1 mainframe you have to activate the power to use the teleporters. And once you have turned on the power if you use 1 of the 3 teleporters it will take you to the mainframe. Now I don't need it to be too fancy but I would like to add the electricity effect that is in fallout 4's Story with the Institute teleporter. Down below I will link so videos to show what I mean. in one of the videos it shows the player linking the teleporters to the mainframe, I'm not necessarily planning on adding that sense it seems to be more of a hassle, unless I can find a n easy way to do it. But like I said I have been struggle to do any of this sense I have no prior scripting experience and have not found a tutorial on even basic teleporters. I would appreciate any help on this and will give credit once my mod is finally finished. 

 

 

 

 



#2
SKK50

SKK50

    Squeaky wheel gets the kick

  • Supporter
  • PipPipPipPip
  • 2,371 posts

Do you know how to place objects like activators in the world ?

Do you know how to attach scripts to objects ?

Are you familiar with papyrus functions like OnActivate() and MoveTo() ?



#3
Swat715

Swat715

    Journeyman

  • Members
  • Pip
  • 49 posts

I am familiar with placing activators and attaching scripts, but have never done onActivate() and move to(). I've been told I need to learn how to use those but have no idea where to learn it. 



#4
SKK50

SKK50

    Squeaky wheel gets the kick

  • Supporter
  • PipPipPipPip
  • 2,371 posts

I can't help with "how to" tutorials as never used them. If your don't get a better offer and are up for doing it the investigative/hard way:

 

(1) Unpack the base game scripts in ...\Fallout 4\Data\Scripts\Source\Base

 

(2) Search on text OnActivate MoveTo ... OnTriggerEnter MoveTo

 

(3) Look at the "extends ObjectReference" header scripts, grab some interesting stuff attach to a test activator you place in the world. Some to look at:

 

TestConcordMuseumQuestTrigger, DLC04:DLC04TestSpawner, V111CompanionFailsafeWarpScript



#5
LoneRaptor

LoneRaptor

    Old hand

  • Supporter
  • PipPipPip
  • 611 posts

The best place to learn these functions is like SKK50 said in existing scripts or alternatively on the CK wiki: OnActivate() and MoveTo()
This page is also very handy to keep bookmarked, it has all the available papyrus function usually with some example code.
 
For an activator that when triggered teleports the player to a preset location you would need something like this (attached to the activator)

Scriptname NameOfScript extends ObjectReference
 
ObjectReference Property DestinationMarker Auto ; fill this property with the objectreference of the XmarkerHeading where you want the player to teleport to.
; optionally you can have some global variables here that get set to 1(on) when certain conditions are met. You can then add an if statement that decides if you can teleport or not.
 
Event OnActivate(ObjectReference akActionRef)
         Game.GetPlayer().MoveTo(DestinationMarker) ;moves the player to the preset location
EndEvent
 

 
for the contitions you mentioned I would test something like this (haven't tested the code myself yet but i should work.

Note the LR_ prefix is something i use for all my globals so they don't conflict with other mods so its best to use your own prefix

Scriptname LR_TeleportScript extends ObjectReference

ObjectReference Property TeleportDestination Auto
GlobalVariable Property LR_PowerActivated Auto ;A global that gets set to 1 when the power is activated use GlobalVariable.SetValue(1) for this
Bool Property LR_TeleporterConnected = False Auto ;if you want the player to connect the teleporter first the you can use this and set it to true when the teleporters are connected can also be done using a global variable

Event OnActivate(ObjectReference akActionRef)
    If LR_PowerActivated.GetValueInt() == 1 ; only teleport when power has been connected if you also want to check if the teleporter is linked change it to this: If LR_PowerActivated.GetValueInt() == 1 && LR_TeleporterConnected
        Game.GetPlayer().MoveTo(TeleportDestination)
    EndIf
EndEvent

 
For the effects I would look at the teleporter in the ck and see how the script on that activates it.


Edited by LoneRaptor, 12 March 2019 - 05:40 PM.


#6
Swat715

Swat715

    Journeyman

  • Members
  • Pip
  • 49 posts

The best place to learn these functions is like SKK50 said in existing scripts or alternatively on the CK wiki: OnActivate() and MoveTo()
This page is also very handy to keep bookmarked, it has all the available papyrus function usually with some example code.
 
For an activator that when triggered teleports the player to a preset location you would need something like this (attached to the activator)

Scriptname NameOfScript extends ObjectReference
 
ObjectReference Property DestinationMarker Auto ; fill this property with the objectreference of the XmarkerHeading where you want the player to teleport to.
; optionally you can have some global variables here that get set to 1(on) when certain conditions are met. You can then add an if statement that decides if you can teleport or not.
 
Event OnActivate(ObjectReference akActionRef)
         Game.GetPlayer().MoveTo(DestinationMarker) ;moves the player to the preset location
EndEvent
 

 
for the contitions you mentioned I would test something like this (haven't tested the code myself yet but i should work.

Note the LR_ prefix is something i use for all my globals so they don't conflict with other mods so its best to use your own prefix

Scriptname LR_TeleportScript extends ObjectReference

ObjectReference Property TeleportDestination Auto
GlobalVariable Property LR_PowerActivated Auto ;A global that gets set to 1 when the power is activated use GlobalVariable.SetValue(1) for this
Bool Property LR_TeleporterConnected = False Auto ;if you want the player to connect the teleporter first the you can use this and set it to true when the teleporters are connected can also be done using a global variable

Event OnActivate(ObjectReference akActionRef)
    If LR_PowerActivated.GetValueInt() == 1 ; only teleport when power has been connected if you also want to check if the teleporter is linked change it to this: If LR_PowerActivated.GetValueInt() == 1 && LR_TeleporterConnected
        Game.GetPlayer().MoveTo(TeleportDestination)
    EndIf
EndEvent

 
For the effects I would look at the teleporter in the ck and see how the script on that activates it.

 

Not gonna lie, I have no idea what I'm looking at lol 

 

Edit: I've re read this for about 4 hours and tried implementing this to a defaultactivator & DefaultActivateSelfTrigger but neither have worked. But chances are I implemented it wrong sense I've never done scripting before. When creating the new script am I putting anything into the documentation string? if the above is suppose to go into the documentation string what do I do in the new window that pops up for properties?


Edited by Swat715, 13 March 2019 - 08:33 AM.


#7
Be3lzeBot

Be3lzeBot

    Journeyman

  • Members
  • Pip
  • 43 posts

Are you adding it as a script to the activator/button/whatever? If so, I think you just need to fill in the Properties...

In the first script, there's 1 Property; "DestinationMarker".

If you attached the script and it compiled, close the script and click on the Properties button. You should see "DestinationMarker". Select it, and tell it where & what your destination marker is.


Edited by Be3lzeBot, 13 March 2019 - 11:06 AM.


#8
LoneRaptor

LoneRaptor

    Old hand

  • Supporter
  • PipPipPip
  • 611 posts

To add a script in the CK click add, give it a name and uncheck the constant checkbox, click ok the documentation string is not needed.

next the properties window will open. You can either click on add property and add the properties that way or click on cancel, right click on the script and select "edit source".

A very basic text editor will open and in there you can paste the script i posted minus the scriptname line as that will already be generated.

Click file save some information will appear in the compiler output. after that you can close this window and fill the properties using the property button next to the list of scripts

if you named the property for the global variable the same as the editor id of the global then you can select it and click on auto fill and the ck will fill it for you. For objectReferences you will have to select it in the worldspace by clicking edit value and then pick reference in render window



#9
Swat715

Swat715

    Journeyman

  • Members
  • Pip
  • 49 posts

To add a script in the CK click add, give it a name and uncheck the constant checkbox, click ok the documentation string is not needed.

next the properties window will open. You can either click on add property and add the properties that way or click on cancel, right click on the script and select "edit source".

A very basic text editor will open and in there you can paste the script i posted minus the scriptname line as that will already be generated.

Click file save some information will appear in the compiler output. after that you can close this window and fill the properties using the property button next to the list of scripts

if you named the property for the global variable the same as the editor id of the global then you can select it and click on auto fill and the ck will fill it for you. For objectReferences you will have to select it in the worldspace by clicking edit value and then pick reference in render window

 

Okay so I Used I followed every step, but it didn't work and I'm assuming its because I used a "DefaultActivateSelfTrigger" sense it has a "defaultactivateself" script. Another this I've noticed is under properties there is only destination marker, is that suppose to be the only property or is there suppose to be more?

 

Edit: So i managed to get it work with a button, but are you able to change the model to somthing else? when i changed it to a differnt object it wasnt activateable. Also i couldnt find the script to make the lightning effect when i activate the teleporter. and for it to require power to use would that be a script aswell?


Edited by Swat715, 14 March 2019 - 02:21 AM.


#10
LoneRaptor

LoneRaptor

    Old hand

  • Supporter
  • PipPipPip
  • 611 posts

The first script only has one property, the second one has 2.

What object did you change it to?

i think the power requirement is either a property on a script attached to each workshopobject(i think this is called workshopobjectscript but i'm not sure) or a keyword and the main settlement script (can't recall what that is called now).

When you clicked save did the compiler give you an error?

The lightning effects don't necessarily have to be controlled via script i just assumed they were if not that try to find the effect itself in the ck and look at the use info to see what uses them.







Also tagged with one or more of these keywords: teleporters, modding, fallout4

Page loaded in: 0.880 seconds