I tried to show an example of this with my "Simple Maze" template but apparently V.S has issues with complicated object areas. I have yet to try using way areas/points & action areas yet & controlling character pos with mouse pos - maybe that'll be ok for a work-around!?
anyway onto the examples for this!
Firstly we'll do setCursorPos which is nice & simple & looks like this: "setCursorPos({x=co-ordinate,y=co-ordinate})"
setCursorPos({x=400,y=450})
You can find the co-ordinates you need via the numbers in brackets on the top right hand corner of the scene preview screen by hovering mouse cursor over the area you want to find the co-ordinates to - see screenshot below.
hint: x = horizontal & y = vertical (for anyone who doesn't know)
right now onto get cursor position script which is also a simple one line piece of code which can also include return values of if pos = so so then do so so or do nothing.
basic example
getCursorPos()
setting the cursor pos in a custom variable
local CurPos = getCursorPos()
Adding it to a return value if/else statement
local CurPos = getCursorPos()if setCursorPos({x=400,y=450}) != CurPos then
setCursorPos({x=400,y=450})
else
end
this is just a quick example but you could use LUA to find the position & width/height of an object area or something & use that to calculate if the cursor is inside or outside of the object area & what to do in each instance
P.S I know the final code example isn't correct as it will most likely set the cursor pos before checking the saved cursor pos obtained in the get cursor pos statement - I will update it later on with something better!
Cheers
For example how would I type out a mouse event for mouse moves? so I can then define with other if else statements what it should do?
also how do I read the x,y positions of getCursorPos() individually?
Cheers