Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,310 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
question about send_skill #94553
10/15/06 09:59
10/15/06 09:59
Joined: Sep 2006
Posts: 108
J
Jered Offline OP
Member
Jered  Offline OP
Member
J

Joined: Sep 2006
Posts: 108
Ok I am confused again. if I do this:
Code:

player = ent_createlocal (str_model, vecto, setup_character);

player_ghost = ent_create (str_model, player.x, null);

player_ghost.invisible = on;






then later when I send_skill (player_ghost.x, send_vec);

it goes to the server. Now once the server gets the event, that triggers the on_server = function; correct?


this is my question. when that function is ran ( the on_server = function;)

I always frst start with ifdef server; just to be safe and everything. But I then want to check to see if the skill that was sent was a specific skill or not. ( making sure we are exicuting the correct code for the right skill that was sent) How do I do this?

what is actually sent to the server? player_ghost? or the vector of player ghost. when I am on the server end what do I use? a pointer? or my? or you? I am lost in this area. If anyone could point me in the right direction and also help me to understand what goes on, I would greatly appreciate it.

What I am trying to do btw is this:

when a new player connects to the server ( creating the player localy and also using the player_ghost pointer thing that Michael talked about in a different thread) and is actually now in the world. I want to += 1 to a variable that keeps track of the number of people.

so after I create the entity localy, and create the global entity, I want the Server to update the new number of players in the actual world ( not just connected to the server). But I am not sure what to use on the server side...my? you? what is it once you create the global entity..to the server what is it?

I know I talked about sending a skill, and at the end am talking about sending a variable...which uses send_var, but if I used a send_skill to send a skill, how does the server see the entity that just sent it's skill...the global entity....I don't "get it" yet...but am trying to understand it...thank you if you can help



also about the send_var. On the server how would I check to see if the variable that was sent was a specific variable? if (variable_recieved == this variable)?

Last edited by Jered; 10/15/06 10:03.
Re: question about send_skill [Re: Jered] #94554
10/16/06 05:06
10/16/06 05:06
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline
Serious User
PrenceOfDarkness  Offline
Serious User

Joined: Aug 2004
Posts: 1,305
New York
I am not 100% sure if you can send player_ghost.x as a skill. PLEASE BY NO MEANS TAKE THIS AS A FACT, I AM A NOOB TO MULTIPLAYER AS WELL. See if you can copy player_ghost.x to a skill like player_ghost_x = player_ghost.x; of course you would need to do that for y and z. I was trying to do something like that before, until I was told what I was doing was a waste of time lol. But uhh, like I said I don't know much about multiplayer, but want to help you out in any way i can.. hopefully I don't make things worse lol


"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: question about send_skill [Re: PrenceOfDarkness] #94555
10/16/06 06:03
10/16/06 06:03
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
in the main write this:

Code:

if(connection == 3)
{
iPlayerConnected += 1;
}



this is not necesarry though, only if you run your game as server+client

create your character. and in the on_server function call this:

Code:

function server_called(strPlayerName)
{
ifdef server;
if(event_type == event_join)
{
iPlayerConnected += 1;
send_var(iPlayerConnected);
}
if(event_type == event_leave)
{
iPlayerConnected -= 1;
send_var(iPlayerConnected);
}
endif;
wait(1);
}




this should work, i use ti like this in my game and it works perfect.


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: question about send_skill [Re: Captain_Kiyaku] #94556
10/16/06 06:47
10/16/06 06:47
Joined: Sep 2006
Posts: 108
J
Jered Offline OP
Member
Jered  Offline OP
Member
J

Joined: Sep 2006
Posts: 108
ok, I know how to incriment the players and what not, that is not what i was attempting to ask . Will try to explain it better.

if I create an entity with with ent_createlocal then create a pointer entity that is created on the server itsel with ent_create. How does the server view the entity that was created on the server?

Would I have to use you? would I have to use my? if I wrote code to have the ghost entity ( the global entity ... the one on the server that is sent to all clients) do something would I have to use my or you? that is what has me confused...how does the server see that ghost entity?


3DGS (6.4) Commercial

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