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
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 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
send_skill(); does not work right #352016
12/30/10 19:42
12/30/10 19:42
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
Hi,
I've been working on this multiplayer game, and it's not quite working the way I want it to.
The player entities update their position on the server and on all clients without problems. The orientation (rotation) also works perfectly.
Now, I was trying to send a range of entity "skills" to the server, and all clients. This works fine as long as all clients are in the same local area network that the server is in, but it does not work when players from a different LAN connect.
Summary: send_skill(); only works in a LAN game. Here's my question: How can I send the data to the server anyways?

In case it helps, here is the code that is sending the skills:
Code:
vec_set(temp,wep.skill2);
vec_scale(temp,random_id);
vec_set(pl_server.skill37,wep.x);
vec_set(pl_server.skill40,temp);
pl_server.skill36 += 1;
send_skill(pl_server.skill37,SEND_VEC);
send_skill(pl_server.skill40,SEND_VEC);
send_skill(pl_server.skill36,0);


pl_server is the entity that is on the server (And yes, I am sure it exists when this code chunk is being executed)
wep is a local entity.

If anyone could help me out here, that would be nice.

Last edited by TehV; 12/30/10 19:44.
Re: send_skill(); does not work right [Re: TehV] #352105
12/31/10 19:47
12/31/10 19:47
Joined: Dec 2010
Posts: 8
S
SQS Offline
Newbie
SQS  Offline
Newbie
S

Joined: Dec 2010
Posts: 8
Quote:
How can I send the data to the server anyways?

Quote:
pl_server is the entity that is on the server

Do I understand this the right way? pl_server is not the entity on the client, but you want send the skills of the client to the server?

Anyway... are you sure this code is running on the client and not only on the server?

Re: send_skill(); does not work right [Re: SQS] #352137
01/01/11 11:48
01/01/11 11:48
Joined: Mar 2010
Posts: 120
Switzerland
T
TehV Offline OP
Member
TehV  Offline OP
Member
T

Joined: Mar 2010
Posts: 120
Switzerland
The entity pl_server is created by the client using ent_create(). On the client, both it's INVISIBLE and PASSABLE flags are set, causing the ship to be "non-existant" to the client that created it. On the server, it is visible and not passable.
Using send_skill, I wanted to transfer skills 36 to 42 to the entity. I set the parameters in the client script and then called the functions as you see above. I know this code is running on the client, because another part of the same function is also responsible for the movement. The server runs a different function.
The player entity that is visible to the player is not the same that is visible on the server and all other clients. To be more exact, each client creates 2 identical entities - one using ent_createlocal() and one using ent_create(). That way, I can run all the movement code on the client (function of local entity), and only have to update the position and orientation on the server, and any other values I want to transfer. On the client that created the entity "pl_server", it is passable and invisible.
Code that creates both entities, if it helps understand what I mean:
Code:
pl = ent_createlocal("ss2.mdl",vector(0,0,0),ship);
pl_server = ent_create("ss2.mdl",vector(0,0,0),sv_processing_function);
pl_server.INVISIBLE = on;
pl_server.PASSABLE = on;



Last edited by TehV; 01/01/11 11:50.
Re: send_skill(); does not work right [Re: TehV] #352280
01/02/11 17:31
01/02/11 17:31
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
When your send script works for local LAN clients, but does not work for remote clients, the main difference is lag. So that's where you should look for the problem.

Maybe you send the skills already when the client_id of the entities on the remote clients is not yet set. You can check if this is the reason by sending the skills later.


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