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
#81
RE: extra_english now is working, but I need help with a different script :)

(05-27-2011, 11:22 PM)Khyrpa Wrote:
(05-27-2011, 10:59 PM)XxRoCkBaNdMaNxX Wrote: What would the function to make Daniel roll to look like he is laying, then to get back up? (I think its like FadePlayerRollTo(X Axis,Y axis, Z axis) or something). But what would be the Numbers for the X, Y, and Z axis?? (For the laying on the ground like sleeping, and the default.)
Well you would just have to tweak and test and tweak these:
MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);
if you want your head close to the ground change float afY to -1 or something.

then there is this what youre mainly after I guess:
FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);
change float afX to -45 or 45 and your view is turned 45 degrees

I'm sorry. I haven't got around to trying this again.

Turns out, he script I had before was what I needed. I just didn't have it set for long enough. I will make it longer and try again.

I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
06-15-2011, 10:52 PM
Find
RawkBandMan Offline
Posting Freak

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

I'm back people! I need help with scripting for using a Crowbar on a door.


Thanks!

I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
07-20-2011, 05:01 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#83
RE: extra_english now is working, but I need help with a different script :)

(07-20-2011, 05:01 PM)XxRoCkBaNdMaNxX Wrote: I'm back people! I need help with scripting for using a Crowbar on a door.


Thanks!

Why a crowbar? Not to sound rude or anything, but some people are getting sick of seeing the crowbar script in a lot of custom stories. :/

07-20-2011, 05:13 PM
Find
RawkBandMan Offline
Posting Freak

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

(07-20-2011, 05:13 PM)Kyle Wrote:
(07-20-2011, 05:01 PM)XxRoCkBaNdMaNxX Wrote: I'm back people! I need help with scripting for using a Crowbar on a door.


Thanks!

Why a crowbar? Not to sound rude or anything, but some people are getting sick of seeing the crowbar script in a lot of custom stories. :/

But everything else is boring, and I like the crowbar particles when you break open a door :3

I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
07-20-2011, 06:23 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#85
RE: extra_english now is working, but I need help with a different script :)

Everything else isn't boring. I can think up 10 unique ideas right now that have never been used in a custom story yet and have the potential to become something enjoyable.

07-20-2011, 06:25 PM
Find
RawkBandMan Offline
Posting Freak

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

(07-20-2011, 06:25 PM)Kyle Wrote: Everything else isn't boring. I can think up 10 unique ideas right now that have never been used in a custom story yet and have the potential to become something enjoyable.

Hm... I just got a great idea xD It may take a lot of scripting, but it sounds cool.

Using a bomb to blow up the door.

Can I get some scripting for it to explode, for it to "blow up" the door, and yeah. For blowing it up, I think I would know how to script it.

I would
Spoiler below!
just deactivate the door that you blow up right when the explosion goes off, and activate a different door that would be like broken and laying on the floor in the room, on its side, and yeah.

I want this. Help me please <Smile?

I would also need to know how I would make the bomb? (Like the Storage, its in a glass jar, but I would need like certain things to make it, like (for instance) acid, blood, and poison.)

I also need help with a key script. 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, 09:56 PM by RawkBandMan.)
07-20-2011, 07:17 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#87
RE: extra_english now is working, but I need help with a different script :)

Did you even try this before?

It's simple, yet time consuming.

As I take from the script functions page:

void SetPropHealth(string& asName, float afHealth);
void AddPropHealth(string& asName, float afHealth);
float GetPropHealth(string& asName);

Modifies/returns the health of a prop.

This can be used on the door. Simply add a prop health of a negative value and then it gets damaged. Or you could replace doors and use this:

StartEffectFlash(1, 1, 2);

Which you could change the numbers a bit by using the script functions page.

07-20-2011, 08:24 PM
Find
RawkBandMan Offline
Posting Freak

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

(07-20-2011, 08:24 PM)Kyle Wrote: Did you even try this before?

It's simple, yet time consuming.

As I take from the script functions page:

void SetPropHealth(string& asName, float afHealth);
void AddPropHealth(string& asName, float afHealth);
float GetPropHealth(string& asName);

Modifies/returns the health of a prop.

This can be used on the door. Simply add a prop health of a negative value and then it gets damaged. Or you could replace doors and use this:

StartEffectFlash(1, 1, 2);

Which you could change the numbers a bit by using the script functions page.

No I have not. So I could have just an explosion, and then have it for when it explodes, put the health -1, so then it would get destroyed?


But how would I make the explosion? I would know how I would make the bomb itself with the mixture, but I don't know of a explosion particle. Is there one?


Sorry If I am annoying you guys to hell Sad

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, 09:54 PM by RawkBandMan.)
07-20-2011, 09:54 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#89
RE: extra_english now is working, but I need help with a different script :)

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

07-20-2011, 10:02 PM
Find
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




Users browsing this thread: 15 Guest(s)