2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
entity passing through everything
#414316
12/28/12 17:39
12/28/12 17:39
|
Joined: Dec 2009
Posts: 82
Denn15
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2009
Posts: 82
|
im moving an entity with c_move but the entity passes through everything. the world does not have the passable flag set
#include <default.c>
#include <acknex.h>
ENTITY* player_box;
var jump = 0;
function cam()
{
while (1)
{
camera.x = player_box.x - 100;
camera.z = 300;
camera.y = 0;
camera.tilt = -50;
wait (1);
}
}
function land()
{
if (event_type == EVENT_BLOCK)
{
jump = 0;
}
}
function shoot()
{
while (1)
{
if (key_space)
{
jump = 20;
while (1)
{
c_move (player_box, nullvector, vector(0, 0, jump*time_step), GLIDE);
jump = jump - 0.2;
if (event_type == EVENT_BLOCK){break;}
wait(1);
}
}
wait(1);
}
}
action player_move()
{
player_box = my;
c_setminmax(my);
my.emask |= ENABLE_BLOCK;
my.event = land;
cam();
shoot();
while (1)
{
c_move (my, nullvector, vector (1*time_step, 20*(key_a-key_d)*time_step, 0),GLIDE);
wait (1);
}
}
function main()
{
level_load ("level.wmb");
}
|
|
|
Re: entity passing through everything
[Re: Denn15]
#414321
12/28/12 18:54
12/28/12 18:54
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
sry then i cant help. I dont know what caused this strange behaviour. edit: about the ground do something like that
var dist_z;
var dist2ground = 0;
dist2ground = c_trace(my.x, vector(my.x, my.y, my.z-1000)...USE_BOX
if(dist2ground > 2 || dist2ground == 0){
accelerate(dist_z, -2.5 * time_step, -1);
}
else dist_z = 0; // jumping over stand on something
..
c_move(me....vector(.., .., dist_z...
Last edited by rayp; 12/28/12 19:02.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: entity passing through everything
[Re: rayp]
#414398
01/01/13 13:07
01/01/13 13:07
|
Joined: Dec 2009
Posts: 82
Denn15
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2009
Posts: 82
|
i tried to simplyfy the script down to this
#include <acknex.h>
#include <default.c>
ENTITY* player_box;
var jump = 0;
function cam()
{
while (1)
{
camera.x = player_box.x - 10;
camera.z = 100;
camera.y = player_box.y;
camera.tilt = -50;
wait (1);
}
}
action my_car()
{
player_box = my;
cam();
while (1)
{
c_move (my, nullvector, vector (1*time_step, 20*(key_a-key_d)*time_step, 0),GLIDE);
wait (1);
}
}
function main()
{
level_load ("homework18.wmb");
}
and then copy the script to a one of the litec workshop project about moving entities where the previous script worked. however the new script makes the car go through everything again so i assume that is must be something with the script.
|
|
|
Re: entity passing through everything
[Re: Denn15]
#414402
01/01/13 15:51
01/01/13 15:51
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Is your model centered around the origin in MED?
Btw. a few screenshots and a demo would help a lot.
Last edited by Superku; 01/01/13 15:52.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: entity passing through everything
[Re: Denn15]
#414410
01/01/13 19:16
01/01/13 19:16
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
It's a problem with your level or with your model. I've created a simple map and tested it, the code is fine and works without problems.
POTATO-MAN saves the day! - Random
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|