Originally Posted by Baardvark
I can get the haste to trigger on sneaking, but can't seem to get that to depend on any stats at all. If I use "IsEqual," the buff always triggers no matter what number I have in the external int or put in the function.


EXTERN variables should be up near the rest of them before the EVENTS block, though I'm not sure it makes a difference. Lack of documentation, etc.

("INT check")
Code
INIT

EXTERN INT: %SneakHasteThreshold0 = 0
EXTERN INT: %SneakHasteThreshold1 = 1
EXTERN INT: %SneakHasteThreshold2 = 2
EXTERN INT: %SneakHasteThreshold3 = 3
EXTERN INT: %SneakHasteThreshold4 = 4
EXTERN INT: %SneakHasteThreshold5 = 5
EXTERN INT: %SneakHasteThreshold6 = 6

EVENTS
EVENT SneakBuffs
VARS
	INT: _SneakingLevel
ON
	OnCharacterStatus(__Me,SNEAKING) 
ACTIONS
	IF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold6)
	THEN
		CharacterHeal(__Me, -0.1)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold5)
	THEN
		CharacterHeal(__Me, -0.01)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold4)
	THEN
		CharacterHeal(__Me, 0.01)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold3)
	THEN
		CharacterHeal(__Me, 0.1)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold2)
	THEN
		CharacterHeal(__Me, 1)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold1)
	THEN
		CharacterHeal(__Me, 10)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold0)
	THEN
		CharacterHeal(__Me, 100)
	ENDIF

("FLOAT check")
Code
INIT

EXTERN FLOAT: %SneakHasteThreshold0 = 0
EXTERN FLOAT: %SneakHasteThreshold1 = 1
EXTERN FLOAT: %SneakHasteThreshold2 = 2
EXTERN FLOAT: %SneakHasteThreshold3 = 3
EXTERN FLOAT: %SneakHasteThreshold4 = 4
EXTERN FLOAT: %SneakHasteThreshold5 = 5
EXTERN FLOAT: %SneakHasteThreshold6 = 6

EVENTS
EVENT SneakBuffs
VARS
	FLOAT: _SneakingLevel
ON
	OnCharacterStatus(__Me,SNEAKING) 
ACTIONS
	IF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold6)
	THEN
		CharacterHeal(__Me, -0.1)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold5)
	THEN
		CharacterHeal(__Me, -0.01)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold4)
	THEN
		CharacterHeal(__Me, 0.01)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold3)
	THEN
		CharacterHeal(__Me, 0.1)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold2)
	THEN
		CharacterHeal(__Me, 1)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold1)
	THEN
		CharacterHeal(__Me, 10)
	ELIF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold0)
	THEN
		CharacterHeal(__Me, 100)
	ENDIF

I was having the same issue for trying to pull the Luck stat to get adjusted 1d6 rolls. For the life of me CharacterGetStat refuses to return any value besides 0 when it comes to certain stats. BodyBuilding was the same way. Try running both of those snippets individually and check the result. You'll be able to see what fires off based on the amount of heal the sneaking character gets.

My guess is you're running into the same issue I had with trying to pull "Luck" and "Sneaking" isn't the correct parameter it's looking for as a Stat so it just returns 0.

Quote

This is in your Player_StateManager script until I can figure out how to use my own scripts.

Yeah, no idea why you can't hook into your own scripts by adding another #INCLUDE and USING where the others are. All you should have to add into Player_StateManger.charScript is another #INCLUDE under Player_LynnStates and another USING under the other using statement as well.

Wonder if they hard capped certain statements to only be able to use a certain number of them. Biggest reason I was doing includes and using was to mimic a bit more natural of a programming flow.