OpenSpace 2.0 officially released
We are creating a game where the user is able to customize his/her floor. At the moment we are using items that take up the entire area of the tile, so the user can drag and drop tiles onto his/her room. So whenever the user drags a tile over another tile, we would like for the old tile to be removed.bax wrote:This is not possible. Can you better describe the reason behind this request, so we can evaluate it.warhell wrote:Is there anyway to have tiles replace other tiles instead of just stack? Example, a project I'm working on contains tile items (floor tiles). I would like it such that if a user places a tile on top of another tile, the old tile is replace by the new tile, instead of having them stack.
Also, is there an ETA on when NPC implementation will be available?
The "ghost" is another avatar (which means that on the client-side its class extends Avatar just like the regular one) which is placed in a layer on top of the isometric map. It can be useful to display, for example, the avatar balloon, or the avatar name. The example provided show the usage of the ghost.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Is there a way to avoid using the Flash authoring tool (Flash CS4) to create the avatar SWC? I'm creating avatars by loading a 3D image via Papervision, so I really have no need to use the authoring tool, all I use is .as classes. Is there a way to generate the SWC at run-time when I compile my Flex project? Is it possibly to bypass using a SWC and just pass in the .as class to OpenSpace?
Last edited by warhell on 25 Mar 2010, 18:17, edited 1 time in total.
Yes. We used the SWC as we need external graphical assets, built with Flash. But if you have a pure actionscript avatar class, there's no need you create an swc. In your main application class simply create a variable pointing at your class (ie: var avatar:MyCustomAvatarClass), so that the compiler includes it in the compiled application SWF. At runtime the class will be available in the default application domain, and OpenSpace will be able to get a reference to it and instantiate it.warhell wrote:Is there a way to avoid using the Flash authoring tool (Flash CS4) to create the avatar SWC? I'm creating avatars by loading a 3D image via Papervision, so I really have no need to use CS3, all I use is .as classes. Is there a way to generate the SWC at run-time when I compile my Flex project? Is it possibly to bypass using a SWC and just pass in the .as class to OpenSpace?
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Thanks a lot! I implemented the changed and it compiles fine, but the avatar is not showing up and I get the following run-time error...bax wrote:Yes. We used the SWC as we need external graphical assets, built with Flash. But if you have a pure actionscript avatar class, there's no need you create an swc. In your main application class simply create a variable pointing at your class (ie: var avatar:MyCustomAvatarClass), so that the compiler includes it in the compiled application SWF. At runtime the class will be available in the default application domain, and OpenSpace will be able to get a reference to it and instantiate it.warhell wrote:Is there a way to avoid using the Flash authoring tool (Flash CS4) to create the avatar SWC? I'm creating avatars by loading a 3D image via Papervision, so I really have no need to use CS3, all I use is .as classes. Is there a way to generate the SWC at run-time when I compile my Flex project? Is it possibly to bypass using a SWC and just pass in the .as class to OpenSpace?
[OpenSpace|ERROR] (0500) Invalid avatar type passed during avatar creation
log: AVATAR CREATION ERROR: Missing 'DemoAvatar' class definition in avatars application domain for 'demo' avatar type
I just removed the SWC from the Flex project and added a variable that points to my avatar class (DemoAvatar).
EDIT: It looks like the issue has to do with me not setting openspace.avatarAppDomain correctly, when and how would I set the avatarAppDomain?
EDIT 2: I tried pointing the avatarAppDomain to the current domain (since that is where the class is loaded) by doing the following...
openspace.avatarAppDomain = ApplicationDomain.currentDomain;
But that didn't seem to solve the issue
Yes, The name of the file is "DemoAvatar.as", and I have the following line in the config file...
It seems like openspace cannot find the class in the application domain.
Code: Select all
<AvatarTypes use8Directions="1">
<!--AvatarType mainClass="DemoAvatar" ghostClass="DemoGhost" stature="55">demo</AvatarType-->
<AvatarType mainClass="DemoAvatar" stature="55">demo</AvatarType>
</AvatarTypes
Avatar Creation in Flash
Hi Bax,
I have been trying to replicate getting avatar into the flash example provided. I used the avatar class files and avatar swf from the flex example. But i was not able to do it successfully.
I was able to succeed in one case:
1. Copied both DemoAvatar.as and DemoGhost.as files to the directory where main flash file exists.
2. Copied the avatar movie clips from DemoAvatarContainer file to library of OsExampleFlash file
This way i was able to render avatar but i would like to achieve it without putting the movie clips into main file library.
Any pointers would be of great help..
Thanx a lot for the great engine guys..You rock..

I have been trying to replicate getting avatar into the flash example provided. I used the avatar class files and avatar swf from the flex example. But i was not able to do it successfully.
I was able to succeed in one case:
1. Copied both DemoAvatar.as and DemoGhost.as files to the directory where main flash file exists.
2. Copied the avatar movie clips from DemoAvatarContainer file to library of OsExampleFlash file
This way i was able to render avatar but i would like to achieve it without putting the movie clips into main file library.
Any pointers would be of great help..
Thanx a lot for the great engine guys..You rock..
The DemoAvatar class has no package? If yes, you have to enter the full package and class name, for example: com.mypackage.avatara.DemoAvatarwarhell wrote:Yes, The name of the file is "DemoAvatar.as", and I have the following line in the config file...
It seems like openspace cannot find the class in the application domain.Code: Select all
<AvatarTypes use8Directions="1"> <!--AvatarType mainClass="DemoAvatar" ghostClass="DemoGhost" stature="55">demo</AvatarType--> <AvatarType mainClass="DemoAvatar" stature="55">demo</AvatarType> </AvatarTypes
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: Avatar Creation in Flash
http://forums.smartfoxserver.com/viewtopic.php?t=7094sidigrid wrote:Hi Bax,
I have been trying to replicate getting avatar into the flash example provided. I used the avatar class files and avatar swf from the flex example. But i was not able to do it successfully.
I was able to succeed in one case:
1. Copied both DemoAvatar.as and DemoGhost.as files to the directory where main flash file exists.
2. Copied the avatar movie clips from DemoAvatarContainer file to library of OsExampleFlash file
This way i was able to render avatar but i would like to achieve it without putting the movie clips into main file library.
Any pointers would be of great help..
Thanx a lot for the great engine guys..You rock..
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team