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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hey! I'm new to scripting, need some help.
LinneaLuna Offline
Junior Member

Posts: 4
Threads: 2
Joined: May 2012
Reputation: 0
#1
Hey! I'm new to scripting, need some help.

Hey guys!

I'm a complete noob when it comes to making maps and scripting, and I've been struggling for hours for such a simple script, and I'm starting to feel stupid lol.

The game crashes when I start my Custom Story, and I'm using this script:

void OnStart()
{
if(ScriptDebugOn())
{

AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);

AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);

SetEntityConnectionStateChangeCallback("lever_simple01_1", "func_secret_1");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}

void ActivateMonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brutehot_1", true);
AddEnemyPatrolNode("servant_brutehot_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_brutehot_1", "PathNodeArea_2", 0, "Idle");
}

void func_secret_1(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret_1",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "secret_1_move_1", 0, false);
return;
}

void OnEnter()
{
}

void OnLeave()
{
}



Ok, so, please tell me the mistakes and how to improve, would be awesome. ^^
05-22-2012, 04:33 PM
Website Find Reply
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#2
RE: Hey! I'm new to scripting, need some help.

You could tell us what the crash report says.Would make this a bit easier.

05-22-2012, 04:36 PM
Find Reply
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#3
RE: Hey! I'm new to scripting, need some help.

The only thing that points out for me is the beginning

void OnStart()

{

if(ScriptDebugOn())

{



AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);



AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);



SetEntityConnectionStateChangeCallback("lever_simple01_1", "func_secret_1");

}

You have 2 { and only 1 }

"What you think is irrelevant" - A character of our time

A Christmas Hunt
05-22-2012, 04:36 PM
Find Reply
LinneaLuna Offline
Junior Member

Posts: 4
Threads: 2
Joined: May 2012
Reputation: 0
#4
RE: Hey! I'm new to scripting, need some help.

(05-22-2012, 04:36 PM)Datguy5 Wrote: You could tell us what the crash report says.Would make this a bit easier.
Ah, yes of course. ^^

FATAL ERROR: Could not load script file
'Custom_stories/Claustrophobia/fart/claustrophobia.hps'!
main (43,2) : ERR : Unexpected end of file

(05-22-2012, 04:36 PM)i3670 Wrote: The only thing that points out for me is the beginning

void OnStart()

{

if(ScriptDebugOn())

{



AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);



AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonster", true, 1);



SetEntityConnectionStateChangeCallback("lever_simple01_1", "func_secret_1");

}

You have 2 { and only 1 }
Ah yes, I can see that. >.<
Thanks!
(This post was last modified: 05-22-2012, 04:45 PM by LinneaLuna.)
05-22-2012, 04:43 PM
Website Find Reply
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#5
RE: Hey! I'm new to scripting, need some help.

Hope it worked out and no problems.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
05-22-2012, 05:27 PM
Find Reply




Users browsing this thread: 1 Guest(s)