Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,586 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Why can't I get events to work? #186337
02/29/08 00:08
02/29/08 00:08
Joined: Mar 2006
Posts: 12
D
DeMante Offline OP
Newbie
DeMante  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 12
If I do

my.event = pick_or_drop;

It does nothing, it never get's to the pick_or_drop function. But if I do this:

my.event = pick_or_drop();

Then it goes to the function, but only once and not when it's suppose to!

I got the code straight out of AUM.

Re: Why can't I get events to work? [Re: DeMante] #186338
02/29/08 07:42
02/29/08 07:42
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
you have to declare what acctivates your event, like enable_scan, enable_touch ...
f.e.:

my.enable_scan = on;
my.event = pick_or_drop;

Re: Why can't I get events to work? [Re: kasimir] #186339
03/01/08 03:10
03/01/08 03:10
Joined: Mar 2006
Posts: 12
D
DeMante Offline OP
Newbie
DeMante  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 12
I did, I copied the exact code out of AUM. I can't get any sort of event to work.

Re: Why can't I get events to work? [Re: DeMante] #186340
03/01/08 09:33
03/01/08 09:33
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Could you please post the code of the action (where the events are attached to the action) and the event function?

Re: Why can't I get events to work? [Re: Xarthor] #186341
03/01/08 09:48
03/01/08 09:48
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
this works:
Code:


function event_item_pickup
{
if(event_type == event_click || (event_type == event_scan && indicator == _click))
{
snd_play(click_wav,100,0);
check_for_inventory(my._item);
}
}


action item_pickup
{
my.enable_click = on;
my.enable_scan = on;
my.event = event_item_pickup;
}



Re: Why can't I get events to work? [Re: kasimir] #186342
03/01/08 13:40
03/01/08 13:40
Joined: Mar 2006
Posts: 12
D
DeMante Offline OP
Newbie
DeMante  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 12
Some of that code was generating some errors for me so I changed it to this. I added some comments to explain a little more.

function event_item_pickup
{
if(event_type == event_click || (event_type == event_scan)) //it didn't like the if event that you gave me for some reason.
{
//snd_play(click_wav,100,0); //i don't have any wav files in my project
//check_for_inventory(my._item); //is this a custom functin?

temp.x = pointer.x; //this stuff is to move a 3d object
temp.y = pointer.y;
temp.z = 200; // move the object 200 quants below the camera, play with this value
vec_for_screen(temp.x, camera);
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
}
}


action item_pickup
{
my.enable_click = on;
my.enable_scan = on;
my.event = event_item_pickup;
}

Re: Why can't I get events to work? [Re: DeMante] #186343
03/01/08 13:41
03/01/08 13:41
Joined: Mar 2006
Posts: 12
D
DeMante Offline OP
Newbie
DeMante  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 12
oh I forgot to say, it still doesn't work. I put a break point into the event_item_pickup and nothing happens.

Re: Why can't I get events to work? [Re: DeMante] #186344
03/01/08 15:11
03/01/08 15:11
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Who/what is the action item_pickup assigned to?

Re: Why can't I get events to work? [Re: tindust] #186345
03/01/08 18:38
03/01/08 18:38
Joined: Mar 2006
Posts: 12
D
DeMante Offline OP
Newbie
DeMante  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 12
a 3d model.

Re: Why can't I get events to work? [Re: DeMante] #186346
03/01/08 18:55
03/01/08 18:55
Joined: Aug 2005
Posts: 312
Sweden
tindust Offline
Senior Member
tindust  Offline
Senior Member

Joined: Aug 2005
Posts: 312
Sweden
Try if:

if(event_type == event_click)

alone works, just to begin to narrow down where the problem is.


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