Monday, February 15, 2010

FlashDevelop support

FlashDevelop is an OpenSource editor and compiler that creates swf files. It has some limitations that Flash itself does not have but the great advantage of being free. I have also found it seems to generate slightly larger swf files but this is a minor limitation.

FlashDevelop appears to require all actionscript code must be in a class, and fails to compile it you use global functions or variables.

This is a major limitation for Slave Maker as the general structure of Slaves and Assistants is a collection of global functions that the code game calls to show graphics or do events. The slave/assistant's swf file is loaded into a MovieClip in the core game and the methods called as needed. A MovieClip inherits from the base class Object and can have unrestricted member functions and variables, and you can create variables at run-time.

To handle FlashDevelop I have created a base class
and now the slave/assistant swf file is loaded and associated with an instance of this class. For backward compatibility SlaveModule inherits from MovieClip and thus work as currently.

So to use Flash develop the game will need you to extend the class SlaveModule. The class has many vurtual methods and you will have to populate them similarly to now, so you will write the method

public function ShowSexActFuck() {

similarly to how previously you

function ShowSexActFuck()

Note the class you develop must be named for the slave, so Akane's class would be Akane.

Also the output swf file must be named either (replace Akane with your slave's name)

There are also some peculiarities for FlashDevelop, there is not FLA file so you must create all MovieClips at runtime. In FlashDevelop any images are added to the library and are included in the swf file, but are not MovieClips.

You have to create a MovieClip and load the image at runtime using attachMovie.

I have provided support functions, to load the movie and show the movie

private function LoadMovie(movie:String) : MovieClip

you can use ShowMovie on the returned MovieClip here or just call the next function

private function LoadAndShowMovie(movie:String, main:Boolean, align:Number, gframe:Number) : MovieClip

The last peculiarity is that SlaveModule has a member
private var BaseMovie:MovieClip;

This is the MovieClip the swf is loaded into and the MovieClip that all movies should be loaded into (as LoadMovie and LoadAndShowMovie use)

When I release the new SDK there will be an example assistant using this method and slave girl to provide examples.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.