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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (NnamueN, Akow, 1 invisible), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Learning "Events" #255141
03/08/09 00:04
03/08/09 00:04
Joined: Jan 2009
Posts: 86
Brasil - RS
D
DiegoFloor Offline OP
Junior Member
DiegoFloor  Offline OP
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
Hi!

After reading the manual, I get the idea that the event system is very important/useful for communication between entities. But what I read was not enough to actually undertand how it works!

Is there some tutorial about events? I find it really hard to navigate through all those lite-c workshops!

Re: Learning "Events" [Re: DiegoFloor] #255144
03/08/09 01:09
03/08/09 01:09
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
I don't know better for now than show you the links to the online manual to start with them:

http://www.conitec.net/beta/aentity-event.htm

http://www.conitec.net/beta/aent-scan_entity.htm

Try to build simple functions build on that. It is quite complicated.

Probably, in some issues of the AUM Magazine are articles about that, but I don't know where.

Re: Learning "Events" [Re: Pappenheimer] #255150
03/08/09 05:00
03/08/09 05:00
Joined: Jan 2009
Posts: 86
Brasil - RS
D
DiegoFloor Offline OP
Junior Member
DiegoFloor  Offline OP
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
Thanks for the response Pappenheimer smile

I'm a little uncertain of what's going on, but I managed to make it work!

Re: Learning "Events" [Re: DiegoFloor] #255170
03/08/09 11:46
03/08/09 11:46
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Some hints:
Let's think of a special event:
let's say an npc pushes another.
You can scan each frame, but it is better to scan in a certain situation only, for instance when the player pushes the push button, or when the npc pushes another, means he is in an attack state and has reached a certain distance to the other, then call c_scan.
In case you have a lot scans within the game, and the more complex your world gets the more you need to assure that they don't interfere, then you should give each scan a scan id.
And, to assure that the other isn't pushed several times from a single event you have to switch the event off (my.event = NULL;)
Probably, you play a sound as well, and that sound should play only once, too.

But, when you set the event to zero, you have to switch it on, at least in the attack state (my.event = npc_event;), before you can use it again.

I describe it as it is in A6 - there could be slightly changes in A7, though.


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