Jump to content

Creature Script Detection of Defensive harmony


Recommended Posts

I am trying to detect if a creature has the Defensive harmony bonus applied to them. There is no state or spell state that is applied when the spell is cast, but however a 'proficiency' is modified and is set to 1.

I had tried to detect this with the following script but the execution happens constantly until all instances of this spell are depleted.  Why can't i detect this spell specifically?  Any way around this?
Script:
 

// Defensive Harmony
IF
	CheckStat(Myself, 0, CLERIC_DEFENSIVE_HARMONY)
	HaveSpell(CLERIC_DEFENSIVE_HARMONY)
	THEN
		RESPONSE	#100
		Spell(Myself, CLERIC_DEFENSIVE_HARMONY)
END

I have also tried with !CheckStat(Myself, 1, CLERIC_DEFENSIVE_HARMONY) also with LT/GT and nothing works for me. I also tried using the id found in the STATS.IDS file for CLERIC_DEFENSIVE_HARMONY, which was 133.  This did not work either.

Link to comment
Guest morpheus562

If you have near infinity, I recommend going into the Defensive Harmony spell to ensure it is applying opcode 233 appropriately. Do you have detectable spells installed? Probably pedantic, but there shouldn't be any spaces in:

CheckStat(Myself,0,CLERIC_DEFENSIVE_HARMONY)
Link to comment
10 minutes ago, Bubb said:

That block works fine on my end. Maybe another mod is messing with the stat?

Interesting... I don't have many mods installed and ones that shouldn't be messing with that stats in that way.

I use:
Dlcmerge
Dragonspear UI++
hiddengameplayoptions
 

and my own mod currently.  my own mod is the only one that messes with items, but it is only making new items or patching existing ones. I don't mess with internal stats and stuff in mine.

Link to comment
5 minutes ago, morpheus562 said:

If you have near infinity, I recommend going into the Defensive Harmony spell to ensure it is applying opcode 233 appropriately. Do you have detectable spells installed? Probably pedantic, but there shouldn't be any spaces in:

CheckStat(Myself,0,CLERIC_DEFENSIVE_HARMONY)

I used near infinity to find the opcode in the first place.  I checked a save where i had previously cast it and can locate it on the creature.
image.thumb.png.ca422a3cf782ffee46c2d9ade9e595a0.png

Also, I am like 99% sure that whitespace is ignored in this language.  I have HUNDREDS of lines of other code that works properly with spaces between the parameters.

Link to comment
Guest morpheus562

hmm...let me think. Do you have DS installed? What other spells are active on your character?

You are showing us the baf file before it is compiled. What does the .bcs/.bs file look like?

Edited by morpheus562
Link to comment
3 hours ago, subtledoctor said:

Maybe the stat doesn't detect as zero if it is not applied? I guess you could try

CheckStatLT(Myself,1,CLERIC_DEFENSIVE_HARMONY)

or

!CheckStat(Myself,1,CLERIC_DEFENSIVE_HARMONY)

and/or replace "CLERIC_DEFENSIVE_HARMONY" with "133" to keep it simple.

Yeah I actually started with !CheckState as mentioned in post, along with just using 133.  My brain doesn't know off hand what 133 is but CLERIC_DEFENSIVE_HARMONY makes more sense to my non-cyber brain. :D I thought there may be a conflict but it doesn't seem so.

2 hours ago, morpheus562 said:

hmm...let me think. Do you have DS installed? What other spells are active on your character?

You are showing us the baf file before it is compiled. What does the .bcs/.bs file look like?

I'm not sure what you mean by DS?  You mean SoD? I'm on the most recent version of the game, running from steam v 2.6.6.

I did forget to mention I am using this mod that messes with .PVRZ files, its the 'Denoised 4k' assets can't remember full name right now. But i don't think that would impact the IDS file or anything? The spell seems to act as intended for all intents and purposes. 

Maybe i'll just fully remove all mods and reinstall game and start fresh and see if i can get it to work.  If others are seeing the code work then I know its just something on my end and likely (as suggested) that either mods are changing something or something is broken on my end.

I'll check that and report back should it not work.  Thanks.

Link to comment
1 hour ago, Shandalar said:

My brain doesn't know off hand what 133 is but CLERIC_DEFENSIVE_HARMONY

That is stat # 133 - which I gleaned from your screenshot :p  It’s possible the script works with the actual stat # but not the descriptive name. (Also make sure it is CheckStat, not CheckState

Link to comment

SoD, as well as EEs v2.0+ (?) in general, ships with DS package already built in.

18 hours ago, subtledoctor said:

Maybe the stat doesn't detect as zero if it is not applied?

Nah, it works fine.

Quote

It’s possible the script works with the actual stat # but not the descriptive name.

Also nah, works with both.

 

Edited by Ardanis
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...