Need some help on a simple script (pretty please)

Post » Wed Jun 20, 2012 8:02 pm

Hello all,

I'm using a script inspired by the one managing the stormcloaks/imperial prisoners in the vanilla game.
My two prisoners use the same script in their own Reference Alias. Everything works just fine, when i activate any of the two prisoners, both are released as intended.
My only issue is that the script keeps running on the prisoner I didn't activate, so the message box pops up again when I try to speak to him.
Is there a simple way to deactivate all instances of this script once it has been used one time ?

Thanks !

Scriptname QBET01FreeTwins extends ReferenceAliasMessage Property QBet01FreeSlavesMessageBox AutoReferenceAlias Property RaKhirr  Auto  ReferenceAlias Property RaMhirr  Auto  Outfit Property RakhirrOutfit  Auto  Outfit Property RaMhirrOutfit  Auto  bool bound = Trueint iSetFree = 0int iDoNothing = 1Event OnActivate(ObjectReference akActionRef)	   if Bound == true				Actor ActorRef = GetActorReference()		int result = QBet01FreeSlavesMessageBox.show()		if result == iDoNothing			;debug.Notification("DO NOTHING")					elseif result == iSetFree			;debug.Notification("SET FREE")			RaKhirr.GetActorRef().SetOutfit (RakhirrOutfit)			RaMhirr.GetActorRef().SetOutfit (RaMhirrOutfit)			GetOwningQuest().setstage(70)			RaKhirr.GetActorRef().EvaluatePackage()			RaMhirr.GetActorRef().EvaluatePackage()			bound = False					EndIf		EndIfEndEvent
User avatar
gandalf
 
Posts: 3400
Joined: Wed Feb 21, 2007 6:57 pm

Post » Wed Jun 20, 2012 9:17 pm

If you don't need to see them again, then you could just clear both aliases so that neither or them have the script anymore. Otherwise, you could try this:

Spoiler
Scriptname QBET01FreeTwins extends ReferenceAliasMessage Property QBet01FreeSlavesMessageBox AutoReferenceAlias Property RaKhirr  Auto  ReferenceAlias Property RaMhirr  Auto  Outfit Property RakhirrOutfit  Auto  Outfit Property RaMhirrOutfit  Auto  bool bound = Trueint iSetFree = 0int iDoNothing = 1Event OnActivate(ObjectReference akActionRef)    if Bound == true		             Actor ActorRef = GetActorReference()        int result = QBet01FreeSlavesMessageBox.show()        if result == iDoNothing            ;debug.Notification("DO NOTHING")					            elseif result == iSetFree            ;debug.Notification("SET FREE")            RaKhirr.GetActorRef().SetOutfit (RakhirrOutfit)            RaMhirr.GetActorRef().SetOutfit (RaMhirrOutfit)            GetOwningQuest().setstage(70)            RaKhirr.GetActorRef().EvaluatePackage()            RaMhirr.GetActorRef().EvaluatePackage()            (RaKhirr as QBET01FreeTwins).Bound = False            (RaMhirr as QBET01FreeTwins).Bound = False                    EndIf    EndIfEndEvent
User avatar
BaNK.RoLL
 
Posts: 3451
Joined: Sun Nov 18, 2007 3:55 pm

Post » Wed Jun 20, 2012 2:31 pm

Use a global for Bound, so when one of them changes it, the other script will see the change.
User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am


Return to V - Skyrim