The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Skip Intro when in debug / developer mode? (Solved)
Shadowfied Offline
Senior Member

Posts: 261
Threads: 34
Joined: Jul 2010
Reputation: 5
#1
Skip Intro when in debug / developer mode? (Solved)

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.
(This post was last modified: 03-25-2011, 12:41 PM by Shadowfied.)
03-25-2011, 10:38 AM
Find


Messages In This Thread
Skip Intro when in debug / developer mode? (Solved) - by Shadowfied - 03-25-2011, 10:38 AM



Users browsing this thread: 1 Guest(s)