Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
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
|
|
04-23-2013, 07:54 AM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
7heDubz
Posting Freak
Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation:
41
|
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 |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
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
|
|
04-23-2013, 02:01 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
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
(This post was last modified: 04-23-2013, 02:30 PM by Romulator.)
|
|
04-23-2013, 02:24 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Make something occur upon continue?
void OnStart() { AddEntityCollideCallback("Player", "ScriptAreaName", "BlackAndWhite", false, 0); }
void BlackAndWhite(string &in asParent, string &in asChild, int alState) { if(alState) == 0) { FadeSepiaColorTo(100.0f, 1.0f); } }
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
04-23-2013, 02:30 PM |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: Make something occur upon continue?
yes and just put false in the
AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, false, 0);
|
|
04-23-2013, 02:31 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Make something occur upon continue?
Okay, I'll try the if statement now. It actually just popped into my head just then
Discord: Romulator#0001
|
|
04-23-2013, 02:32 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
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 |
|
|