Forum

> > CS2D > Scripts > Rotate player
Forums overviewCS2D overview Scripts overviewLog in to reply

English Rotate player

38 replies
Page
To the start Previous 1 2 Next To the start

old Re: Rotate player

Yasday
User Off Offline

Quote
You should've given up when DC said
DC has written
(it is not possible ...

he's the creator of this game and he does know if it's possible or not.

old Re: Rotate player

KimKat
GAME BANNED Off Offline

Quote
Yasday has written
Anyways, it won't work, you cannot change the rot of any player( exept of your own one ).
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.

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

old Re: Rotate player

Yasday
User Off Offline

Quote
You cannot change the rot of any player, exept of your own one, but only with the mose, got it? That is not possible with Lua.

old Re: Rotate player

J4x
User Off Offline

Quote
Wellknw that we(kimkat and me) know that that's not possible, can u add this to the game DC?

old Re: Rotate player

KimKat
GAME BANNED Off Offline

Quote
Fine be that way.

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.

old Re: Rotate player

KimKat
GAME BANNED Off Offline

Quote
Well from sight it will make illusion that player is rotated... therefor interpreted freely by the player. Right?

If not, wth.
haha.

old Re: Rotate player

archmage
User Off Offline

Quote
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
function setrotation(id, angle)
	local x = 320 + 100 * math.cos(angle);
	local y = 240 + 100 * math.sin(angle);
	setcursorpos(id, x, y);
end

old Re: Rotate player

DC
Admin Off Offline

Quote
why the hell should I allow the server to mess with the cursor position of a client?! that would be pretty insane! (and it could actually be abused to annoy players to death)

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.

old Re: Rotate player

FlooD
GAME BANNED Off Offline

Quote
ya forcing cursor position would be weird... server-side aimbot? lol
1
player(id, "cursor_x"), player(id, "cursor_y")
that would be pretty cool, especially if u can see someone's cursor in spec

old Re: Rotate player

J4x
User Off Offline

Quote
Well, if u don't like that server control other peoples cursor, atleast u can implement some thing like
1
cursor(id,"x"),cursor(id,"y")
, this would be cool to make scripts which need cursor position.

old Re: Rotate player

Flacko
User Off Offline

Quote
FN_Linkin Park has written
Well, if u don't like that server control other peoples cursor, atleast u can implement some thing like
1
cursor(id,"x"),cursor(id,"y")
, this would be cool to make scripts which need cursor position.


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)

old Re: Rotate player

J4x
User Off Offline

Quote
Im glad that DC add the cursor position in cs2d 0.1.1.9

old Re: Rotate player

Flacko
User Off Offline

Quote
Still, what you wanted to achieve is still impossible because the newly-set cursor position will be overriden by the actual mouse position (as DC said).
The only way of doing something like that would be using an OS-dependant API that might not be avaiable in Blitz3D

old Re: Rotate player

J4x
User Off Offline

Quote
yeah u have reason, but im still happy, now it will be easier to simulate something like an airstrike(just put a explosion at mouse position).
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview