Xena95 Posted April 16, 2016 Share Posted April 16, 2016 Greetings, I am currently working on a plug-in for a mod, and I'm having quite a bit of trouble getting one of the most simplistic components to work. Scripting in terminals..For some reason scripts seem to behave differently in terminals, This is what i want the script to do.. Stage 1: Display a 'Message Box' (when 'Item Text' is selected vir a 'Sub-Menu in a 'Terminal') with a Yes and No button. Stage 2: If Yes is selected; Remove all Items from a container (If No is selected; Do nothing) Sounds simple right? I just can't get it to work, maybe someone can guide me in the right direction. Script as follows.. (This is a 'Item Result Script', so no 'GameBlocks' are required to my knowledge)______________________________________________________________________________________ Short buttonVarshowmessage TerminalMessage01 set buttonVar to getbuttonpressed if buttonVar == 0 TerminalContainer.removeallitems elseif buttonVar == 1 ; Do nothing endIf______________________________________________________________________________________ Link to comment Share on other sites More sharing options...
uhmattbravo Posted April 16, 2016 Share Posted April 16, 2016 (edited) You don't need all that for a result script. All you should need is literally "TerminalContainer.removeallitems" in the result script for the terminal option that you want to empty the box, and you can just leave the other option's result script blank. You don't need the script name for a result script, and I'm pretty sure you can't declare variables in it either. You can sort of think of the result script box as an onactivate block for that option on the terminal. It doesn't have the full functionality of an object or quest script, it's just run once whenever the option is chosen so it's not really used to declare variables or run timers or some of the other things actual scripts can. Edited April 16, 2016 by uhmattbravo Link to comment Share on other sites More sharing options...
Xena95 Posted April 16, 2016 Author Share Posted April 16, 2016 Works fine with the 'removeallitems' command itself, but i want a 'Message Box' to provide confirmation before removing all items from the container Is their anyway to make this work with a ' Message Box' and buttons? Link to comment Share on other sites More sharing options...
Xena95 Posted April 16, 2016 Author Share Posted April 16, 2016 Just had an idea.. What about if i get the "Item Text" to trigger an activator which runs a script that opens a message box with buttons Would that work in MenuMode? Link to comment Share on other sites More sharing options...
uhmattbravo Posted April 16, 2016 Share Posted April 16, 2016 That should work. Or you could just have another terminal set up as a sub menu. I think you could use a gamemode block though instead of the menumode. I think terminals run in gamemode, but I could be wrong. Link to comment Share on other sites More sharing options...
Recommended Posts