Jump to content

Need help with scripting.


Unknown_User

Recommended Posts

Posted

Hi,

 

I'm creating a mod which I'm going to release it on LL when done(not stupid nexusmods).

And I need help with scripting.

 

I'm editing this script(attached to the quest)

--------------

Scriptname ***** extends Quest

ReferenceAlias Property NPCxxx Auto; this points to NPC ref

ReferenceAlias Property NPCxxx_alive Auto; this points to XMarker

GlobalVariable Property NPCxxx_isalive Auto

 

...

 

function updateActorStatus()

if ((NPCxxx as Actor).isdead()||NPCxxx.isenabled()===false)

NPCxxx_alive.disable()

NPCxxx_isalive = 0

else

NPCxxx_isalive = 1

NPCxxx_alive.enable()

endif

endfunction

--------------

 

The problems are,

 

1.

What is the proper command for getting "dead" status and "enabled" status?

isdead() and isenabled() returned error in CK.

 

2.

How can I run updateActorStatus() every 9 AM/day(in skyrim of course) using Quest?

(or once per day)

 

Any advice will be appreciated.

(I'm not a papyrus mage you see XD)

Posted

1.

IsEnabled() & IsDisabled() are Member of ObjectReference Script. And IsDead() is Member of Actor Script.

So you must be Get the ActorReference and ObjectReference for each.

And, to set the value of GlobalValue you must use the SetValue () or SetValueInt ().

 

So it will be like this.

 

Scriptname ***** extends Quest
ReferenceAlias Property NPCxxx Auto; this points to NPC ref
ReferenceAlias Property NPCxxx_alive Auto; this points to XMarker
GlobalVariable Property NPCxxx_isalive Auto
 
function updateActorStatus()
 
Actor NPCX = NPCxxx.GetActorReference()
ObjectReference NPCX_alive = NPCxxx_alive.GetReference()
 
if NPCX.isdead() || !NPCX.isenabled()
NPCX_alive.disable()
NPCxxx_isalive.SetValue(0)
else
NPCxxx_isalive.SetValue(1)
NPCX_alive.enable()
endif
 
endfunction
 
2.
Use Event OnUpdateGameTime() & RegisterForSingleUpdateGameTime().

http://www.creationkit.com/RegisterForSingleUpdateGameTime_-_Form

 

But, if you want to get ReferenceAlias is dead, I think there is a way to use the Event OnDeath() by attaching the Script to ReferenceAlias of Actor.

http://www.creationkit.com/OnDeath_-_Actor

 

 

I'm sorry if you did not understand my Engrish.

Archived

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

  • Recently Browsing   0 members

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