my.emask |= ENABLE_SCAN = off?

Posted By: Ericmor

my.emask |= ENABLE_SCAN = off? - 05/26/11 12:24

Hi people;
Iīm translating old c-scripts to Lite-C, and i know that...
Code:
my.enable_scan=on; //C-script

is now:

my.emask |= ENABLE_SCAN;//Lite-C



...but how do you write "my.enable_scan=OFF"?
Any help is appreciated, thanks in advance.
Posted By: WretchedSid

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 12:27

Code:
my.emask &= ~ENABLE_SCAN


Its btw mentioned in the manual: http://www.conitec.net/beta/flags.htm
Posted By: Ericmor

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 12:49

Thanks JustSid.
Pity, emasks canīt be set/reset/toggled like the other flags.
Code:
set(my, ENABLE_SCAN);
reset(you,ENABLE_SCAN);


It would be so more simaple frown
Posted By: WretchedSid

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 13:20

Write your own macro that does the job:
Code:
#define setEmask(ent, flag) ent.emask |= flag
#define resetEmask(ent, flag) ent.emask &= ~flag
#define toggleEmask(ent, flag) ent.emask ^= flag
#define isEmask(ent, flag) ent.emask & flag



Its just like the set, reset, toggle and is macros that are already defined for you in the engine.
Posted By: Quad

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 13:30

there is also an undocumented reset_emask(); function, when called from inside an event, it resets that event from the emask.

the function is placed right after the set/reset macros in acknex.h
Posted By: Ericmor

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 13:41

Thanks, JustSid and Quadraxas!
I just copy/pasted your code in my acknex.h!
Seriously, seems like a good analysis inside acknex.h, Litec.h, compat.h and afuncs.h and all pre-defined scripts are necessary for a good understanding of the Lite-C... i tought all i needed was the tutorials, but thatīs far from the truth... specially for big projects.
Thanks again!
Posted By: WretchedSid

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 13:46

Originally Posted By: Ericmor
I just copy/pasted your code in my acknex.h!

DON'T do this! Acknex.h doesn't belong to you but to the engine, you should only edit files that belong to you!
Posted By: Quad

Re: my.emask |= ENABLE_SCAN = off? - 05/26/11 14:06

yeah, instead of doing that just include acknex.h
Posted By: Ericmor

Re: my.emask |= ENABLE_SCAN = off? - 05/27/11 00:13

...what?!?
I have a copy of acknex.h inside my project folder (to preserve the original)... i canīt have that?!?
Even owning the full license?
Well, placing the code in another location (inside the initial script maybe) would affect it in any way?
Posted By: Ericmor

Re: my.emask |= ENABLE_SCAN = off? - 05/27/11 01:22

Well, i deleted the lines from acknex.h and declared it in the main game.c, right after the acknex.h includes... the engine didnīt complained, so i guess it worked (canīt be sure, i still have 10000 lines of C-script to translate, lol)!
Posted By: JibbSmart

Re: my.emask |= ENABLE_SCAN = off? - 05/27/11 01:51

It's not a legal thing. The thing is, acknex.h will change with the free updates. It'll either override your changes, or (in the case that you have a copy in your folder) the folder version won't get updated.

That's all.

Jibb
© 2024 lite-C Forums