Community Forum

"unwrap" Mouse (Player)

Forum Overview >> Scripting

Created09.12.2009 13:57

Sven Köhler (Unknown) 09.12.2009 14:01
The Script VehicleCamera() has a function:
if self.isActivated then
wrapMousePosition(0.5, 0.5);
self.posXLast = 0.5;
self.posYLast = 0.5;
I need this on Player() to "unwrap" the Mouse, while is Active, but the Player.lua isn´t free to copy&paste the Player:update(dt) to new Script. I Script a Mod, how you can Change the Vehicle with an HUD on Screen with a map Picture, there you can see the Vehicle´s and Entered it with Mouseclick!

Thanks for Help and my bad Englisch! :-)

MfG Sven

Stefan Geiger - GIANTS Software 10.12.2009 13:03
You can overwrite the wrapMousePosition function with your own implementation (just empty) if you want to have a freely movable mouse. As soon as you are finished, you can reset it to the original.

local oldwrapMousePosition = wrapMousePosition;
wrapMousePosition = function(x,y)

when you are finished:
wrapMousePosition = oldwrapMousePosition;

Sven Köhler (Unknown) 10.12.2009 15:07
Oh, Yes of course! :) Other Problem, all Vehicles are loaded in g_currentMission.vehicles, but i need not the TrafficCars. All other Vehicles are loaded in any other table?

Andrew Asche (Unknown) 10.12.2009 23:39
How about g_currentMission.vehiclesToSave?

Sven Köhler (Unknown) 11.12.2009 03:39
No, other Scripter are Help my. It´s g_currentMission.steerables, in this table are all Vehicles the can Entered! ;-)

Thx for Help!

Andrew Asche (Unknown) 11.12.2009 10:20
But that will not include any implements and tools.

Sven Köhler (Unknown) 11.12.2009 16:05
Implements and tools are g_currentMission.attachables!


Andrew Asche (Unknown) 11.12.2009 21:11
You're right! Thanks, always good to learn and refine =]

Note: Log in to post. Create a new account here.