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:
  • 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


Messages In This Thread
Hey! I'm new to scripting, need some help. - by LinneaLuna - 05-22-2012, 04:33 PM



Users browsing this thread: 1 Guest(s)