Gamestudio Links
Zorro Links
Newest Posts
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 (AndrewAMD, ozgur), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Click on Entity.[CLOSED] #290732
09/20/09 22:20
09/20/09 22:20
Joined: Nov 2008
Posts: 26
France
H
Hirogens Offline OP
Newbie
Hirogens  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 26
France
Hi,

How to intercept a click on Entity ?

regards

Last edited by Hirogens; 09/20/09 22:57.

A7 Commercial License.
http://www.wormhole-the-game.com

AMD64 6000+, GTX 280 2GB, 4 GB Ram, Seven
Re: Click on Entity. [Re: Hirogens] #290736
09/20/09 22:32
09/20/09 22:32
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
In the entity's function set "my.emask |= ENABLE_CLICK;" and for example "my.event = mouse_event;"
The function might look like:
Code:
function mouse_event() 
{
  if (event_type == EVENT_CLICK) 
  {
    //entity has been clicked! do whatever you want to do!
  }
}




GameStudio Version: A7 Pro v7.86
Re: Click on Entity. [Re: garv3] #290739
09/20/09 22:44
09/20/09 22:44
Joined: Nov 2008
Posts: 26
France
H
Hirogens Offline OP
Newbie
Hirogens  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 26
France
thanks,

but have you an explicite example...

regards


A7 Commercial License.
http://www.wormhole-the-game.com

AMD64 6000+, GTX 280 2GB, 4 GB Ram, Seven
Re: Click on Entity. [Re: Hirogens] #290741
09/20/09 22:54
09/20/09 22:54
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
I'll write an example down:
Code:
function entity_event()
{
  if (event_type == EVENT_CLICK) 
  {
    ent_remove(me);
  }
}

action entity_action()
{
  my.emask |= ENABLE_CLICK;
  my.event = entity_event;
}



If you assign the action "entity_action" to an entity it will be removed if you click it.
But be sure that:
1st: mouse_range is at least the distance between camera and entity
2nd: mouse_mode = 1 or 2

derGarv


GameStudio Version: A7 Pro v7.86
Re: Click on Entity. [Re: garv3] #290742
09/20/09 22:57
09/20/09 22:57
Joined: Nov 2008
Posts: 26
France
H
Hirogens Offline OP
Newbie
Hirogens  Offline OP
Newbie
H

Joined: Nov 2008
Posts: 26
France
thanks,

My error was : mouse_mode missing


regards...


A7 Commercial License.
http://www.wormhole-the-game.com

AMD64 6000+, GTX 280 2GB, 4 GB Ram, Seven
Re: Click on Entity. [Re: Hirogens] #290743
09/20/09 22:58
09/20/09 22:58
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
You're welcome!


GameStudio Version: A7 Pro v7.86

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