1 registered members (AndrewAMD),
1,248
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
How i can manage collisions ?
#221694
08/15/08 15:06
08/15/08 15:06
|
Joined: Mar 2008
Posts: 104
theDust
OP
Member
|
OP
Member
Joined: Mar 2008
Posts: 104
|
Hi, i need something like that in code-form: "when the player collides with the wall(or everything that is solid), he can jump" I haven't found examples or tutorials that show how i can manage this whole collisions thing. PS: My player is a model and the wall is a wed-block (is that a problem ?)
Last edited by theDust; 08/15/08 15:07.
|
|
|
Re: How i can manage collisions ?
[Re: cro_games]
#221786
08/16/08 13:04
08/16/08 13:04
|
Joined: Mar 2008
Posts: 104
theDust
OP
Member
|
OP
Member
Joined: Mar 2008
Posts: 104
|
Ähm, you dont understand me (or I dont understand you ). I dont want to modify the collision. I need a piece of code that detects when the collision happens and when not. I have no idea how to use ph_setcollisions for my needs.
Last edited by theDust; 08/16/08 13:40.
|
|
|
Re: How i can manage collisions ?
[Re: theDust]
#221808
08/16/08 14:35
08/16/08 14:35
|
Joined: Sep 2007
Posts: 761 Hrvatska (Croatia ), Slavonski...
cro_games
User
|
User
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
|
Yes,i didn't understand you:
c-scripts: my.enable_entity = on; my.enable_block = off; my.event = function_name;//when the collision happens call function
lite-c: my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); sensitive for block and entity collision my.event = function_name;//when the collision happens call function
Last edited by cro_games; 08/16/08 14:37.
|
|
|
Re: How i can manage collisions ?
[Re: cro_games]
#224449
08/30/08 08:20
08/30/08 08:20
|
Joined: Dec 2004
Posts: 35 Germany
Fanatiker
Newbie
|
Newbie
Joined: Dec 2004
Posts: 35
Germany
|
Hi, i am using c-lite and have a problem with collisions too. I want to use a polygon hull for my player. But i get always an error. i copied this 2 lines from the online manual in my file: my.polygon = on; set(my,polygon); if i start the enngine says: polygon is not a member of ENTITY maybe someone has an idea ?
var walk_percentage;
function move()
{
camera.y = me.y;
c_move(me,vector((key_d - key_a) * 5 * time_step,0,0),nullvector,GLIDE);
ent_animate(me, "walk", walk_percentage, ANM_CYCLE); // "walk" Animations-Loop
walk_percentage += (key_d - key_a) * 10 * time_step; // 3 = Animationsgeschwindigkeit für "walk"
}
function jump()
{
c_move(me,vector(0,0,5*time_step),nullvector,GLIDE);
}
action spieler()
{
my.polygon = on;
set(my,polygon);
//my.NARROW = ON; //Kollisionshülle in Form einer Kugel im Zentrum der Figur
//my.FAT = ON;
//my.NARROW = ON;
//my.eflags &= ~FAT;
//my.efalgs |= NARROW; // Eine zylindrische Kollisionshülle
camera.x = 1000; // halte d. Kamera 300 Quants hinter d. Ball
camera.y = me.y; // verwende dasselbe y wie mit d. Ball
camera.z = 600; // und plaziere sie bei z = 1000 Quants
camera.pan = 180;
camera.tilt = -30;
while(1)
{
if(key_d == 1)move();
if(key_a == 1)move();
if(key_w == 1)jump();
wait(1);
}
}
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|