Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 604 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
GSTNet ent_create problem #426636
07/26/13 13:00
07/26/13 13:00
Joined: Jun 2012
Posts: 15
R
rotti Offline OP
Newbie
rotti  Offline OP
Newbie
R

Joined: Jun 2012
Posts: 15
Hello Community
I have been testing some things with GSTNet today. But now i have a problem. I wanted to create a global entity which every Client can see. I used GSTNet_ent_create. But only the Server can see the entity but the clients are connected! Please help!

My Server code:
Click to reveal..
#include <GSTNet.h>
#include <acknex.h>

function main()
{
GSTNet_StartServer(2300, 1);
while(GSTNet_Connection() == 0)
{
wait(1);
}
level_load("multiplayer6.wmb");
vec_set(camera.x, vector (-600, 0, 100));
wait(-0.5);
GSTNet_ent_create(_str("redguard.mdl"),vector(-100,-50, 40),_str("NULL"));
}


My Client code:
Click to reveal..
#include <GSTNet.h>
#include <acknex.h>


function main()
{
GSTNet_StartClient(_str("127.0.0.1"), 2300, 1);
while(GSTNet_Connection() == 0)
{
wait(1);
}
level_load("multiplayer6.wmb");
vec_set(camera.x, vector (-600, 0, 100));
}

Re: GSTNet ent_create problem [Re: rotti] #426638
07/26/13 13:24
07/26/13 13:24
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
What about use a key to spawn the entity if you are sure that the client is connected?
Also I would suggest to load the level before connecting, or even making 2 hotkeys, 1 for connecting, and 1 on the server for spawning.

Re: GSTNet ent_create problem [Re: Ch40zzC0d3r] #426643
07/26/13 13:47
07/26/13 13:47
Joined: Jun 2012
Posts: 15
R
rotti Offline OP
Newbie
rotti  Offline OP
Newbie
R

Joined: Jun 2012
Posts: 15
ok thanks that worked

#Edit

another question:
I want the entity to move globally but again it just moves locally!

here is the code:
Click to reveal..
#include <GSTNet.h>
#include <acknex.h>

function create()
{
GSTNet_ent_create(_str("redguard.mdl"),vector(-100,-50, 40),_str("walk"));
}


function main()
{
GSTNet_StartServer(2300, 1);
while(GSTNet_Connection() == 0)
{
wait(1);
}
level_load("multiplayer6.wmb");
vec_set(camera.x, vector (-600, 0, 100));
on_x = create;
}

client:
Click to reveal..
#include <GSTNet.h>
#include <acknex.h>

action walk()
{
while(1)
{
my.pan += (key_cul-key_cur)*5*time_step;

var distance = (key_cuu-key_cud)*5*time_step;
c_move(me, vector(distance,0,0), NULL, GLIDE);
wait(1);
}
}


function main()
{
GSTNet_StartClient(_str("127.0.0.1"), 2300, 1);
while(GSTNet_Connection() == 0)
{
wait(1);
}
level_load("multiplayer6.wmb");
vec_set(camera.x, vector (-600, 0, 100));
}

Last edited by rotti; 07/26/13 13:57.
Re: GSTNet ent_create problem [Re: rotti] #426668
07/26/13 17:11
07/26/13 17:11
Joined: Nov 2011
Posts: 274
de
lemming Offline
Member
lemming  Offline
Member

Joined: Nov 2011
Posts: 274
de
Because you never tell the server you have moved. GSTNet has GSTNet_TrackEntity() for this. It's described in the manual.

Re: GSTNet ent_create problem [Re: lemming] #426713
07/27/13 18:32
07/27/13 18:32
Joined: Jun 2012
Posts: 15
R
rotti Offline OP
Newbie
rotti  Offline OP
Newbie
R

Joined: Jun 2012
Posts: 15
I've tried the track entity but i didn't get it to work. Sorry. Can you give me a code example?

Re: GSTNet ent_create problem [Re: rotti] #426840
07/30/13 16:31
07/30/13 16:31
Joined: Nov 2011
Posts: 274
de
lemming Offline
Member
lemming  Offline
Member

Joined: Nov 2011
Posts: 274
de
When I get the time I'll write a short snippet. Likely within the next few days.


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