Jump to content

Some scripting help


Starsickle

Recommended Posts

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!

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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