Jump to content

[LE] Setting conditions, and/or question


pw508

Recommended Posts

So I'm trying to make a simple mod that makes it more dangerous to be out at night, by adding a spell to the player that reduces something like damage resistance or stamina, I haven't really decided yet.

 

Anyway what I have right now is a quest that adds the spell, and I'm trying to add conditions but I'm not sure how they interact with each other. I'm messing around with checking the "or" box but I'm basically shooting in the dark right now, I'm not sure how more than two conditions work with each other. Here's what I have so far for conditions (in the spell tab, not magic effect tab)

 

Condition 0: SubjectIsInInterior = 0.00 OR (Because I don't want this to matter in dungeons, etc)

Condition 1: SubjectGetGlobalValue(GameHour) = >=22.00 OR (So the debuff only occurs after 10pm)

Condition 2: SubjectGetGlobalValue(GameHour) = <=6.00 OR (Again, debuff only before 6am)

Condition 3: Subject.IsUndead = 0.00 OR (So it doesn't apply to vampires)

Condition 4: Subject.HasSpell(WerewolfChange "Beast Form") = 0.00 OR (So it doesnt apply to werewolves)

 

Now I know the "or's" in there are likely wrong. But basically with the conditions above, this is how I read it in my head: Apply the debuff unless the player is inside, or the time is after 10pm or before 6am, or if the player is a vampire or a werewolf. So to me it makes sense, basically don't apply the spell if any one of the conditions is met - if two or more conditions need to be met, I would think to put AND rather than OR. But I'm certain that's not the case.

 

Basically I'm just not sure how the game reads the conditions, and I'm hoping someone can help. I found some stuff searching google but it was mostly forum posts with people throwing ideas back and forth but no conclusive answers so it didn't help a whole lot, I didnt find any actual guides or instructions or info from someone who really knows what they're doing. I also tried mimicking existing entries such as the sunlight damage for vampires but after testing in game it didn't work correctly - either the spell wouldn't apply at all, or it would apply at all times, or it would apply correctly outside but would persist in interiors... I have no idea what to do.

 

So can anyone offer any help or point to any guides or tutorials?

Link to comment
Share on other sites

First of all, I want to make sure that you know that any constant damage effect that doesn't have much of an impact on a system works all the time, they just aren't applied. So the game unfortunately always reads as if you're taking some damage all the time, thus not letting the character sleep or wait. The constant sun damage for vamps issue was discussed quite a long time ago for Sacrosanct.

 

When it comes to and/or conditionals, the engine unfortunately is very picky and error-prone in those. I did some multiple or conditionals with 3 or more conditions and found that if your final condition has the "OR" flag, then the spell or spell effect can/will always run, whether it is day or night, character is in an interior or not, and such, in your case. Try changing the werewolf one from "OR" to "AND" then check if it works. It did in my case, but may not do so every time...

Link to comment
Share on other sites

if you use OR it means first valid condition matches. If you are in interieurs at night, condition is valid. If you are no werewolf but in interieurs, condition is valid. With only one of the condition matches, your spell is active. So use AND instead, because you want all of the conditions to be valid.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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