Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Visible entities higher than created entities? #380806
08/21/11 16:24
08/21/11 16:24
Joined: Mar 2009
Posts: 88
Walori Offline OP
Junior Member
Walori  Offline OP
Junior Member

Joined: Mar 2009
Posts: 88
Picture says it all:


What I'm missing here? Creating an entity creates 2 visible entities? There is nothing special in entity creation itself. The entity is created runtime and its pointed to structure then. c_mimax called for each entity. Flags I'm using are(is) UNLIT, nothing more. Their material's are changed every 1 second if needed and are not dynamic. There is only one sky entity.

Tried with simple code that creates 100 cubes and it didn't occur there. What could cause this? Any thoughts appreceated.

Re: Visible entities higher than created entities? [Re: Walori] #380813
08/21/11 17:43
08/21/11 17:43
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
I don't know this handy magic spell.
Please provide the code i would really appreciate that.

Re: Visible entities higher than created entities? [Re: Walori] #380856
08/22/11 06:11
08/22/11 06:11

C
chris_oat
Unregistered
chris_oat
Unregistered
C



its probably the sky entity.
Try to remove it for testing, then the "ent" and "vis" should be the same.

Re: Visible entities higher than created entities? [Re: ] #380857
08/22/11 07:22
08/22/11 07:22
Joined: Jan 2008
Posts: 58
A
Asgadir Offline
Junior Member
Asgadir  Offline
Junior Member
A

Joined: Jan 2008
Posts: 58
Here the same. ent 16, vis 52. Strange...

Re: Visible entities higher than created entities? [Re: Asgadir] #380868
08/22/11 09:07
08/22/11 09:07
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Hmm, You use the older A7.862 version, try to A7.866 patch it here.
But anyway better is to testing with the newer A8.2 version from here.


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: Visible entities higher than created entities? [Re: rojart] #380873
08/22/11 10:12
08/22/11 10:12
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
could be caused by another view...
Do you accidentally include any postprocessing effect? I know that free version can't use shader, but it does can create another view

Re: Visible entities higher than created entities? [Re: bart_the_13th] #380928
08/22/11 18:29
08/22/11 18:29
Joined: Mar 2009
Posts: 88
Walori Offline OP
Junior Member
Walori  Offline OP
Junior Member

Joined: Mar 2009
Posts: 88
Quote:

its probably the sky entity.
Try to remove it for testing, then the "ent" and "vis" should be the same.

Tried to remove, no change.

Quote:

Hmm, You use the older A7.862 version, try to A7.866 patch it here.
But anyway better is to testing with the newer A8.2 version from here.

Happens in both versions, 8.20 and 7.86

Quote:

could be caused by another view...
Do you accidentally include any postprocessing effect? I know that free version can't use shader, but it does can create another view

Nope, I'm only attaching materials to entities. And removing those materials doesn't fix it.

Below the crucial codes:

Entity creation
Code:
ACTOR[id]->entity = ent_create(ACTOR[id]->mesh,vector(ACTOR[id]->x,ACTOR[id]->y,ACTOR[id]->z),NULL);
		ACTOR[id]->entity->scale_x = ACTOR[id]->scale.x;
		ACTOR[id]->entity->scale_y = ACTOR[id]->scale.y;
		ACTOR[id]->entity->scale_z = ACTOR[id]->scale.z;
		ACTOR[id]->entity->pan = ACTOR[id]->pan;
		ACTOR[id]->entity->tilt = ACTOR[id]->tilt;
		ACTOR[id]->entity->roll = ACTOR[id]->roll;
		ACTOR[id]->entity->flags |= SHADOW|UNLIT|CAST;
		wait(1);
		c_setminmax(ACTOR[id]->entity);
		ACTOR[id]->entity->skill1 = id;
		ACTOR[id]->entity->skill2 = 1;
		ACTOR[id]->entity->skill3 = ACTOR[id];



Material assigment function
Code:
ENTITY* ent = NULL;
	while(1)
	{
		ent = ent_next(NULL);
		while(ent)
		{
			if(ent != ent_select && ent.skill3 != NULL)
			{
				if(ent.skill2 < 3 ||ent.skill2 == 4)
				{
					if(ent_type(ent) != 4)ent.material = NULL;
					else ent.material = mtl_terraintex;
				}
				else if(ent.skill2 == 3) ent.material = NULL;
				else if(ent.skill2 == 5) ent.material = NULL ;
				else ent.material =NULL;
				
				ent.emask &=~DYNAMIC;
				ent.flags &=~LIGHT;
			}
			else 	if(ent == ent_select)
			{
				ent.material = mtl_red;
				ent.emask |=DYNAMIC;
				ent.flags |=LIGHT;
			}
			ent = ent_next(ent);
		}
		
		if(ent_select)
		{
			if(win_ent.pos_x == -1110)
			{
				win_edit_ent.pos_x =  0;
				win_ent.pos_x = screen_size.x-300;
				LBG_update_window(win_ent);
				LBG_update_window(win_edit_ent);
			}
			if(!key_ctrl && mouse_panel)
			{		
				UpdateModelFrom();
			}
		}
		else
		{
			lock_select = 0;
			if(win_ent.pos_x != -1110)
			{
				win_edit_ent.pos_x = -1110;
				win_ent.pos_x = -1110;
				LBG_update_window(win_ent);
				LBG_update_window(win_edit_ent);
			}
		}
		wait(-0.5);
	}



The struct that's linked to entity:
Code:
typedef struct MODEL
{
	var id;
	var flags;
	var use_billboard;
	VECTOR scale;
	var x;
	var y;
	var z;
	VECTOR size;
	var pan;
	var tilt;
	var roll;
	var ambient;
	var red;
	var blue;
	var green;
	var lightrange;
	STRING* mesh;
	ENTITY* entity;
}MODEL;



Re: Visible entities higher than created entities? [Re: Walori] #381593
08/30/11 07:22
08/30/11 07:22
Joined: Mar 2009
Posts: 88
Walori Offline OP
Junior Member
Walori  Offline OP
Junior Member

Joined: Mar 2009
Posts: 88
Any thoughts about this? The weird thing is, when I remove the entity/model wit this function:
Code:
function DeleteModel(MODEL* model)
{
	if(!model)return 0;

	if(model->entity)
	{
		switch(model->entity.skill2)
		{
			case 1:
			ACTOR[model->entity.skill1] = NULL;
			actor_count--;
			break;
			
			case 2:
			MAP_TERRAIN[model->entity.skill1] = NULL;
			terrain_count--;
			break;
			
			case 3:
			ALIGHT[model->entity.skill1] = NULL;
			light_count--;
			break;
			
			case 4:
			PORTAL[model->entity.skill1] = NULL;
			portal_count--;
			break;
			
			case 5:
			WATER[model->entity.skill1] = NULL;
			water_count--;
			break;
		}
		ptr_remove(model->entity);
	}
	model_count--;
	if(model->mesh)ptr_remove(model->mesh);

	memset(model,0,sizeof(MODEL));
	free(model);
	return 1;
}


The entity is deleted as should, however the visible entities also decrease by two.

Re: Visible entities higher than created entities? [Re: Walori] #381629
08/30/11 13:29
08/30/11 13:29
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
As bart said, this is something that would be caused by having another view. However, I don't think a pp-view would do it.

Do a search for "VIEW" and tell us how many you've got going.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1