|
Re: How do I use event_click correctly??
[Re: Wollez]
#367560
04/14/11 18:26
04/14/11 18:26
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Welcome to the forums!
1. Don't use loops in events. 2. Don't use ENABLE_CLICK in combination with the set macro. This will do bad things. 3. Check if the action sound_on_click is ever called by placing a beep or a printf("Over here!"); in the first line of the action.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: How do I use event_click correctly??
[Re: Wollez]
#367562
04/14/11 18:33
04/14/11 18:33
|
Joined: Jan 2011
Posts: 797 Da wo du nicht bist! Muhahaha!
xxxxxxx
User
|
User
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
|
Hi, why do you use this while in your event? remove the while loop, it doesnt make sence there!
function mouse_event()
{
if (event_type == EVENT_CLICK)
{
beep();
ent_remove(me);
return();
}
}
how big is the distance btw. the camera and the objekt?(in quants) and use code tags if you want to show us parts of your code(dont forget to use "inden all" in sed) [ code ] [ /code ] without spaces xxxxxxx
Last edited by xxxxxxx; 04/14/11 18:34.
Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben!
|
|
|
Re: How do I use event_click correctly??
[Re: Wollez]
#367566
04/14/11 19:09
04/14/11 19:09
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
You used the set macro in the line "set(me,ENABLE_CLICK);". set is a macro because it gets replaced by the precompiler. After the precompiler changed your line it should look like "(me->flags |= (ENABLE_CLICK));". That is very dangerous because you set an eflag in the flags.
When you execute Redeemer's code it should work, yes. Please place a "prtinf("Here!");" in the first line of sound_on_click. Does that pop up a message box for you?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: How do I use event_click correctly??
[Re: Uhrwerk]
#367653
04/16/11 07:20
04/16/11 07:20
|
Joined: Apr 2011
Posts: 40 germany
Wollez
OP
Newbie
|
OP
Newbie
Joined: Apr 2011
Posts: 40
germany
|
Why doesn't this work? I've done all you've said, bur it still doesn't work EDIT: Found sth. if i put a printf in event_click, nothing happens. The event isn't beeing executed. But I've got no idea why. Please!! Someone help me. 
Last edited by Wollez; 04/16/11 12:40.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|