Gamestudio Links
Zorro Links
Newest Posts
voip phone service
by lorikob361. 05/24/24 03:33
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (VoroneTZ, Ayumi), 657 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lorikob361, LucasJoshua, Baklazhan, Hanky27, firatv
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
entity following cursor's position #400606
05/04/12 15:00
05/04/12 15:00
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
Ok, I know it sounds simple, but I just didn't manage to make it. I want an entity which follows the mouse cursor, but its Z position must be always 0. (I need this to place 3d entities in my level using just the mouse)
here's what I tried, but the engine crashes or nothing happens:

action object()
{
VECTOR* temp;
while(1)
{
temp.x = mouse_pos.x;
temp.y = mouse_pos.y;
temp.z = 0;
vec_for_screen(temp,camera);
vec_set(me.x,temp.x);
wait(1);
}
}

Re: entity following cursor's position [Re: mEnTaL] #400612
05/04/12 17:05
05/04/12 17:05
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Vector *tmp needs to be vector temp ,learned this from evilsob


Compulsive compiler
Re: entity following cursor's position [Re: Wjbender] #400621
05/04/12 18:45
05/04/12 18:45
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
I changed it to VECTOR temp and it doeasn't show an error now;
I also changed temp.z = 200 and it works.
Problem fixed. Thanks.

Last edited by mEnTaL; 05/04/12 18:59.

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