Page 1 of 1

able to move spring manually?

PostPosted: Tue Nov 22, 2016 9:36 pm
by Vorticus
can we use any keybinds to move the springs, and by keybinds i mean on keyboard? itd be pretty cool. like for example, the target length, just to push something without having to create a sliding joint by a rotating circle attached to a box on the edge of the circle. thx if this gets accepted, also u can see some kinda sucky transformer figure's i've made for fun on my profile (in the algobox)

Re: able to move spring manually?

PostPosted: Wed Nov 23, 2016 4:25 am
by faytree
It's actually possible to do it in Algodoo.
Here's a scene I made as an example ;)

[scene]146488[/scene]

Re: able to move spring manually?

PostPosted: Thu Nov 24, 2016 2:17 pm
by Vorticus
faytree wrote:It's actually possible to do it in Algodoo.
Here's a scene I made as an example ;)

[scene]146488[/scene]

it's probably just me not being good at thyme and I rather just make action figures out of transformers on this game by cutting them to thier proportial pieces then jointing them back together with axles. i do it for prviate and personal use and just for fun. thanks. i've made springs like that for my robots, but not one that pushes a spring with keybind. thanks again

Re: able to move spring manually?

PostPosted: Thu Nov 24, 2016 2:20 pm
by Vorticus
atlealst i just found out about the fact that if you set inertiamultilier to infinity the object that has an infinite amount of intertia/intertiamultiplier will stabilize itself

Re: able to move spring manually?

PostPosted: Thu Dec 15, 2016 8:16 am
by sandhaul
Hi Faytree, am I able to toggle a spring by hotkey, the only difference from holding is it that when you press the hotkey, the spring stays to the spot and when you press it again it goes back to it's prime spot. This is Vorticus, I am just using another account for some reason.

Re: able to move spring manually?

PostPosted: Thu Dec 15, 2016 5:32 pm
by FRA32
You can do this by opening the springs script menu, going to postStep and add this statement to it:

keys.isDown("up/down/left/right/abcdefg...) ? {
length = 9001} : {length = 9}

Pick the key you want to use and change the numbers to your desired length. You can do the same with any other variable.

Re: able to move spring manually?

PostPosted: Fri Dec 16, 2016 5:35 am
by sandhaul
thanks, im vorticus by the way, like i said in my above post, im just using another account. is there anyway to make the spring stay at a spot like it's toggled, and when you press that key again, it goes back to it's original spot?

Re: able to move spring manually?

PostPosted: Fri Dec 16, 2016 3:45 pm
by FRA32
You can add a _toggle = false variable using the black box in the top left. Then in the keys.isdown ? {} : {} you add
!_toggle ? {
_toggle = true;
length = 9001 ? {
_length = 9
} : {
_length = 9001
}
} : {}
in the first bracket, and
_toggle = false
in the second bracket. This way, when you release your key, the spring stays in place until you hit it again

Re: able to move spring manually?

PostPosted: Sat Dec 17, 2016 5:04 am
by sandhaul
sorry if im bothering but could you make a small scene for a better understanding? thx

Re: able to move spring manually?

PostPosted: Mon Dec 19, 2016 7:22 am
by faytree
I've updated the scene. Feel free to look at the script I've written in the spring(the right spring, not left) 8-)

[scene]146488[/scene]