A few final questions to help me wrap up the new THS

Post » Sun Nov 18, 2012 2:50 am

It would greatly help me speed up this last part of finishing off the complete rework of my THS mod if I can have some simple advice on a few topics.

I was lucky in being able to fully support vampires without having to touch any scripts or anything outside of my MOD. All I had to do was check for total necks bitten in the players general status. (Yay compatibility, bite a neck get fed!)

questions:
  • Is it possible to do something similar to the above to support werewolves eating bodies? ( Similar as in not having to touch anything outside of THS )
  • Is it possible to do something similar to the above to support cannibalism? ( Similar as in not having to touch anything outside of THS )
I want to fully support Frost Fall in the new version of THS. So far the only thing I think that is not compatible is that foods do not warm you up when combined with THS.

question:
  • What are all the effects that I need to consider to make sure all foods work with Frost Fall?
For a survival mod such as THS is there anything else in general I need to think about? Am I missing any details? hmm
Remember this is a complete from the ground up redesign of THS, the overall quality of the mod has been raised DRASTICALLY on every possible front.
User avatar
Erika Ellsworth
 
Posts: 3333
Joined: Sat Jan 06, 2007 5:52 am

Post » Sat Nov 17, 2012 8:19 pm

I was lucky in being able to fully support vampires without having to touch any scripts or anything outside of my MOD. All I had to do was check for total necks bitten in the players general status.
This isn't indicative that the player is a vampire, only that they were one in the past. Here is the function I use to check for vampirism and set the bool property bIsVampire to True or False. The Belua Sanguinare compatibility section may or may not barf a bunch of errors into your log. It used to, but I haven't tested it in a while.

Spoiler
bool function GetVampirismState()                    ;Approved 1.6.1    bool bIsVampire = false    if VampireQuestRef.VampireStatus >= 1        bIsVampire = true    else        ;Belua Sanguinare Vampirism Check        bool isBSRLoaded = Game.GetFormFromFile(0x02001DB8, "MM_BeluaSangunaireRevisited.esp")        if (isBSRLoaded)            Form isBSRVampire = Game.GetFormFromFile(0x02001DB8, "MM_BeluaSangunaireRevisited.esp")            if (isBSRVampire as GlobalVariable).GetValue() >= 1.0                bIsVampire = true            endif        endif    endif    return bIsVampireendFunction

Werewolves: here's how I do it. There might be a better way. I'm still reviewing it. Maybe it will point you in the right direction.

Spoiler
Scriptname _DE_WerewolfMonitor2 extends ReferenceAlias; #SUMMARY# =====================================================================================================================; Name ...................: _DE_WerewolfMonitor2; Attached To (EditorID)..:; Description ............: Monitor's the player's Werewolf state and activities to apply Exposure bonuses.; Author .................: Chesko; Last Approved (version) : 1.6b; Status .................: Needs Review; Remarks ................: Needs compatibility support for Tales of Lycanthropy; ===============================================================================================================================GlobalVariable property _DE_ExposurePoints autorace property WerewolfBeastRace autoMagicEffect property WerewolfFeedRestoreHealth autoimport debugEvent OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)    ;notification("I am feeding")    if akEffect == WerewolfFeedRestoreHealth        if _DE_ExposurePoints.GetValue() <= 110.0                                ;Prevent EP being set too high            _DE_ExposurePoints.SetValue(_DE_ExposurePoints.GetValue() + 10.0)        elseif _DE_ExposurePoints.GetValue() > 110.0            _DE_ExposurePoints.SetValue(120.0)        endif    endifendEvent

Cannibalism - Haven't tried that yet.

Frostfall - you probably saw my other post in the Frostfall thread, but you don't need to do anything. I look for foods to be "equipped" (eaten) by the Player Alias. I don't support new food items.

Good luck!
User avatar
Far'ed K.G.h.m
 
Posts: 3464
Joined: Sat Jul 14, 2007 11:03 pm

Post » Sat Nov 17, 2012 8:42 pm

Awesome response Chesko, this will be way more than enough for me to work with. I bet I can get cannibalism to work with:
"Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)"

On the vampire effect I was not clear as all I did was constantly run a check to see if necks bit increases at all. If it does then I restore thirst hunger and exhaustion.
For the rest all I do is check the global variable that seems to be hooked up fairly well and seems to be working nicely at the moment. Looking over the code it SEEMS to be safe to reference that global variable. Werewolves have a similar global as well.

You seem to be referencing the Vampire quest though and I wonder if that is more reliable.

I think its super awesome that food is already supported fully in THS without any additional effort on my part! I also dont add any new foods as that is out of the scope of THS.

This leaves only one thing left to think about... How should the player be able to drink from ponds rivers lakes and streams... <--- Most likely the answer is they wont. :/
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Sat Nov 17, 2012 1:07 pm

Event OnMagicEffectApply(ObjectReference akCaster, MagicEffect akEffect)
if akEffect == WerewolfFeedRestoreHealth
;notification("I am feeding")

endif
endEvent
I have a question about the above function. It does not seem to want to fire off when I eat as a werewolf. This may be simply because I tested by just adding the beast form spell to my magic inventory.
Is there anything I should know about the above code to get it to work properly?

Nevermind I just figured it out. I never said who the caster is so it doesn't know who to check to see if the effect has been added to.. XD
User avatar
Genevieve
 
Posts: 3424
Joined: Sun Aug 13, 2006 4:22 pm

Post » Sat Nov 17, 2012 12:29 pm

Yea, I should have specified that that function is attached to a player alias. It's implicitly the alias sending the event to that attached script.
User avatar
Lexy Dick
 
Posts: 3459
Joined: Mon Feb 12, 2007 12:15 pm

Post » Sat Nov 17, 2012 2:04 pm

Yea, I should have specified that that function is attached to a player alias. It's implicitly the alias sending the event to that attached script.

So will something to the effect of this work or do I need to do something more? Sorry at work so cant test the code atm...

if akCaster == game.getplayer && akEffect == WerewolfFeedRestoreHealth
do stuff

endif

I apologize for asking so many questions as I am certainly a novice coder at best.
User avatar
Kitana Lucas
 
Posts: 3421
Joined: Sat Aug 12, 2006 1:24 pm

Post » Sun Nov 18, 2012 4:03 am

Yes, but you have to have something receive the event. You can't tie a script directly to the player reference (or at least you shouldn't), so you need to attach it to an alias instead. The script has to be attached to something that will send an OnMagicEffectApply() event.
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm

Post » Sat Nov 17, 2012 2:19 pm

Yes, but you have to have something receive the event. You can't tie a script directly to the player reference (or at least you shouldn't), so you need to attach it to an alias instead. The script has to be attached to something that will send an OnMagicEffectApply() event.

So I did a little research on this and found that aliases are a whole other can of worms I never even knew existed o.O
I am messing with it now and made a simple Alias where the only thing about it is that it points unique reference "Player" and to a script that extends Aliases .... There seems to be a ton of stuff though so I am crossing my fingers keeping it simple will work...
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am


Return to V - Skyrim