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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[ANET] NPC, ENEMY Pointer #420868
04/05/13 10:12
04/05/13 10:12
Joined: Jul 2011
Posts: 55
Berlin, Germany
S
Sammy32 Offline OP
Junior Member
Sammy32  Offline OP
Junior Member
S

Joined: Jul 2011
Posts: 55
Berlin, Germany
hi,

how i can create the globalpointer for an entity was create with WED and this entity has an action with an enemy/npc script.
What is the best way?

have everyone an script?

action enemy(){
......
}

I use A-net Pro

Last edited by Sammy32; 04/05/13 10:13.

- 3d Gamestudio Commercial -
- ANET Pro -
<JAVA | PHP | HTML | Flash > DEVELOPER

Re: [ANET] NPC, ENEMY Pointer [Re: Sammy32] #420869
04/05/13 10:27
04/05/13 10:27
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
if i understood u right u simply want an global pointer to your enemy ?

if so:
Code:
ENTITY* my_ent_pointer;
action enemy(){
   my_ent_pointer = me;
   ..
}
action AnyAction(){
   while (!my_ent_pointer) wait(1);
   if (my_ent_pointer....
   ...
}



Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: [ANET] NPC, ENEMY Pointer [Re: rayp] #420870
04/05/13 10:52
04/05/13 10:52
Joined: Jul 2011
Posts: 55
Berlin, Germany
S
Sammy32 Offline OP
Junior Member
Sammy32  Offline OP
Junior Member
S

Joined: Jul 2011
Posts: 55
Berlin, Germany
hi,

in my multiplayer game (A-NET) , i have create a map with WED, all Enemys have become an Action for the movement and the ai.

But the Globalpointer cant use for the moment, i have read, i must create an globalpointer with "enet_svent_create(i, &creating_pos);",
but i cant create the entity in livetime, the entity is create at levelstart.
Please help me with an example.
and i hope somebody understand my problem
special thanks


- 3d Gamestudio Commercial -
- ANET Pro -
<JAVA | PHP | HTML | Flash > DEVELOPER

Re: [ANET] NPC, ENEMY Pointer [Re: Sammy32] #420871
04/05/13 10:57
04/05/13 10:57
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Level entities aren't created with enet_svent_create, enet_clent_create so they have no global pointer.
But you can use a simple workaround:
Create spawnpoints instead of enemies. The spawnpoint action checks if you are a server or a server/client and then spawns your enemies. This allows you to have them as a global pointer. You can also delete the spawnpoints afterwards because you don't need them anymore now...


Visit my site: www.masterq32.de
Re: [ANET] NPC, ENEMY Pointer [Re: MasterQ32] #420910
04/06/13 11:29
04/06/13 11:29
Joined: Jul 2011
Posts: 55
Berlin, Germany
S
Sammy32 Offline OP
Junior Member
Sammy32  Offline OP
Junior Member
S

Joined: Jul 2011
Posts: 55
Berlin, Germany
hi,

ok thank you very much,
it works fine.

If i start a Server and a start a client it works fine.
if start a server/client in one application i have some problems,
in this mode start the Action 2 Times , how can make a difference between this actions.



action enemy(){
if(......) // only server

if(....) // all clients and the server/client - client part
}


enet_get_connection() has onyl the information about the applictaion.


thank you for you response and help

best regards


Last edited by Sammy32; 04/06/13 11:30.

- 3d Gamestudio Commercial -
- ANET Pro -
<JAVA | PHP | HTML | Flash > DEVELOPER

Re: [ANET] NPC, ENEMY Pointer [Re: Sammy32] #420920
04/06/13 16:33
04/06/13 16:33
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
enet_get_connection() can return:
CLIENT_MODE
SERVER_MODE
SERVER_CLIENT_MODE

means:
If(enet_get_connection() == SERVER_MODE || enet_get_connection() == SERVER_CLIENT_MODE)
{
...
}
else if(enet_get_connection() == CLIENT_MODE)
{
...
}

Last edited by Ch40zzC0d3r; 04/06/13 16:34.
Re: [ANET] NPC, ENEMY Pointer [Re: Ch40zzC0d3r] #421155
04/12/13 06:58
04/12/13 06:58
Joined: Jul 2011
Posts: 55
Berlin, Germany
S
Sammy32 Offline OP
Junior Member
Sammy32  Offline OP
Junior Member
S

Joined: Jul 2011
Posts: 55
Berlin, Germany
Hi,

thank you for the help,

the problem is fixed,

I have build some enemys , with spawn points and some aggro management.

Thanks to All

Best regards


- 3d Gamestudio Commercial -
- ANET Pro -
<JAVA | PHP | HTML | Flash > DEVELOPER


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