Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,251 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[GSTNet] GSTNet_TrackEntity problem #377814
07/16/11 15:51
07/16/11 15:51
Joined: Jul 2011
Posts: 7
M
M3n1nWh1T3 Offline OP
Newbie
M3n1nWh1T3  Offline OP
Newbie
M

Joined: Jul 2011
Posts: 7
Hey guys =)
I bought A7 Extra one time and dont have multiplayer.
So i decided to use GSTNet.
I made a simple game(shooter) to test GSTNet for my big project.
All worked great but 1 thing made me very angry.
I morphed the player to a gun, and programmed gravity. Now the gun is at the bottom and the playerfeets too. But i want to get weapon higher. I cant move model(aniamtions dont work after) or change camera. So i need to do smthg with GSTNet_TrackEntity. Please help me frown

Re: [GSTNet] GSTNet_TrackEntity problem [Re: M3n1nWh1T3] #377832
07/16/11 23:44
07/16/11 23:44
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
please post some code


Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files
Re: [GSTNet] GSTNet_TrackEntity problem [Re: nfs42] #377840
07/17/11 08:09
07/17/11 08:09
Joined: Jul 2011
Posts: 7
M
M3n1nWh1T3 Offline OP
Newbie
M3n1nWh1T3  Offline OP
Newbie
M

Joined: Jul 2011
Posts: 7
K. So my player_action:

Code:
action player_action()//this is the player action executed on all machines
{
	while(GSTNet_Handle(my) == 0)
	{
		wait(1);
	}
	GSTNet_TrackEntity(me,1+2);//track the position and rotation of this entity, parameters will be send to all PCs, but they wont be send from the server to the client that created this ent(userful :) )
	GSTNet_TrackSkills(me,1,3);//track skills 1-3 of this entity. Same situation as above
	while(1)
	{
		my.event = pl_hurt;
		my.emask = ENABLE_IMPACT;
		c_move(my,nullvector,my.force_x,IGNORE_PASSABLE|GLIDE);
		VECTOR vFeet;
	   vec_for_min(vFeet,me);
	   c_trace(me.x,vector(me.x,me.y,me.z-200), IGNORE_ME | IGNORE_PASSABLE);
	  	me.z = hit.z - vFeet.z+100;
		wait(1);
	}	
}



And a few lines of my player_movement:

Code:
function control_player()//this is the control function of the player, only executed on the given client
{
	mouse_mode = 0;
	player.STATE = 7;
	player.CLASS = 4;
	shoot2();
	set(player, FLAG2);
	
	while(player == NULL)
	{
		wait(1);
	}	
	ent_morph(player, "Models\\Weapons\\m24\\m24_take.mdl");
	while(1)
	{
		player.force_x = (key_w-key_s)*pl_speed*time_step;
		player.force_y = (key_a-key_d)*12*time_step;
		player.force_z = 0;
		player.pan -= mouse_force.x*2;
		player.tilt += mouse_force.y*2;
                .....



Re: [GSTNet] GSTNet_TrackEntity problem [Re: M3n1nWh1T3] #377854
07/17/11 11:47
07/17/11 11:47
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
please add GSTNet_Debug(100); to your main function and start your game with -diag cmdline parameter. post acklog.txt here or per pm

my interpretation of your code
action player_action()
is executed on all clients >> _Track.. only watches the values on the creating client and send them to all others !ok

function control_player()
runs only on the player client
you morph this entity only on the player client >> so the new entity is used for tracking. !not so good

i would do it like this:
all clients: GSTNet_ent_createlocal() a weapon entity attached to the playerentity
player client: set the player entity invisible


Andreas
GSTools - Home of
GSTScript 0.9.8: lua scripting for A6/7/8
GSTNet 0.7.9.20: network plugin for A6/7/8
GSTsqlite 1.3.7: sql database plugin for A6/7/8
3DGS Codebase: 57 snippets || 3DGS Downloads: 248 files

Moderated by  HeelX, Spirit 

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