nyteschayde Posted February 9, 2011 Share Posted February 9, 2011 So I am in the middle of trying to add a base effect for a new stat called hygiene that I am introducing for my mod, Further Needs. I am tracking the variable as a quest script variable. I've created a new Base Effect called ReduceHygiene. The effect archetype is Script. I have also attached an associated script called ReduceHygieneEffectScript. The flags are: Detrimental, Recover, Self, Touch. Now, this Base Effect is referenced in an Actor Effect called PoorHygiene200 for testing. When the correct conditions occur, namely hygiene reaches 200, the PoorHygiene200 Actor Effect gets applied to the player using Player.AddSpell PoorHygiene200. Don't worry about the logistics of adding ReduceHygiene as an effect of PoorHygiene200. I am adding here to verify it works. I can get NVSE PrintC messaging in the console for ScriptEffectStart and ScriptEffectUpdate blocks. This proves to me that the script for the Base Effect is running. This is good. Most Base Effects however have a magnitude. I've looked through the NVSE docs (nicer version written by me here) as well as the geck.bethsoft.com functions listing. I cannot see any way to: Determine the magnitude of a Base Effect with type ScriptDetermine which Actor Effects or Spells are applied to the PlayerDetermine if a particular Actor Effect/Spell is applied to the player If anyone knows how to do any of these 3 things, please let me know as soon as possible. I can simulate a magnitude if I can detect the Actor Effect/Spell that is applied. For example, "if PoorHygiene200 is applied to the Player, then magnitude should be 10." If there is some obscure function that actually gets me the magnitude I can just use that. If there is some way of looping over applied actor effects I can detect it there and make logical assumptions. I am requiring NVSE for my mod so if there is a way to do so using NVSE please let me know. Thanks in advance,Nyteschayde Link to comment Share on other sites More sharing options...
AllanOcelot Posted February 9, 2011 Share Posted February 9, 2011 oi lazy bones! back to work, You did not turn up on skype last night :O! Link to comment Share on other sites More sharing options...
davidlallen Posted February 9, 2011 Share Posted February 9, 2011 Determine the magnitude of a Base Effect with type ScriptDetermine which Actor Effects or Spells are applied to the PlayerDetermine if a particular Actor Effect/Spell is applied to the playerIf somebody else knows more details, please let us know; but AFAIK there is not much of an API for this type of information. For the second and third ones, you may want to have one boolean variable in a quest script; when your spell effect starts, set the variable; when the spell effect ends, clear the variable. Then your other scripts can access this variable. Assuming you are mostly/only interested in the effects on the player, you might do the same using an int, to track the current hygiene value. Link to comment Share on other sites More sharing options...
nyteschayde Posted February 9, 2011 Author Share Posted February 9, 2011 If somebody else knows more details, please let us know; but AFAIK there is not much of an API for this type of information. For the second and third ones, you may want to have one boolean variable in a quest script; when your spell effect starts, set the variable; when the spell effect ends, clear the variable. Then your other scripts can access this variable. Assuming you are mostly/only interested in the effects on the player, you might do the same using an int, to track the current hygiene value. The problem with this approach is that base effects like ReduceHygiene are added and specified with a magnitude when creating actor effects. The only solution that I can come up with, horrible as it may be, would be to create several different base effects. For example: ReduceHygiene10ReduceHygiene20ReduceHygiene35Etc... Wherein each of those has an associated script. The associated script would then be responsible for deducting a hard coded amount of points based on it's type (10, 20, 35, etc...). I've also noticed that it seems that the ScriptEffectFinish block hasn't fired yet for me. I'll need to track down how I can get this event to actually fire. It's also fairly crucial. I have another script that monitors the level of hygiene and applies these events so in this specific case I could use that as a trigger to know when ScriptEffectFinish is actually really supposed to fire and code the equivalent results. But none of this is ideal. It's sad really; only a few minor tweaks from Oblivion/Bethesda and this could work really well for everybody. Link to comment Share on other sites More sharing options...
rickerhk Posted February 10, 2011 Share Posted February 10, 2011 Determine the magnitude of a Base Effect with type ScriptDetermine which Actor Effects or Spells are applied to the PlayerDetermine if a particular Actor Effect/Spell is applied to the player 1. Not sure why you need a magnitude, because with the scripteffectstart block you usually apply the effect and you can also update your quest variable.2,3. There's nothing that can return them all in a list, but if you need to check if a specific one is active, there is http://geck.bethsoft.com/index.php/IsSpellTarget Link to comment Share on other sites More sharing options...
rickerhk Posted February 10, 2011 Share Posted February 10, 2011 If somebody else knows more details, please let us know; but AFAIK there is not much of an API for this type of information. For the second and third ones, you may want to have one boolean variable in a quest script; when your spell effect starts, set the variable; when the spell effect ends, clear the variable. Then your other scripts can access this variable. Assuming you are mostly/only interested in the effects on the player, you might do the same using an int, to track the current hygiene value. The problem with this approach is that base effects like ReduceHygiene are added and specified with a magnitude when creating actor effects. The only solution that I can come up with, horrible as it may be, would be to create several different base effects. For example: ReduceHygiene10ReduceHygiene20ReduceHygiene35Etc... Wherein each of those has an associated script. The associated script would then be responsible for deducting a hard coded amount of points based on it's type (10, 20, 35, etc...). I've also noticed that it seems that the ScriptEffectFinish block hasn't fired yet for me. I'll need to track down how I can get this event to actually fire. It's also fairly crucial. I have another script that monitors the level of hygiene and applies these events so in this specific case I could use that as a trigger to know when ScriptEffectFinish is actually really supposed to fire and code the equivalent results. But none of this is ideal. It's sad really; only a few minor tweaks from Oblivion/Bethesda and this could work really well for everybody. That's how rad sicknes works - in steps as a different actor effect depending on the rad level.To get the ScriptEffectFinish block to run, you do a http://geck.bethsoft...php/RemoveSpellYou can do a RemoveSpell from within the ScriptEffectUpdate block if you are all done with it. Link to comment Share on other sites More sharing options...
nyteschayde Posted February 10, 2011 Author Share Posted February 10, 2011 That's how rad sicknes works - in steps as a different actor effect depending on the rad level.To get the ScriptEffectFinish block to run, you do a http://geck.bethsoft...php/RemoveSpellYou can do a RemoveSpell from within the ScriptEffectUpdate block if you are all done with it. If you look closely you'll see that my Reduce Hygiene is supposed to be a Base Effect, not an Actor Effect. I have a PoorHygiene200 through PoorHygiene1000 as analogues to the Radiation200 through Radiation1000 Actor Effects. I am trying to simulate a *new* attribute called Hygiene. So the Base Effect ReduceHygiene is something would be applied as an effect to an Actor Effect. To try and make this more clear, the Radiation600 Actor Effect has 4 Base Effects applied to it; they are Reduced Agility (magnitude 2), Reduced Endurance (magnitude 3), Reduced Strength (magnitude 1) and Regeneration (magnitude 6). These Base Effects are what I am trying to duplicate, but in regards to my new attributes. I have created 3; currently they are Hygiene, Waste Level and Comfort. Because scripted Base Effects have no way to discern the magnitude specified for them in an Actor Effect I may have to create several base effects. This is very different than how rad sickness works (at least how I understand it). It also sounds like there isn't going to be a solution here and that I will have to go the route of creating several Base Effects when one would clearly work if there was a way to get the magnitude specified for that base effect inside an actor effect. As far as removing the actor effects go, I am currently calling Player.RemoveSpell PoorHygiene200 when the situation warrants it. I can see the effect disappear from the effects area in the PipBoy, but I still haven't seen the ScriptEffectFinish block execute. I'll play with it some more. Link to comment Share on other sites More sharing options...
Recommended Posts