Jump to content

[LE] Check Conditions on Spell Target


Recommended Posts

Hi,

 

i create my own mod for "horse feeding" to expand the experience with other Survival mods.

its simple generally but works fine, but i'cant get success with checking the target.

 

i start the "feeding" with a spell:

 

Event OnEffectStart(Actor akTarget, Actor akCaster) EndEvent
at my last step i want to add an check to get sure that the "Target" is only a "PlayerHorse" and thats the point iam going complet fail :-( I test the following parts:
1.) if Target.GetFactionRank(PlayerHorseFaction) >= 0 endif
2.) if Target.GetFactionOwner() == PlayerFaction endif
3.) if Target.HasKeyword(ActorTypeHorse) endif
---Edit--- 4.) ;Race TargetRace = Target.GetRace() ;If TargetRace == HorseRace

 

1.) Its says ok on the Target Horse but also on ever NPC i'v found around

2.) give me nothing

3.) give also nothing - The Savegame is modded (Convenient Horse) so i think thats why the Keyword "ActorTypeHorse" not exists anymore ?

---Edit--- 4.) That seams also not clearly identify the Owned Horse cause NPC says also OK

 

The only good news is thats automaticaly forbidden to use the spell on not owned Horses but NPC .. :-(

 

Has anyone a tip that is not so complex - My experience with papyrus is not that deep.

Edited by Daimonicon
Link to comment
Share on other sites

Yes, i think so..

 

Faction Property PlayerHorseFaction auto
Faction Property PlayerFaction auto
I use this two propertys that i had seen in an example.
Edit:
The Wiki says ("A non-negative number equal to the actor's rank in the faction."). Logoutput give me "1" for my owned horse and my follower give me "2". 20/20 NPC in Whiterun give me "2" so nearly all. If iam getting right by checking "==1" ? The code i got from example check ">= 0" this is true for nearly all :-)
Edited by Daimonicon
Link to comment
Share on other sites

 

Yes, i think so..

 

Faction Property PlayerHorseFaction auto
Faction Property PlayerFaction auto
I use this two propertys that i had seen in an example.
Edit:
The Wiki says ("A non-negative number equal to the actor's rank in the faction."). Logoutput give me "1" for my owned horse and my follower give me "2". 20/20 NPC in Whiterun give me "2" so nearly all. If iam getting right by checking "==1" ? The code i got from example check ">= 0" this is true for nearly all :-)

 

 

This answer suggests that the properties aren't filled out, because you're responding with a code snip instead of the properties window of your script.

 

Simply declaring properties in your script's code is not enough for a script to know what's inside them. Once you've compiled your script, you need to back out to the script area of whatever object you're attaching the script to, highlight the script you want to work on, and press the "Properties" button to the right. It will bring up the Properties window, where you can then fill in your properties.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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