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
attach entity to player #387241
11/16/11 02:34
11/16/11 02:34
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
hi, i want to create an entity that follows the player. i create the new entity by ent_create but it stand still and i want to move it along with the player. and also when i press the key to run the ent_create funcition it creates many new entities as the key is pressed, and i just want to create one tongue

Re: attach entity to player [Re: Funeral] #387244
11/16/11 06:13
11/16/11 06:13
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Just give the created entity the Funktion:

Quote:
function created_entity()
{
my.x = player.x;
my.pan = player.pan;
my.tilt = player.tilt;
my.roll = player.roll
}


Last edited by Random; 11/16/11 06:14.


Re: attach entity to player [Re: Random] #387273
11/16/11 13:27
11/16/11 13:27
Joined: Nov 2011
Posts: 21
MO:US and sometimes Ambato Ecu...
L
LewyT Offline
Newbie
LewyT  Offline
Newbie
L

Joined: Nov 2011
Posts: 21
MO:US and sometimes Ambato Ecu...
regarding the multiple creations:
it sounds like your create_entity is inside your while loop
you should call create_entity before your while loop in the player action
this will create the entity right after the player entity is created

untested pseudocode
Code:
action playeraction()
{
    initialize player stuff
    wait(1)
    created_entity(,,,,created_entity) // this is for the following intity
    wait(1)
    while()
    {
        player control stuff
    }
}



Re: attach entity to player [Re: LewyT] #387865
11/24/11 19:18
11/24/11 19:18
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline
Senior Member
rtsgamer706  Offline
Senior Member
R

Joined: Dec 2009
Posts: 361
If you want to directly connect the entity to the player
just use a vec_for_vertex command like:
vec_for_vertex(me.x, Pointer, 182);
it will connect the entity to that vertex
on the entity you typed into the command.


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