Trigger script

Post » Fri Oct 03, 2014 3:46 pm

My goal is:

Make an NPC talk to an other when the player goes in to the trigger (the blue box), but just when a specific stage of my quest is donne

This is what i've done at the moment:

- Created a quest

- Created a scene

- Created a trigger with the following script

Scriptname SCVtriggerscript extends ObjectReference  Int Property SCVTriggered  Auto  Quest Property Myquest  Auto  Scene Property MyScene  Auto  Event OnTriggerEnter(ObjectReference akActionRef)   if akActionRef == Game.GetPlayer()      if SCVTriggered == 0        if Myquest.GetStageDone(25)            SCVTriggered = 1             MyScene.Start()         endIf      endIf   endIfendEvent
I'm totally noob with scripts, so i don't know if i'm doing something wrong. By the way, i don't know what "Int Property SCVTriggered Auto " is. I mean, i copied part of this script from a tutorial, and i understant most of it. I know that "Quest Property Myquest Auto AND Scene Property MyScene Auto" are some kind of links to my Quest and Scene ID. But "Int Property SCVTriggered Auto"? don't know what the hell is that.
User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Fri Oct 03, 2014 5:39 pm

SCVTriggered doesn't need to be a property. You can just make it a local variable (change it to Int SCVTriggered). It's explained in my tutorial http://skyrimmw.weebly.com/skyrim-modding/creating-a-do-once-script-skyrim-modding-tutorial.

User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm

Post » Fri Oct 03, 2014 10:19 am

Oh! didn't know about that web! Thanks a lot. By the way, my script is not working, do u know why?

User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm

Post » Fri Oct 03, 2014 9:42 am

You'll have to be more specific than that. What about it isn't working? If the scene isn't starting, make sure you've filled all your properties (via the Properties box and then selecting scene/quest from dropdown after highlighting the property). If it still doesn't work add a debug.notification somewhere in your script to check which part isn't working:

Scriptname SCVtriggerscript extends ObjectReference  Int SCVTriggeredQuest Property Myquest  Auto  Scene Property MyScene  Auto  Event OnTriggerEnter(ObjectReference akActionRef)   if akActionRef == Game.GetPlayer()      if SCVTriggered == 0        if Myquest.GetStageDone(25)             SCVTriggered = 1             Debug.Notification("Got to the scene part. Scene not started yet.")             MyScene.Start()         endIf      endIf   endIfendEvent
User avatar
AnDres MeZa
 
Posts: 3349
Joined: Thu Aug 16, 2007 1:39 pm


Return to V - Skyrim