zoot
Community Members-
Posts
1.557 -
Joined
-
Last visited
-
Days Won
9
Everything posted by zoot
-
Shouldn't be too big, we just reorganize things a bit.
-
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.
-
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.
-
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.
-
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?
-
Very cool Maybe make the blinking slightly faster / higher frequency. (Don't know the answer to your question, unfortunately.)
-
[RESOLVED] Adds game speed option to match setup error!
zoot replied to gameboy's topic in Bug reports
Did you do this: -
[RESOLVED] Adds game speed option to match setup error!
zoot replied to gameboy's topic in Bug reports
Recompile or wait until next autobuild. http://trac.wildfiregames.com/changeset/13340 -
There is no library, to my knowledge. The XML parsing and rendering is done by the engine itself.
-
Sounds right
-
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
-
The minimap UI 'type' is initialized here: https://github.com/0ad/0ad/blob/master/source/gui/CGUI.cpp#L442
-
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);
-
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.
-
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.
-
Hi. See here if you want to get started programming: http://trac.wildfiregames.com/wiki/GettingStartedProgrammers Also feel free to ask questions.
-
Did you try this:
-
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 }); } }
-
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.
-
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.
-
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.
-
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.)
-
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.
-
Thanks
-
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.