Gamestudio Links
Zorro Links
Newest Posts
MRC.c and WFO
by 11honza11. 11/18/25 15:22
webGL
by Ice2642. 11/17/25 21:27
Camera always moves upwards?
by NeoDumont. 11/17/25 09:56
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, 1 invisible), 16,939 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
SkinnyApe, tritom, sheliepaley, Blueguy, blobplayintennis
19179 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