Magiic
2008-12-08 14:39:28
Using {$Define }
{$Define } although a very simple feature isn't really included in many scripts i've noticed, but although unknown it is extremely useful, for things such as SMART.
For example, instead of having to either have two scripts, one smart, one not you could simply use {$Define}
{$Define SMART}Well, what this basically does is define the thing SMART so that if you use
{$IfDef SMART}
{.include srl/srl/misc/smart.scar}
{$EndIf}it would include Smart as it has been defined (hence IfDef) if it were commented out however it wouldn't include smart as you wouldn't have defined it.
This also works in the main loop so you can use it there like so
{$IfDef SMART}
SmartSetupEx(world, false, true, false);
SetTargetDC(SmartGetDC);
{$EndIf}so yeah that's the end of my small tut, post questions if you have any please :)you can also use
{$UnDef} which does exactly what it says it removes something you have previously defined{$IfNDef} which will do something if something isn't defined, in other words the opposite of {$IfDef}
Edit:apparently ScarScript needs to be updated for this, it should be black.