Thank you very much Hanaisse
Basically, I want to attach the script to the player and here is what I did in detail:
I chose on the quests that are available in the creation kit, edited it and in the scripts tab, I attached this script:
Scriptname nourascript3 extends Quest
int count
Potion Property itemToAddPotion Auto
Int Property ItemCount = 1 Auto
Actor Property PlayerREF Auto
Event OnInit() ; This event will run once, when the script is initialized
count=count+1
Debug.MessageBox("Message 1")
Debug.MessageBox("Message 2")
Debug.MessageBox(" Message 3")
RegisterForSingleUpdate(2)
EndEvent
Event OnUpdate()
count=count+2
if count==3
Debug.MessageBox(" Message 4")
Endif
bool playerIsDead = Game.GetPlayer().IsDead()
if playerIsDead==true
Debug.MessageBox("the player is dead")
else
Debug.MessageBox("he is alive")
Endif
if Game.GetPlayer().IsBleedingOut()
Game.GetPlayer().ResetHealthAndLimbs()
else
Game.GetPlayer().AddItem(itemToAddPotion, 2000)
endif
EndEvent
bool Function IsDead() native
Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerREF ; This condition ensures that only the player will trigger this code
Debug.MessageBox("Yippee!")
EndIf
EndEvent
Event OnEnterBleedout()
Debug.Trace("Unfortunately, I have entered my bleedout state :(")
endEvent
I have been trying to see whether the events execute while the player player Skyrim; however, only oninit() works when when the game starts and then nothing works. Although OnUpdate is supposed to work every 2 seconds, it only works one time when the game starts. Also, the events and statements highlighted in green don't work at all. If the code is not clear, I can rewrite everything, but please help me to attach any code to the player and make ti works
The text file is .txt file which is resulted from a matlap code. I can put the data in a database, but how can I access the data in the creation kit (to be used in the papyrus script) ?
If you found anything unclear, please don't hesitate to comment on it
Thaaanks a alot