OpenSpace 2.0 officially released

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

laxersaz
Posts: 50
Joined: 30 Nov 2009, 16:19
Contact:

Postby laxersaz » 03 Mar 2010, 10:53

Why is that? I'm only talking about the default behavior which can be overwritten by placing tiles on top.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 03 Mar 2010, 11:02

Because the engine uses a specific approach based on tiles to handle the avatar movement. Having a different behavior on the empty parts of the map would require a specific, different logic (walkable/non-wlakable parts, depth switching, etc).
Paolo Bax
The SmartFoxServer Team
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 04 Mar 2010, 21:15

bax wrote:
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.

This is not possible. Can you better describe the reason behind this request, so we can evaluate it.


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.

Also, is there an ETA on when NPC implementation will be available?
kot
Posts: 1
Joined: 09 Mar 2010, 13:10

Postby kot » 09 Mar 2010, 14:24

warhell wrote: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.

We need this feature too :roll:
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 10 Mar 2010, 10:27

warhell wrote:Also, is there an ETA on when NPC implementation will be available?

No, sorry.
Paolo Bax
The SmartFoxServer Team
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 10 Mar 2010, 17:41

While looking through the new version of OpenSpace, I saw that in OpenSpace_server.xml contains an xml property "ghostClass". What is the significance of this?
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 10 Mar 2010, 21:19

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
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 24 Mar 2010, 18:23

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 25 Mar 2010, 09:33

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?

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.
Paolo Bax
The SmartFoxServer Team
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 25 Mar 2010, 18:35

bax wrote:
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?

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.


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...

[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 :(
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 25 Mar 2010, 20:18

Is the name of your avatar class DemoAvatar? If not, you have to enter the fully qualified name in the server-side configuration file.
Paolo Bax
The SmartFoxServer Team
warhell
Posts: 199
Joined: 18 Aug 2007, 16:49
Location: Silicon Valley, CA
Contact:

Postby warhell » 25 Mar 2010, 20:30

Yes, The name of the file is "DemoAvatar.as", and I have the following line in the config file...

Code: Select all

<AvatarTypes use8Directions="1">
      <!--AvatarType mainClass="DemoAvatar" ghostClass="DemoGhost" stature="55">demo</AvatarType-->
        <AvatarType mainClass="DemoAvatar" stature="55">demo</AvatarType>
   </AvatarTypes


It seems like openspace cannot find the class in the application domain.
sidigrid
Posts: 7
Joined: 24 Mar 2010, 04:18

Avatar Creation in Flash

Postby sidigrid » 26 Mar 2010, 02:59

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..

:D
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 26 Mar 2010, 08:34

warhell wrote:Yes, The name of the file is "DemoAvatar.as", and I have the following line in the config file...

Code: Select all

<AvatarTypes use8Directions="1">
      <!--AvatarType mainClass="DemoAvatar" ghostClass="DemoGhost" stature="55">demo</AvatarType-->
        <AvatarType mainClass="DemoAvatar" stature="55">demo</AvatarType>
   </AvatarTypes


It seems like openspace cannot find the class in the application domain.


The DemoAvatar class has no package? If yes, you have to enter the full package and class name, for example: com.mypackage.avatara.DemoAvatar
Paolo Bax
The SmartFoxServer Team
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Avatar Creation in Flash

Postby Bax » 26 Mar 2010, 08:37

sidigrid 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..

:D


http://www.smartfoxserver.com/forums/viewtopic.php?t=7094
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 35 guests