Page 1 of 2

Need help in editing the map

Posted: 28 May 2013, 10:54
by Madhav
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

Re: Need help in editing the map

Posted: 28 May 2013, 14:17
by Bax
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.

Re: Need help in editing the map

Posted: 31 May 2013, 04:32
by Madhav
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...

Re: Need help in editing the map

Posted: 31 May 2013, 06:35
by Bax
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

Re: Need help in editing the map

Posted: 05 Jun 2013, 04:44
by Madhav
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

Re: Need help in editing the map

Posted: 05 Jun 2013, 07:48
by Bax
Ouch, it seems I don't even remember what our own examples contain! Sorry! :D
Glad you found the solution.

Re: Need help in editing the map

Posted: 13 Jul 2013, 10:30
by radiateur
Oh nice! Thank you Madhav!

Re: Need help in editing the map

Posted: 13 Jul 2013, 14:27
by Madhav
@ radiateur, happy that this post helped you... :)
Credit goes to sfs team....

Re: Need help in editing the map

Posted: 29 Jul 2013, 14:00
by radiateur
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?

Re: Need help in editing the map

Posted: 29 Jul 2013, 14:14
by Madhav
Hai radiateur,
No you dont need to add it as a room extension.
Just add it as zone extension (and extend openspace extension)

Re: Need help in editing the map

Posted: 29 Jul 2013, 16:07
by radiateur
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)

Re: Need help in editing the map

Posted: 30 Jul 2013, 04:56
by Madhav
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...... :)

Re: Need help in editing the map

Posted: 30 Jul 2013, 08:54
by radiateur
wow thanks, it's great ^^, it's so simple !

I can add any kind of extension like this, great !

Re: Need help in editing the map

Posted: 13 Aug 2013, 04:30
by Madhav
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.... :(

Re: Need help in editing the map

Posted: 13 Aug 2013, 07:57
by Bax
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.