Strange crash

Posted By: snake67

Strange crash - 01/17/11 04:33

Hi. I downloaded the A8.1 trial version and ran a script i wrote in A7. I get a new crash "Script crash in ...: SYS". I could reduce it to the following:

This works:
you=NULL;
//object_distance=c_trace(from_vec, to_vec, IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | USE_POLYGON);
if(you!=NULL)
{...

This does not:
you=NULL;
object_distance=c_trace(from_vec, to_vec, IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | USE_POLYGON);
if(you!=NULL)
{...

This works again:
you=NULL;
object_distance=c_trace(from_vec, to_vec, IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | USE_POLYGON);
...

Any suggestions?
Posted By: SchokoKeks

Re: Strange crash - 01/17/11 10:29

I'm still using A7 where I've always relied on the same method, so I can only guess:

You can try to use hit.entity for checking which entity was hit instead of you. It might require settings SCAN_TEXTURE. see the manual unter c_trace and hit.
Posted By: Superku

Re: Strange crash - 01/17/11 13:14

sys_marker("CT1");
you=NULL;
object_distance=c_trace(from_vec, to_vec, IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | USE_POLYGON);
sys_marker("CT2");
if(you!=NULL)
{...
}
sys_marker(NULL);

Try this code again and check the error message. There are three possibilities:
"Script crash in ...: SYS"
"Script crash in ...: CT1"
"Script crash in ...: CT2"
Posted By: snake67

Re: Strange crash - 01/17/11 16:18

Hi

Thanks a lot. This one is solved. There where to many local vars... But there is an other problem which is new due to porting from A7 to A8 with my Lite-C code. The movement code seems not to work proper, the player is hovering and the collision hull seems to be much bigger. What could this be?
Posted By: Superku

Re: Strange crash - 01/17/11 16:38

You probably use c_setminmax(my). This function now uses all frames of the model to calculate the bounding box dimension. Replace it with c_updatehull(my,1) (or the like).
Posted By: Logan

Re: Strange crash - 01/17/11 17:08

Oh, nice Superku. I'll have to try that--my movement code in A8 behaves horribly and I assumed it was a scripting error although I copied the algorithm directly from an A6 project. So Snake, you're not alone in that.
Posted By: Superku

Re: Strange crash - 01/17/11 17:17

Additionally, c_setminmax(my) now works in the first frame of an action, beforehand you've had to wait a frame to get the real bb size:

A7 :
action my_action() {
wait(1);
c_setminmax(my);
}

A8 :
action my_action() {
c_setminmax(my);
}

Without the wait, the NARROW and FAT flags would have been set but not the real size because min/max was set at entity creation, that is in A7 the first frame.

(Everything is subject to correction.)
Posted By: snake67

Re: Strange crash - 01/17/11 17:56

Hi

Tried all, nothing changed... I have to think about...
Posted By: Superku

Re: Strange crash - 01/17/11 18:28

Set min/max directly after c_setminmax-call, f.i. to -32...+32.
Posted By: snake67

Re: Strange crash - 01/18/11 04:37

Hi

Thanks. Its very wierd. After some playing around with values and "c_update..." i found that it works best with this settings for the player. No "c_updatehull" or "c_setminmax", just this:

my.min_z*=0.75;
my.max_z*=0.75;
my.min_x*=0.2;
my.max_x*=0.2;
my.min_y*=0.2;
my.max_y*=0.2;

But why does A8 behave other than A7 as far as collision is concerned???
Posted By: Superku

Re: Strange crash - 01/18/11 15:11

It only behaves differently because some c_set/c_hull bugs have been fixed and the bounding box is now set at entity creation and not in the first frame (AFAIK).

Remember, you can always use d3d_lines or press F11 twice to show the bounding box of impassable objects.
Posted By: snake67

Re: Strange crash - 01/25/11 16:45

Whan the player is moved by c_move he gets stuck into physics objects. This might be a new problem porting from A7 with ODE to A8 with PhysX too.

I tried to move the player by PhysiX by "pXent_movechar", but now he passes through normal models (not PhysiX).

I am a little disappointed... Are there others with similar problems?
Posted By: Superku

Re: Strange crash - 01/25/11 17:39

Yes, that's a disadvantage with physX. You cannot have a physX object collide with a normal model, it just passes through the non-registered object.

Normally, all static objects (that means models that don't have an action attached) are registered on level loading (through physX_level_load, you can define your own function if you want to).

Quote:
Whan the player is moved by c_move he gets stuck into physics objects.

I did not experience that problem, yet.
© 2024 lite-C Forums