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
I need help with creating more than 1 scripts for my custom story
ironman0001 Offline
Member

Posts: 53
Threads: 8
Joined: Sep 2012
Reputation: 0
#11
RE: I need help with creating more than 1 scripts for my custom story

(09-28-2012, 05:08 AM)Statyk Wrote: No, all your scripts start from there. You should never have more than one OnStart, OnLeave, or OnEnter.
Well i played one custom story and it has alot of scripts and i only see void OnStart. Here is the script: void OnStart()
{
AddUseItemCallback("", "key_1", "level_wood_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "Scary_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Scary_2", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "Scary_3", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "Scary_4", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "Scary_5", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "Scary_6", true, 1);
SetEntityPlayerInteractCallback("key_1", "Pickup_1", true);
SetEntityPlayerInteractCallback("key_study_1", "Pickup_2", true);
SetEntityPlayerInteractCallback("key_study_2", "Pickup_3", true);
SetEntityPlayerInteractCallback("key_study_3", "Pickup_4", true);
SetEntityPlayerInteractCallback("note1", "ReadPaper", true);
AddUseItemCallback("", "knife", "blocker2", "cuttertask", true);
AddUseItemCallback("", "dolch", "gruntmonster", "kill1", true);
AddUseItemCallback("", "key_study_1", "door1", "d1", true);
AddUseItemCallback("", "key_study_2", "door2", "d2", true);
AddUseItemCallback("", "key_study_3", "door3", "d3", true);
AddUseItemCallback("", "key_study_4", "door4", "d4", true);
SetPlayerLampOil(0.0f);
}

void Scary_6(string &in asEntity)
{
SetMessage("Messages", "text1", 5);
}

void kill1(string &in asItem, string &in asEntity)
{
GiveSanityBoostSmall();
PlaySoundAtEntity("", "attack_claw.snt", "Player", 0, false);
PlaySoundAtEntity("", "attack_claw_hit.snt", "Player", 0, false);
SetEntityActive("gruntmonster", false);
}

void d1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "unlock_door", "d1", 0, false);
RemoveItem("key_study_1");
}

void d2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door2", false, true);
PlaySoundAtEntity("", "unlock_door", "d2", 0, false);
RemoveItem("key_study_2");
}

void d3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door3", false, true);
PlaySoundAtEntity("", "unlock_door", "d3", 0, false);
RemoveItem("key_study_3");
}

void d4(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door4", false, true);
PlaySoundAtEntity("", "unlock_door", "d4", 0, false);
RemoveItem("key_study_4");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_wood_1", false);
PlaySoundAtEntity("", "unlock_door", "level_wood_1", 0, false);
RemoveItem("key_1");
}

void cuttertask(string &in asItem, string &in asEntity)
{
SetEntityActive("sewer_grate_broken_1", true);
PlaySoundAtEntity("", "pickaxe_hit.snt", "Player", 0, false);
SetEntityActive("sewer_grate_new_1", false);
SetEntityActive("blocker2", false);
GiveSanityBoostSmall();
}

void Scary_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt1", true);
AddPropImpulse("grunt1", -20, 0, 0, "world");
}

void Scary_2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "enabled.snt", "Player", 0, false);
}

void Scary_3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("gay1", true);
SetEntityActive("gay2", true);
SetEntityActive("gay3", true);
AddPropImpulse("gay1", -20, 0, -20, "world");
AddPropImpulse("gay2", -20, 0, -20, "world");
AddPropImpulse("gay3", -20, 0, -20, "world");
PlaySoundAtEntity("", "21_screams.snt", "Player", 0, false);
SetEntityActive("key_study_1", true);
}

void Scary_4(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("breaker", false);
SetEntityActive("breaker2", true);
AddPropImpulse("breaker2", 0, 0, -30, "world");
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0, false);
PlaySoundAtEntity("", "amb_alert.snt", "Player", 0, false);
}

void Scary_5(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("corpse_male_1", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "Player", 0, false);
AddPropImpulse("corpse_male_1", 0, 0, -20, "world");
}

void Pickup_1(string &in asEntity)
{
SetEntityActive("gruntmonster", true);
GiveSanityDamage(5.0f, true);
}

void Pickup_2(string &in asEntity)
{
PlaySoundAtEntity("", "04_warn.snt", "Player", 0, false);
}

void Pickup_3(string &in asEntity)
{
SetEntityActive("ScriptArea_5", true);
SetEntityActive("breaker3", true);
PlaySoundAtEntity("", "break_stairs.snt", "Player", 0, false);
}

void Pickup_4(string &in asEntity)
{
SetEntityActive("hanging_prisoner_1", true);
SetEntityActive("hanging_prisoner_2", true);
SetEntityActive("hanging_prisoner_3", true);
SetEntityActive("hanging_prisoner_4", true);
SetEntityActive("hanging_prisoner_5", true);
SetEntityActive("hanging_prisoner_6", true);
SetEntityActive("hanging_prisoner_7", true);
SetEntityActive("hanging_prisoner_8", true);
SetEntityActive("hanging_prisoner_9", true);
SetEntityActive("hanging_prisoner_10", true);
PlaySoundAtEntity("", "ui_insanity_touch.snt", "Player", 0, false);
}

void Timer_1(string &in asTimer)
{
SetEntityActive("John1", false);
GiveSanityDamage(5.0f, true);
}

void Timer_2(string &in asTimer)
{
GivePlayerDamage(10, "BloodSplat", true, false);
PlaySoundAtEntity("", "hit_wood.snt", "Player", 0, false);
}

void ReadPaper(string& asName)
{
SetEntityPlayerInteractCallback("note1","", true);
}
09-28-2012, 05:20 AM
Find


Messages In This Thread
RE: I need help with creating more than 1 scripts for my custom story - by ironman0001 - 09-28-2012, 05:20 AM



Users browsing this thread: 1 Guest(s)