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
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#2
RE: Script making map crash in Dev Mode.

I kinda get the first question, but yes. All your scripts for the map are in the (mapname).hps

You said you copied the script directly? Did you copy&paste or type it all down? I see a few inconsistency, I think.
This is just me scrutinizing every detail since any typo can mess up your script.

Make sure you have a Script Area called "script_slam" in your map, and the door named "mansion_1". I'm just saying this because you said you were a newcomer, and that could mean alot of things can possibly go wrong.

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
I think that might be ok, I'll test it out later. But I think you need something in the first "", because its the internal name. Anything will do, just dont call it "Late for Dinner".

Also the "react_scare" should have a .snt normally at the end "react_scare.snt". I know you can preload the sound, but the other 2 have .snt at the end, so I would think that would also need it to.

Or the developer mode could be screwing it up, either you missed something or its just Amensia itself. The game is quite buggy in my opinion.
Go back and review the Developer Enviroment Guide and tripe-check your settings.
(This post was last modified: 08-01-2011, 09:32 PM by Rapture.)
08-01-2011, 09:32 PM
Find
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#3
RE: Script making map crash in Dev Mode.

Change this:

Spoiler below!
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

to this:

Spoiler below!
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
08-02-2011, 01:16 AM
Find




Users browsing this thread: 1 Guest(s)