Opened 11 years ago

Last modified 10 years ago

#2154 closed enhancement

[PATCH] Add an alert button (kind of Town Bell) — at Version 15

Reported by: Itms Owned by: Itms
Priority: Nice to Have Milestone: Alpha 16
Component: UI & Simulation Keywords: patch
Cc: againsttcpa84@… Patch:

Description (last modified by Itms)

This feature works like this :

  • A new component, named AlertRaiser, allows for example CCs to sound the alarm
  • The alert is effective just in a range which can be adjusted in AlertRaiser (I chose initial territory extension for CCs, which are for the moment the only template implementing this component)
  • The alarm can be triggered in 'yellow alert' (ie. normal mode) and all female citizens look for a place to garrison. Then, one can trigger the 'end of alert', or pass into 'red alert', in that case all units try to garrison
  • The feature uses the back to work behaviour when the alert ends.
  • The End of Alert is effective across the entire map, but ungarrisons only the units garrisoned by the ungarrisonning AlertRaiser

I need artwork for the feature, please visit this post : http://www.wildfiregames.com/forum/index.php?showtopic=17703

Change History (23)

comment:1 by Itms, 11 years ago

Description: modified (diff)

comment:2 by Marcio, 11 years ago

this ticket is already exist and if you want see the list of button and commands go to. http://www.wildfiregames.com/forum/index.php?showtopic=16932&hl=buttons&fromsearch=1

comment:3 by Adrián Chaves, 11 years ago

See also #35.

comment:4 by Itms, 11 years ago

Description: modified (diff)
Summary: Add a "City Bell" buttonAdd a "Town Bell" button

comment:5 by Michael, 11 years ago

Cc: againsttcpa84@… added

comment:6 by Itms, 11 years ago

Description: modified (diff)
Keywords: review patch added
Summary: Add a "Town Bell" button[PATCH] Add a "Town Bell" button

This is the patch I wrote. It works after revision [13987] which implements the back to work behaviour.

Please tell me what you think about it !

by Itms, 11 years ago

Attachment: patch_townbell.diff added

comment:7 by Tom Brewe, 11 years ago

I compiled from the latest svn but couldn't find the city bell buttons on a civic center. Where are they supposed to be?

comment:8 by Itms, 11 years ago

I am not allowed to commit anything : I attach my testing-buttons to this ticket, they must be placed in binaries/data/mods/public/art/textures/ui/session/icons/

However, these buttons shall be replaced soon by buttons designed by the artwork department. See this thread on the forums : http://www.wildfiregames.com/forum/index.php?showtopic=17703

Then you patch your copy of the svn with the patch I attached and it should work. You don't have to recompile anything since my changes apply to the javascript side.

by Itms, 11 years ago

Attachment: bell_level0.png added

by Itms, 11 years ago

Attachment: bell_level1.png added

by Itms, 11 years ago

Attachment: bell_level2.png added

comment:9 by sanderd17, 11 years ago

Resolution: fixed
Status: newclosed

EDIT: closed by mistake

Last edited 11 years ago by sanderd17 (previous) (diff)

comment:10 by Itms, 11 years ago

Resolution: fixed
Status: closedreopened

I think this is a mistake in the number of the ticket ref'ed.

comment:11 by Itms, 11 years ago

Status: reopenednew

comment:12 by sanderd17, 11 years ago

Sorry, the ticket that should have been closed is #2048.

Last edited 11 years ago by sanderd17 (previous) (diff)

comment:13 by Marcio, 11 years ago

Why many levels? And if building have a flag points ignoring that, right?

Last edited 11 years ago by Marcio (previous) (diff)

comment:14 by sanderd17, 11 years ago

Some comments on the code:

  • I don't like most of the GarrisonHolder changes. The TownBellStriker should remember the units it garrisoned, not garrisonHolder. The only thing you might need to change there is a method to ungarrison units without following the ralleypoint, or maybe you can immediately replace the unitAI command.

You can achieve this by listening to the GlobalGarrisonedUnitsChanged message, and checking the entity ids.

  • IMO, if you make a difference between alerts, a red alert should garrison all units (including heroes), this is a must for some maps that start with a hero unit.
  • You don't need empty DeInit and OnUpdate functions
  • why is there a difference in UnitAI on the Garrison command in both cases? (wrt to the data encoding)
  • Your code should watch out with moving garrisonholders (like ships, rams ...), it would be best to exclude those.

comment:15 by Itms, 11 years ago

Description: modified (diff)
Summary: [PATCH] Add a "Town Bell" button[PATCH] Add an alert button (kind of Town Bell)

Hello, I corrected what you pointed out in the code. It allowed me to improve the behaviour of units still not garrisoned when the alert ends. I also added the sounds provided by LAVS, which I attach to the ticket, they must be placed into binaries/data/mods/public/audio/interface/alarm/

Let me know what you think of the code.

I open a thread on the forums to discuss the number of levels needed for the bell : http://www.wildfiregames.com/forum/index.php?showtopic=17807

Last edited 11 years ago by Itms (previous) (diff)

by Itms, 11 years ago

Attachment: patch_townbell.2.diff added

by Itms, 11 years ago

Attachment: alarmalert.ogg added

by Itms, 11 years ago

Attachment: alarmalertend.ogg added

by Itms, 11 years ago

Attachment: alarmalertred.ogg added
Note: See TracTickets for help on using tickets.