Jump to content

zoot

Community Members
  • Posts

    1.557
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by zoot

  1. Shouldn't be too big, we just reorganize things a bit.
  2. You can just use the existing 'attack-notification' branch, since the branch in your repo is seperate from the one in mine. You need to "git add" all the files you have modified and/or created. Then "git commit" or: git commit -m "Some helpful commit message here." Once you've committed to your local repo, you should be able to push as described in the link above.
  3. If you are still working from the clone from GitHub, is there chance you can push your changes so far back to your repo on GitHub: https://help.github.com/articles/pushing-to-a-remote Then I can try and see if I can move the attack 'suppression' logic into messages.js in some way.
  4. It may turn out that we need to move much of the attack detection / suppression logic into messages.js, so we can treat sound and ping differently from each other.
  5. There is a small problem with this; if we have a clump of units, and the one that was 'pinged' dies, the blinking will presumably stop even though the skirmish continues for the other units. I'm not quite sure how to address that?
  6. Very cool Maybe make the blinking slightly faster / higher frequency. (Don't know the answer to your question, unfortunately.)
  7. Recompile or wait until next autobuild. http://trac.wildfiregames.com/changeset/13340
  8. There is no library, to my knowledge. The XML parsing and rendering is done by the engine itself.
  9. The actual in-game minimap is instantiated from XML: https://github.com/0ad/0ad/blob/master/binaries/data/mods/public/gui/session/session.xml#L744
  10. The minimap UI 'type' is initialized here: https://github.com/0ad/0ad/blob/master/source/gui/CGUI.cpp#L442
  11. That error is because you are passing an object from JS: Engine.PingMinimap({ "entity": notification.message.target }); The stuff in curly braces is an object literal. You should probably just pass the entity ID directly: Engine.PingMinimap(notification.message.target);
  12. Note, if you aren't already aware, that maps internally are square, so positions in the corners of the internal map won't be visible on the circular minimap.
  13. It's completely up to you what you want to work on and how you want to proceed. Some work has already been done on the task you described: http://trac.wildfiregames.com/ticket/657 If you wish, you can take the WIP patch on that ticket, and continue work on it.
  14. Hi. See here if you want to get started programming: http://trac.wildfiregames.com/wiki/GettingStartedProgrammers Also feel free to ask questions.
  15. Exactly (or something very close to that, depending on what works out for you). It's a detail, but you'd need to enclose both lines in the 'if' context: else if (notification.type == "attack") { if (notification.player == Engine.GetPlayerID()) { Engine.GuiInterfaceCall("PlaySound", { "name":"attacked", "entity": notification.message.target }); Engine.PingMinimap({ "entity": notification.message.target }); } }
  16. The AttackDetection.js component is part of the simulation and this component invokes the PushNotification function which passes execution into messages.js which runs in the GUI.
  17. I think the CCmpMinimap.cpp component is what units use to make themselves show up on the minimap, while MiniMap.cpp is what actually renders the minimap.
  18. Your approach could work too, I'm not sure how that minimap component is actually organized. It just seems odd to me that the ping would need to go through the simulation, since it is specific to a single player and shouldn't need to be network synchronized or anything.
  19. Once you've found the right place to add the function, you would likely want to add a reference to it here to expose it to the GUI JS context: https://github.com/0ad/0ad/blob/master/source/gui/scripting/ScriptFunctions.cpp#L612 (RegisterFunction() adds the function as a global Engine.* function in the given JS context.)
  20. Unknown territory to me, so your guess is as good as mine, but I don't believe you will want to add it to any file in the simulation2 subdirectory, since the simulation is a different scripting context from the GUI. The attack notification sound is played from the GUI context (messages.js), so the ping probably should too.
  21. Yes, an "interface" in this context is a simulation component interface. Engine.QueryInterface() acquires a reference to a particular interface of a particular entity. (Though, to be honest I know little of how it actually does that, I just use it ) Some assorted background info: http://svn.wildfiregames.com/docs/writing-components.html Elements like <AttackDetection/> in templates are references to components, yes.
×
×
  • Create New...