Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Posted

From my experience with SleepEz & NoDoze, the actor immediately gets up when their Fatigue is above zero and I can get it to zero by modding Fatigue in a script instantly if I wanted to I'm using this in NoDoze to wake the actor up

 

rZActor.RestoreActorValue Fatigue iFatigueMod

Guest tomm434
Posted

From my experience with SleepEz & NoDoze, the actor immediately gets up when their Fatigue is above zero and I can get it to zero by modding Fatigue in a script instantly if I wanted to I'm using this in NoDoze to wake the actor up

 

rZActor.RestoreActorValue Fatigue iFatigueMod

 

Thanks, it worked. There is difference between NPC getting knocked down because he dies and he is essential and if he loses his fatigue.

 

 

 

 

Posted

 

From my experience with SleepEz & NoDoze, the actor immediately gets up when their Fatigue is above zero and I can get it to zero by modding Fatigue in a script instantly if I wanted to I'm using this in NoDoze to wake the actor up

 

rZActor.RestoreActorValue Fatigue iFatigueMod

 

Thanks, it worked. There is difference between NPC getting knocked down because he dies and he is essential and if he loses his fatigue.

 

Yeah I'd also use DamageActorValue for the opposite as far as I remember using ModActorValue & ForceActorValue can screw with the base values and cause all sorts of issues like non-recoverable contitions by permanently resetting Maximum & Minimum values.

Posted

Imo, the best way to deal with actor values is by casting a spell with a reduce/increase base effect that is flagged as 'recover'. It just applies that on top of the base value, and cleans up when the spell is over. Those base effects are conditionalized entries in the spell too so if you want to have the end result of a specific value, you can stagger that (pretty handy with AI-related actor values because they have such a limited range).

Guest tomm434
Posted

scriptname aaalabscript

short doonce
short button
short waiting


begin OnActivate

if getstage aaalab <=75
player.showmessage mes1


elseif getstage aaalab ==78
if waiting ==0
player.showmessage mes2

set waiting to 1
endif
endif

end


begin gamemode
if waiting ==1
set button to getbuttonpressed

if (button == 0)
  player.kill
endif

if (button == 1)
set waiting to 0
endif

if (button == 2)
set waiting to 0
endif


if (button == 3)
set waiting to 0
endif

endif


end


I can't get menu to work!!At stage 78 on activate mes 2 appears(with 3 oprions). I push any button, menu dissapears and I can't use radio again because waiting is set to 1. I don't know why it doesn't work. I've got another scipt for another activator and it is simmilar and it works.

 

 

 

Scriptname aaalabovenscript

short waiting
short doonce
short button

begin onactivate
if waiting ==0
showmessage aaalabmesovenafter
set waiting to 1
endif
end

begin gamemode
if waiting ==1
set button to getbuttonpressed 


if (button ==0)
  SetObjectiveCompleted aaalab 44 1
  SetObjectiveCompleted aaalab 45 1
  setstage aaalab 74
  set waiting to 0
endif 

if (button ==1)
set waiting to 0
endif 


endif

end

 

 

 

 

 

This code doesn't work too.

 

scriptname aaalabradioscript

 

short doonce

short button

short waiting

 

 

begin OnActivate

 

if getstage aaalab <=75

player.showmessage mes1

 

 

elseif getstage aaalab ==78

player.showmessage mes2

 

 

endif

 

end

 

 

begin MenuMode 1001

 

set Button to GetButtonPressed

 

if ( Button == 1 )

player.kill

endif

 

end

 

Posted

Why are there 3 options not 4?

 

There are various notes on the ShowMessage page of the GECK wiki, check there isn't a problem with the message.

 

Also, according to the GECK wiki: 'This will only react to a ShowMessage call from within the same script.' Its just a speculation, but maybe you can only have 1 options message per script, what happens if you remove the other?

 

On style: you should use a if-elseif for the button checks, if its button 0 then you are redundantly checking 3 more conditions (it can't be 0 and 1 and 2 and 3). Your code would be a lot easier to read and debug for you and everyone if you indent every new block, and are consistent with spacing for your conditions (you use 'con == 1' and 'con ==1'), and naming capitalization - you use 'gamemode' and 'OnActivate'. Personally I use all lower case for variables and upper camel case for functions, its much easier to read (example: set button to GetButtonPressed). Your code looks really lazy. Using a proper text editor with syntax highlighting will help you avoid mistakes too, try NotePad++ with doctasax's syntax (or Vim with mine if you can be bothered with the learning curve ;)).

 

EDIT: oops thats my python var style not geck.

Guest tomm434
Posted

Why are there 3 options not 4?

 

There are various notes on the ShowMessage page of the GECK wiki, check there isn't a problem with the message.

 

Also, according to the GECK wiki: 'This will only react to a ShowMessage call from within the same script.' Its just a speculation, but maybe you can only have 1 options message per script, what happens if you remove the other?

 

On style: you should use a if-elseif for the button checks, if its button 0 then you are redundantly checking 3 more conditions (it can't be 0 and 1 and 2 and 3). Your code would be a lot easier to read and debug for you and everyone if you indent every new block, and are consistent with spacing for your conditions (you use 'con == 1' and 'con ==1'), and naming capitalization - you use 'gamemode' and 'OnActivate'. Personally I use all lower case for variables and upper camel case for functions, its much easier to read (example: set button to GetButtonPressed). Your code looks really lazy. Using a proper text editor with syntax highlighting will help you avoid mistakes too, try NotePad++ with doctasax's syntax (or Vim with mine if you can be bothered with the learning curve ;)).

 

 

Scriptname aaalabovenscript

short waiting
short doonce
short button

begin onactivate
if waiting ==0
  showmessage aaalabmesovenafter
  set waiting to 1
endif
end

begin gamemode
if waiting ==1
  set button to getbuttonpressed 


if (button ==0)
  SetObjectiveCompleted aaalab 44 1
  SetObjectiveCompleted aaalab 45 1
  setstage aaalab 74
  set waiting to 0
endif 

if (button ==1)
  set waiting to 0
endif


endif

end

 

 

 

Here is the script for other activator. For some rason if I type

elseif (button ==1)
  set waiting to 0

instead of

if (button ==1)
  set waiting to 0
endif

this button#1 doesn't work. button #0 works anyway.

 

 

 

I reduced number of buttons in script to 3 (0,1,2) and deleted mes1 and I get the same result. Well, I can always make my radio a talking activator and add all options through dialogue.

Posted

Here's a snippet from one of my scripts to show how I've got a menu setup.

 

 

Begin GameMode
	if (0 == iMenuLevel) ;Select Menu for 2p ---TOMM, ignore this as that this the entire script is actually a multilevel menu
		Set iButton0 to GetButtonPressed
		if (-1 == iButton0)
			Return
		elseif (0 == iButton0)
			ShowMessage SexoutBang2pOral1
			Set iMenuLevel to 1			
			Return
		elseif (1 == iButton0)	;Missionary
			Set iStrapOnNow to 1
			Call SexoutBangSetActors2PFxnSCRIPT rQPartner iMFPlayer iMFQPartner iStrapOnNow
			ShowMessage SexoutBang2pVagAnalMiss1
			Set iMenuLevel to 1
			Return

 

 

 

I'll say that I've never thrown a menu on an activator, so I can't speak to any idiosyncrasies of that.  I'm not sure why you're calling showmessage as player.showmessage.

 

So keep all of your button evaluations in one big if/elseif statement and make sure that the first one is if == -1, return.  That's basically saying "if someone hasn't pushed a button yet, keep waiting for it to happen."

Guest tomm434
Posted

Here's a snippet from one of my scripts to show how I've got a menu setup.

 

 

Begin GameMode
	if (0 == iMenuLevel) ;Select Menu for 2p ---TOMM, ignore this as that this the entire script is actually a multilevel menu
		Set iButton0 to GetButtonPressed
		if (-1 == iButton0)
			Return
		elseif (0 == iButton0)
			ShowMessage SexoutBang2pOral1
			Set iMenuLevel to 1			
			Return
		elseif (1 == iButton0)	;Missionary
			Set iStrapOnNow to 1
			Call SexoutBangSetActors2PFxnSCRIPT rQPartner iMFPlayer iMFQPartner iStrapOnNow
			ShowMessage SexoutBang2pVagAnalMiss1
			Set iMenuLevel to 1
			Return

 

 

 

I'll say that I've never thrown a menu on an activator, so I can't speak to any idiosyncrasies of that.  I'm not sure why you're calling showmessage as player.showmessage.

 

So keep all of your button evaluations in one big if/elseif statement and make sure that the first one is if == -1, return.  That's basically saying "if someone hasn't pushed a button yet, keep waiting for it to happen."

 

Thanks! I hope this solves my problems.

Posted

@Tomm:  Other info:  The snippet that I posted has return statements after every button.  That's only because it's a multi-level menu and it needs to get the button pressed for the next message.  So in your case, since you only have one menu that comes up, the only statement that needs a return is the button == -1.

 

I've only used menus on tokens with OnAdd, and the way to leave the menu once a final selection had been made was to use RemoveMe.  I don't know if anything special needs to happen for a menu used with OnActivate.  This could completely counter what I just said about the == -1 statement needing to be the only one that uses return.

Guest tomm434
Posted

@Tomm:  Other info:  The snippet that I posted has return statements after every button.  That's only because it's a multi-level menu and it needs to get the button pressed for the next message.  So in your case, since you only have one menu that comes up, the only statement that needs a return is the button == -1.

 

I've only used menus on tokens with OnAdd, and the way to leave the menu once a final selection had been made was to use RemoveMe.  I don't know if anything special needs to happen for a menu used with OnActivate.  This could completely counter what I just said about the == -1 statement needing to be the only one that uses return.

 

Thanks. I actually replaced the whole cutscene already(So now player doesn't do anything at all - othet npc does everthing for him) but in future I would use your code because codes that are listed in wiki are not guaranteed to work(at least for me).

 

Posted

Cipcis also has a tutorial on his page for menus, but there's a typo in the code for one of the longer/multi-level examples (either a menulevel check or button check).  I do not remember which one.  I just know that I motherfucking hate menus even though I've gotten to be pretty good at them.  :D

Posted

MCM:  I'm uncertain why two of my fields aren't showing as inactive.  The example for one of the fields is shown below.  Same config for the second one that isn't working.  Tried to prevent too much comment overspill onto other lines.

 

Essentially, Variable #13 should only be accessible (not-greyed out) if Variable #5 AND Variable #12 are enabled.  If Variable #5 is disabled, it shouldn't give a fuck that #12 (which should then be inaccessible) is enabled by default.

 

 

 

...

	SetUIFloat "StartMenu/MCM/*:1/*:5/_enable" 1
	SetUIString "StartMenu/MCM/*:1/*:5/_title" "Enable Non-Con Sex?"
	SetUIFloat "StartMenu/MCM/*:1/*:5/_type" 5
	SetUIFloat "StartMenu/MCM/*:1/*:5/_value" SexoutBangMain.iEnableNonCon  ;Enabled by Default

	Set iNonCon to 2 - SexoutBangMain.iEnableNonCon



;;;;;;Vars 6 - 11


	SetUIFloat "StartMenu/MCM/*:1/*:12/_enable" iNonCon   ; If #5 above is off, this displays but is inactive as it should be
	SetUIString "StartMenu/MCM/*:1/*:12/_title" "Player-Initiated Non-Con Sex: Use Strap-Ons?"
	SetUIFloat "StartMenu/MCM/*:1/*:12/_type" 5
	SetUIFloat "StartMenu/MCM/*:1/*:12/_value" SexoutBangMain.iUseStrapOnOnGuyPlayerNC   ;Enabled by Default
				
	if (iNonCon)     ;same var #5 
		if (SexoutBangMain.iUseStrapOnOnGuyPlayerNC)  ;When above (#12) is enabled...which is the default
			Set iStrapOnPlayerNC to 2 - SexoutBangMain.iUseStrapOnOnGuyPlayerNC  ;#13 below should only be enabled if both Non-Con and Non-Con Strap-On Use are enabled (#5 and #12)
		endif
	else
		 Set iStrapOnPlayerNC to 2   ;If #5 is disabled, #13 below should display but be inactive
	endif	


	SetUIFloat "StartMenu/MCM/*:1/*:13/_enable" iStrapOnPlayerNC 
	SetUIFloat "StartMenu/MCM/*:1/*:13/_suffix" 1
	SetUIString "StartMenu/MCM/*:1/*:13/_suffixText" "%"
	SetUIString "StartMenu/MCM/*:1/*:13/_title" "Strap-On Chance"
	SetUIFloat "StartMenu/MCM/*:1/*:13/_type" 2
	SetUIFloat "StartMenu/MCM/*:1/*:13/_value" SexoutBangMain.iStrapOnChancePlayerNC

...

 

 

Posted

More MCM!  *head-desk*

 

I'll just throw the entire fucking script in here this time.

 

What I'm trying to do:  Allow someone to select a strap-on from the list and change the resulting number from that list (since that's what lists return) to the corresponding strap-on and assign that to the ref var in my MQ.

 

Default Setup:  In my MQ initialize script, the DoOnce portion that sets up the mod sets the MCM variable iStrapOn to 4, which corresponds to the default one whose ref is set in the MQ.

 

What It's Doing: On mod load, the 4th strap-on option appears as the selected strap-on in MCM.  When I change the value of a field or if I just init sex with it, the first option is always used.  When I change the value of an MCM field, the strap-on field goes back to the 1st value.  I can set it back to another one, but the setting gets changed back whether showing up in MCM after changing a different field or in game strap-on sex.

 

The problem is with Var #9 on SubMenu 1.

 

 

 

scn SexoutBangMCMQuestSCRIPT

short iMaster
short iMouseover
short iOption
short iTemp
int iSubMenu
int iEnableStrapOns
int iStrapOn
int iStrapOnPlayerNC
int iStrapOnNPCNC
int iSelectCreatures
int iNonCon
int iCreatureMenu
float fTemp
float fValue
reference rList

begin GameMode
	if GetGameRestarted
		if IsModLoaded "The Mod Configuration Menu.esp"
			set iMaster to GetModIndex "The Mod Configuration Menu.esp"
			set rList to BuildRef iMaster 2790
			ListAddForm rList SexoutBangMCMToken
		endif
	endif
end

begin MenuMode 1013
	if IsModLoaded "The Mod Configuration Menu.esp"
	else
		Return
	endif
	
	if (GetUIFloat "StartMenu/MCM/_ActiveMod" == GetModIndex "SexoutBangatron.esp" && GetUIFloat "StartMenu/MCM/_ActiveMenu" == 0)
		Set iOption to GetUIFloat "StartMenu/MCM/_ActiveOption"
		Set fValue to GetUIFloat "StartMenu/MCM/_Value"

		if (GetUIFloat "StartMenu/MCM/*:5/SubMenu1/_enable" == 0)
			SetUIFloat "StartMenu/MCM/_ActiveSubMenu" 1
			
			SetUIFloat "StartMenu/MCM/*:5/SubMenu1/_enable" 1
			SetUIString "StartMenu/MCM/*:5/SubMenu1/text/string" "Mod Settings"
			SetUIString "StartMenu/MCM/*:8/SubTitle1/string" "Mod Settings"
			
			SetUIFloat "StartMenu/MCM/*:5/SubMenu2/_enable" 1
			SetUIString "StartMenu/MCM/*:5/SubMenu2/text/string" "NPC & Creature Types"
			SetUIString "StartMenu/MCM/*:8/SubTitle2/string" "NPC & Creature Types"
		endif

		Set iSubMenu to GetUIFloat "StartMenu/MCM/_ActiveSubMenu"
			
;1 -RESET
		
		if (GetUIFloat "StartMenu/MCM/_Reset" != 0)
			SetUIFloat "StartMenu/MCM/_Reset" 0
			if (iSubmenu == 1)
				SetUIFloat "StartMenu/MCM/*:1/_columns" 1
			
				SetUIFloat "StartMenu/MCM/*:1/*:1/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:1/_textOff" "OFF"
				SetUIString "StartMenu/MCM/*:1/*:1/_textOn" "ON"
				SetUIString "StartMenu/MCM/*:1/*:1/_title" "Debug Mode"
				SetUIFloat "StartMenu/MCM/*:1/*:1/_type" 6
				SetUIFloat "StartMenu/MCM/*:1/*:1/_value" SexoutBangMain.iDebugging
			

				SetUIFloat "StartMenu/MCM/*:1/*:2/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:2/_title" "Masturbation Menu Hotkey"
				SetUIFloat "StartMenu/MCM/*:1/*:2/_type" 3
				SetUIStringEx "StartMenu/MCM/*:1/*:2/value/*:1/string" "%k" SexoutBangMain.iMasturbation

				
				SetUIFloat "StartMenu/MCM/*:1/*:3/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:3/_title" "Con Sex Hotkey"
				SetUIFloat "StartMenu/MCM/*:1/*:3/_type" 3
				SetUIStringEx "StartMenu/MCM/*:1/*:3/value/*:1/string" "%k" SexoutBangMain.iConSex

				SetUIFloat "StartMenu/MCM/*:1/*:4/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:4/_title" "Non-Con Sex Options"
				SetUIFloat "StartMenu/MCM/*:1/*:4/_type" 0
				SetUIFloat "StartMenu/MCM/*:1/*:4/_RGB" 050241137

				
				SetUIFloat "StartMenu/MCM/*:1/*:5/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:5/_title" "Enable Non-Con Sex?"
				SetUIFloat "StartMenu/MCM/*:1/*:5/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:5/_value" SexoutBangMain.iEnableNonCon

				Set iNonCon to 2 - SexoutBangMain.iEnableNonCon
				
				SetUIFloat "StartMenu/MCM/*:1/*:6/_enable" iNonCon
				SetUIString "StartMenu/MCM/*:1/*:6/_title" "Player-Initiated Non-Con Sex Hotkey"
				SetUIFloat "StartMenu/MCM/*:1/*:6/_type" 3
				SetUIStringEx "StartMenu/MCM/*:1/*:6/value/*:1/string" "%k" SexoutBangMain.iNonConSexPlayer

				SetUIFloat "StartMenu/MCM/*:1/*:7/_enable" iNonCon
				SetUIString "StartMenu/MCM/*:1/*:7/_title" "NPC-Initiated Non-Con Sex Hotkey"
				SetUIFloat "StartMenu/MCM/*:1/*:7/_type" 3
				SetUIStringEx "StartMenu/MCM/*:1/*:7/value/*:1/string" "%k" SexoutBangMain.iNonConSexNPC				
				
				
				
				
				SetUIFloat "StartMenu/MCM/*:1/*:8/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:8/_title" "Strap-On Options"
				SetUIFloat "StartMenu/MCM/*:1/*:8/_type" 0
				SetUIFloat "StartMenu/MCM/*:1/*:8/_RGB" 050241137				


				SetUIFloat "StartMenu/MCM/*:1/*:9/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:9/_title" "Select a Strap-On"
				SetUIFloat "StartMenu/MCM/*:1/*:9/_type" 1
				if iStrapOn == 1
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon01"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon01
				elseif iStrapOn == 2
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon02"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon02
				elseif iStrapOn == 3
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon02Twin"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon02Twin
				elseif iStrapOn == 4
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon03"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon03					
				elseif iStrapOn == 5
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon04"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon04					
				elseif iStrapOn == 6
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon05DildoPurple"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon05DildoPurple
				elseif iStrapOn == 7
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon05DildoBlack"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon05DildoBlack					
				elseif iStrapOn == 8
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon05DildoPink"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon05DildoPink					
				elseif iStrapOn == 9
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon06Tentacle02"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon06Tentacle02
				elseif iStrapOn == 10
					SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon07"
					set SexoutBangMain.rStrapOn to SexoutSKSTStrapon07					
				endif

				
				
				
				SetUIFloat "StartMenu/MCM/*:1/*:10/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:10/_title" "Con Sex: Use Strap-Ons?"
				SetUIFloat "StartMenu/MCM/*:1/*:10/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:10/_value" SexoutBangMain.iUseStrapOnOnGuy

				Set iStrapOn to 2 - SexoutBangMain.iUseStrapOnOnGuy

				SetUIFloat "StartMenu/MCM/*:1/*:11/_enable" iStrapOn
				SetUIFloat "StartMenu/MCM/*:1/*:11/_suffix" 1
				SetUIString "StartMenu/MCM/*:1/*:11/_suffixText" "%"
				SetUIString "StartMenu/MCM/*:1/*:11/_title" "Strap-On Chance"
				SetUIFloat "StartMenu/MCM/*:1/*:11/_type" 2
				SetUIFloat "StartMenu/MCM/*:1/*:11/_value" SexoutBangMain.iStrapOnChance
				
				
				SetUIFloat "StartMenu/MCM/*:1/*:12/_enable" iNonCon
				SetUIString "StartMenu/MCM/*:1/*:12/_title" "Player-Initiated Non-Con Sex: Use Strap-Ons?"
				SetUIFloat "StartMenu/MCM/*:1/*:12/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:12/_value" SexoutBangMain.iUseStrapOnOnGuyPlayerNC
				
				if (iNonCon)
					if (SexoutBangMain.iUseStrapOnOnGuyPlayerNC)
					Set iStrapOnPlayerNC to 2 - SexoutBangMain.iUseStrapOnOnGuyPlayerNC
					endif
				else
					Set iStrapOnPlayerNC to 2
				endif	

;				else
;					Set iStrapOnPlayerNC to 2
;				endif

				SetUIFloat "StartMenu/MCM/*:1/*:13/_enable" iStrapOnPlayerNC
				SetUIFloat "StartMenu/MCM/*:1/*:13/_suffix" 1
				SetUIString "StartMenu/MCM/*:1/*:13/_suffixText" "%"
				SetUIString "StartMenu/MCM/*:1/*:13/_title" "Strap-On Chance"
				SetUIFloat "StartMenu/MCM/*:1/*:13/_type" 2
				SetUIFloat "StartMenu/MCM/*:1/*:13/_value" SexoutBangMain.iStrapOnChancePlayerNC			
			
				SetUIFloat "StartMenu/MCM/*:1/*:14/_enable" iNonCon
				SetUIString "StartMenu/MCM/*:1/*:14/_title" "NPC-Initiated Non-Con Sex: Use Strap-Ons?"
				SetUIFloat "StartMenu/MCM/*:1/*:14/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:14/_value" SexoutBangMain.iUseStrapOnOnGuyNPCNC

;				if (iNonCon)
					Set iStrapOnNPCNC to SexoutBangMain.iUseStrapOnOnGuyNPCNC
;				else	
;					Set iStrapOnNPCNC to 2
;				endif				


				SetUIFloat "StartMenu/MCM/*:1/*:15/_enable" iStrapOnNPCNC
				SetUIFloat "StartMenu/MCM/*:1/*:15/_suffix" 1
				SetUIString "StartMenu/MCM/*:1/*:15/_suffixText" "%"
				SetUIString "StartMenu/MCM/*:1/*:15/_title" "Strap-On Chance"
				SetUIFloat "StartMenu/MCM/*:1/*:15/_type" 2
				SetUIFloat "StartMenu/MCM/*:1/*:15/_value" SexoutBangMain.iStrapOnChanceNPCNC				
				;Duration - Slider vs. Drop-Down List
				
;				SetUIFloat "StartMenu/MCM/*:1/*:15/_enable" 1
;				SetUIString "StartMenu/MCM/*:1/*:15/_title" "Sex Duration Options"
;				SetUIFloat "StartMenu/MCM/*:1/*:15/_type" 0
;				SetUIFloat "StartMenu/MCM/*:1/*:15/_RGB" 255255255			
				
				
			elseif (iSubmenu == 2)
				SetUIFloat "StartMenu/MCM/*:1/_columns" 2
				SetUIFloat "StartMenu/MCM/*:1/*:1/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:1/_title" "Selectable Humanoids"
				SetUIFloat "StartMenu/MCM/*:1/*:1/_type" 0
				SetUIFloat "StartMenu/MCM/*:1/*:1/_RGB" 050241137

				SetUIFloat "StartMenu/MCM/*:1/*:3/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:3/_title" "Humans"
				SetUIFloat "StartMenu/MCM/*:1/*:3/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:3/_value" SexoutBangMain.iHumans
				
				SetUIFloat "StartMenu/MCM/*:1/*:4/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:4/_title" "Ghouls"
				SetUIFloat "StartMenu/MCM/*:1/*:4/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:4/_value" SexoutBangMain.iGhouls
				
				SetUIFloat "StartMenu/MCM/*:1/*:5/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:5/_title" "Super Mutants"
				SetUIFloat "StartMenu/MCM/*:1/*:5/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:5/_value" SexoutBangMain.iSuperMutant				
				
				SetUIFloat "StartMenu/MCM/*:1/*:9/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:9/_textOff" "NO"
				SetUIString "StartMenu/MCM/*:1/*:9/_textOn" "YES"
				SetUIString "StartMenu/MCM/*:1/*:9/_title" "Allow Creatures?"
				SetUIFloat "StartMenu/MCM/*:1/*:9/_type" 6
				SetUIFloat "StartMenu/MCM/*:1/*:9/_value" SexoutBangMain.iAllowCreatures
				SetUIFloat "StartMenu/MCM/*:1/*:9/_RGB" 050241137

				
				Set iSelectCreatures to 2 - SexoutBangMain.iAllowCreatures
				
				SetUIFloat "StartMenu/MCM/*:1/*:11/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:11/_title" "Ants"
				SetUIFloat "StartMenu/MCM/*:1/*:11/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:11/_value" SexoutBangMain.iAnt

				SetUIFloat "StartMenu/MCM/*:1/*:12/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:12/_title" "Mantises"
				SetUIFloat "StartMenu/MCM/*:1/*:12/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:12/_value"  SexoutBangMain.iMantis				
				
				SetUIFloat "StartMenu/MCM/*:1/*:13/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:13/_title" "Bighorners"
				SetUIFloat "StartMenu/MCM/*:1/*:13/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:13/_value" SexoutBangMain.iBighorner

				SetUIFloat "StartMenu/MCM/*:1/*:14/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:14/_title" "Mole Rats"
				SetUIFloat "StartMenu/MCM/*:1/*:14/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:14/_value"  SexoutBangMain.iMoleRats
				
				
				SetUIFloat "StartMenu/MCM/*:1/*:15/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:15/_title" "Bloatflies"
				SetUIFloat "StartMenu/MCM/*:1/*:15/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:15/_value" SexoutBangMain.iBloatfly

				SetUIFloat "StartMenu/MCM/*:1/*:16/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:16/_title" "Lakelurks"
				SetUIFloat "StartMenu/MCM/*:1/*:16/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:16/_value" SexoutBangMain.iMirelurk		
				
				
				SetUIFloat "StartMenu/MCM/*:1/*:17/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:17/_title" "Cazadors"
				SetUIFloat "StartMenu/MCM/*:1/*:17/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:17/_value" SexoutBangMain.iCazador				
				
				
				SetUIFloat "StartMenu/MCM/*:1/*:18/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:18/_title" "Nightstalkers"
				SetUIFloat "StartMenu/MCM/*:1/*:18/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:18/_value" SexoutBangMain.iNightstalker		
				
				SetUIFloat "StartMenu/MCM/*:1/*:19/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:19/_title" "Centaurs"
				SetUIFloat "StartMenu/MCM/*:1/*:19/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:19/_value" SexoutBangMain.iCentaur

				SetUIFloat "StartMenu/MCM/*:1/*:20/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:20/_title" "Radroaches"
				SetUIFloat "StartMenu/MCM/*:1/*:20/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:20/_value"  SexoutBangMain.iRadroaches				
				
				SetUIFloat "StartMenu/MCM/*:1/*:21/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:21/_title" "Deathclaws"
				SetUIFloat "StartMenu/MCM/*:1/*:21/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:21/_value" SexoutBangMain.iDeathclaw


				SetUIFloat "StartMenu/MCM/*:1/*:22/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:22/_title" "Rats"
				SetUIFloat "StartMenu/MCM/*:1/*:22/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:22/_value" SexoutBangMain.iGiantRats


				SetUIFloat "StartMenu/MCM/*:1/*:23/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:23/_title" "Dogs"
				SetUIFloat "StartMenu/MCM/*:1/*:23/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:23/_value" SexoutBangMain.iDog
				
				SetUIFloat "StartMenu/MCM/*:1/*:24/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:24/_title" "Scorpions"
				SetUIFloat "StartMenu/MCM/*:1/*:24/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:24/_value"  SexoutBangMain.iScorpions				

				
				SetUIFloat "StartMenu/MCM/*:1/*:25/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:25/_title" "Feral Ghouls"
				SetUIFloat "StartMenu/MCM/*:1/*:25/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:25/_value" SexoutBangMain.iFeralGhoul	
				
		
				SetUIFloat "StartMenu/MCM/*:1/*:26/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:26/_title" "Spore Plants"
				SetUIFloat "StartMenu/MCM/*:1/*:26/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:26/_value" SexoutBangMain.iSporePlant				

				SetUIFloat "StartMenu/MCM/*:1/*:27/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:27/_title" "Geckos"
				SetUIFloat "StartMenu/MCM/*:1/*:27/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:27/_value" SexoutBangMain.iGecko

				SetUIFloat "StartMenu/MCM/*:1/*:28/_enable" iSelectCreatures
				SetUIString "StartMenu/MCM/*:1/*:28/_title" "Other"
				SetUIFloat "StartMenu/MCM/*:1/*:28/_type" 5
				SetUIFloat "StartMenu/MCM/*:1/*:28/_value"  SexoutBangMain.iOther
			endif			
;2 - DEFAULT				
		elseif GetUIFloat "StartMenu/MCM/_Default"		
			SetUIFloat "StartMenu/MCM/_Default" 0
			SetUIFloat "StartMenu/MCM/_Reset" 1
			if (1 == iSubMenu)
				Set SexoutBangMain.iDebugging to 0
				Set SexoutBangMain.iMasturbation to 21
				Set SexoutBangMain.iConSex to 36
				Set SexoutBangMain.iUseStrapOnOnGuy to 1
				Set SexoutBangMain.iStrapOnChance to 50
				Set SexoutBangMain.iUseStrapOnOnGuyPlayerNC to 1
				Set SexoutBangMain.iStrapOnChancePlayerNC to 100
				Set SexoutBangMain.iUseStrapOnOnGuyNPCNC to 1
				Set SexoutBangMain.iStrapOnChanceNPCNC to 100
				Set iStrapOn to 4
				Set SexoutBangMain.rStrapOn to SexoutSKSTStrapon03
				Set SexoutBangMain.iEnableNonCon to 1
				Set SexoutBangMain.iNonConSexPlayer to 37
				Set SexoutBangMain.iNonConSexNPC to 38
			
			elseif (2 == iSubMenu)
				Set SexoutBangMain.iHumans to 1
				Set SexoutBangMain.iGhouls to 1
				Set SexoutBangMain.iSuperMutant to 1
				Set SexoutBangMain.iAllowCreatures to 1
				Set SexoutBangMain.iAnt to 1
				Set SexoutBangMain.iMantis to 1			
				Set SexoutBangMain.iBighorner to 1
				Set SexoutBangMain.iMoleRats to 1
				Set SexoutBangMain.iBloatfly to 1
				Set SexoutBangMain.iMirelurk to 1
				Set SexoutBangMain.iCazador to 1
				Set SexoutBangMain.iNightstalker to 1
				Set SexoutBangMain.iCentaur to 1
				Set SexoutBangMain.iRadroaches to 1
				Set SexoutBangMain.iDeathclaw to 1
				Set SexoutBangMain.iGiantRats to 1
				Set SexoutBangMain.iDog to 1
				Set SexoutBangMain.iScorpions to 1
				Set SexoutBangMain.iFeralGhoul to 1
				Set SexoutBangMain.iSporePlant to 1
				Set SexoutBangMain.iGecko to 1
				Set SexoutBangMain.iOther to 1	
			endif	
			
;3 - NEW VALUE			
		elseif (GetUIFloat "StartMenu/MCM/_NewValue" != 0)		
			SetUIFloat "StartMenu/MCM/_NewValue" 0
			SetUIFloat "StartMenu/MCM/_Reset" 1
			if (iSubmenu == 1)
				if (iOption == 1)
					Set SexoutBangMain.iDebugging to fValue
				elseif (iOption == 2)
					if (fValue != SexoutBangMain.iConSex)
						set SexoutBangMain.iMasturbation to fValue
					endif
				elseif (iOption == 3)
					if (fValue != SexoutBangMain.iMasturbation)
						set SexoutBangMain.iConSex to fValue
					endif
				elseif (iOption == 5)
					set SexoutBangMain.iEnableNonCon to fValue					
				elseif (iOption == 6)
					if ((fValue != SexoutBangMain.iConSex) && (fValue != SexoutBangMain.iNonConSexNPC) && (fValue != SexoutBangMain.iMasturbation))
						set SexoutBangMain.iNonConSexPlayer to fValue
					endif
				elseif (iOption == 7)
					if ((fValue != SexoutBangMain.iConSex) && (fValue != SexoutBangMain.iNonConSexPlayer) && (fValue != SexoutBangMain.iMasturbation))				
						set SexoutBangMain.iNonConSexNPC to fValue
					endif
				elseif (iOption == 9)
					set iStrapOn to fValue
				elseif (iOption == 10)
					set SexoutBangMain.iUseStrapOnOnGuy to fValue
				elseif (iOption == 11)
					set SexoutBangMain.iStrapOnChance to fValue
				elseif (iOption == 12)
					set SexoutBangMain.iUseStrapOnOnGuyPlayerNC to fValue
				elseif (iOption == 13)
					set SexoutBangMain.iStrapOnChancePlayerNC to fValue	
				elseif (iOption == 14)
					set SexoutBangMain.iUseStrapOnOnGuyNPCNC to fValue
;				elseif (iOption == 15)
;					set SexoutBangMain.iStrapOnChanceNPCNC to fValue
				endif
			elseif (iSubmenu == 2)
				if (iOption == 3)
					set SexoutBangMain.iHumans to fValue
				elseif (iOption == 4)
					set SexoutBangMain.iGhouls to fValue
				elseif (iOption == 5)
					set SexoutBangMain.iSuperMutant to fValue
				elseif (iOption == 9)
					set SexoutBangMain.iAllowCreatures to fValue			
				elseif (iOption == 11)
					set SexoutBangMain.iAnt to fValue
				elseif (iOption == 12)
					set SexoutBangMain.iMantis to fValue
				elseif (iOption == 13)
					set SexoutBangMain.iBighorner to fValue
				elseif (iOption == 14)
					set SexoutBangMain.iMoleRats to fValue
				elseif (iOption == 15)
					set SexoutBangMain.iBloatfly to fValue
				elseif (iOption == 16)
					set SexoutBangMain.iMirelurk to fValue
				elseif (iOption == 17)
					set SexoutBangMain.iCazador to fValue
				elseif (iOption == 18)
					set SexoutBangMain.iNightstalker to fValue
				elseif (iOption == 19)
					set SexoutBangMain.iCentaur to fValue
				elseif (iOption == 20)
					set SexoutBangMain.iRadroaches to fValue
				elseif (iOption == 21)
					set SexoutBangMain.iDeathclaw to fValue
				elseif (iOption == 22)
					set SexoutBangMain.iGiantRats to fValue
				elseif (iOption == 23)
					set SexoutBangMain.iDog to fValue
				elseif (iOption == 24)
					set SexoutBangMain.iScorpions to fValue
				elseif (iOption == 25)
					set SexoutBangMain.iFeralGhoul to fValue
				elseif (iOption == 26)
					set SexoutBangMain.iSporePlant to fValue
				elseif (iOption == 27)
					set SexoutBangMain.iGecko to fValue
				elseif (iOption == 28)
					set SexoutBangMain.iOther to fValue
				endif
			endif
			
			
			
;4 - SHOW LIST
		elseif GetUIFloat "StartMenu/MCM/_ShowList" == 1		
			SetUIFloat "StartMenu/MCM/_ShowList" 2
			if (1 == iSubMenu)
				if (iOption == 9)
					SetUIString "StartMenu/MCM/*:3/_title" "Select a Strap-On"
					SetUIFloat "StartMenu/MCM/*:3/*:1/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:2/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:3/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:4/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:5/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:6/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:7/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:8/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:9/_enable" 1
					SetUIFloat "StartMenu/MCM/*:3/*:10/_enable" 1
					SetUIString "StartMenu/MCM/*:3/*:1/text/string" "SexoutSKSTStrapon01 (Black w/ Straps)"
					SetUIString "StartMenu/MCM/*:3/*:2/text/string" "SexoutSKSTStrapon02  (Red w/ Straps)"
					SetUIString "StartMenu/MCM/*:3/*:3/text/string" "SexoutSKSTStrapon02Twin (2 Dildos w/ Straps)"
					SetUIString "StartMenu/MCM/*:3/*:4/text/string" "SexoutSKSTStrapon03 (Light Pink w/ Straps)"
					SetUIString "StartMenu/MCM/*:3/*:5/text/string" "SexoutSKSTStrapon04 (Black w/ Straps)"
					SetUIString "StartMenu/MCM/*:3/*:6/text/string" "SexoutSKSTStrapon05DildoPurple (Purple w/o Straps)"
					SetUIString "StartMenu/MCM/*:3/*:7/text/string" "SexoutSKSTStrapon05DildoBlack (Black w/o Straps)"
					SetUIString "StartMenu/MCM/*:3/*:8/text/string" "SexoutSKSTStrapon05DildoPink (Pink w/o Straps)"
					SetUIString "StartMenu/MCM/*:3/*:9/text/string" "SexoutSKSTStrapon06Tentacle02 (Fleshy w/o Straps)"
					SetUIString "StartMenu/MCM/*:3/*:10/text/string" "SexoutSKSTStrapon07 (White  w/ Straps)"
					SetUIFloat "StartMenu/MCM/_Value" iStrapOn
				endif
			elseif (2 == iSubMenu)
			endif
;5 - SHOW SCALE
		elseif GetUIFloat "StartMenu/MCM/_ShowScale" == 1		
			SetUIFloat "StartMenu/MCM/_ShowScale" 2
			if (iSubMenu == 1)
				if (iOption == 11)
					SetUIFloat "StartMenu/MCM/_Value" SexoutBangMain.iStrapOnChance
					SetUIFloat "StartMenu/MCM/_ValueDecimal" 0
					SetUIFloat "StartMenu/MCM/_ValueIncrement" 1
					SetUIFloat "StartMenu/MCM/_ValueMax" 100
					SetUIFloat "StartMenu/MCM/_ValueMin" 1
					SetUIString "StartMenu/MCM/*:2/_suffixText" "%"
					SetUIString "StartMenu/MCM/*:2/_title" "Strap-On Chance"			
				elseif (iOption == 13)
					SetUIFloat "StartMenu/MCM/_Value" SexoutBangMain.iStrapOnChancePlayerNC
					SetUIFloat "StartMenu/MCM/_ValueDecimal" 0
					SetUIFloat "StartMenu/MCM/_ValueIncrement" 1
					SetUIFloat "StartMenu/MCM/_ValueMax" 100
					SetUIFloat "StartMenu/MCM/_ValueMin" 1
					SetUIString "StartMenu/MCM/*:2/_suffixText" "%"
					SetUIString "StartMenu/MCM/*:2/_title" "Player Strap-On Chance"			
				elseif (iOption == 15)
					SetUIFloat "StartMenu/MCM/_Value" SexoutBangMain.iStrapOnChanceNPCNC
					SetUIFloat "StartMenu/MCM/_ValueDecimal" 0
					SetUIFloat "StartMenu/MCM/_ValueIncrement" 1
					SetUIFloat "StartMenu/MCM/_ValueMax" 100
					SetUIFloat "StartMenu/MCM/_ValueMin" 1
					SetUIString "StartMenu/MCM/*:2/_suffixText" "%"
					SetUIString "StartMenu/MCM/*:2/_title" "NPC Strap-On Chance"
				endif				
			elseif (2 == iSubMenu)
			endif
;6 - DEFAULT SCALE
		elseif GetUIFloat "StartMenu/MCM/_DefaultScale"		
			SetUIFloat "StartMenu/MCM/_DefaultScale" 0
			SetUIFloat "StartMenu/MCM/_ShowScale" 2
			if (1 == iSubMenu)
				if (11 == iOption)
					SetUIFloat "StartMenu/MCM/_Value" 50
				elseif (13 == iOption)
					SetUIFloat "StartMenu/MCM/_Value" 100				
				elseif (15 == iOption)
					SetUIFloat "StartMenu/MCM/_Value" 100
				endif
			elseif (2 == iSubMenu)
			endif
		endif
;7 - MOUSE-OVER
		elseif iMouseover != GetUIFloat "StartMenu/MCM/*:1/_optionID"		
			set iMouseover to GetUIFloat "StartMenu/MCM/*:1/_optionID"
			if iMouseover
				SetUIFloat "StartMenu/MCM/MCM_Info/visible" 1
				if (1 == iSubMenu)
					if iMouseover == 1
					else
						SetUIFloat "StartMenu/MCM/*:9/visible" 0
					endif
				elseif (2 == iSubMenu)
					
				endif
			endif
		endif
	
end

 

 

 

EDIT:  I've thought about other ways to translate the number to a selection.  Perhaps I should just say "fuck it" and pass the value in to be used to select a cell in an array that has the refs of the strap-ons?

Posted

 

 

.....
elseif iStrapOn == 10
                    SetUIString "StartMenu/MCM/*:1/*:9/value/*:1/string" "SexoutSKSTStrapon07"
                    set SexoutBangMain.rStrapOn to SexoutSKSTStrapon07                    
                endif                     
                
                .......
        SetUIFloat "StartMenu/MCM/*:1/*:10/_value" SexoutBangMain.iUseStrapOnOnGuy
....

                Set iStrapOn to 2 - SexoutBangMain.iUseStrapOnOnGuy

 

 

 

- You reset var iStrapOn straight after the if-elif block, thats why it resets to 1.

 

What happens if you use a conditional instead of the magic number:

 

 

Set iNonCon to 2 - SexoutBangMain.iEnableNonCon
SetUIFloat "StartMenu/MCM/*:1/*:12/_enable" iNonCon 
 
; instead something like:
int _SHOW
int _GREYED
set _SHOW to 1
set _GREYED to 2
 
if SexoutBangMain.iEnableNonCon
    SetUIFloat "StartMenu/MCM/*:1/*:12/_enable" _SHOW
else
    SetUIFloat "StartMenu/MCM/*:1/*:12/_enable" _GREYED
endif

 

 

Posted

Ah yes...the old "I renamed a variable to an existing variable."  *head meets desk*

 

Will report back on conditional w/ variable.

 

 

Posted

Is there a reason that you used underscores at the beginning of the variable names?

 

EDIT:  I just learned about compiler override, so I want to make sure that I've got my shit straight.

Posted

Not really, its just for readability, to signify the int is a constant value matching some type field.  int _TYPEDEF = SomeMeaninglessLookingNumber.

 

The underscore does prevent conflicts with vanilla forms/globals etc. You can't have a var named 'Goodsprings' but you can have '_Goodsprings'.

 

You could just use a '2' instead of '_GREYED', but it might make your eyes bleed a little bit less reading MCM code ;)

Posted

I think it causes real havoc w/ starting a script name with a number, but starting with a number seems like a bad idea anyway.

Posted

Is that just numbers, or any special characters? I use quite a few variable names starting with an underscore and haven't noticed any problems, although I don't think any names in the vanilla game include them at all, which made me nervous at first.

Posted

concerning numbers, some objects cause troubles while some other don't, you can call a weapon starting with a number but you can't call a quest. I've read it creates issues when it's referred on scripts because the compiler can't understand if it's hex or not, I sell it as I've read it... but concerning underscore I've never tried. Some symbols are forbidden, the compiler doesn't find issues but the script breaks in game, as the ones over the numbers, but anyway my feeling is I still would be careful with any symbol

Posted

Anecdote time!

 

 

 

Back in the day I was a teacher's assistant to the comp sci teacher for a summer program for kids.  One of them made a program that compiled fine but kept throwing out weird/wrong results.  This stumped us all for awhile...until I noticed that the guy had put zeroes in front of some numbers.  The weird results were due to the compiler interpreting them as octal instead of decimal.  I figured that one out.  feelsgoodman.jpg

 

 

Posted

MCM Fix:  If you have a var that's only going to be equal to 0 or 1, 2 minus it will never equal 0.

 

MCM/Debugging Issue:

 

If I turn on the Debugging option that I added to the MCM menu and go back into the game, I get a Visual C++ Runtime Error crash.  If I turn it on and then back off and go back into the game, it's fine.

 

The MCM script is straightforward.

 

 

				SetUIFloat "StartMenu/MCM/*:1/*:1/_enable" 1
				SetUIString "StartMenu/MCM/*:1/*:1/_textOff" "OFF"
				SetUIString "StartMenu/MCM/*:1/*:1/_textOn" "ON"
				SetUIString "StartMenu/MCM/*:1/*:1/_title" "Debug Mode"
				SetUIFloat "StartMenu/MCM/*:1/*:1/_type" 6
				SetUIFloat "StartMenu/MCM/*:1/*:1/_value" SexoutBangMain.iDebugging

 

 

 

Here's the code in the MQ that actually activates debugging mode.

 

 

	if iDebugging && iSetupDebugging     ;When the mod is initialized, iDebugging = 0 (this is the one that is toggled by MCM) and iSetupDebugging = 1
		setdebugmode 1
		Set iSetupDebugging to 0
		Call SexoutBangWriteMCMSettingsToFileSCRIPT   ;UDF that just writes all values that are modified by MCM to the console with a billion debugprint statements
	endif

 

 

 

DebugPrint statements have been placed upside down, sideways, and counterclockwise in different scripts. (And more are still needed :@ )

 

FWIW, I reinstalled Vis. C++ 2008 to make sure that nothing had gotten fucked up by _____.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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