Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Make something occur upon continue?
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#1
Make something occur upon continue?

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?

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-23-2013, 07:54 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Make something occur upon continue?

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-23-2013, 10:14 AM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#3
RE: Make something occur upon continue?

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.

04-23-2013, 10:42 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#4
RE: Make something occur upon continue?

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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-23-2013, 02:01 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#5
RE: Make something occur upon continue?

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-23-2013, 02:14 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#6
RE: Make something occur upon continue?

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:
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.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 04-23-2013, 02:30 PM by Romulator.)
04-23-2013, 02:24 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#7
RE: Make something occur upon continue?

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

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


"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 04-23-2013, 02:33 PM by PutraenusAlivius.)
04-23-2013, 02:30 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#8
RE: Make something occur upon continue?

yes and just put false in the

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

"What you think is irrelevant" - A character of our time

A Christmas Hunt
04-23-2013, 02:31 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#9
RE: Make something occur upon continue?

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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-23-2013, 02:32 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#10
RE: Make something occur upon continue?

Bro, the integer is 0. Refresh the page.

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-23-2013, 02:33 PM
Find




Users browsing this thread: 3 Guest(s)