0 registered members (),
666
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
terrain PASSABLE flag does not work
#444581
08/14/14 12:29
08/14/14 12:29
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
Hi,
I just tested in my editor why ground/water terrain identification does not work properly when wmb is compiled by WED, while it does work when I compile from my editor. I'm sure it was fine when I made this script in Sept-Oct 2013, using an older engine version.
Apparently, when PASSABLE flag is checked in WED, the temporary $$m file is correct, the 10th flag measured from last one is 1, but somehow when cycling through all the entities on level load, it is detected as unset. (temporarily I check file name to include "water" which is a crap solution) The same check works when I compile from my editor.
please test it whether it works or not, thanks!
|
|
|
Re: terrain PASSABLE flag does not work
[Re: Superku]
#444619
08/15/14 10:15
08/15/14 10:15
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
it uses the same compiler by 1st generating the .$$m file from script, then the same build window opens up, the only difference is that I set by script some level related stuff, and set the 1st 20 skills for entities from script. everything works fine.
after loading the level by level_load(), my script cycles through all the entities, checking for terrains by ent_type, works, but then the "if (is(temp_ent, PASSABLE))" fails in case of a WED output, and identifies it as a ground terrain, but the PASSABLE flag was set both in WED and my editor for the water hmp entity, and also clearly can be seen in both $$m files.
Last edited by sivan; 08/15/14 10:16.
|
|
|
Re: terrain PASSABLE flag does not work
[Re: sivan]
#444620
08/15/14 11:13
08/15/14 11:13
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
OP
Expert
|
OP
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
here is a short corresponding script:
if (file_exists_onepath(temp_str))
{
ENTITY* temp_ent = ent_create( NULL , nullvector , NULL);
temp_ent = ent_next(NULL); // get first entity
int counter_int = 0; // for progress bar
while (temp_ent) // repeat until there are no more entities
{
// terrains - assign only actions when they are unassigned - needed for terrain editing!
if (ent_type(temp_ent) == (var)4)
{
// printf("terrain founc : %s", _chr(str_for_entfile(NULL, temp_ent)));
if (is(temp_ent, PASSABLE))
{
wait(1);
// printf("Water found : %s", _chr(str_for_entfile(NULL, temp_ent)));
// if (proc_status(TerrHmp_WaterAction) == (var)0)
{
my = temp_ent; // must be set! MB.2.31 fix
TerrHmp_WaterAction();
}
}
else
{
wait(1);
// printf("Ground found : %s", _chr(str_for_entfile(NULL, temp_ent)));
// if (proc_status(TerrHmp_GroundAction) == (var)0)
{
my = temp_ent; // must be set! MB.2.31.fix
TerrHmp_GroundAction();
}
}
}
|
|
|
|