Player inside cube
Moderator: Core Staff
Player inside cube
Does anyone know how can you code a mod (script) so that a player can't leave a certain virtual cube?
Or how can you create it that a player can not cross a line between point A and B?
Then I can try to script the rest of the cube myself.
Or how can you create it that a player can not cross a line between point A and B?
Then I can try to script the rest of the cube myself.
Re: Player inside cube
You could make a cube out of player clip and then use scripting to make it solid and non-solid.
Re: Player inside cube
Thank you for your reply.Pedsdude wrote:You could make a cube out of player clip and then use scripting to make it solid and non-solid.
I don't know what you mean with "player clip".
Can you give an example or a link to a tutorial or something?
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Player inside cube
Spawn a trigger radius. Check every frame if player is touching said trigger. If not, teleport back to trigger radius center. Not exactly a cube but will do the job.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Re: Player inside cube
Thank you for the explanationKillerSam wrote:Peds was refering to a mapping technique where you use selectively passable invisible walls to control players.Moustache wrote:Thank you for your reply.Pedsdude wrote:You could make a cube out of player clip and then use scripting to make it solid and non-solid.
I don't know what you mean with "player clip".
Can you give an example or a link to a tutorial or something?
If it's a mod, I assume you can create a cube from player co-ordinates and then script it so that the player gets returned to the cube if they leave (or suicide, w/e works best). I'm not sure how to do this though, but I know it to be possible.
I will try screwing around with some codes.
EDIT:
How can you make a trigger radius?Rezil wrote:Spawn a trigger radius. Check every frame if player is touching said trigger. If not, teleport back to trigger radius center. Not exactly a cube but will do the job.
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Player inside cube
Code: Select all
trig = Spawn( <classname>, <origin>, <flags>, <radius>, <height> )
origin: any point(keep in mind points in space are written like so: (x, y, z) with the brackets mandatory!)
flags: not sure what flags the trigger_radius has, check in Radiant.
radius: self-explanatory
height: how tall do you want the trigger to be.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Re: Player inside cube
Hmm. I don't know if I can use that. Because that is a cylinder.
But maybe I can place a few columns on the side and create a wall with it.
Then it would look a bit like this (view from above):
OOOOOOO
O---------O
O---------O
O---------O
OOOOOOO
The O is a trigger radius and if you touch it you get pushed back, at least that is my theory .
Or is there a better way to create this?
But maybe I can place a few columns on the side and create a wall with it.
Then it would look a bit like this (view from above):
OOOOOOO
O---------O
O---------O
O---------O
OOOOOOO
The O is a trigger radius and if you touch it you get pushed back, at least that is my theory .
Or is there a better way to create this?
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Player inside cube
Why do you need a cube? A sphere would be much better suited for keeping a player in a certain area.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Player inside cube
Take a quick look at how killtriggers worked in CoD2.
Pseudo:
If PLAYER X coordinates are between 500-600.
If PLAYER Y coordinates are between 200-300.
If PLAYER Z coordinates are between 0 -100.
You can now use that code and create a box with corners:
Bottom back left corner
(500, 200, 0)
Top front right corner
(600, 300, 100)
Pseudo:
If PLAYER X coordinates are between 500-600.
If PLAYER Y coordinates are between 200-300.
If PLAYER Z coordinates are between 0 -100.
You can now use that code and create a box with corners:
Bottom back left corner
(500, 200, 0)
Top front right corner
(600, 300, 100)
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Player inside cube
K thank you all that worked
Put how can I prevent the players from leaving the cube?
Is there a way to push them back a bit instead of teleporting/killing them?
Put how can I prevent the players from leaving the cube?
Is there a way to push them back a bit instead of teleporting/killing them?
Re: Player inside cube
You could use the finishPlayerDamage function, but it would be pretty complicated to do properly.
You would have to do some code similar to that for each side of the box. The tricky part would be getting it to push the player in the right direction. It would probably be possible by saving some variables, but I haven't paid close attention to the rest of this thread so I'm not exactly sure how you'd go about it.
Code: Select all
if(players[i] istouching(trigger) && isalive(players[i]))
{
players[i].health = 1000000;
players[i].maxhealth = 1000000;
players[i] finishPlayerDamage(players[i], players[i], damage 0, "MOD_FALLING", "deserteaglegold_mp", origin, direction, "head", 0);
wait(0.05);
players[i].health = 100;
players[i].maxhealth = 100;
}
"Zaitsev is a cunt." - Pedsdude
Re: Player inside cube
Maybe you could do a series of quick teleports which would make it seem like a push (even though it's not).
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Player inside cube
Soviets method will work, but you need some knowledg in Maths.
The directionial vector is simple in theory (player origin forward to centre of cube), but you need to now how to use the vector commands to do this.
I don't know of the top of my head and haven't the time or effort that is required to work it out.
The directionial vector is simple in theory (player origin forward to centre of cube), but you need to now how to use the vector commands to do this.
I don't know of the top of my head and haven't the time or effort that is required to work it out.
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Player inside cube
Peds' method was used in nm_cure. Since there are no fastfiles for CoD1 you could download it and take a look at how Nightmare did it. He used it for a conveyor belt I believe.
"Zaitsev is a cunt." - Pedsdude
Re: Player inside cube
Isn't it possible to set a center of the cube and let the direction be placed towards it.
The origin would be a bit harder I guess. But I will give it a try.
Thanks all for the help and info
The origin would be a bit harder I guess. But I will give it a try.
Thanks all for the help and info
Who is online
Users browsing this forum: No registered users and 26 guests