Jump to content

Enabling and Disable an Xmarker via terminal


LongRaider

Recommended Posts

Hello all!
I'm developing a house mod and one of its key abilities is its interaction.

I currently have many, many switches that act to disable and then re-enable objects in the mod, all linked via an xmarker.

My question: how do I do this via terminal? I (think I) know how to create a terminal.

I created a new terminal new base and reference ID and all that jazz.

Then I placed it in my house, gave it a welcome text and a menu item.

I simply copy and pasted my script I use on the buttons (a very ghetto script, I borrowed from a lights on and off script that i re purposed to enable and disable my objects) into the item result script.

In-game, I open the terminal, select the option and close the terminal.

The items aren't enabled, (or disabled) and when I try to re open the terminal, I can't.

 

Next I saw I had to link the terminal to my object so I linked the terminal to my xmarker.

Then in the item result script I simply wrote this script to disable the xmarker (and its enable children) that are initially enabled.

 

ref myLinkREF
set myLinkREF to GetLinkedRed

myLinkREF.Disable

 

That was the script used on the tutorial that suggested I link the terminal and xmarker. I changed the "myLinkREF" to the refid of my xmarker.

In game I had the same result as before, no change, unable to re access terminal.

 

Basically what I want is this one menu item will disable the xmarker if is enabled and enable it if it is disabled.

Any help would be much appreciated.

Thank you!

 

EDIT: The ghetto script was working with the switches and here it is. with my unique refids

 

scn ExampleScript
Short LightsOn
Begin OnActivate
If LightsOn != 1
board1marker.Enable
Set LightsOn to 1
Return
ElseIf LightsOn == 1
board1marker.Disable
Set LightsOn to 0
Return
Endif
End
Link to comment
Share on other sites

if (XmarkerRef.Enabled)
     XmarkerRef.Disable
else
     XmarkerRef.Enable
endif

That should disable if enabled and enable if disabled. You don't need to link the terminal to the xmarker if you have given the xmarker a unique name, just us the unique name in place of 'XmarkerRef'.

Link to comment
Share on other sites

if (XmarkerRef.Enabled)
     XmarkerRef.Disable
else
     XmarkerRef.Enable
endif

That should disable if enabled and enable if disabled. You don't need to link the terminal to the xmarker if you have given the xmarker a unique name, just us the unique name in place of 'XmarkerRef'.

 

I really appreciate the help Gribbles but I actually ended up using a message and instead of one button enabling AND disabling I used two buttons with conditions showing either disable or enable.

Again, thank you!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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