Gamestudio Links
Zorro Links
Newest Posts
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/17/26 07:16
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Quad), 3,455 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 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 | 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