Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
0 registered members (), 1,472 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 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 | 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