Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (RealSerious3D, rvl, tomaslolo), 685 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 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 | 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