Unity-like Live Variable Tweaking!


(Jonathan Stoler) #1

I wasn’t planning on releasing this until I added a few more features, but I thought I’d try to release this before Ludum Dare starts tomorrow, in case people want to use it.

This little class lets you change properties in real-time so you don’t have to recompile every time you want to change your player’s jump height or whatever.

Here’s a brief video demo of how it works.

Check it out on my Github. It’s still a WIP but I’ve left a todo list up there. If anyone wants to fork it and make some changes, feel free! :slight_smile:

Let me know if you have any questions or encounter any bugs or anything. I hope this can help to speed up your game development time.


(Zachary Lewis) #2

That’s really, really neat, and super useful for prototyping.


(Kyuur) #3

Wow! Very, very cool. Definitely one of the best things about Unity, so bravo!

I’ll be giving this a try for sure.


(reopucino) #4

wow this is great… like zach say… this is super duper useful


(Willard Torres) #5

It’s beginning to look a lot like Christmas, because this is the coolest thing/gift I’ve seen so far.


(Jonathan Stoler) #6

Thanks, everyone! I’m glad you like it.

I just pushed a really minor update to the github so sandbox violations no longer cause the entire thing to crash and burn! Yay! :smile:

Here’s the link again if you want to grab the new version.

Hopefully I’ll be able to make some bigger, more important changes soon.


(Ultima2876) #7

This seems like a really nice tool and a fantastic idea.


(Willard Torres) #8

It doesn’t seem to work for me at all, especially with packages such as

com.something.blah

It gives me the [LIVEVARS ERROR] No class named com.something.blah could be found. message.


(Jonathan Stoler) #9

For packages you need to use a double colon syntax, like:

com::something::blah

This is something ActionScript does in its getDefinitionByName function. I’m not really sure why.


(Willard Torres) #10

I’m still getting the error, with

com::anheu::platformer::GameWorld.player

as the property.

It’s weird because when I tried to output

getDefinitionByName("com.anheu.platformer::GameWorld")

it outputs [class GameWorld] correctly. When I tried to output

getDefinitionByName("com::anheu::platformer::GameWorld")

it throws an exception.


(Jonathan Stoler) #11

Alright, so I was wrong about how ActionScript handles this sort of thing.

The double colon only goes before the class itself, but package names still use dot syntax. I don’t typically use nested packages for my world variables so it always looked like the dots were replaced with colons when I was testing it!

You want com.anheu.platformer::GameWorld.player. I’ll update the readme to reflect this, thanks for bringing it to my attention. Let me know if you have any other problems.


(Jonathan Stoler) #12

And I’m wrong again! (sorry for double post!)

This produces invalid toml, so it won’t work anyway. I need to think about this some more, but I’ll try to update this some time later today or tomorrow.

As a workaround, just don’t use nested packages yet.


(Alex Larioza) #13

Hm this is interesting!

What I usually do when I need to tweak stuff when the game is running is setup an XML file with the vars and reload it after I’ve made tweaks. Its not as intuitive as this though, as I have to manually set the vars on the respective objects.


(Willard Torres) #14

Thanks for the reply!

I also tried tracing the prop variable in the for loop, and it just outputs com. I’m guessing this is part of why trying

com.anheu.platformer::GameWorld

stil didn’t work, since it only parsed the “com” part. I’ll look more into this, and for the mean time, I guess I have to use single packages :smiley:

Edit: I think this behavior is caused by the parse function in TOML.as to only get the com part. As I am not yet fully familiar with how the whole thing works, I’ll refrain from trying to fix it and just wait


(Jonathan Stoler) #15

Yeah, this is how toml handles nested objects and it’s also why we unfortunately can’t feed LiveVars the proper ActionScript syntax. But there is a solution!


I just pushed a fix that will convert between the double colon package syntax and ActionScript syntax, so you’ll want to use the double colon package syntax in your toml file:

com::anheu::platformer::GameWorld

(Obviously be sure to download the update before trying this!) Let me know if you have any more problems.


(Willard Torres) #16

Thanks! I hope this doesn’t break any previous effort. I’m not really sure how many people use nested packages.