Gamestudio Links
Zorro Links
Newest Posts
long time to load data
by qin. 12/31/25 09:57
The new evaluation shell
by jcl. 12/29/25 09:56
about Zorro S (monthly)
by AndrewAMD. 12/29/25 03:24
Xor Memory Problem.
by TipmyPip. 12/26/25 19:14
ZorroFix. ini /data and /log path
by Martin_HH. 12/19/25 21:02
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 6,599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Syndrela, HDRSEO, AOUNZA, digitalboy381, agasior
19190 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Create character from another character #407346
09/11/12 18:46
09/11/12 18:46
Joined: May 2006
Posts: 30
awstar Offline OP
Newbie
awstar  Offline OP
Newbie

Joined: May 2006
Posts: 30
How would the script go for a character that spawns or creates two other characters if a player or another character gets within a certain distance to the model? There was a wdl example of the a while back but im working with a8.

Re: Create character from another character [Re: awstar] #407349
09/11/12 19:38
09/11/12 19:38
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
This depends on how you are actually creating the character. A piece of code would help us.
To get the distance just use a c_trace and / or vec_dist.

Re: Create character from another character [Re: Ch40zzC0d3r] #407357
09/11/12 20:38
09/11/12 20:38
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Use this as a start:

function enemy_spawner()
{
while(!player)wait(1);
while(1)
{

if(vec_dist(player.x, my.x) < 100)
{
ent_create(...);
ent_create(...);
break;
}
wait(1);
}
ent_remove(me);
}


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | 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