Jump to content

Teleporter Modding Help


Recommended Posts

For the effects (and any other stuff too), you can look around in my Immersive Teleportation mod (see signature). The source code should be included in the BA2.

 

There might indeed be a trick to using the player variant of the spell, but I can't remember anymore. It might include fading out the screen, maybe more.

 

sweet ill take a look tonight, I like where the teleporter is right now but I'm trying to get it as close to the actual teleporter so looking at your mod with you being a more experienced Modder will help a lot.

Link to comment
Share on other sites

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

 

That may be my go to but im messing with it to find a way to make it so once you walk onto the teleporter your basicly inside the button so no matter where you look as long as you are on the teleporter you can activate it. Kind of like a trigger box but you have to activate it manually.

 

 

You could make a trigger the size of the teleporter and in its primitive tab select player activation. this should do what you want. The only issue is that it can be activated from outside the teleporter. This can easily be fixed by creating a second trigger as an actual trigger and changing the code on the activator to this (leave the properties and scriptname as they are):

Event OnInit()
    Self.BlockActivation(True, True) ;This disables the activator initialy
EndEvent
 
Event OnActivate(ObjectReference akActionRef)
    If !Self.IsActivationBlocked() ; this makes sure the player can't accidentally activate the activator even if they can't see it
        Game.GetPlayer().MoveTo(TeleportDestination)
    EndIf
EndEvent

And adding the following script to the trigger:

;scriptname part goes here (extends ObjectReference)
 
ObjectReference Property ActivatorRef Auto ; fill this with the activator's reference
 
Event OnTriggerEnter(ObjectReference akActionRef)
    If akActionRef == Game.GetPlayer(); this makes sure only the player can enable the activator
        ActivatorRef.BlockActivation(False) ; this enables activation again
    EndIf
EndEvent

Event OnTriggerLeave(ObjectReference akActionRef)
    If akActionRef == Game.GetPlayer()
        ActivatorRef.BlockActivation(True, True) ; this disables the activator again after the player leaves it
    EndIf
EndEvent

You can add additional checks to these if you end up needing power or not

Whenever I use a trigger with and without plaver activation nothing happens. Im using the defaultemptytrigger, is there a specific trigger I need to be using?

 

edit: I added a defaultactivateself script to see if it was needed but with player activation it woulnt work but when I disable player activation it works but can only be used once. But was still unable to use a trigger for an activator.

Edited by Swat715
Link to comment
Share on other sites

Almost ready to give up on the power portion of the teleporters. I've all day attempting to get it to work and nothing has. I've tried making the "WorkshopPowerSwitchbox01" to always have power but it doesn't want to work outside a buildable area. I've tried linking it directly to the Button that activates the teleporter but the switch itself never powers on and when I add the keyword "WorkshopStartUnpoweredOff" to the button it still remains functional. I've looked at some mods on nexus to try and help figure it out but its all workshop based, I tried look at the museum in concord because it had a generator there but I'm not sure if its functional. Ive also noticed when teleporting sometimes I take damage and even though its linked to the xmarker it doesn't teleport you directly on it, but like 10 feet away. You guys have definitely earned my respect cause doing this is stressful lol

Edited by Swat715
Link to comment
Share on other sites

I'm confused. So you are trying to use power, but outside of a workshop area? Why even?

I thought you wanted to make some part of your mod buildable.

 

What exactly are you trying to do atm?

 

im making a science facility which is a small portion of my mod, part of the quest requires you to go to different locations in the facilty which is why I was trying to implement the teleporters. so the teleporters are static which is why I was trying to find a way to make them powered. you basically just find a switch to turn on the teleporters which will open new areas in the facility.

 

Edit: So i may have come up with a simpler and less complicated way to do what im trying to do, i just need a manual activator/trigger that works like a button but is invisible and a semifunctional power switch it really just needs to be an activator but doesn't have to produce power. also out of curiosity is it possible to group objects together in the ck to make it "preset?" for the lake of a better word.

Edited by Swat715
Link to comment
Share on other sites

im making a science facility which is a small portion of my mod, part of the quest requires you to go to different locations in the facilty which is why I was trying to implement the teleporters. so the teleporters are static which is why I was trying to find a way to make them powered. you basically just find a switch to turn on the teleporters which will open new areas in the facility.

Ah.

Don't use actual power. That's only relevant for workshop-buildable stuff. Instead, create a global variable. Make the teleporters check it's value, and if it's 0, don't do the actual teleportation.

Then, your switch simply sets it to 1.

 

Edit: So i may have come up with a simpler and less complicated way to do what im trying to do, i just need a manual activator/trigger that works like a button but is invisible and a semifunctional power switch it really just needs to be an activator but doesn't have to produce power.

I still don't quite understand this part. What do you mean by "works like a button but is invisible"?

Maybe the DefaultEmptyTrigger is what you are looking for. Or, in general, make a new Activator without any mesh. It will then become a resizeable trigger box. You can then attach a script to it with the OnTriggerEnter event, to do something as soon as someone enters the box.

 

also out of curiosity is it possible to group objects together in the ck to make it "preset?" for the lake of a better word.

As a matter of fact, you can!

It's called a Pack-In, and IIRC, you just need to select several objects and do rightclick->create pack-in. It even preserves keyword links, enableparents and such between the various objects.

Link to comment
Share on other sites

Whenever I use a trigger with and without plaver activation nothing happens. Im using the defaultemptytrigger, is there a specific trigger I need to be using?

 

edit: I added a defaultactivateself script to see if it was needed but with player activation it woulnt work but when I disable player activation it works but can only be used once. But was still unable to use a trigger for an activator.

Default empty trigger should work without defaultActivateSelf script but you need to attach the seccond script i posted to it to test if it works you can add some debug lines which will tell you in game if it's working or not

I ussually create my triggers a little dirfferently, slelect your teleporter model and click on the create trigger button izR3yWx.png. This will create a triggerbox around the mesh you selected (you might have to resize it a little afteward). It will ask you which trigger to add here you can select the defaultEmptyTrigger. For the trigger leave all settings as is (do not select player activation). After it's created add this script on the trigger:

 

Scriptname LR_TriggerScript extends ObjectReference
 
ObjectReference Property ActivatorRef Auto
 
Event OnTriggerEnter(ObjectReference akActionRef)
    If  akActionRef == Game.GetPlayer()
        Debug.MessageBox("trigger enter") ;this will create a messagebox letting you know the trigger works remove or comment this out to disable the messageboxes
        ActivatorRef.BlockActivation(False)
    EndIf
EndEvent

Event OnTriggerLeave(ObjectReference akActionRef)
    If akActionRef == Game.GetPlayer()
        ActivatorRef.BlockActivation(True, True)
        Debug.MessageBox("Trigger Leave") ;this will create a messagebox letting you know the trigger works remove or comment this out to disable the messageboxes
    EndIf
EndEvent
 
Fill the ActivatorRef property with your activator( not this trigger) Edited by LoneRaptor
Link to comment
Share on other sites

I was able to finally get the activator to work and make a functional power switch. But it leaves me with another question, I have the teleport emitter (Static/Non workshop Version) as a cosmetic piece to my teleporter and was curious if there was a way to have the blue lights and sound effects to be used without power? And how do you add visual effects to activators? for example casue a spark by using an activator?

Edited by Swat715
Link to comment
Share on other sites

These effects don't require power. They are actually animations inside the nif for that model wich you can play using PlayGamebryoAnimation()

 

you can do this by adding something like this to the activator:

ObjectReference Property EmitterRef Auto ;fill this with the reference of the emittor
 
EmitterRef.PlayGamebryoAnimation("stage3loop", True); place this inside the OnActivate event

There are more than just this animation in the nif, you can find them using nifscope in the animation dropdown. then you can replace stage3loop with the name of the animation you would like

This only plays the visual effects for sound effects you have to find the corresponding sound descriptor and play that at the same time as the animation using the following line:

;First add 2 more properties:
Sound Property OBJTeleporterJammerLP Auto; you should be able to auto fill this
Int Property SoundEffectIncetanceID Auto Hidden ; no need to fill this the script will do that, this will later be used to stop the sound effect
 
SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);place this below the PlayGamebryoAnimation line

Both the animation and the sound effect are looping so you'll have to stop them at some point. This can be done on a timer or using an activator when you want them to stop. To stop both use the following lines:

Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop
EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation loop
Edited by LoneRaptor
Link to comment
Share on other sites

 

These effects don't require power. They are actually animations inside the nif for that model wich you can play using PlayGamebryoAnimation()

 

you can do this by adding something like this to the activator:

ObjectReference Property EmitterRef Auto ;fill this with the reference of the emittor
 
EmitterRef.PlayGamebryoAnimation("stage3loop", True); place this inside the OnActivate event

There are more than just this animation in the nif, you can find them using nifscope in the animation dropdown. then you can replace stage3loop with the name of the animation you would like

This only plays the visual effects for sound effects you have to find the corresponding sound descriptor and play that at the same time as the animation using the following line:

;First add 2 more properties:
Sound Property OBJTeleporterJammerLP Auto; you should be able to auto fill this
Int Property SoundEffectIncetanceID Auto Hidden ; no need to fill this the script will do that, this will later be used to stop the sound effect
 
SoundEffectIncetanceID = OBJTeleporterJammerLP.Play(EmitterRef);place this below the PlayGamebryoAnimation line

Both the animation and the sound effect are looping so you'll have to stop them at some point. This can be done on a timer or using an activator when you want them to stop. To stop both use the following lines:

Sound.StopInstance(SoundEffectIncetanceID) ;stops the audio loop
EmitterRef.PlayGamebryoAnimation("stage1", True); stops the animation loop

 

okay so I'm using a separate activator (power Switch) to spawn in the teleport activator so its initially disabled. I'm doing this to give the illusion that there's "power" being used. Now for the Emitter sound and effects if I make 2 versions of the emitter 1 with sounds and effects and apply your script to the power switch activator would this work?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...