Frictional Games Forum (read-only)

Full Version: Doors??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How did they do the Cry Oni doors.. where when you touch them you go into the other room?? I tried copying it from the games HPS file but it didnt work... How?
Can you post your HPS file here?
You need to do more than just copy the script used. You also have to set it up the same in the level editor. For each door you need at least one player start area of its own.
(08-18-2012, 09:32 PM)Your Computer Wrote: [ -> ]You need to do more than just copy the script used. You also have to set it up the same in the level editor. For each door you need at least one player start area of its own.
That's too much work.
(08-18-2012, 09:38 PM)Statyk Wrote: [ -> ]
(08-18-2012, 09:32 PM)Your Computer Wrote: [ -> ]You need to do more than just copy the script used. You also have to set it up the same in the level editor. For each door you need at least one player start area of its own.
That's too much work.
If this is too much work already, you should not start with this project.
(08-18-2012, 09:32 PM)Your Computer Wrote: [ -> ]You need to do more than just copy the script used. You also have to set it up the same in the level editor. For each door you need at least one player start area of its own.
You mean it is teleporting?

So 1 PlayerStartArea at each side of the door.

then 1 ScriptArea at each side of the door.
When you collide with the area SetLocalVarInt("Door1_CollideLeft", 1);
When you don't collide with the area SetLocalVarInt("Door1_CollideLeft", 0);

Then when interacting with the door:
if(GetLocalVarInt("Door1_CollideLeft") == 1)
{
TeleportPlayer("PlayerStartArea_1");
return;
}

if(GetLocalVarInt("Door1_CollideRight") == 1);
{
TeleportPlayer("PlayerStartArea_2");

return;
}

Something like that at each door?
(08-18-2012, 09:38 PM)Statyk Wrote: [ -> ]That's too much work.

Not to mention thinking about naming conventions for the sake of minimizing code.

(08-18-2012, 10:13 PM)beecake Wrote: [ -> ]You mean it is teleporting?

Yeah, teleporting is involved. As for your code, i would have tried to figure out a way to use the same interact callback for teleporting the player in and out of the rooms. For example, using one local map variable of the int type for keeping track of whether or not the user is in a room. I would give the two player start areas the name of the door with a prefix (though a suffix would work too) of the exit states of the player (i.e. "exit" and "enter"). I don't think there would be any issue with the one local map variable, as the user can only interact with one door at a time. 0 would represent that the player is outside of a room, 1 would represent that the player is inside the room.