Need help in editing the map

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

Moderators: Lapo, Bax

Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Need help in editing the map

Postby Madhav » 28 May 2013, 10:54

Hey,
I have a openspace map as avatar home and gave option for users to decorate it using the items i provide(using inventry).
Im creating different dynamic rooms and assigning the room variables as the map name(_os_mapId, myHome#m0_Map) for each user.

But the problem is that if a user decorates his home(edits the map) the changes are affected to all the avatars home since map is same and only room is different.
I dnt want it like that. I want the changes to take place in their home only.

Plz help me sort this out...

Thank you
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Need help in editing the map

Postby Bax » 28 May 2013, 14:17

You have to make sure that each user modifies a separate version of the map.
Read the sendAvatarToMap method description of the OpenSpace serve-side API: http://openspace-engine.com/static/serv ... index.html
If describes an high level approach to make users enter their own "home". Once the user home is created in the right way, then you can modify it without issues.
Paolo Bax
The SmartFoxServer Team
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Need help in editing the map

Postby Madhav » 31 May 2013, 04:32

Thanks Bax,
It seems I need to write a java extension that duplicates the map.
I'm really very poor in java, so if you can lead me to some example or some sample code which I can alter and use,
that would be very helpful...
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Need help in editing the map

Postby Bax » 31 May 2013, 06:35

Sorry, I don't have an example to provide.
Anyway in the OpenSpace documentation you will find instruction on creating the Extension: http://openspace-engine.com/support/manuals/extension2x
Paolo Bax
The SmartFoxServer Team
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Need help in editing the map

Postby Madhav » 05 Jun 2013, 04:44

Thanks a lot Bax,

I got the exact java code of duplicating the map at the link. Saved lot of my work.... :D

If any1 needs it here's the link - http://openspace-engine.com/static/othe ... sion2X.zip
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Need help in editing the map

Postby Bax » 05 Jun 2013, 07:48

Ouch, it seems I don't even remember what our own examples contain! Sorry! :D
Glad you found the solution.
Paolo Bax
The SmartFoxServer Team
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Need help in editing the map

Postby radiateur » 13 Jul 2013, 10:30

Oh nice! Thank you Madhav!
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Need help in editing the map

Postby Madhav » 13 Jul 2013, 14:27

@ radiateur, happy that this post helped you... :)
Credit goes to sfs team....
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Need help in editing the map

Postby radiateur » 29 Jul 2013, 14:00

Hello,

So I read about extensions, and i rewrite the extension with the example, everything in netbeans seems ok. But i'm not sure if i have to plug it as a room extension or not. Somebody could explain me this?
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Need help in editing the map

Postby Madhav » 29 Jul 2013, 14:14

Hai radiateur,
No you dont need to add it as a room extension.
Just add it as zone extension (and extend openspace extension)
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Need help in editing the map

Postby radiateur » 29 Jul 2013, 16:07

Thank you Madhav,

So it just work as as3 not compiled ? I put the jar next to Openspace Extension, as i long as i extend the Openspace class like this in the extension :

Code: Select all

 public class OsCustomExtension extends OpenSpaceExtension implements IOpenSpaceEventsListener

it works ? (excuse me it looks so simple that i'm not sure i undestand well)
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Need help in editing the map

Postby Madhav » 30 Jul 2013, 04:56

Hai,
Worked for me....
In client side (as3) send a extension request for duplication of map... And the extension will duplicate the map, creates a room (with assigned room variables) and sends avatar to the map...... :)
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Need help in editing the map

Postby radiateur » 30 Jul 2013, 08:54

wow thanks, it's great ^^, it's so simple !

I can add any kind of extension like this, great !
Madhav
Posts: 78
Joined: 27 Nov 2012, 04:41

Re: Need help in editing the map

Postby Madhav » 13 Aug 2013, 04:30

Hi,
Need help in canceling the changes made in openspace map during runtime editing!!

Here's the scenario-
Avatar is in a openspace map(whos room is never removed) and sends extension request to login to home(a openspace map). The extension creates a duplicate map and a dynamic room and sends avatar to map using cmd sendAvatarToMap. Now the avatar decorates its home(by dragging inventory items to map) and then chooses to cancel the changes by clicking cancel button [ leaveEditMode(false)]. But then the instead of reloading the current dynamic room, the room avatar was in before joining this map is getting loaded????

plz help.... :(
User avatar
Bax
Site Admin
Posts: 4332
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Need help in editing the map

Postby Bax » 13 Aug 2013, 07:57

Are you sure you are sending the avatar to the duplicated map?
Because when you cancel the editing, the map you were editing is reloaded, not a different one. Of course it is the map linked to the current Room joined by the user.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 7 guests