Jump to content

Scripts please help.


Cohagen

Recommended Posts

I feel like a dumb person, once again here cap in hand to ask for your help.

 

I have been making a mod which allows you to go to a specific terminal and play a 90s style action minigame.

I have so far created all new assets including models, textures, videos, sounds and now im ready to script it all together but im already stuck.

I want to start a stage in my quest by clicking on an activator.

I want it to work like the 'DefaultSetStageTriggerPlayerOnly' activator only instead of activating my quest by walking into the activator i want to activate the it manually.

 

I tried:

Onactivate

MODQuest1.SetStage(20)

But nothing happened.

 

My second query is, is there a script that will store the players inventory into a container and return it all when i want it too?

That is important so that i can keep players from bringing HD stuff into my retro minigame.

 

Thank you anyone than can help me, i love making mods but scripts always sets me back.

Link to comment
Share on other sites

For the activator script try this:

Quest Property YourQuest Auto
Event OnActivate(ObjectReference akActionRef)
 YourQuest.SetStage(20)
EndEvent

Add this script to your activator and make sure not to forget to fill the quest property.

For storing the players items you can use RemoveAllItems but make sure the container you move to is in the same cell as the player when removing/giving back. (See the notes on the wiki page)
Your script for this should be something like this:

ObjectReference Property StorageContianer Auto
 
Event OnActivate(ObjectReference akActionRef)  ;or use a different event to triggers this
   Game.GetPlayer().RemoveAllItems(StorageContianer, True)
EndEvent


To move it back use this:

ObjectReference Property StorageContianer Auto
 
Event OnActivate(ObjectReference akActionRef)  ;or use a different event to triggers this
   StorageContianer.RemoveAllItems(Game.GetPlayer(), True)
EndEvent
Link to comment
Share on other sites

 

For the activator script try this:

Quest Property YourQuest Auto
Event OnActivate(ObjectReference akActionRef)
 YourQuest.SetStage(20)
EndEvent
Add this script to your activator and make sure not to forget to fill the quest property.

Â

For storing the players items you can use RemoveAllItems but make sure the container you move to is in the same cell as the player when removing/giving back. (See the notes on the wiki page)

Your script for this should be something like this:

ObjectReference Property StorageContianer Auto
 
Event OnActivate(ObjectReference akActionRef)Â  ;or use a different event to triggers this
   Game.GetPlayer().RemoveAllItems(StorageContianer, True)
EndEvent
Â

To move it back use this:

ObjectReference Property StorageContianer Auto
 
Event OnActivate(ObjectReference akActionRef)Â  ;or use a different event to triggers this
   StorageContianer.RemoveAllItems(Game.GetPlayer(), True)
EndEvent

Wow great, thanks for replying.

I will try as soon as I get home.

With

Event OnActivate(ObjectReference akActionRef) do I paste it as is or make object reference a property? Thanks

Link to comment
Share on other sites

 

For the activator script try this:

Quest Property YourQuest Auto
Event OnActivate(ObjectReference akActionRef)
 YourQuest.SetStage(20)
EndEvent
Add this script to your activator and make sure not to forget to fill the quest property.

Â

For storing the players items you can use RemoveAllItems but make sure the container you move to is in the same cell as the player when removing/giving back. (See the notes on the wiki page)

Your script for this should be something like this:

ObjectReference Property StorageContianer Auto
 
Event OnActivate(ObjectReference akActionRef)Â  ;or use a different event to triggers this
   Game.GetPlayer().RemoveAllItems(StorageContianer, True)
EndEvent
Â

To move it back use this:

ObjectReference Property StorageContianer Auto
 
Event OnActivate(ObjectReference akActionRef)Â  ;or use a different event to triggers this
   StorageContianer.RemoveAllItems(Game.GetPlayer(), True)
EndEvent

Wow great, thanks for replying.

I will try as soon as I get home.

With

Event OnActivate(ObjectReference akActionRef) do I paste it as is or make object reference a property? Thanks

Link to comment
Share on other sites

For the activator script try this:

Quest Property YourQuest Auto
Event OnActivate(ObjectReference akActionRef)
ÃÂ YourQuest.SetStage(20)
EndEvent
Add this script to your activator and make sure not to forget to fill the quest property.

ÃÂ

For storing the players items you can use RemoveAllItems but make sure the container you move to is in the same cell as the player when removing/giving back. (See the notes on the wiki page)

Your script for this should be something like this:

ObjectReference Property StorageContianer Auto
ÃÂ 
Event OnActivate(ObjectReference akActionRef)ÃÂ  ;or use a different event to triggers this
ÃÂ ÃÂ  Game.GetPlayer().RemoveAllItems(StorageContianer, True)
EndEvent
ÃÂ

To move it back use this:

ObjectReference Property StorageContianer Auto
ÃÂ 
Event OnActivate(ObjectReference akActionRef)ÃÂ  ;or use a different event to triggers this
ÃÂ ÃÂ  StorageContianer.RemoveAllItems(Game.GetPlayer(), True)
EndEvent
Wow great, thanks for replying.

I will try as soon as I get home.

With

Event OnActivate(ObjectReference akActionRef) do I paste it as is or make object reference a property? Thanks

 

Edit: Sorry for multiple posts, I'm not good doing this on the phone.

Edited by Cohagen
Link to comment
Share on other sites

If that doesn't work and the script is attached to the terminal in the render window. It might be because of that. I haven't tried using onActivate on a terminal before and don't have the time now. but if you want to set the stage when the player reads something on the terminal you can do this by adding a script fragment on the option. Start by Creating a property for your quest using the add property button in the properties menu. Then in the fragment you write MyQuest.SetStage(20).
Otherwise you could use an activator like a button on the wall. and attach the script you already have to it.

Link to comment
Share on other sites

If that doesn't work and the script is attached to the terminal in the render window. It might be because of that. I haven't tried using onActivate on a terminal before and don't have the time now. but if you want to set the stage when the player reads something on the terminal you can do this by adding a script fragment on the option. Start by Creating a property for your quest using the add property button in the properties menu. Then in the fragment you write MyQuest.SetStage(20).

Otherwise you could use an activator like a button on the wall. and attach the script you already have to it.

 

Just added the script to activator, not the render window, removed the changes made by the ck and now it works :yes:

The transition to the minigame is seamless thanks for your help.

Any idea if DisablePlayerControls Will not work in Fallout 4?

I tried 'player.disablePlayerControls(abVATS = true)' but it come up with 'disablePlayerControls is not a function or does not exist'

I would just like to know to save me chasing a dead horse.

Edited by Cohagen
Link to comment
Share on other sites

  • Recently Browsing   0 members

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