Page 1 of 1

Setting OLD_LinkedObjId

Posted: 24 Jul 2009, 04:23
by anilone
I am trying to set a linked object to attach a movie clip using OpenSpace Trial version.
I did the following steps for the same.

1. Created a skin with a Movie Clip on it
2. Created a tile and set OLD_LinkedObjId to the above created skin, which was availble on Skin library
3. Place the tile on map.
4. Create another tile with the above skin ( created in step 1) and place on map
5. Export the map xml and used in Flash (Adobe CS4 & AS3)
6. When I tried

Code: Select all

var mapObject1:Sprite = evt.params.linkedMapObject as Sprite
i am Getting NULL only. What is wrong with my approach?

I have compare the map xml of Ranch example and my XML and found that my map dXML doesn't have objectId property set ( like objectId="ranchWing2"). I think if this property is set correctly in my map xml, i would get the correct linked object from AS. Please advise?

Posted: 27 Jul 2009, 09:00
by Bax
Yes, you have to set the objectId property on the skin instance. Edit the tile containing the skin in the Editor, click on the skin and open the instance properties panel. There you will find where to set that property.

Posted: 17 Sep 2009, 18:07
by Banjosan
Hi Paolo,

I have the same problem. "objectId" doesn't appear in the xml when exporting a map. I simply can't figure out why. Here's what I do:
- In the map editor, I select a walkable tile
- Open the panel for "Tile instance properties"
- Set the input field "Name" to "WhatEver"
- Click "Update map"
- Export the map

But no attribute "objectId= WhatEver" appears in the "skin" xml-node.
I'm sure it's just me being unable to grasp the concept. :)
Can you help me?

Søren

Posted: 18 Sep 2009, 03:46
by krazl
I know the solution..

Seems Flash cant detect sprite straight from code...

Do below will save all your problems.

Code: Select all

var mapObject:Object = evt.params.linkedMapObject
var mapMC:MovieClip = mapObject as MovieClip;

Posted: 18 Sep 2009, 06:03
by Banjosan
Thanks for the reply Krazl.
But I'm afraid that it's not the answer to my problem.

The problem is in the export of the map from the Openspace editor. When opening the exported map xml-file in a text editor I would expect to find something similar to:
<skin className="SensorE" objectId="WhatEver"/>

But there isn't any attribute "objectId" to find anywhere. :/

Posted: 18 Sep 2009, 07:05
by anilone
The surprising thing is that if you export map Ranch (Outside) [m0] of the FarWest_Ranch example provided with OpenSpace engine, it generate correct object id, you can see the entry like

<skin className="RanchMain1" cache="1" objectId="ranchMain1"/>

I dont know whether I am missing something, But for our object id, it wont generate the xml entry. I have to give it manully after export every time i update the map.

Posted: 18 Sep 2009, 09:02
by Bax
Banjosan, as you need to set the skin's objectId, you have to set it on the skin instance, not on the tile instance. So, go to the Tile editor, open the tile containing the skin you are considering, open the skin instance properties pane and set the "Name (OLD objectId)" parameter.

Posted: 18 Sep 2009, 10:22
by Banjosan
Thanks Bax,

I knew the solution had to be simple. Sorry for being that stupid. :/
Am I then correct in presuming that the editor is prepared for setting a tile specific id-reference in the next version of Openspace? (Would be a rather cool feature) :)

Posted: 18 Sep 2009, 14:46
by Bax
Yes exactly, the way to get a reference to objects on the map will be a little different in the next release.