|
|
[ANET] enet_ent_register
#319427
04/14/10 20:57
04/14/10 20:57
|
Joined: Jun 2008
Posts: 428
Rasch
OP
Senior Member
|
OP
Senior Member
Joined: Jun 2008
Posts: 428
|
Hi there, got a problem with the enet_ent_register function. I palced some actors in WED and give them this action
action standing_guard()
{
while(enet_get_connection() == 0){wait(1);} //wartet bis ein Service initialisiert wird
if(enet_get_connection() == 1)
{
enet_ent_register(my); //der Server registriert nun die Entity
}
while(enet_ent_globpointer(my) == -1){wait(1);}
var ani_speed = random(3)+1;
while(1)
{
my.skill1 += ani_speed*time_step;
if (my.skill1 > 99){my.skill1 = 0;}
ent_animate(me,"stand",my.skill1,ANM_CYCLE);
wait(1);
}
}
Now the problem is that the entity register dont seem to work cause my npc dont do his animation. Also if i connect as a client too the entity is not synchronized. I think it´s looping at the wait for the globpointer. I removed that line but than the entity is not registerd. I start as a SERVER not SERVER_CLIENT. Whats the problem?
|
|
|
Re: [ANET] enet_ent_register
[Re: Rasch]
#319505
04/15/10 13:21
04/15/10 13:21
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Does this happen with the latest ANet release (1.3.0.2)?
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [ANET] enet_ent_register
[Re: Rasch]
#319524
04/15/10 14:46
04/15/10 14:46
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
If you want to update, download the ANet Demo and use this .dll and .h.
I guess the plugin isn't loaded when you call enet_init(). Try to place a wait(1); before you call enet_init();.
EDIT: Additionally if you update always download the latest manual and read the update section first.
Last edited by Dark_samurai; 04/15/10 14:47.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: [ANET] enet_ent_register
[Re: Rasch]
#319724
04/17/10 08:05
04/17/10 08:05
|
Joined: Jun 2008
Posts: 428
Rasch
OP
Senior Member
|
OP
Senior Member
Joined: Jun 2008
Posts: 428
|
Got another problem. The entity_register function now works. I´m using the example from the manual. It waits till it get the globpointer but when i send the position from the entity it works for 1 second or 1 1/2 then suddenly it says: Do you know why this is happening?
Last edited by Rasch; 04/17/10 08:39.
|
|
|
Re: [ANET] enet_ent_register
[Re: Rasch]
#319790
04/17/10 19:51
04/17/10 19:51
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
print the value that is returned by enet_get_globpointer(). Maybe the entity pointer you passed to enet_get_globpointer() was changed by your code and thus the function returns -1.
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|
|
|