Need Help With Scripting (Berserker mod)

Post » Sun Jun 17, 2012 5:13 pm

Hey guys, I just need a little help to get the ball rolling. I had this script back in Oblivion that made you deal more damage the more you got hurt. Here is that script, for reference:
ScriptName SacrierBloodScriptFloat FQuestDelayTimeShort BoostStrShort ResetStrShort BaseStrShort BoostAgiShort ResetAgiShort BaseAgiShort BoostIntShort ResetIntShort BaseIntShort BoostWilShort ResetWilShort BaseWilShort BoosterShort CurrentHPShort LastHPShort MaxHPBegin GameModeIf (FQuestDelayTime != 1)Set FQuestDelayTime to 1EndIfSet BaseStr to Player.GetBaseAV StrengthSet BaseAgi to Player.GetBaseAV AgilitySet BaseInt to Player.GetBaseAV IntelligenceSet BaseWil to Player.GetBaseAV WillpowerSet MaxHP to Player.GetBaseAV HealthIf GetPCIsRace SacrierSet CurrentHP to Player.GetAV HealthIf CurrentHP < LastHPSet Booster to (LastHP - CurrentHP)Set BoostStr to BoosterSet BoostAgi to BoosterSet BoostInt to BoosterSet BoostWil to BoosterPlayer.ModAV Strength BoosterPlayer.ModAV Agility BoosterPlayer.ModAV Intelligence BoosterPlayer.ModAV Willpower BoosterElseIf CurrentHP > LastHPSet ResetStr to (-Booster)Set ResetAgi to (-Booster)Set ResetInt to (-Booster)Set ResetWil to (-Booster)If Player.GetAV Strength >= BaseStrPlayer.ModAV Strength ResetStrPlayer.ModAV Agility ResetAgiPlayer.ModAV Intelligence ResetIntPlayer.ModAV Willpower ResetWilEndIfElseIf CurrentHP == MaxHPPlayer.ForceAV Strength BaseStrPlayer.ForceAV Agility BaseAgiPlayer.ForceAV Intelligence BaseIntPlayer.ForceAV Willpower BaseWilEndIfSet LastHP to CurrentHPEndIfEnd

Now, in Oblivion I was simply able to attach this to a quest script and let it run in the background. But in Skyrim, it appears that it needs to extend an object. So how do I get a script to attach to the player character and let it run in the background?

Similarly, is there a more efficient method of doing this? Or is what I got basically the best method for it? (As a small explanation, the script looks to see if the player gets hurt, then increases or decreases stats based off of the difference in health.)
User avatar
MISS KEEP UR
 
Posts: 3384
Joined: Sat Aug 26, 2006 6:26 am

Post » Sun Jun 17, 2012 8:51 pm

From what I understand, quest script is still there. If you want your script to run every so often, you could create a Quest as you did in Oblivion.
In the Quest window you just created, click on the 'Scripts' button on the right most bar. There you will be able to assign script(s) to your quest.

Unlike in Oblivion, you can have multiple scripts running on 1 quest. (I'm yet to find how this works, but most likely those scripts are running on different Threads of that quest)

If you like to know more about 'extends' you can google on Object Oriented programming (OOP). There are quite a bit of topics on that, but on the wiki, the author did a great job of explaining OOP to a Layman :tongue:
In short, a script quest could extend something like:

ScriptName YourScript extends Quest Conditional

In Oblivion, you could set the fQuestDelayTime to control how often the script being processed, in CK, you could do RegisterForUpdate() instead.
More info can be found here: http://www.creationkit.com/Differences_from_Previous_Scripting#OnUpdate

Hope it helps :smile:
User avatar
GabiiE Liiziiouz
 
Posts: 3360
Joined: Mon Jan 22, 2007 3:20 am

Post » Sun Jun 17, 2012 9:13 pm

Aha, that's exactly what I needed! Much thanks. I'll post again if I need more help with the specifics of the script, but I think I can work it out from here.
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Sun Jun 17, 2012 11:13 pm

So, ran into some issues. Not sure what the errors compiling are giving me right now.

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1int LastActorHealthint CurrentActorHealth == GetActorValue(Health)Function Sacrier()registerForUpdate(0.1)endFunctionEvent OnUpdateIf GetActorValue(Health) <= LastActorHealththen GetActorValue(Unarmed) == (CurrentActorHealth - LastActorHealth)Else GetActorValue(Health) >= LastActorHealththen GetActorValue(Unarmed) ==  (CurrentActorHealth - LastActorHealth)EndIfCurrentActorHealth == LastActorHealthLastActorHealth == GetActorValue(Health)EndEvent

Am I even looking at the right actor for this to work? I only want it to work on the player character, specifically a certain custom race. Anyone got some pointers for me? The compile is spitting out a couple nonsense errors. I have my PC in japanese mode right now so this is jibberish, but I'll post it in case it helps:


Starting 1 compile threads for 1 files...
Compiling "SacriersBlood"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(6,23): required (...)+ loop did not match anything at input '=='
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(12,14): mismatched input '\\r\\n' expecting LPAREN
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(0,0): error while attempting to read script SacriersBlood: オブジェクト参照がオブジェクト インスタンスに設定されていません。
No output generated for SacriersBlood, compilation failed.
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

Post » Sun Jun 17, 2012 8:13 pm

The "==" operator is a comparison; you'll want to use the "=" operator, which is an assignment, when initialising your CurrentActorHealth variable. You'll also need to call http://www.creationkit.com/GetActorValue_-_Actor on something, and you might not actually want to initialise it here.

As well as that, your "Scarier" function is never called, and since the script only has an http://www.creationkit.com/OnUpdate_-_Form event, unless it's registered for update somewhere else nothing will ever run. You'll probably want to add a http://www.creationkit.com/OnInit event to start things up.

Cipscis
User avatar
мistrєss
 
Posts: 3168
Joined: Thu Dec 14, 2006 3:13 am

Post » Sun Jun 17, 2012 12:54 pm

Ok, I thought I had the syntax correct to look at the player actor here, but it's giving me a bunch of errors. Here's the current version of the code:

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1Actor Function GetPlayer() native globalint LastActorHealthint CurrentActorHealth = Game.GetPlayer().GetAV(Health)Event OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  If Player.GetAV(Health) <= LastActorHealth   then Game.GetPlayer().GetAV(UnarmedDamage) = (CurrentActorHealth - LastActorHealth)  Else Player.GetAV (Health) >= LastActorHealth   then Game.GetPlayer().GetAV(UnarmedDamage) =  (CurrentActorHealth - LastActorHealth)  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

And Here are the Errors:

Starting 1 compile threads for 1 files...Compiling "SacriersBlood"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(7,25): no viable alternative at input 'Game'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(7,25): no viable alternative at input 'Game'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(7,29): required (...)+ loop did not match anything at input '.'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(7,4): Unknown user flag Gamec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(17,12): required (...)+ loop did not match anything at input '.'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(17,46): required (...)+ loop did not match anything at input '='c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(18,7): required (...)+ loop did not match anything at input 'Player'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(19,12): required (...)+ loop did not match anything at input '.'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(19,46): required (...)+ loop did not match anything at input '='No output generated for SacriersBlood, compilation failed.

What am I doing wrong here? I just can't seem to sort it out.
User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Post » Mon Jun 18, 2012 4:49 am

Bump (These forums are moving pretty fast)
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Sun Jun 17, 2012 4:58 pm

Another Bump, still not sure how I need to do this.
User avatar
George PUluse
 
Posts: 3486
Joined: Fri Sep 28, 2007 11:20 pm

Post » Sun Jun 17, 2012 1:49 pm

Get rid of the "then" thing you have in there. You don't need it, and I expect the compiler doesn't like it.

Cipscis
User avatar
Rich O'Brien
 
Posts: 3381
Joined: Thu Jun 14, 2007 3:53 am

Post » Sun Jun 17, 2012 9:20 pm

Okay, I think I made a lot of progress now. I only get one error now. Here's the current script:

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1Actor Function GetPlayer() native globalActor Function GetReference()Actor Player = Player_Alias.GetReference(Game.GetPlayer)int UnarmedDamageint Healthint LastActorHealthint CurrentActorHealthEvent OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  If Player.GetAV(Health) <= LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, (CurrentActorHealth - LastActorHealth))  Elseif Player().GetAV(Health) >= LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, (CurrentActorHealth - LastActorHealth))  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

And the error is: c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(15,0): mismatched input 'Event' expecting ENDFUNCTION

Any ideas?
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Sun Jun 17, 2012 7:29 pm

Duh, I forgot to end the two functions at the beginning. I did some tweaking:

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1Actor Function GetPlayer() native globalPlayer_Alias=Actor Function GetReference()Actor Player = Player_Alias.GetReference(Game.GetPlayer)endFunctionint UnarmedDamageint Healthint LastActorHealthint CurrentActorHealthEvent OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  If Player.GetAV(Health) <= LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, (CurrentActorHealth - LastActorHealth))  Elseif Player().GetAV(Health) >= LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, (CurrentActorHealth - LastActorHealth))  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

Which gave me these errors:

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(8,15): variable Player_Alias is undefinedc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(8,46): a property cannot be used directly on a type, it must be used on a variablec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(8,46): GetPlayer is not a property on script game or one of its parentsc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(8,28): none is not a known user-defined typec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(24,5): variable Player is undefinedc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(24,12): none is not a known user-defined typec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(24,26): cannot compare a none to a int (cast missing or types unrelated)c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(24,26): cannot relatively compare variables to Nonec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,9): Player is not a function or does not existc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,18): none is not a known user-defined typec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,32): cannot compare a none to a int (cast missing or types unrelated)c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,32): cannot relatively compare variables to Nonec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(31,2): type mismatch while assigning to a int (cast missing or types unrelated)

Somewhere I'm messing up my variables but I don't know how. Can someone shed some light on this for me?
User avatar
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Mon Jun 18, 2012 3:38 am

Sorry for the bumps, just trying to get this ready to roll out.
User avatar
W E I R D
 
Posts: 3496
Joined: Tue Mar 20, 2007 10:08 am

Post » Mon Jun 18, 2012 4:49 am

Get rid of the trailing assignment operator (=) on line 4, to start with. Also, you don't need to declare GetPlayer() in your script - all native functions like this one have already been declared in the right scripts. Because your variable "Player" is declared within a function, it will only be accessible within that function.

See where that gets you. There might still be a few errors left over.

Cipscis
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Mon Jun 18, 2012 12:26 am

Thanks for all your help Cipscis. I think I'm almost there. Here's what I've got now:

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1Alias Player_Aliasint UnarmedDamage = 0int Health = 0int LastActorHealth = 0int CurrentActorHealth = 0int Boost = 0Actor Function GetReference()Actor Player = Player_Alias.GetReference(Game.GetPlayer())endFunctionEvent OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  CurrentActorHealth - LastActorHealth = Boost  If Player.GetAV(Health) != LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, Boost)  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

The only error I'm getting right now is:
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(25,23): no viable alternative at input 'LastActorHealth'

I have no idea what that means... Not sure what the issue is now.
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am

Post » Sun Jun 17, 2012 2:23 pm

That's probably due to this line:
CurrentActorHealth - LastActorHealth = Boost
In assignment operations, the left hand side must always have only a single term, which is the variable or property that is going to have its value assigned. Try changing that line to this:
Boost = CurrentActorHealth - LastActorHealth

Cipscis
User avatar
Hearts
 
Posts: 3306
Joined: Sat Oct 20, 2007 1:26 am

Post » Sun Jun 17, 2012 5:32 pm

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1Alias Player_Aliasint UnarmedDamage = 0int Health = 0int LastActorHealth = 0int CurrentActorHealth = 0int Boost = 0Actor Function GetReference()Actor Player = Player_Alias.GetReference(Game.GetPlayer())endFunctionEvent OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  Boost = CurrentActorHealth - LastActorHealth  If Player.GetAV(Health) != LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, Boost)  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

Errors:
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(14,28): GetReference is not a function or does not existc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,5): variable Player is undefinedc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,12): none is not a known user-defined typec:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(26,26): cannot compare a none to a int (cast missing or types unrelated)c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(31,2): type mismatch while assigning to a int (cast missing or types unrelated)

Not sure why it suddenly thinks there isn't a getreference, or that player isn't defined... Isn't that what I'm defining in the GetReference function? Also, what does it mean none is not a user defined type/cannot compare a none to a int? Am I declaring my variables incorrectly?
User avatar
Aman Bhattal
 
Posts: 3424
Joined: Sun Dec 17, 2006 12:01 am

Post » Mon Jun 18, 2012 3:40 am

GetReference isn't defined for that context. You've defined it so that it can be called on the type ScariersBlood, but it doesn't exist for Alias. It exists for http://www.creationkit.com/GetReference_-_ReferenceAlias, though, have you tried that type?

Cipscis
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Mon Jun 18, 2012 1:14 am

Like this?

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1Alias Player_Aliasint UnarmedDamage = 0int Health = 0int LastActorHealth = 0int CurrentActorHealth = 0int Boost = 0ObjectReference Function GetReference() nativeObjectReference Player = Player_Alias.GetReference()endFunctionEvent OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  Boost = CurrentActorHealth - LastActorHealth  If Player.GetAV(Health) != LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, Boost)  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

Still getting some errors:

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(14,25): no viable alternative at input 'Player_Alias'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(14,25): no viable alternative at input 'Player_Alias'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(14,37): required (...)+ loop did not match anything at input '.'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(14,16): Unknown user flag Player_Alias
User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Sun Jun 17, 2012 7:59 pm

No, you're still declaring Player_Alias as type Alias. Try either declaring it as type ReferenceAlias or casting it to that type whatn you call GetReference on it. I'm not sure which is the more appropriate way to do it.

Cipscis
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Sun Jun 17, 2012 1:21 pm

This is quite the doozy... Okay, what can I do to alleviate these errors? I'm not sure what's the cause of them.

Scriptname SacriersBlood Extends Quest;Sacrier's Blood Script version .1ReferenceAlias Player_Aliasint UnarmedDamage = 0int Health = 0int LastActorHealth = 0int CurrentActorHealth = 0int Boost = 0ObjectReference Player = Player_Alias.GetReference()Event OnInit()registerForUpdate(0.1)gotoState ("Sacrier")endEventState SacrierEvent OnUpdate()  Boost = CurrentActorHealth - LastActorHealth  If Player.GetAV(Health) != LastActorHealth   Game.GetPlayer().ModAV(UnarmedDamage, Boost)  EndIf  CurrentActorHealth = LastActorHealth  LastActorHealth = Game.GetPlayer().GetAV(Health)EndEventendState

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(12,25): no viable alternative at input 'Player_Alias'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(12,37): required (...)+ loop did not match anything at input '.'c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SacriersBlood.psc(12,16): Unknown user flag Player_Alias
User avatar
lolli
 
Posts: 3485
Joined: Mon Jan 01, 2007 10:42 am

Post » Mon Jun 18, 2012 3:54 am

Uhmm, I would love to help you, but I think you should read the wiki carefully, to understand the flow of the script :)

This line:
ObjectReference Player = Player_Alias.GetReference()

cannot be reached because it doesn't tie to any trigger or event. Since you are running a Quest script, you must make sure when and where such calls are triggered.
One way to solve it is to put that line into the Event OnInit()

Hope it helps,

:)
User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Sun Jun 17, 2012 8:22 pm

I don't think that's it. The initialisation bit will work there, and it's valid outside of any event or other function because it's declarative code.

The problem here, I think, is that Player_Alias can't have a value at that point. Declare it as a property instead of a variable, and assign it a value with the Creation Kit.

Cipscis
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am

Post » Sun Jun 17, 2012 5:54 pm

I don't think that's it. The initialisation bit will work there, and it's valid outside of any event or other function because it's declarative code.

The problem here, I think, is that Player_Alias can't have a value at that point. Declare it as a property instead of a variable, and assign it a value with the Creation Kit.

Cipscis

xD My bad, I think I really need to sleep, brain stop functioning properly xD......
What I meant was, the initialization is fine outside of the trigger block (if you set it to some actual value), but the xxx.GetReference() is not, since this is a function call
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Sun Jun 17, 2012 3:48 pm

It's part of the initialisation, though. The declaration of that variable acts as an entry point for the expression in the initialisation, so it's still valid where it is an will run at the appropriate time.

The compiler error is referencing a later line, too, which implies that there isn't a problem with the initialisation.

Cipscis
User avatar
Emma Copeland
 
Posts: 3383
Joined: Sat Jul 01, 2006 12:37 am

Post » Sun Jun 17, 2012 2:59 pm

Since you replied to my thread I've been kind of watching this thread progress. I'm trying to accomplish something similar after all, so I've been trying to fix my own errors per suggestions made here.

This is what I ended up with in the end for my health check. (I'm stripping the unnecessary code just to show the parts pertaining to yours.)

Function OnUpdateGameTime()   	 Actor Player = Game.GetPlayer()        If Player.GetAV("Health") < 1       	 ;Do Stuff        EndifEndFunction

If I tried to instantiate player under the OnInit event block (or as anything other than an Actor), it would not run. Creating player as an actor property worked as well, but I only used it in this specific instance so I decided not to do that.
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Next

Return to V - Skyrim