problems with entity clicking

Posted By: Ilidrake

problems with entity clicking - 04/30/08 02:34

I have a level built with 1 entity. I want to be able to click the unit and have a panel pop up. Only when i click over it nithing happens. Can someone help me out with this one? I'm giving the action to the building in WED.

function build_units()
{
if (event_type == EVENT_CLICK)
{
build_gui_pan.visible = on;
return;
}
}

//uses:Available_Slots
action on_click_dock
{
my.enable_click = on;
my.event = build_units;
}
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 03:42

do i need to get the vector positions of the entity with vec_for_screen first before i can click them?
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 03:57

come on guys. aint there someone who can help me?
Posted By: Quad

Re: problems with entity clicking - 04/30/08 04:24

check your mouse mode.
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 04:29

mouse_mode = 2;

is this correct?
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 04:33

This is really aggriavting. This is one reason I've never completed anything with this engine because things dont work and it makes me wonder if its my code or a bug in the engine? And its hard to get any help.
Posted By: Quad

Re: problems with entity clicking - 04/30/08 04:47

Because it is already written in the manual if it is correct or not.

try mouse_mode = 4; or use

vec_set(mouse_pos,mouse_cursor);
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 04:49

I've read thru the manual several times trying to get this to work but to no avail. Thank anyway
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 04:56

i tried this just to see if anything was going on:

if(mouse_left == 1) // left Mousebutton pressed?
{
if(mouse_ent)
{
ent_remove(mouse_ent); // remove clicked Entity
}
}
Nothing! Anyone else have any clues? Does the pitch and arc of the camera have anything to do with this?
Posted By: Serex

Re: problems with entity clicking - 04/30/08 05:29

this is the code i use. works fine, in lite-c \:D

 Code:
// Resources Used
BMAP* bHudCursor 	=  "resources/tga/cursor.tga";
BMAP* bHudCursorDown 	= 	"resources/tga/cursor_down.tga";

function createMouse() 
{
	// Mouse Mode
	// 	0 	None Visible
	// 	1 	Visible, Controllable
	//	2	Visible, Not Controllable
	mouse_mode 	= 2;
	
	mouse_map 	= bHudCursor;		// Image for the cursor to use
	mouse_spot.x 	= 1; 			// make the tip of the arrow pointer the hot spot area
	mouse_spot.y 	= 1; 			// (1, 1 on the mouse pointer bitmap)   
}

function updateMouse()
{	

	// Check If Mouse Button Has Been Clicked
	// If So Then Change The Mouse Map
	if (mouse_left == 1 || mouse_right == 1 || mouse_middle == 1)
	{
		mouse_map = bHudCursorDown;	// Active Cursor (clicked)
		
		if (mouse_ent != player && mouse_middle)
		{
			ptr_remove(mouse_ent);	
		}
	}
	else
	{
		mouse_map = bHudCursor;		// Normal Cursor
	}
	
	// Update the position of the cursor
	vec_set(mouse_pos, mouse_cursor);
}


Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 05:52

well i tried that as well but it's like i can't click on anything inside the view. And i've tried dropping another model inside but nothing. Anyone wanna buy a copy of 3DGS A6 Comm. Real cheap! Like 5 bucks and it's yours cause i'm tired of messing with it.

The arrow changes and everything and I had to change ptr_remove to ent_remove but the models themselves r doing nothing
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 06:17

The worst part about this is i've actually made alot of progress setting up my camera movements and GUI system. Modeling and skinning everything. And now the stupid engine wont even click on a model and do what it's supposed to do.
Posted By: vlau

Re: problems with entity clicking - 04/30/08 06:33

Actually, you need to update the mouse_pos frequently :
which means put them inside a loop.

Look at the example from the mighty Manual->mouse_cursor.
Posted By: Joey

Re: problems with entity clicking - 04/30/08 09:42

and check your mouse_range.
Posted By: tompo

Re: problems with entity clicking - 04/30/08 12:11

try add
my.enable_touch = on;
enable_mouse = on;
my.untouchable = off;
and check mouse_range;
Posted By: Ilidrake

Re: problems with entity clicking - 04/30/08 15:42

Well after all of this i just discovered it's the mouse_range. I had to set it to 20000 for this to work.Thanks for the help everyone.
© 2024 lite-C Forums