Basically, i've been thinking of resuming my activity on the modding part, and as a part of that thinking, i was wondering how could all sorts of unit-specific fps gui be implemented.
Considering what lua can do, the only problem with making fun stuff like seeing your gun to aim with, is that i don't know how to find out when a player goes in and out of fps for this or that unit.
Does anyone know how to do it?
How to check when user fps-controls an unit?
Moderator: Moderators
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: How to check when user fps-controls an unit?
function gadget:AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID)
Re: How to check when user fps-controls an unit?
Frog, he's not asking to restrict it in a gadget, he's asking to detect when a player is FPS'ing a unit in (presumably) a widget.
To answer that:
Spring.GetPlayerControlledUnit
( number playerID ) -> nil | number unitID
To answer that:
Spring.GetPlayerControlledUnit
( number playerID ) -> nil | number unitID
- TheFatController
- Balanced Annihilation Developer
- Posts: 1177
- Joined: 10 Dec 2006, 18:46
Re: How to check when user fps-controls an unit?
AllowDirectUnitControl would be called when the player activated it however which would reduce the need for polling