Action on Objects not working!

Posted By: tasha19

Action on Objects not working! - 12/03/10 03:48

if i run on WED, a message box will appear and say that the <army_lights>(which is the name of my action that has its function on SED):Action not found

this is the simple code i made in SED:
//////////////////////////////////////////
BMAP* cursor_pcx = "mousebmp.pcx";

function highlight_event()
{
if (event_type == EVENT_CLICK)
my.ambient = 100;
my.lightrange = 200;
}
else if (event_type == EVENT_RELEASE)
{
my.ambient = 0;
my.lightrange = 0;
}
}

action army_lights()
{

my.emask = ENABLE_CLICK | ENABLE_RELEASE;
my.event = highlight_event;
}

function main()
{
//video_screen = ; // start in full screen mode
//screen_size.x = 500;
//screen_size.y = 400;
level_load ("asas.wmb"); // load the level
mouse_mode = 2; // show the mouse pointer
mouse_map = cursor_pcx; // set the mouse pointer bitmap

while (1)
{
mouse_pos.x = mouse_cursor.x; // allow the mouse pointer to move
mouse_pos.y = mouse_cursor.y; // on the x and y axis
wait (1);
}
}
/////////////////////////////////
is there something i missed to put into? or is there a problem in my code?
Posted By: Liamissimo

Re: Action on Objects not working! - 12/03/10 06:24

I don't know if it changes something but emask has to be set like this:

my.emask |= ....

You've forgot the |
Posted By: MasterQ32

Re: Action on Objects not working! - 12/03/10 09:08

Originally Posted By: TheLiam

my.emask |= ....

no, this shouldn't make any difference, because it's only a logic or and not any special operator!

But did you include acknex.h??
if not, include this file and try again!
Posted By: tasha19

Re: Action on Objects not working! - 12/03/10 11:01

yes i have added acknex.h, and i also tried to put the '|' in the my.emask, but it didn't make any difference.. frown
Posted By: MasterQ32

Re: Action on Objects not working! - 12/03/10 12:08

did you include your scipt into your level?
Posted By: berkay

Re: Action on Objects not working! - 12/03/10 15:25

Which version are using
© 2023 lite-C Forums