Jump to content

Xena95

Recommended Posts

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 buttonVar

showmessage TerminalMessage01

set buttonVar to getbuttonpressed

if buttonVar == 0
TerminalContainer.removeallitems
elseif buttonVar == 1
; Do nothing
endIf

______________________________________________________________________________________

Link to comment
Share on other sites

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 by uhmattbravo
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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