Frictional Games Forum (read-only)
[SCRIPT] Make something occur upon continue? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Make something occur upon continue? (/thread-21251.html)

Pages: 1 2


Make something occur upon continue? - Romulator - 04-23-2013

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?


RE: Make something occur upon continue? - PutraenusAlivius - 04-23-2013

Make sure it's on the void OnEnter() part.


RE: Make something occur upon continue? - 7heDubz - 04-23-2013

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.


RE: Make something occur upon continue? - Romulator - 04-23-2013

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)?


RE: Make something occur upon continue? - PutraenusAlivius - 04-23-2013

(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?


RE: Make something occur upon continue? - Romulator - 04-23-2013

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.


RE: Make something occur upon continue? - PutraenusAlivius - 04-23-2013

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""ScriptAreaName""BlackAndWhite"false0);
}

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




RE: Make something occur upon continue? - i3670 - 04-23-2013

yes and just put false in the

AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, false, 0);


RE: Make something occur upon continue? - Romulator - 04-23-2013

Okay, I'll try the if statement now. It actually just popped into my head just then Tongue


RE: Make something occur upon continue? - PutraenusAlivius - 04-23-2013

Bro, the integer is 0. Refresh the page.