Jump to content

Recommended Posts

Posted

I'm trying to find a way to do two things:

 

Trying to have some script activate a quest on location discovery or upon entering a cell.

 

I'm also trying to figure out how to enable or disable statics as a quest progresses.

 

Been looking around but nothing solid really has come up.

 

Thanks!

Posted
Sorry I can't offer any specific help but you may want to look at existing cells like Sky Haven Temple which currently change along with quest stages to see how things are set up there.
  • 2 weeks later...
Posted
You could try putting down a trigger zone at the door. When the player comes through, the trigger will activate, and you can script it to start up your quest.
Posted (edited)

Here's what I've been able to piece together so far:

 

Player enters house, hits a volume box trigger - it runs a script that starts a quest, then disables itself so the player doesn't keep running into it again.

 

For testing purposes, I just want it to disable a burned down house outside, and enable a complete one outside.

 

Taking from the tutorial, the volume box will have something like:

 

Scriptname Star_TEST_EnterStarter extends ObjectReference
{This script is the trigger on enter script}

Event OnTriggerEnter(ObjectReference akActionRef)
if(akActionRef == Game.GetPlayer()) ; This condition ensures that only the player will trigger this code
	Debug.MessageBox("Yippee!")
               ; BURNEDBUILDING.Disable() ; Take away the burned building outside
               ; NEWBUILDING.Enable() ; fixed up building appears outside
               ; THISVOLUMETRIGGER.Disable() ; so the player doesn't keep running into it.
               ; SOMEQUEST START ; not sure about hte code for this. I just want to start a quest.
endif
EndEvent

 

I'm just not sure what to do and where to put things. You can't just reference these objects, but I don't know how to declare them in this scripting language. I've played with it, but I don't know how to get these references and manipulate them yet.

Edited by blast0r
Posted

Unlike Oblivion, you can't just reference things by their editor/form/reference IDs. You have to declare properties in your script (they're basically the same as variables) which you then set outside of the script, in the property window. Your script should look like this:

 

Scriptname Star_TEST_EnterStarter extends ObjectReference
{This script is the trigger on enter script}

ObjectReference property BurnedBuilding auto
ObjectReference property NewBuilding auto
Quest property SomeQuest auto

Event OnTriggerEnter(ObjectReference akActionRef)
if(akActionRef == Game.GetPlayer())
	Debug.MessageBox("Yippee!")
	BurnedBuilding.Disable()
	NewBuilding.Enable()
	Self.Disable() ; instead of 'this' or 'GetSelf' like in Oblivion
	SomeQuest.Start()
endif
EndEvent

 

After you've put this script on your object, and saved, compiled, and closed the script editing window, you should see your script listed with a "+" in front of it. You can double-click it, and that'll take you to the property window. Now you can set those properties we put in the script to whatever references they should be.

Posted
  On 3/12/2012 at 1:09 AM, fg109 said:

Unlike Oblivion, you can't just reference things by their editor/form/reference IDs. You have to declare properties in your script (they're basically the same as variables) which you then set outside of the script, in the property window. Your script should look like this:

 

Scriptname Star_TEST_EnterStarter extends ObjectReference
{This script is the trigger on enter script}

ObjectReference property BurnedBuilding auto
ObjectReference property NewBuilding auto
Quest property SomeQuest auto

Event OnTriggerEnter(ObjectReference akActionRef)
if(akActionRef == Game.GetPlayer())
	Debug.MessageBox("Yippee!")
	BurnedBuilding.Disable()
	NewBuilding.Enable()
	Self.Disable() ; instead of 'this' or 'GetSelf' like in Oblivion
	SomeQuest.Start()
endif
EndEvent

 

After you've put this script on your object, and saved, compiled, and closed the script editing window, you should see your script listed with a "+" in front of it. You can double-click it, and that'll take you to the property window. Now you can set those properties we put in the script to whatever references they should be.

 

 

Ah, thanks - I'll try that!

Posted (edited)

I noticed if you hit auto-fill it fills the properties, since I named them the same.

 

It's working now. Thanks so much. The Northern Frost Brewery will probably be made public this weekend. :)

Edited by blast0r
Posted
  On 3/17/2012 at 6:48 AM, Susurruss said:

Why don't you do it with a change location event node?

 

I think it had something to do with in addition to entering a cell, discovering a location, which would require a trigger over the specific area around the location marker. The SM event would be a tad cleaner, but depends on the effect they're going for.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...