not passable level or block

Posted By: Kiko

not passable level or block - 03/18/10 08:37

Hi,

I just want to ask about the level or block not passable. I want to explore level which is not passable but everytime the level load it is passable during execution. Is there a need of code on that?

thanks...
Posted By: Tempelbauer

Re: not passable level or block - 03/18/10 09:21

it depends on your code
if you move with c_move through the level, you have a collision-detection
if you are in the walk-thru-modus, then you havnt it

what template do you have chosen?
or if you have coded it by yourself: please show the source
Posted By: Kiko

Re: not passable level or block - 03/18/10 11:31

tnx very much. what do you mean by walk-thru-modus? sorry for asking. i'm just new in gamestudio.
Posted By: Tempelbauer

Re: not passable level or block - 03/18/10 12:09

as i remember right, if you create the main-script in WED you have the choice about several templates. one of them is called "walk-through" or so (maybe its only in A6)
Posted By: luckyxxl

Re: not passable level or block - 03/18/10 16:15

no "walk-through" is also in A7. But you don't nedd that because it is 90% the same like including <default.c> and press 0.

Do you want to walk around with a person or fly with a cam and do collision detection?
Posted By: Kiko

Re: not passable level or block - 03/19/10 01:35

it's ok...we're the same..bad english... grin btw.. I want to do collision detection...
Posted By: luckyxxl

Re: not passable level or block - 03/19/10 11:06

you want to do collision detection with a flying cam, rigth?

I made this code for me:
Code:
#include <acknex.h>

function create_walk_througth(VIEW* view)
{
	wait(1);
	my = ent_create(CUBE_MDL, camera.x, NULL);
	vec_set(my.pan, camera.pan);
	view.clip_near = 0;
	while(1)
	{
		my.pan -= mouse_force.x / 4 - (key_cul - key_cur) * time_step * 5;
		my.tilt += mouse_force.y / 4 + (key_cuu - key_cud) * time_step * 5;
		c_move(my, vector((key_w - key_s) * time_step * 5, (key_a - key_d) * time_step * 5, 0), nullvector, IGNORE_PASSABLE | GLIDE);
		vec_set(view.x, my.x);
		vec_set(view.pan, my.pan);
		wait(1);
	}
}

void main()
{
	level_load("level.wmb");
	wait(5);
	create_walk_througth(camera);
}



just copy the code and replace the levelname...

if you want to do collision detection with a player model use c_move (view the manual!) insted of vec_set
© 2024 lite-C Forums