Quantcast
Channel: Modding — Beamdog Forums
Viewing all articles
Browse latest Browse all 11774

Restcheck (code for mod rest scene compatibility with BG2:EE and other mods)

$
0
0
Full Rest Check version 1.04 Update: The previous versions are combined into one and a fix was put into the coding to make the restchecktool work better. What this is: Rest Check is code to prevent the rest scenes in your mod from triggering at the same time as the dreams and rest scenes in Baldur's Gate II - Enhanced Edition. It will stop any of your rest scenes from triggering before another one does, and for two turns (minutes) of real-time afterward. The Rest Check Tool is code that triggers a dialogue every time you rest which checks whether or not restcheck is working. How to add rest check to a mod you have created: 1) Open the restcheck tp2 file (I'm assuming with Notepad++). Copy and paste the contents into your own mod tp2 file, anywhere after BEGIN. If you want to use the restcheck tool then open that tp2 file and copy/paste that on the bottom of your mod tp2 file. Then use Find... (Under Search, or CTRL+F), go to the 'Replace' tab. Find what: ModFolderName and replace it with whatever the actual name of your mod folder is. 2) Copy the restcheck folder and paste it in your mod folder. Do the same with the restchecktool folder if you want to use that as well. 3) Add the following trigger to your mod's rest scenes: Global("_rc_restcheck","GLOBAL",0) You do not need to change the prefix. 4) You're done. Now your mod scenes will not trigger on the same rest as any of the in-game dreams or romance rest scenes in Baldur's Gate II - Enhanced Edition. 5) If you added the restchecktool to your mod as well then that will have a separate install option when your mod installs. It's only used for testing purposes. You don't need it for restcheck to work (only to verify that it is working). Mods using restcheck: I know of two so far: Playable Clara and All things Mazzy Corthala Romantique And for my own ease-of-use here's the link to the restcheck thread on the Spellhold forum. Thank you. -BCaesar P.S. Here's an example of the coding from restcheck, so you can see how it works. This is for the very first dream in Baldur's Gate SoA:

IF //First Imoen Dream
	GlobalTimerExpired("ImoenDream1","GLOBAL")
	Global("HadImoenDream1","GLOBAL",0)
	GlobalLT("Chapter","GLOBAL",4)
	Global("_rc_restcheck","GLOBAL",0)
THEN
	RESPONSE #100
	SetGlobal("_rc_restcheck","GLOBAL",1)
END

IF
	Global("HadImoenDream1","GLOBAL",1)
	Global("_rc_HadImoenDream1","GLOBAL",0)
THEN
	RESPONSE #100
	SetGlobal("_rc_HadImoenDream1","GLOBAL",1)	
	SetGlobal("_rc_restcheck","GLOBAL",2)
END 
So what this does is if all the conditions for this dream are met (meaning it will happen the next time you rest) then it sets Global("_rc_restcheck","GLOBAL",1). On your rest scenes you add the condition trigger: Global("_rc_restcheck","GLOBAL",0), so your scenes will yield to those already in game. Once the first Imoen dream starts (or any other scene) RestCheck sets Global("_rc_restcheck","GLOBAL",2), meaning that your dreams still will not trigger. Then this coding takes over:

//Rest check timer.
IF
	Global("_rc_restcheck","GLOBAL",2)
THEN
	RESPONSE #100
	SetGlobal("_rc_restcheck","GLOBAL",3)
	RealSetGlobalTimer("_rc_restchecktimer1","GLOBAL",TWO_TURNS)
END

IF
	RealGlobalTimerExpired("_rc_restchecktimer1","GLOBAL")
		Global("_rc_restcheck","GLOBAL",3)
THEN
	RESPONSE #100
	SetGlobal("_rc_restcheck","GLOBAL",0)
END 
So once the dream starts and Global("_rc_restcheck","GLOBAL",2) is set then a 2 minute timer (real-time) starts. As long as that timer is running your rest scenes will still yield. This prevents your scene from occuring right after the Imoen dream finishes. After the 2 minutes Rest Check resets Global("_rc_restcheck","GLOBAL",0) meaning your rest scene is able to happen the next time you rest. A variation of this coding is used for every dream and every romance rest scene in BG2:EE (and for all the Mod rest scenes in Rest Check for Mod Scenes.

Viewing all articles
Browse latest Browse all 11774

Latest Images

Trending Articles



Latest Images