Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,529 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2 events / 1 action #340825
09/07/10 20:35
09/07/10 20:35
Joined: Sep 2009
Posts: 155
France
ayks Offline OP
Member
ayks  Offline OP
Member

Joined: Sep 2009
Posts: 155
France
hello :|

is it possible to put 2 events in 1 action, cause i'm trying to do it but only the second action is executing.

Quote:
action bide()
{
my.event=emovisible();
wait(1);
my.event=show_panels;my.enable_scan=on;
}


"my.event=emovisible();" is not executing in game

any idea why ? tried to change wait(1) by wait(10) but it dont work

Re: 2 events / 1 action [Re: ayks] #340827
09/07/10 20:37
09/07/10 20:37
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
You have to delete the () after emovevisible laugh

Like
Code:
my.event=emovisible;


this.


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: 2 events / 1 action [Re: Liamissimo] #340828
09/07/10 20:45
09/07/10 20:45
Joined: Sep 2009
Posts: 155
France
ayks Offline OP
Member
ayks  Offline OP
Member

Joined: Sep 2009
Posts: 155
France
hmm thanks for answer but it unfortunately dont change anything :s
i ll edit if i find a solution :y

edit : i removed the () after "bide"

action bide() and looks like it works, weird but ok :s

Last edited by ayks; 09/07/10 20:49.
Re: 2 events / 1 action [Re: ayks] #340831
09/07/10 20:55
09/07/10 20:55
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
This couldn't be the solution. I mean you have a syntax error and with it is working? o.O What Version are you using? WED->Help->About WED


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: 2 events / 1 action [Re: Liamissimo] #340833
09/07/10 21:09
09/07/10 21:09
Joined: Sep 2009
Posts: 155
France
ayks Offline OP
Member
ayks  Offline OP
Member

Joined: Sep 2009
Posts: 155
France
i guess i have mass minor syntax error but its ~fine until now :x
and dunno why it works for this one smirk
and i use version 7.82 of wed

Re: 2 events / 1 action [Re: Liamissimo] #340834
09/07/10 21:14
09/07/10 21:14
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
some small info:
this code is really bad:
Code:
action bide()
{
my.event=emovisible();
wait(1);
my.event=show_panels;my.enable_scan=on;
}



i think i should explain your errors:
Code:
action bide()
{

all okay

Code:
my.event=emovisible();

wrong, your function "emovisible" will return anything and it's not you function pointer

Code:
wait(1);

Event will never be called because you have no emask or enable_*
This is good, because your program will crash with the code above

Code:
my.event=show_panels;my.enable_scan=on;

This code contains no errors, but your old, wrong event definition will be overwritten by your new! That's why your program don't call both event functions and so it don't crash! Also the event "scan" will be activated


if you want two event function, write something like this:

Code:
function bide_event()
{
    emovisible();
    show_panels();
}
action bide()
{
    my.event=bide_event;
    my.enable_scan=on;
}



but i don't understand your need of two events, because you only activated ENABLE_SCAN!

Hope it helps
Richi007


Visit my site: www.masterq32.de
Re: 2 events / 1 action [Re: MasterQ32] #340839
09/07/10 22:02
09/07/10 22:02
Joined: Sep 2009
Posts: 155
France
ayks Offline OP
Member
ayks  Offline OP
Member

Joined: Sep 2009
Posts: 155
France
thanks for your explanation, i will read it a second time :y

+ i know im bad, nothing new laugh

btw i need 2 events because i'm trying to do something but im confused so i probably do nonsense things :s

re-edit : i think u would surely cry at the view of my code because its massively bad laugh (maybe u already cry at the view of my english :y)

re-edit : thanks for your post, it helped me to understand some things.

re-edit : theliam u was right :y

re-edit : last question if anyone pass by here :

now all work when the player scans the entity, but one problem is left :
when the player stop to scan the entity (after have scanned it) i want to call another function, but its more difficult than this and i dunno how to do it for now --

for information, i'm trying to make an 'emo' appears above the entity for show that the player can talk to it. (like in classic rpg)

edit :

i did it with
Quote:
while (event_type == EVENT_SCAN)
{
wait(1);
}
var=0;


so, clear.

complete code :

Quote:
function bide_event()
{
emoon=1;
show_panels();
while (event_type == EVENT_SCAN)
{
wait(1);
}
emoon=0;
}

action bide()
{
my.event=bide_event;my.enable_scan=on;
}


Last edited by ayks; 09/07/10 23:49.
Re: 2 events / 1 action [Re: ayks] #340882
09/08/10 10:04
09/08/10 10:04
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Code:
#define ACT_EMO_ON skill99
function bide_event()
{
    show_panels();
    switch(event_type)
    {
        case EVENT_SCAN:
            if(you)
                emoon = you.ACT_EMO_ON;
            break;
    }
}

action bide()
{
my.event=bide_event;my.enable_scan=on;
}



your old code was bad, because every frame you get a new function, so your game will slow down very fast at a very low framerate

in this code you only need to c_scans!
the first is called like this:
Code:
my.ACT_EMO_ON = 1;
c_scan(...);//your scan code


now your variable emoon = 1

the second one looks like this:
the first is called so:
Code:
my.ACT_EMO_ON = 0;
c_scan(...);//your scan code


now your emoon = 0

this variant saves you many frametime and will be much easier to handle for the engine
try it...


Visit my site: www.masterq32.de
Re: 2 events / 1 action [Re: MasterQ32] #340928
09/08/10 17:53
09/08/10 17:53
Joined: Sep 2009
Posts: 155
France
ayks Offline OP
Member
ayks  Offline OP
Member

Joined: Sep 2009
Posts: 155
France
ok, thanks, too complicated for me but i ll try to make it this way now :|


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