Jump to content

Script not working. can someone help me?


bwins95

Recommended Posts

I'm trying to add and remove spells with mcm.it's the next step for my follower recall mod, but I can't get it to work. I've managed to make this and it compiles successfully, but it doesn't work.

 

I've spent all day on this. can somene tell me what I'm doing wrong or point me to a tutorial. I've red through the tutorials on github several times.

 

Scriptname MyConfigmenu extends SKI_ConfigBase

; OID
int toggleOID_B ; _B for toggle

Spell property aaaaa2 Auto

; State
bool toggleState = false

event OnPageReset(string page)
toggleOID_B = AddToggleOption("My Checkbox", toggleState)
endEvent

event OnOptionSelect(int option)
if (option == toggleOID_B)
toggleState = !toggleState
SetToggleOptionValue(toggleOID_B, toggleState)
if (toggleState == True)
Game.GetPlayer().AddSpell(aaaaa2)
elseif (toggleState == False)
Game.GetPlayer().RemoveSpell(aaaaa2)
endif
endIf
endEvent

Link to comment
Share on other sites

The first thing I'd do is add some simple "break points" at your AddSpell and RemoveSpell lines. Like so:

 

if (toggleState)
  Debug.Notification("Adding spell: " + aaaaa2)
  Game.GetPlayer().AddSpell(aaaaa2)
else
  Debug.Notification("Removing spell: " + aaaaa2)
  Game.GetPlayer().RemoveSpell(aaaaa2)
endif

 

 

Also, did you add the PlayerAlias with SKI_PlayerLoadGameAlias?

Link to comment
Share on other sites

 

unuroboros, on 08 Mar 2013 - 18:48, said:

The first thing I'd do is add some simple "break points" at your AddSpell and RemoveSpell lines. Like so:

if (toggleState)
  Debug.Notification("Adding spell: " + aaaaa2)
  Game.GetPlayer().AddSpell(aaaaa2)
else
  Debug.Notification("Removing spell: " + aaaaa2)
  Game.GetPlayer().RemoveSpell(aaaaa2)
endif

 

Also, did you add the PlayerAlias with SKI_PlayerLoadGameAlias?

Thanks for the response.

 

Yes, I"ve got the alias. I've added those lines and I get "adding spell: none" in game.

Edited by bwins95
Link to comment
Share on other sites

  • Recently Browsing   0 members

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