Tags and draw suggest

General discussion about the R.U.B.E editor
Post Reply
Tymonr
Posts: 9
Joined: Mon Dec 21, 2015 12:05 am

Tags and draw suggest

Post by Tymonr » Sun May 22, 2016 6:24 pm

1. Tags

So. The RUBE should have some tool for easy export a world to engine and find objects in this world. Now i use body/shape/fixture names as tag(Name like spider_leg2_root_left realy not cool).
And ability to set tags will be cool

2. Draw

Sometimes i need just set some point (Like spawn or center of gravity). For now solution for me is in an empty body(With name like spawn_red_small_bot, yea), but it's not good for optimisation and world's space
Other draw(Any figures) will be helpful for visual tags in RUBE world and vector drawing in game

I hope that it isn't only my problems and will be a helpful solutions

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Tags and draw suggest

Post by iforce2d » Mon May 23, 2016 3:36 pm

1. I think you need to explain a) why finding things by name is 'not cool' and b) what is the difference between finding things by name and setting a tag. How would you go about setting a tag in the editor, and how would you go about finding an object by tag in your game after loading?

2. If you delete the dummy bodies after loading the scene, they should have no effect on the "world's space". You can use an export filter to exclude some bodies/fixtures from being exported, that would let you use them as a purely visual indicator while editing that will have no effect on the exported result. Look for "export filter" in the built-in help.

Tymonr
Posts: 9
Joined: Mon Dec 21, 2015 12:05 am

Re: Tags and draw suggest

Post by Tymonr » Sat Apr 15, 2017 8:23 am

iforce2d wrote:why finding things by name is 'not cool
because it's very long and uncomfortable process. I mean "rock_bad_50dmg_rolling_trigger_etc" fills awfully
iforce2d wrote:what is the difference between finding things by name and setting a tag
it's not about finding. It about setting mostly. Editing names like that not fills good
iforce2d wrote:How would you go about setting a tag in the editor,
With another properties i guess. Array of user tags or something
iforce2d wrote:and how would you go about finding an object by tag in your game after loading
it isn't has a matter - there just has to be way to identify objects.
iforce2d wrote:You can use an export filter to exclude some bodies/fixtures from being exported
I mean i need to export point, zones, etc. in game

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Tags and draw suggest

Post by iforce2d » Sat Apr 15, 2017 1:21 pm

I can only guess that you mean, you want to set separately "rock" and "bad" and "50dmg" etc as individual properties for that item. This is what custom properties are for. Maybe this will help? https://www.youtube.com/watch?v=nCp-EK_IICA
See also the "Custom properties" pages in the built-in help.
See also the section about custom properties here: http://www.iforce2d.net/b2djson/#customprops
Tymonr wrote:I mean i need to export point, zones, etc. in game
Yes, and the method you are currently using (dummy body or fixture) should work fine. After you load the level, you can get the position of the dummy items, then delete them so that they don't interfere with anything.

The reason I suggested using an export filter to exclude some items from export, was in response to your comment about visual aids while editing, that will not be exported.

Tymonr
Posts: 9
Joined: Mon Dec 21, 2015 12:05 am

Re: Tags and draw suggest

Post by Tymonr » Sun Apr 16, 2017 10:11 am

iforce2d wrote:See also the section about custom properties here
hmm.. it pretty well
iforce2d wrote:Yes, and the method you are currently using (dummy body or fixture) should work fine
yes. But not well

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Tags and draw suggest

Post by iforce2d » Mon Apr 17, 2017 11:25 am

Tymonr wrote:
iforce2d wrote:Yes, and the method you are currently using (dummy body or fixture) should work fine
yes. But not well
You will need to be more descriptive if you want people to offer useful help.

Tymonr
Posts: 9
Joined: Mon Dec 21, 2015 12:05 am

Re: Tags and draw suggest

Post by Tymonr » Fri May 12, 2017 4:59 am

Image
So, custom props is nice solution, i guess(But little hard to find(I know that is in tutorial menu))

With drawing i'll use scripts for now, but vector shapes will be good feature anyway

Post Reply