Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Ayumi, NewbieZorro, TipmyPip), 13,888 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Entity question - Please help [Re: bobby_danseco] #257280
03/22/09 08:23
03/22/09 08:23
Joined: Dec 2008
Posts: 124
bobby_danseco Offline
Member
bobby_danseco  Offline
Member

Joined: Dec 2008
Posts: 124
its working evisob smile thanks a lot..
but still i wanted to have the same
version that you got.. smile

Re: Entity question - Please help [Re: bobby_danseco] #257282
03/22/09 08:50
03/22/09 08:50
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Got to the "Updates and Announcements" forum and the beta download link
is in a thread in there.

Here's the link straight to the thread.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Entity question - Please help [Re: EvilSOB] #257293
03/22/09 12:59
03/22/09 12:59
Joined: Dec 2008
Posts: 124
bobby_danseco Offline
Member
bobby_danseco  Offline
Member

Joined: Dec 2008
Posts: 124
Thanks a lot smile

Re: Entity question - Please help [Re: EvilSOB] #257384
03/23/09 05:30
03/23/09 05:30
Joined: Dec 2008
Posts: 124
bobby_danseco Offline
Member
bobby_danseco  Offline
Member

Joined: Dec 2008
Posts: 124
another question on this.
i comment out the my.pan stuff because i don the object to be moving. but why is that when i move the player or pan it.
the second object pan as well.

is it something to do with the my.pan also which im using on the player.. ???

Re: Entity question - Please help [Re: bobby_danseco] #257386
03/23/09 05:53
03/23/09 05:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Im not sure I get what you mean by you "comment out the my.pan stuff"...
If you mean something like this
Code:
action acao_obst_rampa1()
{
   my.OBJECT_TYPE = OBSTACULO;   //make ME an Obstaculo
   my.TIPO_OBJETO = 4;
   while (!player) { wait(1); }
   while(me)
   {
 //     my.pan += 1 * time_step;
      wait(1);
   }
}
then the oject should not move, no matter what happens in the player action.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Entity question - Please help [Re: EvilSOB] #257387
03/23/09 06:02
03/23/09 06:02
Joined: Dec 2008
Posts: 124
bobby_danseco Offline
Member
bobby_danseco  Offline
Member

Joined: Dec 2008
Posts: 124
yes exactly that's what i did
and your right it should not be move or moving.

but when i move my player such as panning to the left
it also move or pan to the left.. or right or vice versa

btw im using my.pan also on the player move function..




Last edited by bobby_danseco; 03/23/09 06:03.
Re: Entity question - Please help [Re: bobby_danseco] #257390
03/23/09 06:48
03/23/09 06:48
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
"Shouldnt" matter. The MY or ME pointer is only a store of the entity that created the action.
Its very difficuly to find two actions that have the same ME or MY pointer.

Can you post the whole of your player action/script?
I suspect I will be able to spot the fault in there.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Entity question - Please help [Re: EvilSOB] #257394
03/23/09 07:15
03/23/09 07:15
Joined: Dec 2008
Posts: 124
bobby_danseco Offline
Member
bobby_danseco  Offline
Member

Joined: Dec 2008
Posts: 124

sure here it is...im experementing on demo of anet smile

Code:
function move_player()
{
	
	VECTOR player_dist; //needed for the movement
	VECTOR save_pos; //stores the entity.pos (needed to find out if the position has changed)
	VECTOR temp; //a temporary vector
	
	my.flags |= SHADOW;
	my.emask |= ENABLE_ENTITY;
	my.event = NULL;
	my.pan = save_pan; // used to face direction when spawn.,,,,

	you = NULL;

	while(enet_ent_globpointer(my) == -1) {wait(1);} //wait until the entity gets a global pointer
	players[enet_ent_creator(enet_ent_globpointer(my))] = my; //saves the entity into the players array
	

	if(enet_ent_creator(enet_ent_globpointer(my)) == enet_get_clientid()) //if this function runs on the client which created the entity
	{
		wait(1); //needed for c_updatehull
		my.z += 30; //sets the entity above the ground
		c_updatehull(my,0); //updates the collsision hull
		
		while(enet_get_clientid() != -1) //as long as a connection to the server exists
		{

			my.pan -= 2*mouse_force.x; //rotates the entity with the mouse
			player_dist.x = 15*(key_w-key_s)*time_step; //moves the player with [w] [a] [s] [d]
			player_dist.y = 15*(key_a-key_d)*time_step;
			
			//Gravity:
			vec_set(temp, my.x); 
			temp.z -= 1000; 
			player_dist.z = -abs(c_trace (my.x, temp, IGNORE_ME | IGNORE_PASSABLE | USE_BOX ));
			
			//c_move(my,player_dist,nullvector,GLIDE|IGNORE_PASSABLE); //moves the player
			c_move(my,player_dist,nullvector,GLIDE);
			
			if(key_w+key_s+key_a+key_d > 0) //if the entity had been moved
			{
				//animates the entity:
				my.skill[41] += 7*time_step;
				if(my.skill[41] > 100) {my.skill[41] = 0;}
				ent_animate(my,"walk",my.skill[41],ANM_CYCLE);
				//skill[42] == 1 if the entity shows it's animation (needed for the other clients+server to show the animation)
				if(my.skill[42] == 0) //only send the skill if the value has changed
				{
					my.skill[42] = 1;
					enet_send_skills(enet_ent_globpointer(my),42,42,-1); //sends the new skill value
				}
			}
			else
			{
				if(my.skill[42] == 1) //only send the skill if the value has changed
				{
					my.skill[42] = 0;
					enet_send_skills(enet_ent_globpointer(my),42,42,-1); //sends the new skill value
				}
			}
			//sends the position if changed
			if(save_pos.x != my.x || save_pos.y != my.y || save_pos.z != my.z) {enet_send_pos(enet_ent_globpointer(my),-1);vec_set(save_pos,my.x);}
			//sends the angles if they changed
			if(save_pan != my.pan) {enet_send_angle(enet_ent_globpointer(my),-1);save_pan = my.pan;}

			update_views();
			if(you!=NULL)  //make sure an ENTITY has been hit
			{ 
				if(you.OBJECT_TYPE==OBSTACLE)    //check if entity is an OBSTACLE
				{  
					player_teleport();
				} 
			}
			
			wait(1);
		}
	}
}


Re: Entity question - Please help [Re: bobby_danseco] #257396
03/23/09 08:00
03/23/09 08:00
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I cant see anything wrong here.
Try commenting out the "update_views()" function for a test and see if "the object" still moves un-expectedly.
If it stops the problem, post the "update_views()" function, as its in there somewhere.

PS: Does the "player_teleport" trigger work?
(Im not sure if the YOU pointer will come back from the "update_views" correctly or not...)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Entity question - Please help [Re: EvilSOB] #257399
03/23/09 08:27
03/23/09 08:27
Joined: Dec 2008
Posts: 124
bobby_danseco Offline
Member
bobby_danseco  Offline
Member

Joined: Dec 2008
Posts: 124
i already did.
i replace the update view with this..
Code:
        camera.x = my.x-100*cos(my.pan);
	camera.y = my.y-100*sin(my.pan);
	camera.z = my.z+50;
	camera.tilt += mouse_force.y;
	camera.pan = my.pan;
	if(camera.tilt < -50) {camera.tilt = -50;}
	if(camera.tilt > 20) {camera.tilt = 20;}


however here is also the update_view code.. it only toggle between 1st to 3rd person view..

Code:
function update_views()
{
	if (cam_mode == 0) //first person
	{
		camera.x = my.x;
		camera.y = my.y;
		camera.z = my.z + eye_height;
		camera.pan = my.pan;
		camera.roll = my.roll;
		camera.tilt = my.tilt + tilt_1st;
	}
	else  //3rd person
	{
		dist_planar = cos (tilt_3rd) * dist_total;
		camera.x = my.x - cos (cam_angle) * dist_planar;
		camera.y = my.y - sin (cam_angle) * dist_planar;
		camera.z = my.z + sin (tilt_3rd) * dist_total;
		camera.pan = cam_angle;
		camera.roll = 0;
		camera.tilt = - tilt_3rd;
	}
}


yes, the player_teleport trigger work but only after
the player touches the object or bump to it.
then it will go somewhere else. but it doesnt matter
cause the movement (panning of object) happen before i touches it.

i guess probably it got to do something with the you. smile
ill run a test again.. anyway thanks for your time on this
i really appreciate it.. smile

Last edited by bobby_danseco; 03/23/09 08:29.
Page 2 of 3 1 2 3

Moderated by  HeelX, rvL_eXile 

Gamestudio download | 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