Jump to content

Elevator Script Help


MykhailKozak

Recommended Posts

I'm fairly new to the GECK, and I can get the general gist of things.

Currently I'm trying to get it so that you use an activator, it disables controls, plays a sound effect, it waits for the screen to go black, teleports you, and then gives you controls as soon as the screen unfades. I'm not really sure where to go from what I've got.

 

Heres my script so far. Right now, I will teleport and then the screen fade occurs, and my controls are taken away, however do not get enabled.

 

scn ElevatorScriptDown

begin OnActivate
float Timer
short init


ApplyImageSpaceModifier FadeToBlack5sISFX

DisablePlayerControls

Player.MoveTo ElevatorTeleportDownMrk

PlaySound OBJVertibirdPlatform

if init == 0
set Timer to 5
set init to 1
endif
if Timer > 0
set Timer to Timer - getSecondsPassed
else
EnablePlayerControls
endif
endif
end

 

Link to comment
Share on other sites

You could try something like this instead. This is my go-to "cutscene" script.

 

I use an Int (internal variable, in this case "MySequence01") so, when you use StartQuest, you should do

Set MyQuest.MySequence01 to 1
StartQuest MyQuest

The advantage of using ints is that you can merge all of your teleports into one script, and simply check for what int you're using to do different things.

 

But, for a basic one with only one int, this is the script. The quest should have priority 10, delay 0.100000, and not start enabled.

scn CutsceneScriptThing

;-----------------------------------

int MySequence01

;-----------------------------------


Begin GameMode

;-----------------------------------

if (MySequence01 == 1)

  if Reset == 0
          DisablePlayerControls 1 1 1 0 1 1 1
          IMOD FadeToBlack5sISFX
	  Set Timer to 0
	  Set Reset to 1
	EndIf

	Set Timer to Timer + GetSecondsPassed
 
	if Timer > 5

	  Set Reset to 0
          Player.MoveTo MyMarkerREF
	  EnablePlayerControls
          Set MySequence01 to 0
	  StopQuest MyQuest
	endif

endif

You could change the IMOD to one like FadeInfromBlack to make the screen black immediately. You can change the value of Timer > 5 to more or less depending on how long you want the player to stand still.

 

Sorry if the thing about using different ints this isn't very clear. If you need help with that I can give you some more examples.

Link to comment
Share on other sites

Just a minor terminology correction (because terms matter) for what I'm sure was a momentary lapse, but "int" stands for "integer" (which is aka "short") variable type in GECK. But the declaration statement defines the type and determines where it is valid to use. Which is why it's considered good practice to prefix a variable with an indication as to the type it was defined (e.g. "iVarName", "fVarName", "arrVarName", etc. Each of those should be considered a different variable name and type.)

 

-Dubious-

Link to comment
Share on other sites

Try changing the first lines to look like the second.

 

else
EnablePlayerControls

 

 

elseif Timer < 1

EnablePlayerControls

 

Add edit: Oh wait , I missed this is an OnActivate script block.

 

That is the problem , since it only fires once , It won't be able to check if the timer has counted down.

 

The timer count down is only going to work within a GameMode , OnTrigger , OnMenuMode or ScriptEffectUpdate ; Block which they continually read through the lines.

 

Not that Jokerines suggestion may be better ... but to salvage your script , just add a GameMode block like this. Plus I changed the timer to go up , since it defaults at 0 anyways.

 

~~~~~~~~~~~~~~~~~~

scn ElevatorScriptDown

begin OnActivate
float Timer
short init


ApplyImageSpaceModifier FadeToBlack5sISFX

DisablePlayerControls

Player.MoveTo ElevatorTeleportDownMrk

PlaySound OBJVertibirdPlatform

Set Timer to 0

Set init to 1

End

 

BeginGameMode

if init == 1
set Timer to Timer + getSecondsPassed

if Timer >= 5
EnablePlayerControls

Set init to 0

endif
endif

End

Edited by Mktavish
Link to comment
Share on other sites

Thanks everyone for the help, anfld for getting to me so quickly, I tried out Mktavish's script and it worked as i wanted it to, however I'm trying now to make it teleport after 3 seconds rather than right when the button is pressed to give it a smooth transition and its proving rather tricky for someone at my skill level.

 

Any tips? Nothing I've tried so far has worked.

Link to comment
Share on other sites

 

Yes however i wanted a script that would be easy for me to understand as to use for further reference, and looking over yours again it doesn't seem to have the teleport after 3 seconds as i just mentioned.

All you'd need to do is change:

 

if Timer > 5

 

To

 

if Timer > 3

 

No, you misunderstand me. I want the player to teleport 3 seconds in whereas the screen is completely black from the iMod, then the player controls to comeback after 5 seconds when the screen is completely unfaded.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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