Andyno Posted October 21, 2020 Share Posted October 21, 2020 As you can see on this picture... ... I'm trying to make a simple script for this messagebox. When the player will choose 1st option, he will be teleported to custom XMarkerHeading. When he choose 2nd option, the menu will close and nothing happens. Sounds like an easy task, but I have absolutely no clue how to "attach" these two options to appropriate commands (or scripts, or whatever).Can someone help with with this, I have no scripting knowledge at all... Link to comment Share on other sites More sharing options...
niston Posted October 21, 2020 Share Posted October 21, 2020 Use this to show the messagebox and retrieve the option selected by the player:https://www.creationkit.com/fallout4/index.php?title=Show_-_Message The return value will be the Index of the picked option. Link to comment Share on other sites More sharing options...
dylbill Posted October 21, 2020 Share Posted October 21, 2020 What niston said. It would look something like this: Message Property TZStartVertibirdMessage Auto ObjectReference Property MyXMarker Auto Actor Property PlayerRef auto Event SomeEvent(actor akTarget, actor akCaster) Int Button = TZStartVertibirdMessage.Show() If Button == 0 PlayerRef.MoveTo(MyXMarker) Elseif Button == 1 ;do something else EndIf EndEvent Link to comment Share on other sites More sharing options...
Andyno Posted October 21, 2020 Author Share Posted October 21, 2020 Thanks, but I don't have a clue where and how to use this script. I also suppose that I need to create some event for this...? Link to comment Share on other sites More sharing options...
Zorkaz Posted October 21, 2020 Share Posted October 21, 2020 Well basically it all depends on what you'll use it on. If you use it on a Activator/Door (...) use Event OnActivate(ObjectReference refAction) ObjectReference refPlayer = Game.GetPlayer() ;... EndEventSo if you have a button you double click on it, choose apply script or create a new one and use the script Dybill provided, albeit with the Event from above. Afterwards fill out the properties. If you use the script on a holotape use Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() ;... EndEventObviously there are other events for triggerzones, books and whatnot but I think you want one of these Also you might want to add the "AlwaysPersists" keyword to your teleport marker if you put it into an .esl format just to be on the safe side Link to comment Share on other sites More sharing options...
Andyno Posted October 22, 2020 Author Share Posted October 22, 2020 Yes, the vertibird should be an activator. Sorry, I should mention this in the 1st post. This is far as I can get: I click on "Add" in the "Papyrus Scripts" section, and that's it. I think I'm missing some very basic things... :sad: So if you have a button you double click on itWhat do you mean by this? The player should activate the vertibird as a whole object, not only some button. Link to comment Share on other sites More sharing options...
Zorkaz Posted October 22, 2020 Share Posted October 22, 2020 1. Click on new script and give it a name2. Remove the "Const" tag3. Make your script, save and compile it4. Now you close the script and fill out the properties. You can use "Autofill" on PlayerRefLink the Xmarker in the properites to the Xmarker you have placed in the world. This is your Teleport Location Link to comment Share on other sites More sharing options...
Andyno Posted October 22, 2020 Author Share Posted October 22, 2020 Huge thanks, now I'm getting somewhere! :dance: But I'm still something missing, because it's showing me a compile error even though I have placed a functional marker ref: Link to comment Share on other sites More sharing options...
Zorkaz Posted October 22, 2020 Share Posted October 22, 2020 1. Don't use "SomeEvent" he/she just typed this as an example. It doesn't exist. 2. You forgot the "()" PlayerRef.moveto (TZStartVertibirdMarkerRef) 3.The full Event Should look like this(This goes directly after the Properties Event OnActivate(ObjectReference refAction) ObjectReference refPlayer = Game.GetPlayer() Int Button = TZStartVertibirdMessage.Show() If Button == 0 PlayerRef.MoveTo(TZStartVertibirdMarkerRef) Endif EndEvent Link to comment Share on other sites More sharing options...
Andyno Posted October 23, 2020 Author Share Posted October 23, 2020 By properties you probably mean those 3 lines below the script name, right? So my final script should look like this? Scriptname TZStartVertibirdScript extends ObjectReference Message Property TZStartVertibirdMessage Auto ObjectReference Property TZStartVertibirdMarkerRef Auto Actor Property PlayerRef auto Event OnActivate(ObjectReference refAction) ObjectReference refPlayer = Game.GetPlayer() Int Button = TZStartVertibirdMessage.Show() If Button == 0 PlayerRef.MoveTo(TZStartVertibirdMarkerRef) Endif EndEventNow the compilation succeeded. I also clicked on "Auto-Fill All" button in the properties, and the script icon changed to plus symbol with pencil... I have no idea what it means, but I suppose it's correct...? Link to comment Share on other sites More sharing options...
Recommended Posts