Jump to content

MCM help


Magnusen2

Recommended Posts

 

 

event OnOptionSliderAccept(int a_option, float a_value) ;things here get applied when the slider value is accepted
	{Called when the user accepts a new slider value}
	if (a_option == _FemaleRatio)
		xxxFemaleChanceGlobal.SetValue(a_value)
		SetSliderOptionValue(a_option, a_value)
	endIf
endEvent


event OnOptionSelect(int option)
    if (option == _Assassins) ;if the assassin option was toggled
		if xxxGlobal_Assassins.GetValue() == 1  ;if it is already on:
			xxxGlobal_Assassins.SetValue(0)     ;sets the global to 0
			SetToggleOptionValue(_Assassins, 0) ;sets the option to 0
			WEAssassinSubChar.Revert() ;revert the changes done to the leveled list
			WEAssassinSubChar.AddForm( zxxxDefaultWEAssassinSubChar, 1) ;add the default vanilla actors
		endif	
		
		if xxxGlobal_Assassins.GetValue() == 0 ;if it is off:
			xxxGlobal_Assassins.SetValue(1)    ;sets the global to 1
			SetToggleOptionValue(_Assassins, 1);sets the option to 1
			
			;now comes the part in which the rates set on the slider are checked
			if xxxFemaleChanceGlobal.GetValue() == 0  ;if it is set to 0 = only males spawn
				WEAssassinSubChar.Revert()    
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
			
			elseif xxxFemaleChanceGlobal.GetValue() == 10 ;if the chance is 10%
				WEAssassinSubChar.Revert() 
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharNewNPCs, 1)
								
			elseif xxxFemaleChanceGlobal.GetValue() == 20 ;if the chance is 20%
				WEAssassinSubChar.Revert()
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharBanditM, 1)
				WEAssassinSubChar.AddForm( zxxxLCharNewNPCs, 1)

;this goes on  until it reaches 100. Then it goes to the next faction/creature.



 

 

 

What i'm doing:
A sort of variation mod that the user can configure (through a MCM) the rate of males to females that get spawned from leveled lists.

The problem:
There's one slider that the user can select the rate.
I also added toggleable options in which the user can choose which factions and/or types of creatures get the changes applied (e.g. bandits/forsworn/etc).
When i set the slider to a different amount, the script doesn't update the OnOptionSelect event to match the new values.

I want to force the OnOptionSelect event to reevaluate all the options contained within it every time i set the value of the slider (some code that i can throw on the OnOptionSliderAccept event)

 

Any help is appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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