0 registered members (),
1,094
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
can't send to specific entity... -_-' send_skill_id
#348546
11/28/10 01:15
11/28/10 01:15
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
Okay well I've gotten pretty far in making my online RPG but now I'm trying to optimize my code. I have an item who's assigned an ID number on the server side when it's created. I'm trying to send this skill to players only who need it. But for some reason i just can't get it to work. here is my code:
function fItem()
{
//in a function:
while(my.id == 0)
{
if(connection == 2 && my.id == 0 && player != NULL)
{
my.sendto = dplay_id;
send_skill(my.sendto,0);
}
wait(1);
}
//inside a while loop somewhere further down the function
if(my.sendto != 0)
{
send_skill_id(my.sendto,my.id,0);
my.sendto = 0;
}
i tried changing it to send_skill_to and sending a handle a handle of the player to the server and then having it send it to only him but I just can't get it to work. If i change it to send_skill(my.sendto,SEND_ALL); everything works fine again. plz help fastlane I know your out there. I need your help . Are you the only one who's got this freaking acknex multiplayer crap figured out?
Last edited by PrenceOfDarkness; 11/28/10 01:16.
"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: can't send to specific entity... -_-' send_skill_id
[Re: Tobias]
#348711
11/29/10 20:40
11/29/10 20:40
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
I know tobias.. i was trying to simplify it down to help me find the problem... but it didn't help. I can't find the problem else where. I've had this problem forever with A6/A7. It's so impossible to send information to a specific person. God -_-'
"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: can't send to specific entity... -_-' send_skill_id
[Re: Spirit]
#348931
12/01/10 22:20
12/01/10 22:20
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
Spirit that works fine if the entity was created on the client but an item needs to be created on the server so the cliend_id hangs at zero. Further more how do you debug mode using multiplayer? I can only run 1 debug instance at a time and if I run a server using test run and then I run a dubug client the script editor crashes on me.
"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: can't send to specific entity... -_-' send_skill_id
[Re: PrenceOfDarkness]
#349207
12/05/10 01:30
12/05/10 01:30
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
I am still interested in this.
"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: can't send to specific entity... -_-' send_skill_id
[Re: PrenceOfDarkness]
#349605
12/09/10 15:41
12/09/10 15:41
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
okay here is a super basic stand alone script that should in theory but doesn't. Why?
PANEL* testPNL = {
flags = SHOW;
digits(0,0,6.4,*,1,player.skill1);
digits(0,10,6.4,*,1,player.skill98);
digits(0,20,6.4,*,1,dplay_id);
digits(0,30,6.4,*,1,player.client_id);
}
void fPlayer()
{
while(my == NULL){wait(1);}
player = my;
while(connection == 0)
{
wait(1);
}
set(my,TRANSLUCENT);
while(my.skill1 == 0)
{
wait(-1);
if(connection == 2 && my.skill1 == 0)
{
my.skill98 = dplay_id;
send_skill(my.skill98,0);
}
}
wait(-0.5);
reset(my,TRANSLUCENT);
while(1)
{
wait(1);
if(my.skill98 != 0 && connection != 2)
{
my.skill1 = 1;
send_skill_id(my.skill98,my.skill1,0);
my.skill98 = 0;
}
}
}
void main()
{
dplay_localfunction = 2; //run actions on both server and client
level_load("valiance.wmb");
wait(-2);
#ifdef server //if we defined this game as a server
while(connection == 0) {wait(1);} // wait until we have a connection
#endif
#ifdef client //if we defined this game as a client
while(connection == 0) {wait(1);} // wait until we have a connection
#endif
if(connection == 1 || connection == 3)
{
player = ent_create("testing.mdl",vector(0,0,0),fPlayer);
player.skill1 = 100;
}
}
I've honestly been trying to get send_skill_to to work ever since I bought A7 but I have never been able to get it working properly. I've kept putting it off for ever but now I'm at the point where I need it (almost done with the game). PLZ help. http://www.2shared.com/file/l8VY6-BU/test.html
Last edited by PrenceOfDarkness; 12/09/10 15:52.
"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: can't send to specific entity... -_-' send_skill_id
[Re: Spirit]
#349901
12/12/10 01:50
12/12/10 01:50
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
Spirit, Did you check out the 2nd code posting? That stand alone application gives me the same issue. If this is the only issue (i'm not letting the client and server synchronize) then can you please show me how? Which tutorial are you talking about? The workshop tutorials?
"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.
|
|
|
|