Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Why action and event handler pair ? [Re: Joey] #249123
01/31/09 15:59
01/31/09 15:59
Joined: Sep 2003
Posts: 928
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 928
Then you only catch the last event, unless you use a mor complicated variant, like this:

function event_check()
{
my.skill55 |= (1<<event_type);
}

Then in the while loop, you check if the flags (1<<EVENT_ENTITY) and so on of skill55 are set, and if yes you know that event was triggered, and set the flag back.

Only thing that this does not catch is when two events of the same kind happen per frame, or when you need other event parameters like "normal" or "target", then you must really use an event handler function. laugh


Re: Why action and event handler pair ? [Re: Spirit] #249136
01/31/09 16:51
01/31/09 16:51
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
what speaks against event handlers?

Re: Why action and event handler pair ? [Re: Joey] #249146
01/31/09 17:25
01/31/09 17:25
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I prefer them in myself...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Why action and event handler pair ? [Re: Quad] #249158
01/31/09 18:02
01/31/09 18:02
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Thanks for the contributions. I now can see the logic.

As an aside, skill'n' ?? why would I want to use say, skill60 for something ? My natural inclination is to use 'int' or 'float' as I have some C++ experience. Why would I want to use skill'n' ?

Along similar lines, is a 'flag' the same as as a BOOL variable in C++ ie a variable that can be just 0 or 1.

I understand that this may have developed from WED where programming is by clicking check boxes.

Thanks

Drac

Page 2 of 2 1 2

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