Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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