Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/26/26 21:35
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (qin, TipmyPip), 5,848 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
creating object / entity #306693
01/24/10 08:53
01/24/10 08:53
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
hi..
how to create an object or entity in front of the player
regardless of the player facing north, south, east or west.

i am able to create but only static location
eg.
Code:
tmpLoc.x = my.x;
        tmpLoc.y = my.y + 50;
	tmpLoc.z = my.z + 50;

        tmpName = ent_createlocal(_str("cube.mdl"),vector(tmpLoc.x,tmpLoc.y,tmpLoc.z),NULL);



those were create only in one location with a distance of 50
what i want is when im facing right cube should be in front of me the same with left and so on..:)


please help..

thanks laugh

Re: creating object / entity [Re: bobby_danseco] #306702
01/24/10 09:55
01/24/10 09:55
Joined: Apr 2009
Posts: 69
Karlsruhe, Baden Württemberg,...
luckyxxl Offline
Junior Member
luckyxxl  Offline
Junior Member

Joined: Apr 2009
Posts: 69
Karlsruhe, Baden Württemberg,...
vec_for_angle(tmpLoc, my.pan);
vec_normalize(tmpLoc, 50);
vec_add(tmpLoc, my.x);
ent_create(..., tmpLoc, ...);

should work...

If the cube should be left or right the player add between line 1 and 2

vec_rotate(tmpLoc, xx); //(view manual)


Sry for my bad English!! I'm German!!
A7 Extra Edition
Intel Core i7-960 (4x3.2GHz), 8GB DDR3, 9800GT 1GB
My homepage: www.ultitech.de
Re: creating object / entity [Re: luckyxxl] #306713
01/24/10 11:46
01/24/10 11:46
Joined: Dec 2008
Posts: 124
bobby_danseco Offline OP
Member
bobby_danseco  Offline OP
Member

Joined: Dec 2008
Posts: 124
thank you very much laugh


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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