Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 02:32
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, kzhao, qin), 21,501 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 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