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
2 registered members (AndrewAMD, VoroneTZ), 1,258 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_create on client, no function started #129999
05/15/07 09:47
05/15/07 09:47
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
I thought this is a simple code, but I spent at least 4 hours of testing and nothing works. The problem is that I create an entity on the client with "ent_create". Now it will be created globally. That works fine. But the function were not started on the server...

Code:
dedicated server is running....
client join....

function sv_player
{
file_cpy("testfile", "player.mdl"); //create a file on harddisk to see if the function were started
}

starter start_game
{
if(connection == 2)
{
level_load("map1.wmb");

wait(-0.5);

player = ent_create("player.mdl", vector(0,0,20), sv_player); // now it should start the sv_player function on the server, but it doesn't
}
}




if I call the sv_player function manually offline the file will be created. Anyone an idea?

Re: ent_create on client, no function started [Re: oliver2s] #130000
05/15/07 10:53
05/15/07 10:53
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
do you start a server AND a client or server+client together?

Cause connection == 2 is only the client. if you run "-sv -cl" then its connection = 3.

also, does the server load the level too?

did you try to write an "exit;" into "sv_player" to see if the function gets called?


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: ent_create on client, no function started [Re: Captain_Kiyaku] #130001
05/15/07 11:09
05/15/07 11:09
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
I run a server (-sv) server, the level is loaded correctly, I'm 100% sure. Then I start a client (-cl) which executes the functions above. I also tried exit, but this doesn't work too.

Re: ent_create on client, no function started [Re: oliver2s] #130002
05/15/07 11:32
05/15/07 11:32
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
are you 100% sure it connects to the correct server? (like does it show "session blabla found" in the loading screen?


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: ent_create on client, no function started [Re: Captain_Kiyaku] #130003
05/15/07 11:54
05/15/07 11:54
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
Quote:

are you 100% sure it connects to the correct server? (like does it show "session blabla found" in the loading screen?




Yes, I'm 100000% sure. Because I have other functions like showing a message of connected players. This works fine.

Re: ent_create on client, no function started [Re: oliver2s] #130004
05/15/07 13:55
05/15/07 13:55
Joined: Jan 2003
Posts: 517
Illinois
G
giorgi3 Offline
User
giorgi3  Offline
User
G

Joined: Jan 2003
Posts: 517
Illinois
This might be some type of timing issue with the startup of the game. I would suggest moving the code to main () and including a wait to make sure the client connection to the server has completed. Something like this:

Code:
  
function sv_player
{
file_cpy("testfile", "player.mdl"); //create a file on harddisk to see if the function were started
}



function main ()
{


level_load("map1.wmb");

wait(-0.5); // make sure the level is fully loaded

ifdef client;
while(connection== 0) {wait(1);} // make sure we have a connection to the server
endif;

if(connection == 2)
{

player = ent_create("player.mdl", vector(0,0,20), sv_player); // now it should start the sv_player function on the server, but it doesn't
}
}





Giorgi3

10,000 parts flying in a close formation does not constitute an airplane. Some assembly is required.
Re: ent_create on client, no function started [Re: giorgi3] #130005
05/15/07 19:01
05/15/07 19:01
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Hi,

Yes, I also had problems creating and running the SERVER player using ent_create, so to make it work, I just made the SERVER to use an ACTION in the level, and just used ent_create for the clients.

Hey, it works.


Cougar Interactive

www.zoorace.com
Re: ent_create on client, no function started [Re: Ran Man] #130006
05/15/07 19:18
05/15/07 19:18
Joined: Aug 2002
Posts: 3,258
Mainz
oliver2s Offline OP
Expert
oliver2s  Offline OP
Expert

Joined: Aug 2002
Posts: 3,258
Mainz
After a few hours of testing find the source: I had some IFNDEFs in my script. But they had nothing to do with that functions above. I remove them and now it works....strange...

Re: ent_create on client, no function started [Re: oliver2s] #130007
05/15/07 20:02
05/15/07 20:02
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Glad to hear you got it working.

For me, I just made my SERVER players into ACTIONS in WED and then just removed the ones I did not use afterwards.


Cougar Interactive

www.zoorace.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