Jump to content

Attack notification


Recommended Posts

If anyone is interested in working on this, I've cleaned up and slightly expanded upon quantumstate's prototype and uploaded it here:

https://github.com/z...ck-notification

Currently, it correctly presents a textual warning to the player who has come under attack. This should be replaced with an aural warning. It plays an aural warning to the player who has come under attack.

However, the minimap 'ping' notification has yet to be implemented. This must be done in C++, I believe. A function for acquiring a list of ongoing attacks against the current player is already in place. The minimap ping has been implemented by madmax.

Finally, this implementation suppresses repeated attack signals from the same location, so as to not inundate the player with warnings from the same battle, but not attack signals from the same unit. If the unit is moving (fleeing), it's conceivable that the player will get multiple warnings for the same skirmish. This should be fixed.

Edited by zoot
Link to comment
Share on other sites

Currently, it correctly presents a textual warning to the player who has come under attack. This should be replaced with an aural warning.

As of this commit, it now plays a dog bark when any infantry units come under attack :) Any help with the minimap implementation would still be appreciated.

Link to comment
Share on other sites

  • 4 weeks later...

As stated above, the minimap notification has yet to be implemented, so the ticket is not done yet. Right now, it just plays a notification sound, but you have no indication where the attack is occurring (unless the camera is already pointed there).

Also, the sound needs to be added to all relevant unit templates. For now, it has only been added to the infantry unit template.

Link to comment
Share on other sites

As stated above, the minimap notification has yet to be implemented, so the ticket is not done yet. Right now, it just plays a notification sound, but you have no indication where the attack is occurring (unless the camera is already pointed there).

Also, the sound needs to be added to all relevant unit templates. For now, it has only been added to the infantry unit template.

So we can have different sounds for different units? Say a special sound for heroes being attacked?

Link to comment
Share on other sites

ok, so noobish questions now....

I have just updated my SVN code and I do not see zoot's changes in template_unit_infantry.xml

Are the github and SVN code bases kept in sync ? Should I fork from github for future changes or stick with SVN ? Where is the action currently, so to speak :P

Link to comment
Share on other sites

Relevant questions. My changes reside in a branch on Github. You can think of this as a codebase existing in parallel to Wildfire Games' main 0ad mirror on Github.

If anyone wants to continue work on attack notification, they can fork the code from my branch and begin adding their changes to it. When they are done, they must then merge their changes into the main repository.

The main repository for now is still SVN, so you should stick with that if you want to follow the mainline of development. The main 0ad mirror on Github (0ad/0ad) is updated from SVN every few days by k776. My repository (zootzoot/0ad), where the attack-notification branch resides, is only updated when I make any changes.

Edited by zoot
Link to comment
Share on other sites

Ok thanks ! So I just forked your repository. Now I am cloning it into my local machine using the Git Bash console. It seems to be cloning the 0ad master branch and not your branch specifically.

Also, I can switch branches in the github web interface. I could not see 0ad / binaries / data / mods / public / simulation / components / AttackDetection.js

So I switched the branch in the web interface to attack-notification and now I do see it in the github website.

But I guess changing branches in the web interface won't automatically download the files specific to the attack-notification branch to my system ? I guess I need to make the active branch in my local machine as attack-notification ? Only then the files specific to this branch will be added to my local copy ?

By default the master branch will probably be my active branch in my local copy.

Edited by madmax
Link to comment
Share on other sites

Yes, the web interface is only a representation of what is on Github. To use the attack-notification branch on your local machine you have to "check it out".

If you have already cloned my repo to your own machine, you should be able to do:

git checkout attack-notification

If you get a message reading "Switched to branch 'attack-notification'", you should then be able to find AttackDetection.js in the relevant subdirectory.

Edited by zoot
Link to comment
Share on other sites

So now the entire 3 or 4 gb repo is being cloned by GitBash into my local drive. I am wondering if it would be faster for me to see the effect of your changes, if I make a diff of the attack-notification branch from github and apply this diff to my SVN copy(which I already have). Then compile and run the game.

Perhaps I should save https://github.com/z...tification.diff to a diff file and try to apply it to SVN. Does this diff contain all your changes ?

If the build fails, I can always revert to the server copy in SVN.

Edited by madmax
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...