Page 2 of 3

Re: My requests

Posted: Sat Mar 09, 2013 4:19 pm
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.

Re: My requests

Posted: Sat Mar 09, 2013 4:39 pm
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

Re: My requests

Posted: Sat Mar 09, 2013 4:45 pm
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

Re: My requests

Posted: Sat Mar 09, 2013 4:51 pm
by tescott
Alright. I've been able to implement a workaround. Feel free to ignore me. Move along. Nothing to see here. :)

--tim

Re: My requests

Posted: Sat Mar 16, 2013 3:19 pm
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.

Re: My requests

Posted: Sat Mar 16, 2013 4:28 pm
by tescott
- Distance joint: button to auto-calculate Length parameter based on current distance between anchor points.

Re: My requests

Posted: Mon Mar 18, 2013 2:57 pm
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

Re: My requests

Posted: Mon Mar 18, 2013 5:38 pm
by tescott
- Standalone RUBEscript reference (PDF preferred). If one exists, please point me to it.

Re: My requests

Posted: Mon Mar 18, 2013 8:30 pm
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.

Re: My requests

Posted: Wed Mar 27, 2013 3:08 am
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".