Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Local Space Joystick Rotator, of sorts...

Archive: 8 posts


Greetings, mortals.

For a few days now, I've been trying to come up with a way of creating a local-space Joystick Rotator for some local-space camera shooter elements.
However, after many hours of failed attempts, I'm simply at a brick wall here, and I'm definitely going to need some advice.

I realise what I'm asking is a little odd, so let me explain -
I'm trying to create a vehicle with a turret. Regardless of the vehicles orientation, 'Up' on the control stick should make the turret face the front of the vehicle, not 'Up' in relation to the level. Just as 'Down' on the stick should make the turret face the rear, not towards the level floor.
I've been screwing around with Angle Sensors and the Controlinator outputs wired into Signal Combiners, but all I ever wind up with is a standard Joystick Rotator with a load of useless extra logic in front of it, or a makeshift Rocket Rotator.


I know this setup, should be possible, but I'm just totally unable to make it happen. Any help would be appreciated.
2012-07-08 12:24:00

Author:
Ostler5000
Posts: 1017


Make the level rotate instead of the tank? Or is the level too big to do that?2012-07-08 13:29:00

Author:
Brannayen
Posts: 438


Nah, level rotating is far too impractical. Plus this is a multiplayer level, so I'd have to somehow engineer the level to rotate and accomodate all 4 players, which I don't think is possible.


Just prior to posting, though, I realised I could use multiple Angle Sensors attached to many corresponding, angled Joystick Rotators. It's a little sketchy going around corners and not too thermo effecient, but it works for now.
2012-07-08 13:41:00

Author:
Ostler5000
Posts: 1017


there is a way of doing it cleanly, but i dont have the time atm to explain. i'll try to put something together by this time tomorrow and post up some pics with an explanation2012-07-08 14:07:00

Author:
evret
Posts: 612


Thanks, evret, I'd really appreciate that.2012-07-08 14:52:00

Author:
Ostler5000
Posts: 1017


I worked on this same problem for quite a while too. I eventually solved it with a (complicated) system that uses custom angle sensors that output a linear signal over a 0-360 degree range. One goes on the vehicle and one goes on a standalone invisible joystick rotator. Then the signals are added together to give the desired angle, and a rotator and third angle sensor in a feedback loop on the vehicle act like the local space joystick rotator.

It works, but uses a ton of logic, so I'll be interested to see if evret has something better.

If only joystick rotators had a local space option...
2012-07-09 06:20:00

Author:
Dr C
Posts: 122


If only joystick rotators had a local space option...
MM see this!
2012-07-09 07:08:00

Author:
ConanUltimate
Posts: 104


this may or may not be a "clean" way of doing it, depends on your definition of the word when it comes to lbp. however it works and it works well, is all wireless so once u have it set up you wont have to worry about it again. shouldnt be an issue when emitting new tanks etc.
for this example i used no labels, just different coloured tags/sensors, all you would have to do to make it work with multiplayer is to add a "player x" label to all the tags/sensors for each player, where x is the player number.
this method uses 2 different types of "angle matcher" (where one object is keep facing the same angle as another object without rigid connections) one uses angle sensors to send the angle to a joystick rotator wirelessly via tags/sensors, and the other uses 4 sensors and a tag to detect the angle (this was the way i did "angle matching" b4 angle sensors where added)

these images should speak for themselves, so i'll mainly just tell you want you cant see.

this first pic shows how angle sensors are set up on the tank body, they are all set to 180 degrees, and the angle they are placed at is obviously important. the tags send the angle information to what i call the "translator", the start of which is shown in the second pic.
the movement and rotation can be set up however you want, i was also assuming you're using a local space camera.
assuming this is the controlinater the player rides in, it should b set to transmitter (if not obviously reciever)
http://id.lbp.me/img/ft/1ed08f7d7fcc707e7993ebf669b421e742ba3ff3.jpg

the hologram square is 10 small grid squares wide and high, and can be in any thick layer (this is left outside your level, so it doesn't matter if it's visible or not), the tag sensors should be all the same colour and label, set to min 0.0, max 20.0, and set to "closeness". you should use the grid to place the sensors in the middle of each edge, one small grid square in from the edge (the size of this "translater" isnt important, as long as ranges stay the same relative to it's size)
the tag sensors wired to the joystick rotator should be set to max radius, and set to signal strength.
the rotator is deliberately at a 45 degree angle (i'll explain that later), and set to max settings
http://i9.lbp.me/img/ft/0097edaa8026fa0b37fa446661018b28d49e07a7.jpg

this bit of holo should be 10 squares high, 2 squares wide, and on the thin layer in front of the first bit of holo.
the joystick rotator should be set to max settings, and the basic rotator should b set to max deceleration and 0 speed (this just stops unwanted spinning).
the controlinator is set to receive, and the tag matches the sensors on the larger bit of holo.
bolt is placed in the center, extra holo out the other side is just to balance out the mass.
http://ic.lbp.me/img/ft/1fc836fe6c1d79c410990f123027991b3217f61e.jpg

bolt the small bit to the big bit.........
http://ie.lbp.me/img/ft/20e414b40ebae7777d5ee53398d6ffe78239b36e.jpg

sensors set to signal strength again, max radius.
the joystick rotator can bee tweaked as u see fit, you may want cannon rotation to b slower etc (you could probably do this with any of the joystick rotators, but doing it here would be easier as you wouldnt need to alter the translator once it's set)
the rotator is placed at 45 degrees again
http://ib.lbp.me/img/ft/f5beaee75eee53889b93653fca8af19d716bbbe2.jpg

and this is just an overview, the translators should b placed in an unused part of you level
http://i4.lbp.me/img/ft/3540538504e174063c10fc0600b47c1a9e4bce5e.jpg

both of the above angle sensors slow down slightly at certain angles, while this isnt normally an issue it becomes noticable when using 2 together like this, offsetting one by 45 degrees causes the 2 to balance out therefore hiding the issue. the easiest way to do that was to turn 2 joystick rotators 45 degrees.
when u make this in pause, then unpause, the large holo block will rotate 45 degrees, thats normal.

let me know if you have any issues.

edit: a lot wordyer than i intended lol, maybe i should have put it in the tutorials section
2012-07-09 15:35:00

Author:
evret
Posts: 612


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.