Jump to content

Adding a fade to black and timer script...


Deleted2746547User

Recommended Posts

I thought the script I wrote might have a problem, but I wasn't 100% sure. To fix it, I think the timer has to be in a separate script. This is what I would do (there's probably a better way, but hey):

Create a new quest called BlackBriarWashoeNorthRedoubtTimer. Have Start Game Enabled off, so that it's not constantly running. I would also set the script processing delay to 1 second, or lower, so that the script runs almost instantly.

In the quest script, have:

scn BlackBriarWashoeNorthRedoubtTimerScript

short Timer

Begin gamemode

if Timer < 2
    set Timer to Timer + GetSecondsPassed
else            ;This is what will happen while the screen is black.
    ShowMessage BlackbriarConstructionUnderwayMsg
    SetPCSleepHours 4
    BlackbriarNorthRedoubtGuardPlacement.enable ; places hiring clipboard
        BlackbriarNorthernRedoubtActivatorRef.Enable ; builds redoubt & checkpoints
    BlackbriarNorthRedoubtActivatorRef.Disable ; disables build anvil
    BlackbriarNorthRedoubtActivatorRef.markfordelete
    SetStage BlackbriarOPFire 30
    stopquest BlackBriarWashoeNorthRedoubtTimer
endif

End

Now, back to the BlackbriarNorthRedoubtBuildScript:

scn BlackbriarNorthRedoubtBuildScript

short AwaitingInput
short buttonVar

begin OnActivate
 
	ShowMessage BlackbriarWashoeNorthRedoubtChoiceMesg
	set AwaitingInput to 1
 
end

Begin gamemode

if awaitingInput == 1
	set buttonVar to getbuttonpressed

	if buttonVar > -1
		set awaitingInput to 0
 
		if buttonVar == 0
			If BlackbriarBaseStorageRef.GetItemCount BlackbriarHammer >= 1 && BlackbriarBaseStorageRef.GetItemCount BlackbriarMetalResource >= 6 && BlackbriarBaseStorageRef.GetItemCount BlackbriarSandbag >= 18 && BlackbriarBaseStorageRef.GetItemCount BlackbriarResourceWood >= 8                     
				BlackbriarBaseStorageRef.removeitem BlackbriarHammer 1
				BlackbriarBaseStorageRef.RemoveItem BlackbriarSandbag 18
				BlackbriarBaseStorageRef.RemoveItem BlackbriarMetalResource 6
				BlackbriarBaseStorageRef.RemoveItem BlackbriarResourceWood 8

				imod FadeToBlack9sISFX
				PlaySound YourSoundGoesHere
				startquest BlackBriarWashoeNorthRedoubtTimer

			else
				ShowMessage BlackbriarWashoeBuildingMaterialsMsg
			endif
 
		elseif buttonVar == 1
			ShowMessage BlackbriarNextTimeMsg

		endif
	endif
endif

end

I tested a simplified version of this, where I checked for the amount of caps the player had instead of your basestorageref stuff, and it worked for me.

Incidentally, if you want to disable player controls while the screen is black, you could change the timer script to something like this (I didn't test this, but it looks like it should work):

scn BlackBriarWashoeNorthRedoubtTimerScript

short Stage
short timer

Begin Gamemode

if Timer > 0
	set Timer to Timer - GetSecondsPassed
elseif Stage == 0
	set stage to 1
	ShowMessage BlackbriarConstructionUnderwayMsg
	PlaySound YourSoundGoesHere
	disableplayercontrols
	set Timer to 2
elseif Stage == 1	;after 2 seconds, do this
	SetPCSleepHours 4
	BlackbriarNorthRedoubtGuardPlacement.enable ; places hiring clipboard
        BlackbriarNorthernRedoubtActivatorRef.Enable ; builds redoubt & checkpoints
	BlackbriarNorthRedoubtActivatorRef.Disable ; disables build anvil
	BlackbriarNorthRedoubtActivatorRef.markfordelete
	SetStage BlackbriarOPFire 30
	set stage to 2
	set Timer to 2
elseif Stage == 2	;after 2 more seconds (screen is now not black), do this
	enableplayercontrols
	stopquest BlackBriarWashoeNorthRedoubtTimer
endif

End
Edited by sentimeta
Link to comment
Share on other sites

  • 5 months later...

What am I doing wrong? The message on the activator shows the top two lines of the message itself. But that's it. Shows none of the options... and I can't escape from that screen.





BlackbriarBHChipVendorScript

short Button
short PlayerChipAmount

begin OnActivate

if IsActionRef player == 1
ShowMessage BlackbriarBHChipsMessage1
endif

end

BEGIN MenuMode 1001

set Button to GetButtonPressed

if ( Button == 0 )
player.additem BlackbriarBHChip 10
player.RemoveItem caps001 10
elseif ( Button == 1 )
player.additem BlackbriarBHChip 50
player.RemoveItem caps001 50
elseif ( Button == 2 )
player.additem BlackbriarBHChip 250
player.RemoveItem caps001 250
elseif ( Button == 3 )
player.additem BlackbriarBHChip 1000
player.RemoveItem caps001 1000
elseif ( Button == 4 )
player.additem BlackbriarBHChip 5000
player.RemoveItem caps001 5000
elseif ( Button == 5 )
set PlayerChipAmount to player.GetItemCount BlackbriarBHChip
player.RemoveItem BlackbriarBHChip PlayerChipAmount
player.AddItem caps001 PlayerChipAmount
elseif ( Button == 6 )
ShowMessage BlackbriarCanceltransactionMSG
endif
endif

END
Link to comment
Share on other sites

  • Recently Browsing   0 members

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