tutorial for VERY EASY MOUSE POINTER

tutorial for VERY EASY MOUSE POINTER

Hi i'm jesse and if you've got a problem with the "complicated" math scenes of kilinich (not meant bad for you kilinich )
one scene is a mouse pointer like his servo motors, i don't understand s*** about whats the script says

i came up with an idea myself to make a mouse follower that needs only 2 variables
the following script is very easy, i will first explain it to you:
if you make a "aiming hinge with box" (so like the part on a gun that twists when aiming).
it's important it lays FLAT on the ground, so it's not higher than it's wide, then make a laser (only collideset B) and make a small box (also collideset B), make the laser point at the box and set it close to it, now select them both and copy it with "CTRL".
if you've done right you now have 2 lasers and 2 boxes
select 1 laser and the box it's pointing at and put them ON the aiming box, NOT IN THE MIDDLE BUT IN THE CORNER... now take the second laser and box and do the same

example: but laser+box in the top left corner of that box and the other laser+box in the DOWN LEFT CORNER
if you dont understand check the scene, the lasers and boxes in mean are BLUE [0,1,0,1],
now fixate both boxes to the aiming box.
then: select the lasers and type in the onlaserhit:
Code: Select all
`(e)=>{e.laser.distance = (((e.pos(0) - app.mousepos(0)) ^ 2) + ((e.pos(1) - app.mmousepos(1)) ^ 2)) ^ 0.5}`

that is the code for distance calculation (using the law on pytagoras: a^2+b^2=c^2)
now, put in the console:
Code: Select all
`scene.my.distance1 = 0 and scene.my.distance2 =0`

then, put in one laser next to the pytagoras code using ; the following:
Code: Select all
`scene.my.distance1 = e.laser.distance`

put in the OTHER laser the same but now we use the second part of the array, so it will be number2. it looks like this:
Code: Select all
`scene.my.distance1 = e.laser.distance`

a COMPLETE CODE of 1 la2er (caution: the 2 lasers are almost but NOT the same):
Code: Select all
`(e)=>{e.laser.distance = (((e.pos(0) - app.mousepos(0)) ^ 2) + ((e.pos(1) - app.mmousepos(1)) ^ 2)) ^ 0.5;scene.my.distance1 = e.laser.distance}`

now you're almost done, the only thing you have to do is make a hinge
make a hinge at the rotation box, set motor TRUE and torque to +inf
then, set the motorspeed IN THE SCRPIT MENU OF THE HINGE to:
Code: Select all
`{(scene.my.distance1 - scene.my.distance2)* "whatever you want, it will be faster but more unstable, recommended is between 10 and 20"`

now you are done, check this scene of me and if it's practically the same as you made... then you are a hero and have succes

PLZ COMMENT AND RATE, any questions? email me at jesse_bax@live.nl. nederlands? email gwn met nederlands taal haha

Rating:
Filesize: 6.56 kB
Ratings: 1
jessebax129

Posts: 34
Joined: Tue Jan 05, 2010 6:32 pm

Re: tutorial for VERY EASY MOUSE POINTER

What's it supposed to do? Doin nothing but turn In circles

these guys are awesome. <- full stop

FuzzyLogicBrain

Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: tutorial for VERY EASY MOUSE POINTER

this is no help at all! it DOES,,.. NOT,,.. WORK!!!!

these guys are awesome. <- full stop

FuzzyLogicBrain

Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: tutorial for VERY EASY MOUSE POINTER

yes it works... do not say it doesn't because i made it myself
jessebax129

Posts: 34
Joined: Tue Jan 05, 2010 6:32 pm

Re: tutorial for VERY EASY MOUSE POINTER

hmmph! thats scant proof

these guys are awesome. <- full stop

FuzzyLogicBrain

Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: tutorial for VERY EASY MOUSE POINTER

Rating:
Filesize: 9.9 kB
Ratings: 4

I DID NOT MAKE THIS!!!!!

Much, much better mouse pointer.
Heck, I'd go so far as to say that it's infinitely better.
Matthias Wandel is epic, in my humble opinion.
I love my brain...

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.

Someone Else

Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: tutorial for VERY EASY MOUSE POINTER

extreemly simple! woooooww! not a single varible to behold! but it seems to glitch when you put the mouse to close to the circles

these guys are awesome. <- full stop

FuzzyLogicBrain

Posts: 315
Joined: Mon Jan 31, 2011 7:48 pm
Location: when online, on the computer. when not, probably on it anyways. ;D lulz

Re: tutorial for VERY EASY MOUSE POINTER

Yeah... if I could comprehend the code, I might be able to fix that. Or, maybe I'll try making my own code.

At the moment, however, the only thing to do is make the thing smaller (it scales very nicely) and not make it clear where it is. That actually works very well. As TC42 demonstrated in the RPG game thing. Which I might be able to improve upon now that I mostly understand the K-Menu.

Generally speaking, if you can't see where the circle is, then it's difficult (but not impossible) to make it fail like that.
Matthias Wandel is epic, in my humble opinion.
I love my brain...

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.

Someone Else

Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy