Jump to content

help in scripting


Fertal

Recommended Posts

To use get/set AV without reference You need to be in spell effect script (the spell which is cast on Actor) or in script assigned to Actor. You can't assign scripts at runtime AFAIK (at least not until/if FOSE solves this), so you have to make persistent NPC in GECK and assign it this object script.

 

To use get/set AV with reference (that is somewhere else than object/actor or spell/actor script) You need that reference :P

You can use Player.SetAV (to refer to PC) or some reference NPC. (persistent references can be found in GECK however note than many NPCs are levelled and not persistent, and as such can't be directly referenced in script, unless you acquire treir ref during runtime)

 

For example this way you can change some of susan lancaster stats.

SusanLancasterRef.SetAV something 0

(tho I'm not sure if persistent NPCs are allways loaded, if not then it will work only when she is around)

 

This can't be obviously done with unnamed NPCs, so you have to think your way of getting their ref during runtime. (if you need to)

Link to comment
Share on other sites

To use get/set AV with reference (that is somewhere else than object/actor or spell/actor script) You need that reference :P

You can use Player.SetAV (to refer to PC) or some reference NPC.

 

in my script I want to assigne the value of a Player stat (i.e. Small Guns) with GetActorValue and reset this to another value, with SetActorValue.

 

You mean that I must simply specify the ref using Player.GetActorValue SmallGuns and Player.SetActorValue SmallGuns?

Link to comment
Share on other sites

So thats whats wrong (why diden't I think of that) In a script you need to specify the player in order to change values.

 

Syntax:

 

SetActorValue StatName value

SetAV StatName value

 

Example:

 

SetActorValue Strength 60

Player.SetActorValue Alteration 50 ---->This is the one you need

 

SetActorValue sets the stat's base value to the new value.

Notes

 

* Although called on a reference, this function actually changes the value on the base actor (thus the base value on all references of that base actor). Note also that ModActorValue modifies the stat value only on the reference, and so is usually preferable.

 

Frome the TES CS Wiki (linked from the GECK Wiki)

 

I think SetActorValue is best for the player and ModActorValue is best for NPCs

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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