Jump to content

Adding a fade to black and timer script...


Deleted2746547User

Recommended Posts

HOW WOULD I FIX MY SCRIPT TO INCLUDE A FADE TO BLACK, PLAY A SOUND AND TAKE A GAME HOUR OR SO DOING IT. I THINK I KNOW THE SCRIPT TO ADD THE PIECES (THAT IS I KNOW HOW TO DO A FADE SCRIPT/PLAY MUSIC) BUT i DON'T KNOW HOW TO CHANGE MY SCRIPT (SYNTAX) TO MAKE THAT WORK...

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
BlackbriarNorthRedoubtGuardPlacement.enable ; places hiring clipboard
BlackbriarNorthernRedoubtActivatorRef.Enable ; builds redoubt & checkpoints
BlackbriarNorthRedoubtActivatorRef.Disable ; disables build anvil
BlackbriarNorthRedoubtActivatorRef.markfordelete
ShowMessage BlackbriarConstructionUnderwayMsg
SetStage BlackbriarOPFire 30
else ShowMessage BlackbriarWashoeBuildingMaterialsMsg
endif
elseif buttonVar == 1
ShowMessage BlackbriarNextTimeMsg
endif
endif
endif
end
Link to comment
Share on other sites

I'm not sure of how your script actually works (it's 1.30 AM and I'm too tired to dig through, going to sleep soon) so I can't tell you exactly where to add the code, but to make an hour pass use "SetPcSleepHours 1", for the fade to black use "imod FadeToBlackISFX" (there are several fade to black variants in ImageSpace Modifiers) and to play music use PlaySound [soundID].

 

Not sure if that actually helps. Sorry if it's not very useful.

Link to comment
Share on other sites

Jokerine ... how do you mean how it actually works? What's wrong with the code? RIght now, when you activate an activator it runs the script. What effect I'm trying to come up with is where it seems like it took time for the changes (items enabled to appear). hence, the fade to black and the passage of time. And since you're building or doing something, the sound. :) I know how to do the pieces you mentioned but to get them to work in this or a similar code... i'm at a loss. That is, the syntax.. (begin game mode, etc.)

 

THANKS for the reply though... you are always awesome.

Link to comment
Share on other sites

Here's kind of what I mean.. with this script I "Mine" for materials. When you activate the script a message displays, the screen fades to black, it plays a sound and a few hours passes. But no way I've tried to "merge" this effect with the other script work.

That is

scn BlackbriarResourceMetalMiningScriptMAIN
int State
Begin onActivate
If BlackbriarBaseStorageRef.GetItemCount BlackbriarRancherAxe >= 1 && BlackbriarBaseStorageRef.GetItemCount BlackbriarHempbag >= 5 && State == 0 && GetActionRef == player
set State to 1
else
ShowMessage BlackbriarYouNeedGearzMesg
endif
End
Begin GameMode
If State == 1
imod FadeToBlackISFX
Playsound BlackbriarBlackSmithHammer
RewardXP 5
BlackbriarBaseStorageRef.removeitem BlackbriarHempbag 5
Player.DamageActorValue Health 5
Player.ModActorValue Strength 2
Player.DamageActorValue Dehydration 5
Player.DamageActorValue Hunger 5
BlackbriarBaseStorageRef.additem BlackbriarMetalOreResource 3
BlackbriarBaseStorageRef.additem BlackbriarOreMineralResource 2
BlackbriarBaseStorageRef.additem BlackbriarPreciousMetalResource 1
set gamehour to gamehour + 6
ShowMessage BlackbriarSaltMinigMesg
set State to 0
Endif
End
Link to comment
Share on other sites

I'm pretty new to scripting and I might not be fully understanding what you're trying to do, but it seems to me like you can just insert it in. I don't know if objects are going to be enabled right in front of the player, but just in case they are, I included a timer, too. This seems like it would work:

scn BlackbriarNorthRedoubtBuildScript
 
short AwaitingInput
short buttonVar
Short Timer
 
begin OnActivate
 
	ShowMessage BlackbriarWashoeNorthRedoubtChoiceMesg
	set awaitingInput to 1
 
end
 
begin gamemode

if awaitingInput == 1
	set buttonVar to getbuttonpressed
 
	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 FadeToBlackISFX

			if Timer < 3		;This makes 3 seconds pass, because the fade to black takes a few seconds to make the screen fully black.
				set Timer to Timer + GetSecondsPassed
			else			;This is what will happen while the screen is black.
				PlaySound YourSoundGoesHere
				SetPCSleepHours 1
				BlackbriarNorthRedoubtGuardPlacement.enable ; places hiring clipboard
               			BlackbriarNorthernRedoubtActivatorRef.Enable ; builds redoubt & checkpoints
				BlackbriarNorthRedoubtActivatorRef.Disable ; disables build anvil
				BlackbriarNorthRedoubtActivatorRef.markfordelete
				ShowMessage BlackbriarConstructionUnderwayMsg
				SetStage BlackbriarOPFire 30
				set awaitingInput to 0
			endif

		else
			ShowMessage BlackbriarWashoeBuildingMaterialsMsg
		endif
 
	elseif buttonVar == 1
		ShowMessage BlackbriarNextTimeMsg
		set awaitingInput to 0
	endif
endif

end

Again, I might be missing something, but I'm not sure that the Gamemode section of your mining script is needed. Where you have "set State to 1", why not just put the Gamemode section there? So it would be like this:

scn BlackbriarResourceMetalMiningScriptMAIN
 
int State
 
Begin onActivate
If BlackbriarBaseStorageRef.GetItemCount BlackbriarRancherAxe >= 1 && BlackbriarBaseStorageRef.GetItemCount BlackbriarHempbag >= 5 && State == 0 && GetActionRef == player
	imod FadeToBlackISFX
	Playsound BlackbriarBlackSmithHammer
	RewardXP 5
	BlackbriarBaseStorageRef.removeitem BlackbriarHempbag 5
	Player.DamageActorValue Health 5
	Player.ModActorValue Strength 2
	Player.DamageActorValue Dehydration 5
	Player.DamageActorValue Hunger 5
	BlackbriarBaseStorageRef.additem BlackbriarMetalOreResource 3
	BlackbriarBaseStorageRef.additem BlackbriarOreMineralResource 2
	BlackbriarBaseStorageRef.additem BlackbriarPreciousMetalResource 1
	set gamehour to gamehour + 6 
	ShowMessage BlackbriarSaltMinigMesg
else
	ShowMessage BlackbriarYouNeedGearzMesg
endif
End
 

Link to comment
Share on other sites

Know I'm missing something small in this but what? Trying to get it to play the ShowMessage After screen fades back in.

 

 

scn BlackbriarWashoeCleaningScript
short timer
Begin onActivate
imod FadeToBlackISFX
if Timer < 3 ;This makes 3 seconds pass
set Timer to Timer + GetSecondsPasseD
Playsound UIKarmaUp
set gamehour to gamehour + 4
BlackbriarFortWashoeCleaningActRef.disable; disable streetcleaner activator
BlackbriarFortWashoeCleaningActRef.markfordelete
BlackbrairASCCleaningCarREF.enable; turn on streetcar cleaner in ASC bldg
BlackbriarBaseStorageRef.additem BlackbriarResourceWood 50; add resources from cleanup recycling to player base storage
BlackbriarBaseStorageRef.additem BlackbriarHammer 3
BlackbriarBaseStorageRef.additem BlackbriarFieldShovel 4
BlackbriarBaseStorageRef.additem BlackbriarScrapMetal 50
BlackbriarBaseStorageRef.additem BlackbriarGlassResource 20
BlackbriarBaseStorageRef.additem BlackbriarFOODMRE11 20
BlackbriarBaseStorageRef.additem BlackbriarCanvas 20
BlackbriarCleanUp.disable; disable clutter enabling x marker
BlackbriarCleanUp.markfordelete
ShowMessage BlackbriarResourcesAddedtoStorage
setStage BlackbriarOPCitadel 20
endif
Activate
End
Edited by Guest
Link to comment
Share on other sites

One final question tonight: I can't seem to find an answer on the crafting/inventory script. Trying to figure out how to pull ingredients, etc from a container when crafting items. So, the workbench, etc. checks that container for the items and then puts the crafted items back into that same container.

Link to comment
Share on other sites

because it's not super easy and requires some line of code.

 

I can think to at least 2 approaches:

 

1) introduce your own custom crafting system, at least under certain conditions, so that vanilla won't be touched

 

2) remove in game all the player's items, move them on a temporary container, transfer all the items of that container to the player, open the craftin menu and craft, when you close it you will do the inverse - trasferring the items from the player back to the container, and taking the player's item from the temporary container back to the player.

Link to comment
Share on other sites

The code is the part I can't figure out either way. I have introduced 3 machines in the game that will basically serve to craft the recipes etc for the guns, equipment, etc I add with the mod. even if i were to only use that, I still cant' figure how to write the code to make it pull from a specific container....

Speaking of scripts... still can't get this one to work........ I've tried it 100 different ways. I've tried it with timers (from the code in this thread) and a number of other combinations. Either it doesn't show the SHOWMESSAGE, does nothing or fades to black but never executes the rest of the script.


$$$$$$$$$$$$$$$$$$$$$$$


scn BlackbriarWASHOESandbagBuildv2Script
short AwaitingInput
short buttonVar
begin OnActivate
ShowMessage BlackbriarWashoeSandbagbaseChoiceMesg
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 BlackbriarSandbag >= 24 && BlackbriarBaseStorageRef.GetItemCount BlackbriarSoldierDogtag >= 2 && BlackbriarBaseStorageRef.GetItemCount BlackbriarK9ResourceTrained >= 2
BlackbriarBaseStorageRef.removeitem BlackbriarHammer 1
BlackbriarBaseStorageRef.removeitem BlackbriarSandbag 24
BlackbriarBaseStorageRef.removeitem BlackbriarSoldierDogTag 2
BlackbriarBaseStorageRef.removeitem BlackbriarK9ResourceTrained 2
BlackBriarSandbagBuildSwitchRef.disable; removes the anvil build base activator item from area
BlackBriarSandbagBuildSwitchRef.markfordelete
Playsound BlackbriarBlackSmithHammer
imod FadeToBlackISFX
set gamehour to gamehour + 4
BlackbriarTempGuardTowerBuildSwitch.enable; enable build anvil for sandbag towers
BlackbriarFtGaltCourtyardGaurdsRef.enable; enable courtyard and perimeter guards
BlackbriarCitdaelConstruction5REF.enable; enables x marker to build sandbag defenses
setStage BlackbriarOPCitadel 60
; ShowMessage BlackbriarConstructionUnderwayMsg
endif
endif
else
ShowMessage BlackbriarConstructionsnoMaterialsnoBSCMsgn
endif
elseif buttonVar == 1
ShowMessage BlackbriarNextTimeMsg
set awaitingInput to 0
endif
endif
endif
end
Link to comment
Share on other sites

  • Recently Browsing   0 members

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