Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#576619 04/12/15 11:39 PM
Joined: Dec 2015
stranger
OP Offline
stranger
Joined: Dec 2015
Or, well, stance for now.

Still building and tweaking the rest, but hey, here's something at least.

As it stands we just have Thrill of Battle for Man-At-Arms done and there is probably a whole lot of tweaking to do as far as over/under powered aspects of it, but eh.

(Thrill of Battle Details)
Code
Thrill of Battle:
	Description: 
	Increases offensive capability at the expense of defense, becoming a more potent fighter as the battle rages. 
	Taking damage increases the effectiveness.
	Gain extra bonuses from high ability scores.

	Novice (3); 2ap; 4 turn cooldown flat; self-only
	Stage "Low" (When >70% Vitality):
		+10% chance to hit
		+10% damage
		-10% all resistances
	Stage "Moderate" (When >40%<=70% Vitality):
		+20% chance to hit
		+5% critical chance
		+20% damage
		-20% all resistances
	Stage "Maximum" (When <=40% Vitality):
		+30% chance to hit
		+10% critical chance
		+30% damage
		-30% all resistances

	Burning Tempest (Requires 5 Pyromancy):
		Level <=10:
			[low damage] on-hit
		Level >10<=15:
			[low-moderate damage] on-hit
		Level >15:
			[moderate damage] on-hit
			
	Inner Beast (requires 5 Man-at-Arms):
		Constitution (8|9|10):
			Rolls a 1d6:
				If 5 or higher:
					Restore 5% maximum Vitality on-hit
				If roll is less than 5:
					Restore 2% maximum Vitality on-hit
		Constitution (11|12|13):
			Rolls a 1d6:
				If 5 or higher:
					Restore 7% maximum Vitality on-hit
				If roll is less than 5:
					Restore 4% maximum Vitality on-hit
		Constitution >13:
			Rolls a 1d6:
				If 5 or higher:
					Restore 9% maximum Vitality on-hit
				If roll is less than 5:
					Restore 6% maximum Vitality on-hit


I'd post the code for it, but ah, there's a bit, ha ha.

So I'll just link to the files instead: Stances

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
This is really awesome. A great proof of concept, though as an actual skill it's a little complicated. So, to clarify, when you activate it, it'll stay in the "Low" stage forever unless you have less than 70/40% health? Do you lose the Maximum bonus when you're health goes above 40% and it's next turn? If so, I feel like Inner Beast kind of contradicts the skill, because you might heal on a hit and lose your max bonus. This skill would pair nice with a self-damage skill. In Scales I added a Hydrosophist skill called Transfer that lets you heal someone else and makes you bleed, though another low AP skill with a percentage self-damage would help you regulate your health too.

Quite like how the skill factors in Pyromancy, Man-At-Arms level, and Constitution, though I think 5 pyromancy and man-at-arms requirements are a little high. I think it'd be more fun to get these special bonuses a bit earlier (like, Man-At-Arms 3). You're already scaling them by level/constitution, so I don't see why you need to see their effects so late in the game (You could even scale it by Man-At-Arms level too, if you want to really reward high MaA/Pyro abilities, though that's an extra layer of complication). 2%/5% healing on hit would hardly be OP at level 8 or so when you can get Man-at-Arms 3 and you probably have less than 10 Con.

Does the heal from inner beast proc twice when you're dual wielding? That definitely makes it WAY stronger, because then you could conceivably heal 30-50% health per round if you attack 3 times with high DW score. DW warrior fits well with this skill thematically, but it'd work with two-handed too. Does Flurry proc it multiple times? And does this require a melee weapon, or could it work with a ranged weapon? Don't think there's anything wrong with that, but it's just something to consider.

Great work, overall. Can't wait to see the other stances. A movespeed on-hit stance would be cool. Maybe some kind of aggressive caster-stance that grants intelligence when you cast a spell? Would be awesome if you had to sacrifice range to use it (or maybe just offensive, short-range spells improves it, or you could get the distance from an enemy and it has to be less than 7m or so to improve your intelligence.) I'll check out your code and see if I can come up with some of my own skills that use on-hit effects and the like. Definitely opens up a lot, and having a framework is useful. Will help me scale some of my telekinesis skills better.

I may integrate this skill into Scales later, after you test it and make any changes, if that's still alright with you.

Edit: Also don't see a way to acquire this skill besides your cloth + leather scraps.

Last edited by Baardvark; 05/12/15 04:35 AM.
Joined: Dec 2015
stranger
OP Offline
stranger
Joined: Dec 2015
It's a bit... involved, yes.

The stance itself has a few components to it so I'll them break down down individually:

Thrill of Battle itself is just the stance. It offers no stats, bonuses, or negatives. Mechanically it's there to prevent the stacking of other stances and to act as a trigger in combat. Ferocity will not work outside of combat.

Ferocity is set up in stages and is only active during combat. It falls off immediately after combat ends.
As it is currently set up now, these buffs only change stages at the start of your turn.

"Low" triggers any time you're above 70% health and will stay this way until you drop to 69% health while "Moderate" triggers any time you are below 70% health but above 40% health which is when "Maximum" will trigger.

And yes, if you hit 39% health, score a hit and Inner Beast heals you past 40% when the next turn comes around you will be moved back into the "Moderate" stage. You'd still retain the "Maximum" bonuses for the duration of this turn though. It was more a matter of being able to sustain yourself just a bit longer considering that -30% resistances also includes incoming damage from crushing, piercing, and slashing as well.

Even a mage with a pigsticker is going to hurt if they don't die.

As far as the bonuses, it was more of a proof of concept idea that stuck. The original idea didn't involve them at all until that issue I had with CharacterGetStat() was tracked down so there is a whole lot of room for improvement/expansion there into other skills.

As far as dual-wielding goes, Burning Tempest and Inner Beast are both set up to proc any time damage that isn't 0 occurs if you have the Thrill of Battle buff. So yes, potentially, you could heal for really silly amounts with it dual wielding but at the same time I'm not sure you'd be able to fully utilize the stance since staying in Ferocity III would be pretty difficult. Two-handed weapons on the other hand would really shine with it since you'd be able to stay in that sweet spot of not dead and just under or over 40% hp.

Aaaand... Yeah, I totally forgot about ranged weapons, hahah. It doesn't currently have a check on whether or not it's usable only with melee.

Definitely okay with it if you wanted to integrate it and others into Scales. Sort of part of why I posted this now was to provide a proof of concept framework for this sort of thing.

Edit:
Originally Posted by Baardvark

Also don't see a way to acquire this skill besides your cloth + leather scraps.

Ah, yeah, there isn't aside from that. I hadn't looked into how to add it to vendors or anything just yet since I was more focused on the actual coding and testing of it.

Last edited by Aria Boop; 05/12/15 05:22 AM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
See you're point about dual wielding maybe getting you out of low health too quickly, but still could be a lot of healing if you have a tanky DW character (though hard with -30% resist.) Could be an interesting strategy

Looking at the code, it's mostly makes sense to me, but I don't get quite how you use CharacterHasStatus though.

CharacterHasStatus(_Char, CONSUME, LynnBoost_BurningTempest)

Other places I see this used with only two parts, like (_Char, CHILLED). Are the all caps things hardcoded status functions or defined elsewhere, and you have to essentially define the status in the function otherwise?

In general, I don't really understand what "consume" means, and why it's used and sometimes not. Is consume, like CharacterHasStatus, just used for the non hardcoded/otherwise defined elsewhere statuses (e.g., "skillboost" statuses.)

I'm trying to make a skill that lets a character cleanse statuses off an ally but they take those statuses for one round. I'm having it set a status on the cleansee (LeadersCleanse), trying to figure out the statuses removed, but not sure if I need to set a duration or not. Still trying stuff, will see tomorrow if I can figure it out.



Last edited by Baardvark; 06/12/15 06:13 AM.
Joined: Dec 2015
stranger
OP Offline
stranger
Joined: Dec 2015
Originally Posted by Baardvark

Looking at the code, it's mostly makes sense to me, but I don't get quite how you use CharacterHasStatus though.

CharacterHasStatus(_Char, CONSUME, LynnBoost_BurningTempest)

Other places I see this used with only two parts, like (_Char, CHILLED). Are the all caps things hardcoded status functions or defined elsewhere, and you have to essentially define the status in the function otherwise?

In general, I don't really understand what "consume" means, and why it's used and sometimes not. Is consume, like CharacterHasStatus, just used for the non hardcoded/otherwise defined elsewhere statuses (e.g., "skillboost" statuses.)


I didn't get it either until I started looking at the skilldata and how some skills applied statuses.

There are some hardcoded statuses like BURNED, STUNNED, CHILLED, CONSUME, STANCE, etc., and as far as I can tell those are all caps like that. However, for "custom" status effects the game utilizes the potions file to supply them.

CharacterHasStatus() can be supplied with either two or three parameters.

The first use is like you see in most instances with (_Char, CHILLED) this checks if _Char has the hardcoded Chilled status. The second use is like you see with (_Char, CONSUME, LynnBoost_BurningTempest). STANCE is the same way, it takes three parameters to check. CONSUME is the hardcoded status effect that pulls it's status data from the potions.txt file. STANCE is the same way.

Because we don't have any way to make new hardcoded status effects like BURNED we have to utilize the potions.txt and CONSUME/STANCE status to apply new status effects. It's basically a hacky, but intended, workaround to making custom skills that may just be one-off effects. Incidentally, it's also how spells like the Avatar line are modified.
Code
data "SkillProperties" "Consume,100,3,SKILLBOOST_ImmuneToFreezing"

The long and short of it is CONSUME is the hardcoded status effect that is applying the potion effect of SKILLBOOST_ImmuneToFreezing with a 100% chance of success and lasts for a duration of 3 turns whenever Avatar of Frost is cast on someone.

STANCE is the same way, the only difference is stances are can be toggled on and off and new stances overwrite the previous. Technically speaking you can bypass this by using Consume, 100, -1, someNewStance to make sub-stances with infinite duration and use a custom StackID to overwrite it in potions, but uh, something something monkey-dragon-tiger-llama-sloth stance is getting a little too meta there.

Originally Posted by Baardvark

I'm trying to make a skill that lets a character cleanse statuses off an ally but they take those statuses for one round. I'm having it set a status on the cleansee (LeadersCleanse), trying to figure out the statuses removed, but not sure if I need to set a duration or not. Still trying stuff, will see tomorrow if I can figure it out.

The only way I can, at the moment, think of accomplishing something like this would be to use a really hacky implementation of OnDamage() as we aren't able to create custom functions just yet with no editor and we don't have a trigger that checks when cast on. OnVitalityChanged() wouldn't work as we aren't able to specify a source.

("Reactive Cleanse")
Code
CHARACTER:__Me
EXTERN FLOAT:%CleanseHealAmount = -0.01

EVENT StatusCleanse
VARS
	FLOAT:_Damage
	CHARACTER:_Char
ON
	OnDamage(_, _Damage, _Char, _) 
ACTIONS
	IF "c1&c2"
		IsLessThen(_Damage, %CleanseHealAmount) // Was I healed for less than 1% of my vitality?
		CharacterHasStatus(_Char, CONSUME, LaelaBoost_Cleanser) // And does the person healing me have LaelaBoost_Cleanser on them?
	THEN
		IF "c1"
			CharacterHasStatus(__Me, BURNED) // Do I have burn?
		THEN
			CharacterRemoveStatus(__Me, BURNED) // Then remove burned from me
			CharacterApplyStatus(_Char, BURNED, 2, 1) // And apply BURNED to _Char for 2 turns and ignore saves/immunities.
		ENDIF
	ENDIF
// And so on for each debuff you want to cleanse.


LaelaBoost_Cleanser would be a one turn, no effect status that the person cleansing would apply to themselves that way the script has a way to differentiate between, say, chugging a potion and being cleansed. Because we don't have any way to make new On triggers yet you would have to apply a very small heal component to the spell. Super small, even a heal of 1 hp would work.

Another possible way to go about it might be a rolling cleanse:
("Rolling Cleanse")

Code
new entry "LynnBoost_StatusTransfer"
type "Potion"
using "_SkillBoost"
data "Duration" "1"

Code
CHARACTER:__Me	
EXTERN CHARACTER:%Cleanser = null
EXTERN FLOAT:%CleanseHealAmount = -0.01

EVENT RollingCleanse
VARS
	FLOAT:_Damage
	CHARACTER:_Char
ON
	OnDamage(_, _Damage, _Char, _)
ACTIONS
	IF "c1&c2"
		IsLessThen(_Damage, %CleanseHealAmount) // Was I healed for less than 1% of my vitality?
		CharacterHasStatus(_Char, CONSUME, LaelaBoost_Cleanser) // And does the person healing me have LaelaBoost_Cleanser on them?
	THEN
		Set(%Cleanser, _Char) // Set Laela as Lynn's Cleanser
		CharacterConsume(__Me, LynnBoost_StatusTransfer)
	ENDIF
	
		CallFunction("StatusTransfer") // Call a new function from here to facilitate transfering of buffs.

EVENT RollingCleanseWhenAttacking
ON
	OnDamage(_, _, _, _)
ACTIONS
	IF "c1"
		CharacterHasStatus(__Me, CONSUME, LynnBoost_StatusTransfer) // I was set to BURNED because I hit something with BurnContact on it. Do I have LynnBoost_StatusTransfer?
	THEN
		CallFunction("StatusTransfer")
	ENDIF

EVENT RollingCleanseWhenDebuffed
ON
	OnCharacterStatus(__Me, _) // I'm not actually sure this works. OnCharacterStatus requires a CHARACTER and a STATUS, but it should be possible to just use _ to denote any status.
ACTIONS
	IF "c1"
		CharacterHasStatus(__Me, CONSUME, LynnBoost_StatusTransfer) // I was set to BURNED. Do I have LynnBoost_StatusTransfer?
	THEN
		CallFunction("StatusTransfer")
	ENDIF

EVENT StatusTransfer
ON
	OnFunction("StatusTransfer")
ACTIONS
	IF "c1&!c2"
		CharacterHasStatus(__Me, BURNED) // Do I have burn?
		IsEqual(%Cleanser, null)
	THEN
		CharacterRemoveStatus(__Me, BURNED) // Then remove burned from me
		CharacterApplyStatus(%Cleanser, BURNED, 2, 1) // And apply BURNED to _Char for 2 turns and ignore saves/immunities.
	ENDIF
// And so on for each buff.

EVENT EndOfTurnCheck
ON
	OnTurnEnded()
ACTIONS
	IF "c1"
		CharacterHasStatus(__Me, CONSUME, LynnBoost_StatusTransfer) // Transfer any remaining debuffs at the end of my turn.
	THEN
		CallFunction("StatusTransfer")
	ELSE
		Set(%Cleanser, null) // If I no longer have LynnBoost_StatusTransfer, set %Cleanser to null as it is no longer needed.
	ENDIF


I... can't actually check if this works or not as, well, I'm at work but logically, I think it's right.

Last edited by Aria Boop; 06/12/15 07:20 PM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Thanks for the explanation. Makes sense to me now.

Tried your code, couldn't get it to work. Have tried changing it a lot, simplifying it to the most basic stuff, but it doesn't work. Can't even get this to work:
Code
INIT
CHARACTER:__Me

EVENT StatusCleanse
VARS
	FLOAT:_DMG
	CHARACTER:_Char
ON
	OnDamage(__Me,_DMG,_Char,_) 
ACTIONS
	IF "!c1"
		IsEqual(_DMG, 0)
	THEN
		IF "c1"
			CharacterHasStatus(__Me, CHILLED)
		THEN
			CharacterRemoveStatus(__Me, CHILLED)
			CharacterApplyStatus(_Char, CHILLED, 2, 1)
		ENDIF
	ENDIF


I don't know if I'm just hooking into the player script wrong? I added

#INCLUDE LeaderCleanse // Leader Cleanse skill

and

USING LeaderCleanse

to your Player_StateManager script. Is there something else I need to do to get the code to start working?

Thanks a bunch! Really want to get this skill working for the next version of Scales. And whatever LaelaStates are going to be :P

Joined: Dec 2015
stranger
OP Offline
stranger
Joined: Dec 2015
Originally Posted by Baardvark

Code
	OnDamage(__Me,_DMG,_Char,_) 



Here's the problem. OnDamage probably isn't firing off.

OnDamage() has four optional parameters: Damage type, % damage taken (float), a character source, or an item source.

So OnDamage(Fire, _DMG, _Char, _Item) should trigger from a character that dealt fire damage to you and then save the Character to _Char, the item (if any) to _Item, and how much damage in percentage it did to you in relation to your total vitality in _DMG.

Given that they're optional parameters, they can be bypassed with just _, do OnDamage(_,_,_,_) fires off any time any damage is done.

So if you changed OnDamage(__Me,_DMG,_Char,_) to OnDamage(_,_DMG,_Char,_) it should fire off correctly.

__Me in OnDamage() is already happening automatically since it's a trigger in the sense of "Did I take damage? Yes? Then do these actions."

Also, as an aside:
Code
	IF "!c1"
		IsEqual(_DMG, 0)

If _DMG does not equal to 0 basically just checks if it was a miss/block/evade or not as those return 0 damage. I'm not actually sure if this will trigger off a heal/negative damage.

Far as hooking in goes, yeah that's where the the includes/using to add new scripts would go.

Last edited by Aria Boop; 08/12/15 12:16 AM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Okay got it working. Moved the code into your state manager instead of a separate script, works now. Checked for a typo in my using/include commands a billion times, didn't find anything. Renamed LeaderCleanse to Player_LeaderCleanse and changing the using/include commands, didn't change anything. Really don't get why my script isn't getting accessed. You sure there's no other step to activate the script?

Thanks for the tip on the OnDamage function, too. Had it just as (_,_DMG,_Char_) but it wasn't working for the above reason. Thought the first parameter was damage source.

Edit: Got it completely working! Woot! Simple, if kind of brute-forcing it. The skill applies a status, LeaderCleanse, to the cleansee, and then it just finds the source of this status. Seems like CharacterGetStatusSourceCharacter didn't work with 4 parameters.

I could try doing a _Status as a variable (though not sure if it would be a Float, or Float3, or what), and then ask if that status is = to BURNED or CHILLED, and that'd probably be more efficient, though not sure if that would cleanse multiple statuses.

Really satisfying to get this working and to use in game.

Code
EVENT StatusCleanse
VARS
	FLOAT:_DMG
	CHARACTER:_Char
ON
	OnCharacterStatus(__Me,CONSUME,LeaderCleanse) 
ACTIONS
	IF "c1&c2"
		CharacterHasStatus(__Me, CHILLED)
		CharacterGetStatusSourceCharacter(__Me,CONSUME,_Char)
	THEN
		CharacterRemoveStatus(__Me, CHILLED)
		CharacterApplyStatus(_Char, CHILLED, 1, 1)
	ENDIF
	IF "c1&c2"
		CharacterHasStatus(__Me, BURNED)
		CharacterGetStatusSourceCharacter(__Me,CONSUME,_Char)
	THEN
		CharacterRemoveStatus(__Me, BURNED)
		CharacterApplyStatus(_Char, BURNED, 1, 1) 
	ENDIF
	IF "c1&c2"
		CharacterHasStatus(__Me, FROZEN)
		CharacterGetStatusSourceCharacter(__Me,CONSUME,_Char)
	THEN
		CharacterRemoveStatus(__Me, FROZEN)
		CharacterApplyStatus(_Char, FROZEN, 1, 1)
	ENDIF
	IF "c1&c2"
		CharacterHasStatus(__Me, WEAK)
		CharacterGetStatusSourceCharacter(__Me,CONSUME,_Char)
	THEN
		CharacterRemoveStatus(__Me, WEAK)
		CharacterApplyStatus(_Char, WEAK, 1, 1)
	ENDIF
// And so on for each debuff you want to cleanse.

Last edited by Baardvark; 08/12/15 01:57 AM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Okay, now I'm trying to buff the sneaking skill by applying statuses like haste to a character whenever they sneak if they have a sneaking level of higher than X. Problem is, 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. If I use IsGreaterThen, then the buff never triggers. (As a side note, they seriously called their function "IsGreaterTHEN?") It doesn't seem to matter what stat I use, or if I use EXTERN INTs (also tried as FLOATs) as the thresholds or just put the threshold numbers in the function. This is in your Player_StateManager script until I can figure out how to use my own scripts. Any insight?

The following code will always apply haste and never blessed, for example. Another thing I noticed is that it doesn't work at all (or my Leader Cleanse script) on Bairdotr, who I assume doesn't have the Player.charscript so doesn't get the Player_StateManager script. Weirdly, Wolgraff is affected, and not sure about the other companions. Something to keep in mind.

Code
EVENT SneakBuffs
VARS

	INT: _SneakingLevel
        EXTERN INT: %SneakHasteThreshold3 = 3
        EXTERN INT: %SneakHasteThreshold4 = 4
        EXTERN INT: %SneakHasteThreshold5 = 5
        EXTERN INT: %SneakHasteThreshold6 = 6
	
ON
	OnCharacterStatus(__Me,SNEAKING) 
ACTIONS
	IF "c1&c2"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsGreaterThen(_SneakingLevel,1)
	THEN
		CharacterApplyStatus(__Me, BLESSED, 2, 1)
	ENDIF
	IF "c1&(c2|c3)"
		CharacterGetStat(_SneakingLevel,__Me,Sneaking)
		IsEqual(_SneakingLevel,%SneakHasteThreshold5)
		IsEqual(_SneakingLevel,%SneakHasteThreshold6)
	THEN
		CharacterApplyStatus(__Me, HASTED, 1, 1)

Last edited by Baardvark; 08/12/15 06:35 PM.
Joined: Dec 2015
stranger
OP Offline
stranger
Joined: Dec 2015
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.

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
I can't get it to work with ANY stat, though. Vitality, WarriorLore, AirResistance (all stats I've seen used), nothing works right. The statuses activate, so I know OnCharacterStatus works with sneaking, but can't seem to make it depend on a stat. I just tried a talent, and I can get it to depend on, say Stench or Backstab. Pretty excited that I can buff talents in this way, so I guess I'll start with that, but really want to buff the sneak skill as well. Maybe I can apply some kind of status with sneak in a roundabout way.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Isn't sneaking an ability not a stat? Did you try CharacterGetAbility?

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Good point, but doesn't seem to make a difference. Tried RogueLore, Sneaking, not sure what else would work. And anyway, CharacterGetStat wasn't working with Vitality either, which is definitely a stat used in other situations. Really bizarre to me that the talent check works but other things don't.

Last edited by Baardvark; 09/12/15 02:33 AM.
Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Any progress on other stances or anything else you're working on? One thing I noticed is that I could have 2 Thrill buffs at once (level 1 and 2, as well as the base stance.) Probably should add something removes the other levels when you get a different one. Or maybe you could just give them the same stackid? It might also be possible to write it so that the buffs are stances themselves, and you don't need this extra thrill of the hunt stance status that doesn't do anything. I don't think there'd be anything wrong with letting you get the stance effects outside of combat, if that's an issue.

I sort of got the sneak thing working. Put it in the base charscript and it worked. But still have the problem where it always activates the buffs even if the sneak failed. I tried doing a check if a character can see you, then the buffs don't activate, but couldn't get that to work. Had another idea where I could do a small timer delay and check if you still had sneaking after a tiny amount of time, then apply the buffs, but couldn't get that working either >.<

Now trying to buff talents in more intricate ways. Trying to buff Hyperopia by giving you a buff for hitting long range shots. Can get the buff to apply on damage if you have the talent, but want to do a distance check and can't get that to work. (Note, just testing with stench and fortified because that's a talent one of my characters has.) Part of the problem is I don't know what the distance number exactly represents. In another script it's used as a float, and they use less than 70 as a threshold, which is enormous if that's meters. I've tried lots of small numbers with greater then, huge ones with less than, and none seem to work. Ideas?

EVENT HyperOpia

VARS
FLOAT: _Distance
CHARACTER: _Char

ON
OnDamage(_, _, _Char, _)
ACTIONS
IF "c1&c2&c3"
CharacterHasTalent(_Char,Stench)
GetDistance(_Distance,__Me,_Char)
IsGreaterThen(_Distance, 1)
THEN
CharacterApplyStatus(_Char, FORTIFIED, 2,1)
ENDIF


Edit: Also, is it possible to get the damage dealt as an integer rather than a float percentage? I'm trying to make Ice King heal you for a percentage of the water damage you deal, but it seems more like it heals you for a percentage of the enemy's life you take with your damage. This makes it too good against low-health enemies and pretty subpar against bosses. I could do it as a flat percentage heal whenever you deal water damage, but that's kind of boring.

Last edited by Baardvark; 14/12/15 09:05 PM.

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5