Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

Tags for filtering? If the mod provides new clutter objects or modifications of clutter objects then it could be given that tag. I do not think it would apply to a mod that uses clutter objects.

 

Example,

Mod A changes the mesh and or texture of a basket

Mod B adds new piles of gold to be scattered about

Mod C places existing objects in a new dungeon

 

Mods A and B could use the "Items - Clutter" tag

Mod C should not as the clutter is not the focus of the mod but rather the dungeon itself.

Link to comment
Share on other sites

  • 4 weeks later...

I don't believe states respawn. Once a script is in a state, it should stay in that stay until the GoToState function is used again. You might want to test it to be sure, and possibly make the activator a permanent reference so it doesn't respawn.

Link to comment
Share on other sites

Thank you for the answer!

 

I want to prevent the script from running so that it does not affect performance, so the state method may not be appropriate.

I am planning two other methods: attach the script to the trigger box and do disable and none to the trigger box at the end of Event, and attach the script to the dialog of the quest.

Link to comment
Share on other sites

Thanks!
For ease of explanation, I said activator, but it is actually a Static object. This script enables the Static object once the quest is completed.
I was thinking of attaching a script to the xmarker to enable the Static object at the same time using "enable parent".
But thanks to your post, I realized that there is a way to delete the xmarker with the script attached after enables the Static object using "LinkedRef".
Quest Property anyQuest  Auto  

int Property anyStage  Auto  

Message Property EnableAchiveMessage  Auto  

bool Property bStageMustBeDone = false Auto  
{false by default
if true, look for GetStageDone anyStage
if false, look for GetStage >= anyStage}

ObjectReference myLinkedRef

auto State waiting
	event OnLoad()
		myLinkedRef = GetLinkedRef() as ObjectReference
		if (bStageMustBeDone && anyQuest.GetStageDone(anyStage)) || (!bStageMustBeDone && anyQuest.GetStage() >= anyStage)
			gotoState("done")
			myLinkedRef.enable()
                        self.Delete()
                        self = None                   
			EnableAchiveMessage.Show()
		endif
	endEvent
endState

state done
; do nothing
; note: if ref is reenabled after this state is set, this script will not redisable it
endState

 

ah, self = None part could be wrong. I'm not sure if this part runs correctly as I'm writing this part myself.

Edited by nakednohman
Link to comment
Share on other sites

Yes, self = None isn't necessary and won't even compile. The only reason to do that is to clear something from script memory. You could do myLinkedRef = none to clear it from memory, but you could also just put that property in the onLoad event. The only reason to hold that in script memory by defining it outside of the event is if you need to use it in other events. Like this:

 

Quest Property anyQuest  Auto  

int Property anyStage  Auto  

Message Property EnableAchiveMessage  Auto  

bool Property bStageMustBeDone = false Auto  
{false by default
if true, look for GetStageDone anyStage
if false, look for GetStage >= anyStage}

auto State waiting
    event OnLoad()
       ObjectReference myLinkedRef = GetLinkedRef() as ObjectReference
       if (bStageMustBeDone && anyQuest.GetStageDone(anyStage)) || (!bStageMustBeDone && anyQuest.GetStage() >= anyStage)
            gotoState("done")
            myLinkedRef.enable()
                        self.disable()
                        self.Delete()
                        myLinkedRef = None                   
            EnableAchiveMessage.Show()
       endif
    endEvent
endState

state done
; do nothing
; note: if ref is reenabled after this state is set, this script will not redisable it
endState

Although using OnLoad is unreliable I've heard, so I would probably just enable your reference with a papyrus fragment on your quest stage.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...