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 making map crash in Dev Mode.
89ShadowUK Offline
Junior Member

Posts: 10
Threads: 4
Joined: Jun 2011
Reputation: 0
#1
Script making map crash in Dev Mode.

So I found out that all scripting needs to be done within the (mapname).hps file, rather than set scripts, for example, "Doorslam.hps", then linking said scripts to areas within the level editor.

Correct me if I'm wrong there please guys!

So anyways, now I've been messing around, just practicing, with a simple door slam script, so player leaves a room, and the door will slam shut behind him/her. Here's my script, copied directly from a Wiki Tutorial.

Quote:void OnStart()

{
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

But now, when in Developer mode, and trying to load my map, it says it can't read the script and crashes.

By the way, Yes, I am a newcomer haha.

Thanks guys!
08-01-2011, 05:40 PM
Find


Messages In This Thread
Script making map crash in Dev Mode. - by 89ShadowUK - 08-01-2011, 05:40 PM



Users browsing this thread: 1 Guest(s)