Acces tile's skin references after map is generated.

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

Moderators: Lapo, Bax

Post Reply
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Acces tile's skin references after map is generated.

Post by radiateur »

Helllo,

I already know how to catch a mouse-event to a skin, and then fire a function to manipulate this skin : mySkin.gotoAndPlay("action");
It's easy because the Mouse-event send the Skin references, like this i can access position of the skin on the screen and else.

But what i don't know is the way to manipulate a tile's skin after the map is loaded and builded (to play automatic dialogues on pnjs) and get all its references (position x/y in for example) WITHOUT a mouse event or a player interaction on it.

So what would be the way to achieve this ?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Acces tile's skin references after map is generated.

Post by Bax »

Give the tile containing a relevant skin an instance name in the Editor, then use the IOpenSpaceAPI.getSkinByName method.
Paolo Bax
The SmartFoxServer Team
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Acces tile's skin references after map is generated.

Post by radiateur »

Thank you Bax :)
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Acces tile's skin references after map is generated.

Post by radiateur »

Hello,

I did like you said and it works very nice (thank you), but i have an extension of my question :
How could i access tiles located INSIDE a supertile ? By using a named supertile like this : "supertile.skin1" "supertile.skin2" ?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Acces tile's skin references after map is generated.

Post by Bax »

A supertile is nothing more than a group of tiles.
Using the IOpenSpaceAPI.getGroup() method you can retrieve all the tiles of the supertile. Now you have to look for the exact tile you need and proceed like explained before.
Paolo Bax
The SmartFoxServer Team
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: Acces tile's skin references after map is generated.

Post by radiateur »

Great, thank you bax ^^

PS : I'm so happy i almost finished the development x)
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Acces tile's skin references after map is generated.

Post by Bax »

Great! We will be happy to see the final result of your work.
Paolo Bax
The SmartFoxServer Team
Post Reply