Gamestudio Links
Zorro Links
Newest Posts
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
Zorro version 3.0 prerelease!
by TipmyPip. 02/24/26 17:09
ZorroGPT
by TipmyPip. 02/23/26 21:52
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
5 registered members (Martin_HH, TipmyPip, AndrewAMD, Grant, USER0328), 5,287 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
help!! #389279
12/12/11 17:41
12/12/11 17:41
Joined: Nov 2011
Posts: 17
Caloocan City
kHimaSutra Offline OP
Newbie
kHimaSutra  Offline OP
Newbie

Joined: Nov 2011
Posts: 17
Caloocan City
this is the problem..
i want to place a pointer to a entity once I clicked it..

function scan_ent()
{
if (mouse_left == 1)
{
if(mouse_ent)
{
vec_set(mat_model.ambient_green,vector(255,0,0));
}
}
}

but I don't know how and where to put a action that will make a pointer to a entity that is clicked..
thx sirs..

Re: help!! [Re: kHimaSutra] #389282
12/12/11 18:10
12/12/11 18:10
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
mouse_ent IS the pointer to the Entity the mouse is covering ^^

so..

Code:
ENTITY* old_ent;  //a second entity pointer

function scan_ent()
{
	//check mouseklick, if mouse_ent is different NULL and if mouse_ent  is different old_ent
	if(mouse_left && mouse_ent && old_ent != mouse_ent)
	{
		//set the old_ent´s default ambients
		old_ent.ambient_red = 0; old_ent.ambient_green = 0; old_ent.ambient_blue = 0;
		//set the new entities ambients
		mouse_ent.ambient_red = 255; mouse_ent.ambient_green = 0; mouse_ent.ambient_blue = 0;
		//set old-ent to mouse_ent. The model keeps his new ambient, until another one is clicked
		old_ent = mouse_ent;
	}
}




Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: help!! [Re: Espér] #389284
12/12/11 18:39
12/12/11 18:39
Joined: Nov 2011
Posts: 17
Caloocan City
kHimaSutra Offline OP
Newbie
kHimaSutra  Offline OP
Newbie

Joined: Nov 2011
Posts: 17
Caloocan City
is this code the same as yours or wrong?
i'd just put a "me" pointer. grin

ENTITY* man;
function scan_ent()
{
if (mouse_left == 1)
{
if(mouse_ent)
{
vec_set(mat_model.ambient_green,vector(255,0,0));
man = me;
}
}
}

Re: help!! [Re: kHimaSutra] #389289
12/12/11 19:04
12/12/11 19:04
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
1) Give your posts a proper title and don't just write "Help!!".
2) Don't post twice the same code!
3) Use the "code" tag to format your code
4) This is not the same as Espers code. Ask yourself what the pointer "me" points to. Espere is right telling you that to use mouse_ent. mouse_ent is a pointer to an entity that is currently touched by the mouse pointer.

Re: help!! [Re: PadMalcom] #389345
12/13/11 09:48
12/13/11 09:48

M
mercuryus
Unregistered
mercuryus
Unregistered
M



in general:

the color vector is BGR (blue, green, red)
So you should use ...

"vec_set(mat_model.ambient_blue,vector(255,0,0));"
-> to set to blue

or
"vec_set(mat_model.ambient_green,vector(0,255,0));"
-> to set to green

otherwise your program meight crash randomly/show strange behavior (when you overwrite used memory)


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