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 Wake up script
Saren Offline
Member

Posts: 196
Threads: 20
Joined: Jan 2012
Reputation: 1
#36
RE: Wake up script

(05-05-2012, 02:45 AM)Your Computer Wrote:
(05-05-2012, 02:40 AM)Saren Wrote: Oh yea, it does feel like there something missing here... like a fricken CALLBACK, Right.... so the question is, WHAT'S IT CALLED??? Cause I sure have no idea.. The callbacks I know is either used on doors and stuff or require a script area.... I dunno with one fits this...

All the code you've provided so far hasn't given me enough information to inform you of the syntax required. All i know is that the latest wakeup function you've posted applies to almost no callback.
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(0, 2, 500); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 15.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

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

void OnStart()
{

//Callbacks
AddEntityCollideCallback("Player", "Spawnmusic", "PlayMusic", true, 1);
AddEntityCollideCallback("Player", "Stopmusic", "StopMusic", true, 1);
AddEntityCollideCallback("Player", "Missingstaff", "Message1", true, 1);
AddEntityCollideCallback("Player", "Guarddogthoughts", "Message2", true, 1);
AddUseItemCallback("", "Masterbedroomkey", "masterbedroomdoor", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide2", "MonsterFunction2", true, 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("masterbedroomdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "masterbedroomdoor", 0, false);
PlaySoundAtEntity("", "03_puzzle_secret", "Player", 0, false);
RemoveItem("Masterbedroomkey");
}

//Doormessages
void MasterBedroomDoor(string &in entity)
{
SetMessage("Messages", "MasterBedroomDoor", 0);
}

//Crowbar
void OnEnter()
{
AddUseItemCallback("", "crowbar_1", "crowbar_door", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}


void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("crowbar_door", false, true);
AddPropImpulse("crowbar_door", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("crowbar_door", true);
SetSwingDoorClosed("crowbar_door", false, false);
SetMoveObjectState("crowbar_door", 1);
PlaySoundAtEntity("","break_wood_metal", "BreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

//Foodstorage grunt
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_foodstorage", true);
ShowEnemyPlayerPosition("grunt_foodstorage");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("grunt_foodstorage", "PathNodeArea_8", 0, "");
}

void Despawngrunt_foodstorage(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("grunt_foodstorage", false);
}

//Penumbra dog
void MonsterFunction2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("guard_dog", true);
ShowEnemyPlayerPosition("guard_dog");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("guard_dog", "PathNodeArea_27", 0, "");
}

//Messages
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Missingstaff", 5);
}

void Message2(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Guarddogthoughts", 5);
}

void OnLeave()
{
}

Whole thing..

05-05-2012, 02:47 AM
Find


Messages In This Thread
Wake up script - by Saren - 04-30-2012, 11:44 AM
RE: Wake up script - by trollox - 04-30-2012, 11:50 AM
RE: Wake up script - by Saren - 04-30-2012, 12:19 PM
RE: Wake up script - by Your Computer - 04-30-2012, 12:27 PM
RE: Wake up script - by Saren - 04-30-2012, 12:31 PM
RE: Wake up script - by Your Computer - 04-30-2012, 12:38 PM
RE: Wake up script - by Saren - 04-30-2012, 12:42 PM
RE: Wake up script - by Adrianis - 04-30-2012, 01:16 PM
RE: Wake up script - by Saren - 04-30-2012, 05:15 PM
RE: Wake up script - by JetlinerX - 04-30-2012, 05:26 PM
RE: Wake up script - by Saren - 04-30-2012, 07:55 PM
RE: Wake up script - by Adrianis - 05-01-2012, 07:48 PM
RE: Wake up script - by Saren - 05-01-2012, 11:05 PM
RE: Wake up script - by Adrianis - 05-02-2012, 07:26 PM
RE: Wake up script - by Saren - 05-03-2012, 12:48 PM
RE: Wake up script - by Homicide13 - 05-03-2012, 03:13 PM
RE: Wake up script - by Saren - 05-04-2012, 02:19 PM
RE: Wake up script - by Homicide13 - 05-04-2012, 02:50 PM
RE: Wake up script - by Saren - 05-04-2012, 03:08 PM
RE: Wake up script - by Homicide13 - 05-04-2012, 06:59 PM
RE: Wake up script - by Saren - 05-04-2012, 10:17 PM
RE: Wake up script - by Homicide13 - 05-04-2012, 10:20 PM
RE: Wake up script - by Saren - 05-04-2012, 10:30 PM
RE: Wake up script - by Homicide13 - 05-05-2012, 12:35 AM
RE: Wake up script - by Saren - 05-05-2012, 12:57 AM
RE: Wake up script - by FragdaddyXXL - 05-04-2012, 11:43 PM
RE: Wake up script - by Saren - 05-05-2012, 12:00 AM
RE: Wake up script - by Homicide13 - 05-05-2012, 01:08 AM
RE: Wake up script - by Saren - 05-05-2012, 01:09 AM
RE: Wake up script - by Cranky Old Man - 05-05-2012, 02:01 AM
RE: Wake up script - by Saren - 05-05-2012, 02:21 AM
RE: Wake up script - by Your Computer - 05-05-2012, 02:29 AM
RE: Wake up script - by Saren - 05-05-2012, 02:40 AM
RE: Wake up script - by Your Computer - 05-05-2012, 02:45 AM
RE: Wake up script - by Saren - 05-05-2012, 02:47 AM
RE: Wake up script - by Cranky Old Man - 05-05-2012, 02:44 AM
RE: Wake up script - by Your Computer - 05-05-2012, 04:23 PM
RE: Wake up script - by Saren - 05-05-2012, 06:42 PM
RE: Wake up script - by Saren - 05-10-2012, 11:31 AM
RE: Wake up script - by Adrianis - 05-10-2012, 01:38 PM
RE: Wake up script - by Saren - 05-10-2012, 07:24 PM
RE: Wake up script - by Adrianis - 05-10-2012, 09:38 PM
RE: Wake up script - by Saren - 05-10-2012, 10:33 PM
RE: Wake up script - by Adrianis - 05-10-2012, 10:51 PM
RE: Wake up script - by Saren - 05-10-2012, 11:19 PM
RE: Wake up script - by Adrianis - 05-11-2012, 12:01 AM
RE: Wake up script - by Saren - 05-11-2012, 12:05 AM
RE: Wake up script - by Adrianis - 05-11-2012, 09:37 AM
RE: Wake up script - by Saren - 05-11-2012, 10:31 AM
RE: Wake up script - by Adrianis - 05-11-2012, 01:35 PM
RE: Wake up script - by Saren - 05-11-2012, 08:45 PM
RE: Wake up script - by Adrianis - 05-11-2012, 09:15 PM
RE: Wake up script - by Saren - 05-11-2012, 10:40 PM
RE: Wake up script - by Adrianis - 05-11-2012, 11:19 PM
RE: Wake up script - by Saren - 05-12-2012, 01:03 AM
RE: Wake up script - by Adrianis - 05-12-2012, 04:08 PM
RE: Wake up script - by Saren - 05-13-2012, 03:28 AM
RE: Wake up script - by Rownbear - 05-13-2012, 04:35 PM
RE: Wake up script - by Saren - 05-13-2012, 08:23 PM
RE: Wake up script - by Adrianis - 05-13-2012, 09:10 PM
RE: Wake up script - by Saren - 05-14-2012, 02:14 AM
RE: Wake up script - by Statyk - 05-14-2012, 03:52 AM
RE: Wake up script - by Saren - 05-14-2012, 08:12 AM
RE: Wake up script - by Adrianis - 05-14-2012, 01:16 PM
RE: Wake up script - by Mine Turtle - 05-14-2012, 03:01 PM
RE: Wake up script - by Adrianis - 05-14-2012, 03:48 PM
RE: Wake up script - by Saren - 05-14-2012, 05:13 PM
RE: Wake up script - by Adrianis - 05-14-2012, 06:39 PM
RE: Wake up script - by Saren - 05-14-2012, 07:03 PM
RE: Wake up script - by Cranky Old Man - 05-14-2012, 06:56 PM
RE: Wake up script - by Adrianis - 05-14-2012, 07:10 PM



Users browsing this thread: 1 Guest(s)