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
Script Help New Editor looking for help.
Chaosturn Offline
Junior Member

Posts: 3
Threads: 1
Joined: Oct 2011
Reputation: 0
#1
New Editor looking for help.

Hello Frictional Games Forum!
I've been working on my very first custom story for a week now.
So far it's looking pretty good. Smile

I have some problems though, with scripting! Confused











1.
I've made a wake-up script. It works wonderful. The player wakes up in the middle of a forest and has no clue why he's there.
A message is displayed: "Oh god... My head... Wha-... What happened?"

Basic story...

Anyways: I'm trying to make a Screen Message show when he LEAVES the first area (PlayerStartArea is inside this bigger area, which i named).
The message that i want displayed is as following: "I... I remember seeing someone. In the forest."

My .lang file currently looks like this:

<LANGUAGE>    <CATEGORY Name="CustomStoryMain">        <Entry Name="Description">Dark approaches.[br][br]Your camp's bonfire is beginning to fade. You will need help if you'd like to stay alive out here.[br]Who are you? How did you get here? You don't have the answers. They've faded with the dusk...</Entry>    </CATEGORY>        <CATEGORY Name="Journal">        <Entry Name="Note_theletter_Name">Familiar Note...</Entry>        <Entry Name="Note_theletter_Text">I know. You can't remember. I can't give you any answers. I've set up a camp here, in a cleft of the woods, but this forest... [br]It is a cursed one. [br]You're going to need to get out of here, there are no-...[br][br]The rest of the note is covered with spilled ink.</Entry>    </CATEGORY>        <CATEGORY Name="Messages">        <Entry Name="WakeUp">Oh god... My head... Wha-... What happened?</Entry>        <Entry Name="Where">I... I remember seeing someone. In the forest.</Entry>        <Entry Name="GetOut">I should probably get out of here.</Entry>    </CATEGORY>    </LANGUAGE>

and i reckon that's all good.

Here is my .hps file:
void OnStart()    {    CollideForestArea();    PlaySoundAtEntity("WakeUp", "flashback_flash.snt", "ForestArea", 10, false);    SetPlayerLampOil(0.0f);    SetMessage("Messages", "WakeUp", 6);    AddEntityCollideCallback("Player", "ForestArea_1", "LeaveCamp", false, -1);    AddEntityCollideCallback("Player", "ScriptArea_1", "CollideForest", false, 0);    PlaySoundAtEntity("WakeUp_1", "react_breath_slow.snt", "ForestArea", 4, false);}
void LeaveCamp(){    SetMessage("Messages", "Where", 5.0f);}
void CollideForest(){    PlaySoundAtEntity("ForestScare00", "scare_ghost.snt", "ScripArea_1", 10, false);    PlaySoundAtEntity("ForestScare01", "react_scare.snt", "ScripArea_1", 10, false);}void CollideForestArea() {    FadeOut(0);    FadeIn(20);    FadeImageTrailTo(2, 2);    FadeSepiaColorTo(100, 4);    SetPlayerActive(false);    FadePlayerRollTo(80, 220, 220);    FadeRadialBlurTo(0.15, 2);    SetPlayerCrouching(true);    AddTimer("trig1", 6.0f, "beginStory");}
void beginStory(string &in asTimer){    ChangePlayerStateToNormal();    SetPlayerActive(true);    FadePlayerRollTo(0, 50, 50);    FadeRadialBlurTo(0.0, 1);    FadeSepiaColorTo(0, 4);    SetPlayerCrouching(false);    FadeImageTrailTo(0,1);}


void OnEnter(){AddTimer("timer1", 0, "what");}

void OnLeave(){
}


I've messed around with it a bit, but I can't get it to work.
Please, tell me what I'm doing wrong. I suspect there's something wrong in the .hps file, as I am kind of new to scripting.
The weird thing is, when I load the map in Amnesia, the game doesn't give me any kind of error in script file.















2.
When the player moves on in to the forest, a scare sound is supposed to be played, and also a react sound. It's also supposed to be triggered by an area.
Here's the part i put into the onStart block:

AddEntityCollideCallback("Player", "ScriptArea_1", "CollideForest", false, 0);

And here is the new void I created further down the script:

void CollideForest(){    PlaySoundAtEntity("ForestScare00", "scare_ghost.snt", "ScripArea_1", 10, false);    PlaySoundAtEntity("ForestScare01", "react_scare.snt", "ScripArea_1", 10, false);}

It does NOT WORK. I was playing around with the script for about half an hour, but I just can't get it to work.
I'm also going to display a message here saying: "I should probably get out of here."
And I'm also going to make the player look into the forest.
I need help, please ! Huh

If you see any other errors in my script file, please tell me!
Thanks for your support! Shy
(This post was last modified: 10-21-2011, 11:19 PM by Chaosturn.)
10-21-2011, 11:17 PM
Find


Messages In This Thread
New Editor looking for help. - by Chaosturn - 10-21-2011, 11:17 PM
RE: New Editor looking for help. - by Khyrpa - 10-21-2011, 11:43 PM
RE: New Editor looking for help. - by Chaosturn - 10-22-2011, 12:10 AM
RE: New Editor looking for help. - by nemesis567 - 10-21-2011, 11:49 PM
RE: New Editor looking for help. - by Khyrpa - 10-22-2011, 01:45 AM
RE: New Editor looking for help. - by Chaosturn - 10-22-2011, 11:52 AM



Users browsing this thread: 1 Guest(s)