Gamestudio Links
Zorro Links
Newest Posts
Bug in train mode, or it seem to me
by mistery. 09/24/26 17:34
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 09/22/26 12:21
Capital slider is not saving in Z12
by Petra. 09/22/26 06:49
Parent/child object
by VoroneTZ. 09/22/26 05:52
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 12,763 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Knull, Opus, Jubilee, lopezsergio07, mistery
19240 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
multiplayer camera pointer #152991
09/09/07 19:44
09/09/07 19:44
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hi, i am creating a weapon shoot in the player action:

Code:

if (MY._weapon)
{
if (my._FIRING_WEAPON == TRUE)
{
vec_for_vertex (temp.x, MY._weapon, 1465);
temp.z -= 0.3;
you = ent_create ("ball0.055.mdl", temp.x, projectile_function);
}
my._FIRING_WEAPON = FALSE;
}




And then the projectile function:

Code:


function projectile_function()
{
proc_late();

my.pan = camera.pan;
my.tilt = camera.tilt;
var old_x;
var old_y;
var old_z;

MY.scale_x = 3;
MY.scale_y = 3;
MY.scale_z = 3;

my.enable_entity = ON;
my.enable_block = ON;

my._LIFE_SPAN = 300;

my._FORCE_Y = 0;
my._FORCE_X = 170 * time_step;
my._FORCE_Z = 0;

while (my._LIFE_SPAN != 0)
{
my._LIFE_SPAN -= 1;
c_move (my, my._FORCE_X, nullvector, ignore_passable);
my._FORCE_Z - = 0.5 * time_step;

if( my.x != old_x || my.y != old_y || my.z != old_z)
{
old_x = my.x;
old_y = my.y;
old_z = my.z;
if( my.x == 0)
{
SEND_SKILL( my.x, SEND_VEC + SEND_ALL);
SEND_SKILL( my.pan, SEND_VEC + SEND_ALL);
}
else
{
SEND_SKILL( my.x, SEND_VEC + SEND_ALL | SEND_UNRELIABLE);
SEND_SKILL( my.pan, SEND_VEC + SEND_ALL | SEND_UNRELIABLE);
}
}
wait (1);
}

sleep(.1);
ent_remove(my);
}



It works ok, except the camera direction, the bullet always assume the player1.pan (server) and not the direction of the client camera.

If i call ent_create ("ball0.055.mdl", temp.x, null); and then the project_function right after ent_create it just works.

what a hell is going on, why the camera pointer does not pass to the function called inside ent_create?

Thanks.

Re: multiplayer camera pointer [Re: demiGod] #152992
09/10/07 21:25
09/10/07 21:25
Joined: Jun 2001
Posts: 1,004
Dossenbach
N
nfs42 Offline
Serious User
nfs42  Offline
Serious User
N

Joined: Jun 2001
Posts: 1,004
Dossenbach
from my understanding of builtin mp:
ent_create() executes function only on the server. So camera object is always camera of the server.

Code:

{
vec_for_vertex (temp.x, MY._weapon, 1465);
temp.z -= 0.3;
you = ent_create ("ball0.055.mdl", temp.x, projectile_function);
you.pan = camera.pan;
you.tilt = camera.tilt;




or use proc_client.


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: multiplayer camera pointer [Re: nfs42] #152993
09/10/07 21:46
09/10/07 21:46
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Yes you´re right about ent_create and proc_client / proc_local, thanks.

Because you.pan and you.tilt above dont solve the problem, camera is always server camera.

Re: multiplayer camera pointer [Re: demiGod] #152994
01/10/08 20:14
01/10/08 20:14
Joined: Apr 2006
Posts: 28
LB, CA, USA
WINBERRY Offline
Newbie
WINBERRY  Offline
Newbie

Joined: Apr 2006
Posts: 28
LB, CA, USA
Help with proc_client:

I am trying to alter the Loocweed multiplayer code to include mouose movements = client player movements. I can get the mouse to pan, but the movement keys will not follow the pan direction. I have tried my best to implement the proc_client but either I have no idea how to code for it, or I'm way over my head.

Any help would be greatly appreciated.

Thanks winberry.com


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