Jump to content

Script to enable pushblock switch


Recommended Posts

Hello, I'm hoping to get a little help. I don't script. But I need one script in a mod quest I'm putting together.

 

I have a pushblock (that activates a secret portal) which starts off "initially disabled", but which needs to be enabled when the player GetsInCell with the quest at a certain stage. I want to run this script from a Quest Stage 'Result Script' box.

 

This seems very simple, but I haven't run across useful script examples in any of the tutorials or forum topics I've browsed so far.

 

Would appreciate any (simple) advice on how to do this.

 

Thanks,

Link to comment
Share on other sites

It seems that a very simple script such as:

 

;Scriptname EnableHiddenSwitch
;short doonce
;
;Begin Gamemode
; if ( GetStage MyQuest>= 30 ) && ( doonce == 0 )
; HiddenSwitchRef.Enable
; set doonce == 1
; SetStage MyQuest == 40
; Endif
;End
; ;enables the initially disabled pushblock in the Hidden Library

 

 

should work. However, when I try to compile this, it gives me an error and refuses to recognise the name given to the specific pushblock "HiddenSwitch", or the numeric code for the item if I use that instead. What am I doing wrong?

 

Thanks,

Link to comment
Share on other sites

In order to be able to remote-disable/enable items such as this you'll need to make them a so-called "persistent" reference in their options and give the actual reference you placed into the game world a unique name as well. The Base Item's EditorID, or its numeric FormID as you also tried, cannot be used for this.

 

Also there's several syntax errors inside the script you posted.

"set" lines do not contain comparisons like "set doonce == 1", not even assignments like "set doonce = 1", but their valid syntax always goes like this:

 

set doonce to 1

 

Likewise your "SetStage" function call does not contain another valid parameter, as it should do, but there's yet another bogus comparison in its place instead:

 

SetStage MyQuest == 40

 

The correct syntax would be:

 

SetStage MyQuest 40

 

or

 

SetStage MyQuest, 40

 

But ObScript doesn't care for the "," separators.

 

That should be all I see already though. Hope it helps.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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