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
My mod I'm currently working on.
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#1
My mod I'm currently working on.

So I started a new one because I think I just took too much time on the other one anyways learning stuff about the editor. But besides that, in my new mod, "the experiment", some doors are supposed to open automatically. So in the trigger areas I am using, how do I get it so that it collides with both the monster and the player? Because using wildcards, commas, or spaces just don't work
(This post was last modified: 03-11-2016, 11:43 PM by Hypercube.)
03-11-2016, 11:40 PM
Find
WALP Offline
Posting Freak

Posts: 1,221
Threads: 34
Joined: Aug 2012
Reputation: 45
#2
RE: My mod I'm currently working on.

Instead of trying to fit both the player and the monster into the same callback, maybe just add a seperate callback for the monster that calls the same function?

This is the HPL3 version of AddEntityCollideCallback from HPL2:

Entity_AddCollideCallback(const tString &in asParentName,const tString &in asChildName,const tString &in asFunction)
03-12-2016, 02:00 AM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#3
RE: My mod I'm currently working on.

You could add a collide area that just collides with everything, but then you'd run into issues because it collides with everything, including things you don't expect it to be colliding with. With keeping to neat organization and all around general sanity, it might be easier to just have two overlapping areas for the player and the monster each.

(Although, I think that most monsters have it built-in to their AI code that if a path node rests on top of a door, they will open the door themselves already.)
03-12-2016, 02:59 AM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#4
RE: My mod I'm currently working on.

(03-12-2016, 02:59 AM)Abion47 Wrote: You could add a collide area that just collides with everything, but then you'd run into issues because it collides with everything, including things you don't expect it to be colliding with. With keeping to neat organization and all around general sanity, it might be easier to just have two overlapping areas for the player and the monster each.

(Although, I think that most monsters have it built-in to their AI code that if a path node rests on top of a door, they will open the door themselves already.)

I see what your saying, and I kind of do think it would be better for it to collide with say every entity in my map, because it's supposed to be like motion sensor sort of things, and making two seperate areas for all of those doors in my mod would be a lot of stuff to script that I don't need. And if the monsters open the doors, the doors don't close behind them so that's another problem. I'll just do the first thing you said.
03-12-2016, 09:45 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#5
RE: My mod I'm currently working on.

(03-12-2016, 09:45 PM)Hypercube Wrote:
(03-12-2016, 02:59 AM)Abion47 Wrote: You could add a collide area that just collides with everything, but then you'd run into issues because it collides with everything, including things you don't expect it to be colliding with. With keeping to neat organization and all around general sanity, it might be easier to just have two overlapping areas for the player and the monster each.

(Although, I think that most monsters have it built-in to their AI code that if a path node rests on top of a door, they will open the door themselves already.)

I see what your saying, and I kind of do think it would be better for it to collide with say every entity in my map, because it's supposed to be like motion sensor sort of things, and making two seperate areas for all of those doors in my mod would be a lot of stuff to script that I don't need. And if the monsters open the doors, the doors don't close behind them so that's another problem. I'll just do the first thing you said.

In that case, here are some things you should take into consideration.

An area that collides with everything will collide with everything. This means parts of the walls, the floor, some incidental bits of furniture that happen to be around, and even the door itself. All of these things will trigger a collision, and your collision function will have to take that into account. The collision triggers will also fire when something is already inside the area when the map is first loaded, so all the things I talked about above will become concerns when the player enters the level for the first time and suddenly all the doors are opening.

Also, the collision function will only be called when one of two things happen - when something enters the area, and when something leaves the area; movement inside the area is not recorded. So if something enters the area, moves away from the door but doesn't quite leave it, then walks toward the door again, the collision will only be registered once. Also, the collision doesn't discriminate between what exactly is entering or leaving, so if the player enters the area, but almost immediately after something else like, say, a tin can gets knocked out of the area, the area will trigger an "exit" collision from the can, even though the player is still trying to get through the door.

So if you want the door to act like it's connected to a motion detector, you are going to need more than just trigger areas. You're going to need to keep track of every single object that enters the area, when they leave, and whether or not they are moving while inside the area. You're going to need to have some kind of system that keeps track of when multiple objects are coming and going (even at the same time) and react accordingly. And you're going to need to do this all for every single door in your level that you want to open and close automatically.

So yeah, my recommendation is to just go with the two-overlapping-area approach instead.
03-13-2016, 07:33 AM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#6
RE: My mod I'm currently working on.

(03-13-2016, 07:33 AM)Abion47 Wrote: In that case, here are some things you should take into consideration.

An area that collides with everything will collide with everything. This means parts of the walls, the floor, some incidental bits of furniture that happen to be around, and even the door itself. All of these things will trigger a collision, and your collision function will have to take that into account. The collision triggers will also fire when something is already inside the area when the map is first loaded, so all the things I talked about above will become concerns when the player enters the level for the first time and suddenly all the doors are opening.

Also, the collision function will only be called when one of two things happen - when something enters the area, and when something leaves the area; movement inside the area is not recorded. So if something enters the area, moves away from the door but doesn't quite leave it, then walks toward the door again, the collision will only be registered once. Also, the collision doesn't discriminate between what exactly is entering or leaving, so if the player enters the area, but almost immediately after something else like, say, a tin can gets knocked out of the area, the area will trigger an "exit" collision from the can, even though the player is still trying to get through the door.

So if you want the door to act like it's connected to a motion detector, you are going to need more than just trigger areas. You're going to need to keep track of every single object that enters the area, when they leave, and whether or not they are moving while inside the area. You're going to need to have some kind of system that keeps track of when multiple objects are coming and going (even at the same time) and react accordingly. And you're going to need to do this all for every single door in your level that you want to open and close automatically.

So yeah, my recommendation is to just go with the two-overlapping-area approach instead.
Yeah it would be kind of crazy to actually have it react to everything that would open the door. Umm, yeah... I would go with two overlapping areas to do this instead. It would just be easier to only use one area that could be a motion tracker sort of thing.
(This post was last modified: 06-22-2016, 02:17 AM by Hypercube.)
03-13-2016, 08:51 PM
Find




Users browsing this thread: 1 Guest(s)