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
Door slam and cache?
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#1
Door slam and cache?

I've been trying to make a door slam following THIS tutorial here, from frictional games wiki, but it doesn't work! I could'nt find any mistake... I think this is being caused by the map.cache, that you guys say that causes several issues, so I deleted it, but every time I go test the level, another file is created!

Here's the map.cache:

void OnStart()
{
AddEntityCollideCallback("Player", "script_bam", "func_bam", true, 1);
}

void func_bam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door1", 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);
}

Please help me!
(This post was last modified: 01-08-2013, 04:23 PM by Victor.)
10-26-2011, 06:09 PM
Find Reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: Door slam and cache?

This is not the map_cache, this is a script, from your script file. If you are worried about map_cache files, setup a developer environment (how to is in wiki), and your game will ignore them.

Check entity names in your level editor to see if their names match. Probably that's the cause.

10-26-2011, 06:39 PM
Website Find Reply
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#3
RE: Door slam and cache?

(10-26-2011, 06:39 PM)Tanshaydar Wrote: This is not the map_cache, this is a script, from your script file. If you are worried about map_cache files, setup a developer environment (how to is in wiki), and your game will ignore them.

Check entity names in your level editor to see if their names match. Probably that's the cause.
The door is called "door1" (without the thingies) and the area is called "script_bam".
10-26-2011, 06:53 PM
Find Reply
MBchrono Offline
Junior Member

Posts: 14
Threads: 5
Joined: Sep 2011
Reputation: 1
#4
RE: Door slam and cache?

Your code looks fine. Are you sure the script itself is running? It must be named the same as your map.

Example:
Castle.map
Castle.hps
(This post was last modified: 10-26-2011, 07:03 PM by MBchrono.)
10-26-2011, 07:00 PM
Website Find Reply
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#5
RE: Door slam and cache?

Yes, I know that, it is correct.
10-26-2011, 07:13 PM
Find Reply
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#6
RE: Door slam and cache?

(10-26-2011, 07:13 PM)Victor Wrote: Yes, I know that, it is correct.
Please, help?
10-26-2011, 09:39 PM
Find Reply
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#7
RE: Door slam and cache?

Does at least the sound and sanity damage get set off?

Tutorials: From Noob to Pro
10-26-2011, 09:44 PM
Website Find Reply
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#8
RE: Door slam and cache?

Nope. Nothing.
10-26-2011, 09:48 PM
Find Reply
Victor Offline
Member

Posts: 83
Threads: 19
Joined: Oct 2011
Reputation: 2
#9
RE: Door slam and cache?

(10-26-2011, 09:48 PM)Victor Wrote: Nope. Nothing.
Help?
10-26-2011, 11:16 PM
Find Reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#10
RE: Door slam and cache?

Use debug messages to see if Player actually collides with that area. I wager you already set up a developer environment and thus can see debug messages through F1 menu.

10-26-2011, 11:46 PM
Website Find Reply




Users browsing this thread: 1 Guest(s)