PDA

View Full Version : Drag-in commands



cbailey78
08-29-2006, 12:22 AM
Wouldn't it be alot easier to have Freeform Combo Drag-in commands than scripting? Like the drag-in commands in Game Maker.

DarkDragon
08-29-2006, 12:59 AM
As has been frequently mentioned before, the next beta will contain a compiler that lets you write scripts in a higher-level C-like language, rather than the currently assembly language.

As a sneak preview to whet your appetite, here is an example script I wrote for testing purposes; it should give you an idea of the format of the language:


script foo {
void run()
{
doSpiral(60,900);
}

void doSpiral(int maxradius, int period)
{
for(int i=0; true; i++)
{
this->X = Link->X+maxradius*Sin(i)
* (1-Abs(period-i%(2*period))/period);
this->Y = Link->Y+maxradius*Cos(i)
* (1-Abs(period-i%(2*period))/period);
Waitframe();
}
}
}


Please keep in mind the above is a preview only, and that the syntax may very well change before the next beta.

Rakki
08-29-2006, 01:06 AM
...Wow. And that would make a combo circle around Link, right? That seems quite simpler than what I've seen currently has to be done.

DarkDragon
08-29-2006, 01:33 AM
Indeed, this script makes the combo spiral around link.

_L_
08-29-2006, 08:29 AM
Aww, but I like the assembly language.

Say, what's with using "X->X" in place of "X.X" ? This scripting system doesn't have pointers, does it?

DarkDragon
08-29-2006, 12:49 PM
You'll still be able to import pure assembly if that's your bag, no worries.

The -> is pure syntax; the . is already used to access other scripts' global variables, so pointer notation is used to access the data and methods of "object" types.