Frictional Games Forum (read-only)

Full Version: Skip Intro when in debug / developer mode? (Solved)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi! I'm creating my own map, and I want my intro (where the player wakes up) only to play when the map is ran on a normal profile. So when I load the map on the developer profile I want the intro to be skipped. I've been checking the scripts for some other maps and seems like some developers do this, I tried copying / pasting that part of the script but it doesn't work for me.

By the way, I copied the script from the custom story "Black Forest Castle" by "theDARKW0LF"

So here's how my script looks..

Spoiler below!


void OnStart()
{
if(!ScriptDebugOn()) wakeUp(); //no intro when you are testing
else AddDebugMessage("Skipping Intro", false);
wakeUp();
SetPlayerLampOil(20);
AddQuest("Lantern", "Lantern");
AddEntityCollideCallback("Player", "CollideKnightHeadTrigger1", "CollideKnightHeadTrigger1", true, 0);
}



void wakeUp () {
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 200, 200); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}


I don't understand how this code works
Spoiler below!

if(!ScriptDebugOn()) wakeUp(); //no intro when you are testing
else AddDebugMessage("Skipping Intro", false);

but it seemed to work on the Black Forest Castle map. (Also the wakeUp(); part was called Intro(); on the Black Forest Castle map I believe, I renamed it as I assume it shall be the name of my intro there..)

If anyone could be please tell me how I can skip the intro in developer mode I would appreciate it very much. And I am also a newbie at scripting, I know so please don't leave unnecessary replies, thanks.
He copied that from me. Wink
Remove the fifth line
Code:
wakeUp();
Will it still play on a normal profile then?
Try it? Wink
You got it two times, that's why it plays all the time even when you are in debug mode..
And of course it will only play when other players are not using debug mode either, that's why I would remove the if part when you release your custom story.
Tried it and it works the way I want to!

Thank you very much! Smile
Awesome Big Grin