Back again with Script probs this time

Post » Thu May 28, 2015 9:16 am

I have created a trophy reward system for my mod im working on. The final trophy has me stumped. To sum up basically there is a location called the Nethersphere with 11 doors leading to 11 trials. Now I want the trophy to be awarded once the player has visited all 11 trial in no set order (any combination of trials so I want to avoid using setstage).

I am trying to achieve this via 11 seperate TRIG boxes all with the same script attached (Script set to 3 for testing purposes):

Scriptname NSTrigScript extends ObjectReference  Int Property TrigCount  Auto  Quest Property TQ  Auto  ObjectReference Property TB  Auto  Event OnTriggerEnter(ObjectReference akActionRef)	If(akActionRef == Game.GetPlayer())		If  TrigCount!=3		TrigCount +=1		ElseIf TrigCount == 3			TQ.SetStage (200)			TB.disable()			EndIf	EndIfEndEvent

The short story: It isn't working lol.

The reason I have used the TB.disable() function on the TRIG boxes is this:

I used to control the number of times a trig box script ran with an INT I would name RunOnce. Since I started work on this new mod. I have copied and pasted my RunOnce scripts exactly the way the were when they worked on previous mods. However The CK, Skyrim, or whatever is now ignoring all my RunOnce Conditions for some unknown reason, hence why I disable the trig box after 1 run. But Yeah any help would be appreciated. Thanks.

User avatar
I’m my own
 
Posts: 3344
Joined: Tue Oct 10, 2006 2:55 am

Post » Thu May 28, 2015 7:47 am

What exactly isn't working?

Each individual trigger object will keep track of its own variables, the values don't get shared between them. By the looks of it all your trigger zones set the same quest stage too, why is this?

If you want to know how many triggers the player has entered, you could increment a global variable or set different stages in your quest (from there the quest could increment a count or just check that the 11 requisite stages have been completed).

User avatar
SamanthaLove
 
Posts: 3565
Joined: Mon Dec 11, 2006 3:54 am

Post » Wed May 27, 2015 5:32 pm

A I see. What I want exactly is a variable, global, or whatever that starts at 0 and is incresed by 1 only once each time the player enters all 11 seperate trigger boxes, then when the variable, global or whater reaches 11, the stage is set to 200 which adds the taskmaster trophy. I dont know how to achieve this using trig boxes and scripts

User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Thu May 28, 2015 12:20 am

Make a global variable instead, and MyGlobal.Mod(1.0) instead, and if MyGlobal.GetValue() == 12.0, set the stage. And disable the trigger if you want, but you should probably just disable all of them in the stage.
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm


Return to V - Skyrim