Jump to content

How to add a button on unity details area?


Recommended Posts

Hi all,

I still far away to understand how magically things are placed on the game interface and the game structure at all... However, as i did my first task with Leper orientation, i want to make a bigger step: the capture ability, with your orientation.

First query: How to add a button on unity details area?

post-15096-0-28814800-1356819289_thumb.j

I didn't find myself here, but i believe i will touch the unit_commands.js file. But, how? And, where more?

Link to comment
Share on other sites

The way that we do multiplayer in 0 AD is to send all of the players commands over the network and have the simulation run identically on each users computer. This is why the GUI buttons use the following function (this example is the promote units debug command).

Engine.PostNetworkCommand({"type": "promote", "entities": g_Selection.toList()});

These messages are received by Commands.js on each player's computer. Commands.js is part of the simulation code so it can then call the necessary simulation functions.

The simulation is made up of lots of components. There is some fairly good documentation about components here . You will want to add some components, perhaps Capture and Loyalty, as you design the code this should become clearer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...