My requests

What would you like to see in future versions of the editor?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: My requests

Post by iforce2d »

- Boolean values that do not exist in the JSON are implicitly false.

... so if it exists and is set to false, that would be fine by that rule, no?

The JSON implementation I'm using allows you to check if a property exists, so you can do this to see if a vector value is the simplified 0 form or a proper vector with two explicitly specified x,y values.

Code: Select all

JSONObject vecValue = ...;
if ( ! vecValue.has("x") )
    ... value is 0,0 ...
else 
    ... value is explicit ...
Perhaps the implementation you're using doesn't allow this - if not... it really should :) Besides, if you need to use a try/catch to check if a value is simplified 0, wouldn't you also need to use a try/catch to see if the value is there or not? I wonder why a catch needs to output a warning anyway, that seems annoying.

In the interest of making the file a bit smaller though, you have a point. I'm not too excited about completely omitting values for 0,0 altogether as it breaks compatibility for older versions (and the free version) of RUBE, for only a little gain.
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

You are right, of course. I don't know why I used the term "violating". Derp!

It's not the catch that is producing the warning. Here's the code:

Code: Select all

		Vector2 vector = new Vector2(0.0f, 0.0f); 
		
		try 
		{
			// consume "null" vectors here.
			json.readValue(float.class, jsonData);
		} 
		catch (SerializationException e) 
		{
			vector.x = json.readValue("x", float.class, 0.0f, jsonData);
			vector.y = json.readValue("y", float.class, 0.0f, jsonData);
		}
				
		return vector;
The warning is emitted for a value that is non-0. It's the dalvikvm on Android spitting out that it is not able to create a newInstance of the float.class. In other words, i believe the try fails because it's trying to interpret a vector object as a float. In that case, the catch takes over and properly reads in the x/y values.

--tim
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

I'm going to see what I can to do work around this better. Unfortunately, it doesn't look like the JSON implementation I'm using includes a check to see if a property exists or not.

--tim
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

Alright. I've been able to implement a workaround. Feel free to ignore me. Move along. Nothing to see here. :)

--tim
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

- I've got a two monitor setup. It would handy to detach the player window so I could have the simulation running on one monitor and the editor running on another monitor.
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

- Distance joint: button to auto-calculate Length parameter based on current distance between anchor points.
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

tescott wrote:- Distance joint: button to auto-calculate Length parameter based on current distance between anchor points.
Looks like the next rev of RUBE has got some really cool features. This functionality will be possible through some scripting APIs. I've demoed a WIP from iforce2d and it is really really cool!

--tim
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

- Standalone RUBEscript reference (PDF preferred). If one exists, please point me to it.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: My requests

Post by iforce2d »

If you're looking for a way to text-search in the script reference, maybe this will help:

www.iforce2d.net/rube/qt-assistant-win32.zip

It uses mostly the same underlying libs that the help panel in RUBE uses, with a more fully featured interface to allow searching and viewing indexes. The indexes need to be set up by hand so they are not there now.
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Re: My requests

Post by tescott »

So, the qt help thing works, but it's not as nice as a PDF. I really wish the entirety of the help was on a single page. :P

New request:

- Custom property type(s) that allows you to select a Box2D object as target (joint, body, fixture -- much like the Body A / Body B fields for Joints.) Use Case: setting things up for game engine scripting. Let's say I want to have an object that triggers activity on another object (button A opens door B). I could define a script field (string type) that uses reflection to indicate a "buttonOpenScript" is tied with a particular body. Another field would indicate the script's target (in this example -- the corresponding door's body or perhaps, the door's joint).

I wouldn't be concerned about simulating this in RUBE -- just the ability to be able to select and reference another object within the editor.

I think my current course of action will be to have unique names defined for the objects that need to be referenced and use that... e.g. "buttonA", "doorB".
Post Reply