Forum




Rotate player
38 replies DC has written
(it is not possible ...
he's the creator of this game and he does know if it's possible or not.

Yasday has written
I think you can do it for all players, as Lua affects all players not just one depending on how to Lua script is built. Anyways, it won't work, you cannot change the rot of any player( exept of your own one ).

Well if it works for one, that's already enough to prove my point that rotation does work on a player...


Why can you then rotate image of the player? haha.
You could then make a player image graphic and rotate it, therefor player rotates, haha.

Just my regular workaround.


If not, wth.

haha.
DC has written
(it is not possible because rotating a player with Lua doesn't make any sense because the player always looks at the mouse position of the corresponding client. so the rotation set via Lua would instantly be changed/overwritten. resulting in no effect at all.)
Maybe a command to set the position of a client's cursor?
1
setcursorpos(id, x, y)
then it would be possible to implement a setrotation function:
1
2
3
4
5
2
3
4
5
function setrotation(id, angle) 	local x = 320 + 100 * math.cos(angle); 	local y = 240 + 100 * math.sin(angle); 	setcursorpos(id, x, y); end



what do you want to do with that command anyway? I think you either have to forget this plan or you have to find another way to realize it.
1
player(id, "cursor_x"), player(id, "cursor_y")
1
cursor(id,"x"),cursor(id,"y")
FN_Linkin Park has written
Well, if u don't like that server control other peoples cursor, atleast u can implement some thing like , this would be cool to make scripts which need cursor position.
1
cursor(id,"x"),cursor(id,"y")
DC already said that CS2D doesn't send the cursor's position to the server. It only sends the rotation of the player so this is not possible (or DC would have to hack a bit into his code to implement this)


The only way of doing something like that would be using an OS-dependant API that might not be avaiable in Blitz3D