Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 6 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script causing game to randomly crash (No FATAL ERROR)
RawkBandMan Offline
Posting Freak

Posts: 1,146
Threads: 35
Joined: Nov 2010
Reputation: 5
#90
RE: extra_english now is working, but I need help with a different script :)

(07-20-2011, 10:02 PM)Kyle Wrote: Actually, as I last remember, doors have the health of 100. So -100 would work. The explosion particle is not exactly needed when you have a StartEffectFlash, but it is possible to test it in the level editor by placing a particle system in there.

The script function page is your friend. Smile

Okay, so that function fades the screen to white. Is there an explosion sound I could play when it fades to white?

EDIT: Never Mind found one! Now I just need to script it and check it.

What would I place the volume for it?


But I still havent figured out my key problem!


I'm pretty sure I have done everything right, but it's not working. It says (when I use the key on the door) that Cannot Use Item This Way, and the name and the description are both blank.

.hps
Spoiler below!

void OnStart()
{
AddUseItemCallback("", "key_torture_chamber_1", "prison_section_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "key_tomb_1", "GruntCells", true, 1);
AddEntityCollideCallback("servant_grunt_1", "monstergone_area", "MonsterGone", true, 1);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 3.0f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0.5f, "");
AddEntityCollideCallback("Player", "GruntWalkBy", "ActivateGrunt", false, 1);
wakeUp();
}

void wakeUp () {
StartPlayerLookAt("servant_grunt_1", 11.0f, 11.0f, "");
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(10); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 16.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);
StopPlayerLookAt();
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_section_1", false, true);
PlaySoundAtEntity("", "unlock_door", "prison_section_1", 0, false);
RemoveItem("key_torture_chamber_1");
}


void MonsterGone(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}

void GruntCells(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_3", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_7", 0.5f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_8", 5.0f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_11", 2.0f, "");
AddEnemyPatrolNode("servant_grunt_2", "PathNodeArea_12", 0.5f, "");
}



extra_english.lang
Spoiler below!

<LANGUAGE>
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You are a man named Gary Johnson. You are having personal problems, such as depression, for an unknown reason. Your wife goes on a trip to somewhere in the desert, and she dies along the way. She gives you most the things in her will, including a strange artifact she found in the desert. You keep it, and strange things start happening. Such as voices telling you to "Throw it away," or "Give it to me." You ignore them, and keep living, or trying to. You are then taking a nice stroll down an abandond road when you hear something in the bushes. You get weak from fear and fall to the floor. The world goes dark and something wacks you on the head. You wake in a cell and the story begins.
</Entry>
</CATEGORY>
<CATEGORY Name="Inventory">
<Entry Name="ItemName_AwesomeKey">Key #476</Entry>
<Entry Name="ItemDesc_AwesomeKey">Key for a door that has the numbers #476...</Entry>
<Entry Name="ItemName_CellKey">Cell #801</Entry>
<Entry Name="ItemDesc_CellKey">On the side there are words scratched in. They said "Cell #801.</Entry>
</CATEGORY>
<CATEGORY Name="Ending">
<Entry Name="StartCredits">
Escape Hell Beta[br]
Made By: XxRoCkBaNdMaNxX[br]
Thanks to: XxWestKillzXx for the help with scripts
Following People with scripting: Roenlond, Mofo, Kyle, Greven.
Frictional Games for this awesome piece of work
Everyone in the community for playing.[br]
</Entry>
</CATEGORY>
<CATEGORY Name="Levels">
<Entry Name="level_dungeon_1">Water Works</Entry>
<Entry Name="level_dungeon_2">Outer Cells</Entry>
</CATEGORY>
</LANGUAGE>


I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
(This post was last modified: 07-20-2011, 10:22 PM by RawkBandMan.)
07-20-2011, 10:08 PM
Find


Messages In This Thread
RE: Where can I find water? - by Greven - 05-08-2011, 05:19 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 05:44 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 08:33 PM
RE: Where can I find water? - by Greven - 05-08-2011, 09:22 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:28 PM
RE: Where can I find water? - by Greven - 05-08-2011, 09:32 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:33 PM
RE: Where can I find water? - by Greven - 05-08-2011, 09:38 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:46 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 09:50 PM
RE: Where can I find water? - by Roenlond - 05-08-2011, 08:31 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 09:18 PM
RE: Where can I find water? - by Simpanra - 05-08-2011, 09:59 PM
RE: Where can I find water? - by RawkBandMan - 05-08-2011, 10:27 PM
RE: Where can I find water? - by Karai16 - 05-08-2011, 11:22 PM
RE: Where can I find water? - by RawkBandMan - 05-09-2011, 12:01 AM
RE: extra_english now is working, but I need help with a different script :) - by RawkBandMan - 07-20-2011, 10:08 PM



Users browsing this thread: 1 Guest(s)