Script to check quest stage and disable reference

Post » Tue Sep 24, 2013 11:46 pm

Hi

I was making a script that checks quest stage and if it's enough (in this case quest completed) then script removes (disables) reference. This done when player enters the cell in which reference is (event oncellattach, tried also event onload but I assume it's not as good as oncellattach).

Script seems to work, but I have no idea is this done as it supposed to be. So, anything I should do otherwise ?

1. I put reference (rubble) to the cell

2. Edited its Reference Editor ID field as mod_rubble

3. Made a new script (named as mod_rubbleremove), compiled it and put it into reference

Scriptname mod_rubbleremove extends ObjectReference

Quest Property DLC1VQ05 Auto

ObjectReference Property mod_rubble Auto

Event OnCellAttach()

if DLC1VQ05.GetStageDone(200) == 1

mod_rubble.Disable()

endIf

endEvent

4. Edited script's properties so that it has wanted values (quest is DLC1VQ05, mod_rubble points to right reference (unique))

I could have done that with a quest, but I assumed it's safer just to attach script to wanted reference. All done like it should ?

User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am

Return to V - Skyrim