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
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
4 registered members (AndrewAMD, Kingware, AemStones, RealSerious3D), 1,388 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[ANET] enet_ent_register #319427
04/14/10 20:57
04/14/10 20:57
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline 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

Code:
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 Offline
Serious User
Dark_samurai  Offline
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: Dark_samurai] #319511
04/15/10 13:41
04/15/10 13:41
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Thats something i didnt test. I now installed the demo (update) and replaced the ANet.dll anet.h and added the 2 other .dlls the problem now is. If i start the engine everything works. But if i start a server errors happen and the message is "ENet is not initialized". But i do. If i replace the new dll and anet.h with the old ones everything works.



Whats the problem?

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 Offline
Serious User
Dark_samurai  Offline
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: Dark_samurai] #319527
04/15/10 14:54
04/15/10 14:54
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Haha great the wait(1) before the init code made it work.

Maybe you should add this to the manual. wink

Thanks very much ! laugh

Re: [ANET] enet_ent_register [Re: Rasch] #319724
04/17/10 08:05
04/17/10 08:05
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline 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 Offline
Serious User
Dark_samurai  Offline
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

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