terrain PASSABLE flag does not work

Posted By: sivan

terrain PASSABLE flag does not work - 08/14/14 12:29

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!
Posted By: Superku

Re: terrain PASSABLE flag does not work - 08/14/14 22:34

I assume your editor is generating wmb files, too? Have you compared possible command line options?
Can't you use actions for terrains which are supposed to be PASSABLE? Don't forget there is ent_type() too.
Posted By: sivan

Re: terrain PASSABLE flag does not work - 08/15/14 10:15

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.
Posted By: sivan

Re: terrain PASSABLE flag does not work - 08/15/14 11:13

here is a short corresponding script:


Code:
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();
									}
							}	
					}

© 2024 lite-C Forums