I'm not content with using the standard TA buttons as UI for interacting with a gadget handling custom game mechanics. For implementing something like an ingame unit customizer interface, that would be very much inadequate.
The main problem is that the unsynced side is designed to interact with only the engine, and not any synced code. Synced code can communicate with the unsynced tough.
There is a backdoor tough, unitcommands. This is the only way unsynced code can actually make a difference ingame as far as I know. So to communicate from unsync -> sync, it should be possible by doing the following:
1. Create a special unit wich only purpose is to receive commands from the unsynced UI.
2. Hide this unit as well as possible from the player. This would include making the unit unselectable (is this possible?), invisible (no model or any graphics), put at a large distance away from the actual map area, and/or above it.
3. Intercept the commands in the synced code handling commands.
Obviously it would be nice if we didn't have to go trough a unit, but I can't think of any other way and it seems to me that it could work pretty well?
Idea (hack) for communicating unsynced->synced
Moderator: Moderators
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
Re: Idea (hack) for communicating unsynced->synced
Yes, LuaSyncedControl::SetUnitNoSelect(number unitID, boolean nonSelectable).Zpock wrote:This would include making the unit unselectable (is this possible?)
NB. You can also set the unit not to be shown on the minimap (LuaSyncedControl::SetUnitNoMinimap).