MadamJaye Posted June 23, 2019 Share Posted June 23, 2019 Hi so for DAYS I've been working on a script to switch between xmarkers to get themes for my house mod. Example Default is already active Player goes to the activator box/trigger etc. Message box pops up and you get X, Y, Z as options. Player clicks Z and default is disabled and everything tied to z marker appears. Player goes back to trigger and default, X, Y show up for the player to choose from. My problem I can get the script to sort of work after two glitchy rounds. So I'll click Y and it wont show up and my message box will only have one option. and so forth. Here is my script ObjectReference Property Vanilla Auto ObjectReference Property Dragonborn Auto ObjectReference Property Werewolf Auto ObjectReference Property Vampire Auto Message Property MyMessagebox Auto Event OnActivate(ObjectReference akActionRef) ObjectReference[] Themes = new ObjectReference[4] Themes[0] = Vanilla Themes[1] = Dragonborn Themes[2] = Werewolf Themes[3] = Vampire Int aiButton = MyMessagebox.Show() Int i = 0 While i < 4 If !Themes[i].IsDisabled() Themes[i].Disable(true) Endif i = i + 1 endWhile If aiButton == 0 Debug.notification("Vanilla") Themes[0].Enable(true) Elseif aiButton == 1 Debug.notification("Dragonborn") Themes[1].Enable(true) Elseif aiButton == 2 Debug.notification("Werewolf") Themes[2].Enable(true) Elseif aiButton == 3 Debug.notification("Vampire") Themes[3].Enable(true) Endif EndEvent Please help <3<3 Link to comment Share on other sites More sharing options...
Ghaunadaur Posted June 23, 2019 Share Posted June 23, 2019 Add conditions to the message buttons, in order to only show up, if the corresponding xMarker is disabled. Like so: I'm also suggesting some changes to the script. The Themes array is then filled within the properties window, this way you don't need the additional ObjectReference properties and the script doesn't need to be changed if you want to add more markers to the array later on. ObjectReference[] Property Themes Auto ; Themes[0] = Vanilla ; Themes[1] = Dragonborn ; Themes[2] = Werewolf ; Themes[3] = Vampire Message Property MyMessagebox Auto Event OnActivate(ObjectReference akActionRef) Int aiButton = MyMessagebox.Show() int i = 0 While (i < Themes.Length) if i == aiButton Themes[i].Enable() else Themes[i].Disable() endif i += 1 EndWhile EndEvent Link to comment Share on other sites More sharing options...
MadamJaye Posted June 23, 2019 Author Share Posted June 23, 2019 Hi so for DAYS I've been working on a script to switch between xmarkers to get themes for my house mod. Example Default is already active Player goes to the activator box/trigger etc. Message box pops up and you get X, Y, Z as options. Player clicks Z and default is disabled and everything tied to z marker appears. Player goes back to trigger and default, X, Y show up for the player to choose from. My problem I can get the script to sort of work after two glitchy rounds. So I'll click Y and it wont show up and my message box will only have one option. and so forth. Here is my script ObjectReference Property Vanilla Auto ObjectReference Property Dragonborn Auto ObjectReference Property Werewolf Auto ObjectReference Property Vampire Auto Message Property MyMessagebox Auto Event OnActivate(ObjectReference akActionRef) ObjectReference[] Themes = new ObjectReference[4] Themes[0] = Vanilla Themes[1] = Dragonborn Themes[2] = Werewolf Themes[3] = Vampire Int aiButton = MyMessagebox.Show() Int i = 0 While i < 4 If !Themes[i].IsDisabled() Themes[i].Disable(true) Endif i = i + 1 endWhile If aiButton == 0 Debug.notification("Vanilla") Themes[0].Enable(true) Elseif aiButton == 1 Debug.notification("Dragonborn") Themes[1].Enable(true) Elseif aiButton == 2 Debug.notification("Werewolf") Themes[2].Enable(true) Elseif aiButton == 3 Debug.notification("Vampire") Themes[3].Enable(true) Endif EndEvent Please help <3<3 I LOVE YOU, I LOVE YOU, I LOVE YOU, I LOVE YOU SOOOOOOO MUCH!!!!!!!!!!!!!!!!! It finally works!!! thank you soooooooooo much again. Do you have a specific place you want me to link to in the credits? Link to comment Share on other sites More sharing options...
Ghaunadaur Posted June 23, 2019 Share Posted June 23, 2019 I'm glad to help, credits are not necessary. :smile: Link to comment Share on other sites More sharing options...
Recommended Posts