Gamestudio Links
Zorro Links
Newest Posts
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
4 registered members (AndrewAMD, ozgur, AbrahamR, wdlmaster), 849 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Problem with events #318457
04/07/10 20:03
04/07/10 20:03
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline OP
Senior Member
Roel  Offline OP
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Hey guys,

I have a little problem with events.
I assigned an action to an entity, with an EVENT_IMPACT emask,
but it seems that the event is not triggered at all, nothing happens
after searching the manual, I got the Idea that my code should work... Maybe some one else can spot the mistake
here is the code:

Click to reveal..

function event_collect()
{
my.z+=100;
}
action target_collect()
{
my.emask |= (EVENT_IMPACT);
my.event = event_collect;
}



the idea is to check if the event is triggered, which can be seen because the entity... jumps


it might be that I forgot something else, maybe some things work different in A7?
It looks like a beginners question to me, but I would really appreciate your help

Thanks in advance


Check out the throwing game here: The throwing game
Re: Problem with events [Re: Roel] #318465
04/07/10 20:36
04/07/10 20:36
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
The code should work, have you add this action to the entity?
Try to make a sys_exit() in the action and if the Engine shut down you know the action works. Then make the same in the event_collect...

Re: Problem with events [Re: Widi] #318471
04/07/10 20:43
04/07/10 20:43
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline OP
Senior Member
Roel  Offline OP
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
I have already tried the sys_exit, but nothing
the action is added, I checked it with shift-f11

but thank you for your answer


Check out the throwing game here: The throwing game
Re: Problem with events [Re: Roel] #318472
04/07/10 20:46
04/07/10 20:46
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
what nothing? The Engine don`t shut down or what?

Re: Problem with events [Re: Roel] #318477
04/07/10 21:28
04/07/10 21:28
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Perhaps the reorganizing of your code would help, like this:
Code:
function event_collect()
{
my.z+=100;
}
action target_collect()
{
if(event_type == EVENT_IMPACT) event_collect();
}

myent=ent_create(file_of_ent,vector_of_ent,target_collect);
myent.emask |= (EVENT_IMPACT);
myent.event = event_collect;



Last edited by Aku_Aku; 04/07/10 21:37. Reason: removing syntax errors
Re: Problem with events [Re: Widi] #318543
04/08/10 10:48
04/08/10 10:48
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline OP
Senior Member
Roel  Offline OP
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
I got it:

In my code emask was set to EVENT_IMPACT, but it must have been ENABLE_IMPACT laugh

Quote:
what nothing? The Engine don`t shut down or what?

sorry, I meant that the engine did not shut down.
what ever I tried to put in the event, nothing happens




Check out the throwing game here: The throwing game
Re: Problem with events [Re: Roel] #318581
04/08/10 15:40
04/08/10 15:40
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Originally Posted By: Roel
I got it:

In my code emask was set to EVENT_IMPACT, but it must have been ENABLE_IMPACT laugh


WOW, How could of we missed that mistake. Sorry Roel.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus

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