Frictional Games Forum (read-only)

Full Version: Make something occur upon continue?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
In order for my grayscale CS to be in black and white, we call the FadeSepiaColorTo() function to handle it. It works blissfully well until whenever I have to resume the game.

Upon resuming, the game is in color. :/ Is there a way to make sure that the game starts implementing code as soon as the save is loaded as such?
Make sure it's on the void OnEnter() part.
Yes because this part of the code (OnEnter) Is ran when the player enter's the map (for any reason whether that be from a door or from loading a save) it will run the script.
Well, its quite interesting, it only worked the first time I tried it.
What if I made a script that covers the entire area that does not disappear upon collision? (No need for the script, I can make this)?
(04-23-2013, 02:01 PM)ROMul8r Wrote: [ -> ]Well, its quite interesting, it only worked the first time I tried it.
What if I made a script that covers the entire area that does not disappear upon collision? (No need for the script, I can make this)?

What do you mean?
Say that there is a ScriptArea which covers the entire map.
This means that no matter the player's position, he/she collides with it.
So if I add a CollideCallback between the player and the script, couldn't I code something like:
Code:
void blackandwhiteeffect(string &in asParent, string &in asChild, int alState)
{
FadeSepiaColorTo(100.0f, 1.0f);
}

?

Edit: The reason I ask this before I implement is that I do not want the game to continuously do this if it will lag some of the underpriveledged computers.
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""ScriptAreaName""BlackAndWhite"false0);
}

void BlackAndWhite(string &in asParentstring &in asChildint alState)
{
if(
alState) == 0)
{
FadeSepiaColorTo(100.0f1.0f);
}

yes and just put false in the

AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, false, 0);
Okay, I'll try the if statement now. It actually just popped into my head just then Tongue
Bro, the integer is 0. Refresh the page.
Pages: 1 2