Gamestudio Links
Zorro Links
Newest Posts
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
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 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 | 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