Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 13,824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse problems #237412
11/20/08 02:36
11/20/08 02:36
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
I've been trying to work with my mouse i.e. clicking on entities, but even something simple like:

#include <acknex.h>
#include <default.c>

function clickE(){
if(event_type == EVENT_CLICK){
sys_exit("");
}
}

action clickF(){
my.emask |= ENABLE_CLICK;
my.event = clickE;
c_updatehull(me,1);
}
function main(){
level_load(NULL);
wait(2);
ent_create("cube.mdl",vector(50,0,0),clickF);
}


it just doesn't work. I click the cube but nothing happens. Any solutions?


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1
Re: mouse problems [Re: PlaystationThree] #237428
11/20/08 03:16
11/20/08 03:16
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
do you have mouse_mode set?

You'll want a function like:

Code:
function initMouse()
{
	mouse_map = mouseMap;	//set the mouse bitmap
	mouse_mode = 2;			//mouse mode is 1 to allow for mouse_force.x/y
	while (mouse_mode > 0) // move it over the screen
  	{  
   	vec_set(mouse_pos,mouse_cursor);	//mouse map is always on the cursor location
   	wait(1);									//avoid endless loops
  	}
}


I usually call it in function main()

Last edited by heinekenbottle; 11/20/08 03:16.

I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: mouse problems [Re: heinekenbottle] #237438
11/20/08 04:26
11/20/08 04:26
Joined: Jul 2008
Posts: 54
Taipei, Taiwan
PlaystationThree Offline OP
Junior Member
PlaystationThree  Offline OP
Junior Member

Joined: Jul 2008
Posts: 54
Taipei, Taiwan
Thanks a million man, it's working perfectly now. Thanks!!


Bet you don't know where Taiwan is lol.

"The Lord is my light and my salvation..." Psm 27:1

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