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
2 registered members (TipmyPip, 1 invisible), 18,789 guests, and 8 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
Moving the entity #249315
02/01/09 18:21
02/01/09 18:21
Joined: Apr 2007
Posts: 141
Germany
Timothy Offline OP
Member
Timothy  Offline OP
Member

Joined: Apr 2007
Posts: 141
Germany
Hallo,
Ich habe folgendes Problem (C-Skript):

Wenn man auf dem Server oder auf dem Client (per G drücken) die Entity mit der action "place_me" erstellt, können beide (Client/Server) sie auch per Maus bewegen. Allerdings wird die Position der Entity nur bei allen Teilnehmern geändert, wenn der Server sie bewegt. Wenn die anderen Clients sie bewegen, wird die Position nur lokal verändert. Wie kann ich das lösen?

Unten ist der Code:

// English

Hello,
I have the following problem (C-Script):

If you create as a server or as a client (by pressing G) the entity with the "place_me" action, both (Server/Client) can move it using the mouse. But the position of the entity will be only changed at all members, when the server moves it. If the other clients move it, the position is only changed local. How can I fix that?

Here's the code:


Code:
function drag()
{
	if(event_type == event_release)
	{
		my.material = null;   // original skin
		my.ambient = 0;
		my.is_used = 0;
	}
	if (event_type == event_touch)
	{
		my.ambient = 75; // hilight skin
	}
	if (event_type == event_click)
	{
		mouse_mode = 0;		
		
		while(mouse_left)
		{
			my.material = mat_clicked; // normal skin
			my.ambient = 0;
	
			my.skill10 = mouse_pos.x;  // follow mouse x-pos
			my.skill11 = mouse_pos.y;  // follow mouse y-pos
			my.skill12 = camera.z;     // same as camera z-pos 
			
			vec_for_screen(my.skill10,camera);
			
			if(connection == 2)
			{
			send_skill(my.skill10, SEND_VEC); // send skill10...13 to the server
			}
			
			// update position			
			my.x = my.skill10;
			my.y = my.skill11;
			my.z = my.skill12;
			
			ent_sendnow(my);
			
			wait(1);
		}
		mouse_mode = 1;
		my.material = null; // normal skin
		my.ambient = 0;			
  	}
}

action place_me()
{
	sleep(0.5);
	proc_local(my, place_me);
	my.material = null;
	my.is_used = 0;
	c_setminmax(my);
	my.passable = on;
	my.enable_touch = on;
	my.enable_release = on;
	my.enable_click = on;
        my.event = drag;
}

function make_ding() // create a warlock.mdl
{
	my = ent_create(warlock_str, nullvector, place_me);
	wait(1);
}

on_g = make_ding;


Re: Moving the entity [Re: Timothy] #249442
02/02/09 16:28
02/02/09 16:28
Joined: Apr 2007
Posts: 141
Germany
Timothy Offline OP
Member
Timothy  Offline OP
Member

Joined: Apr 2007
Posts: 141
Germany
Kann denn niemand helfen?? cry

Re: Moving the entity [Re: Timothy] #250321
02/07/09 12:03
02/07/09 12:03
Joined: Apr 2007
Posts: 141
Germany
Timothy Offline OP
Member
Timothy  Offline OP
Member

Joined: Apr 2007
Posts: 141
Germany
Hmm, ich dachte, das Forum wäre da um Anderen zu helfen.

Re: Moving the entity [Re: Timothy] #250330
02/07/09 12:40
02/07/09 12:40
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
well you're doing it wrong somehow, obviously but i'm not sure i can help you out properly. i'd suggest you go through AUM multiplayer workshops and make sure you understand how that MP stuff works.

also you might wanna take a look in ANet or GSTNet MP plugins for 3dgs. they are much more powerful and easier to use then 3dgs native MP system



Ubi bene, ibi Patria.
Re: Moving the entity [Re: croman] #250335
02/07/09 13:02
02/07/09 13:02
Joined: Apr 2007
Posts: 141
Germany
Timothy Offline OP
Member
Timothy  Offline OP
Member

Joined: Apr 2007
Posts: 141
Germany
Thanks for your answer!
I'll try the plugins.


Moderated by  HeelX, Spirit 

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