niektb Posted November 21, 2014 Report Share Posted November 21, 2014 (edited) Hi everyone!We decided it would be a good idea to do some pioneering work on trigger-based scenarios. Hence we are going to create a trigger-based scenario called Athens Triumphant.The main purpose of this project is logically to do pioneering work on triggers, to provide a base for other maps and to get our Scenario Designers accustomed with the Trigger functionality in 0 A.D.This scenario deals with the Greco-Persian Wars. We divided it roughly into three parts: Battle of Marathon, Defense of Athens and the Battle of Salamis.We created a story diagram to give an easily readable overview of the story line. Note that this could be changed in the future.We have used the Athens Sandbox as a base to build our map upon. Here is the current status (with some triggerpoints and names placed):We'll keep you up-to-date with weekly updates! Keep in touch! Edited November 21, 2014 by niektb 6 Quote Link to comment Share on other sites More sharing options...
Thorfinn the Shallow Minded Posted November 21, 2014 Report Share Posted November 21, 2014 Definitely there are some good thoughts put into this, but I would recommend a few changes to the scenario design. First, walling the isthmus would have been ineffective with the navy free to disembark troops anywhere on Peloponnesus. Rather, the focus could be to rally city-states to your side with different benefits. For instance Argos would provide a reliable army and industry to support you since it was a major weapons manufacturer. The problem would be of course that they would be difficult to win over. Corinth on the other hand might provide a good navy and base for trade operations. The Kingdom of Macedonia could lend cavalry support. With this adding a scenario for the Battle of Plataea could add an interesting element. Quote Link to comment Share on other sites More sharing options...
shieldwolf23 Posted November 21, 2014 Report Share Posted November 21, 2014 Appreciate the scenario inputs, Thorfinn! We might as well put those ideas in a similar scenario in the future. However, we have used the sandbox Athens map to make map-making easier and less time-consuming, so we can only put ideas and scenario objectives within the constraints of the map itself. Having said that, I have started the painting of the map, and lo, my inadequate painting : 5 Quote Link to comment Share on other sites More sharing options...
Prodigal Son Posted November 21, 2014 Report Share Posted November 21, 2014 Perhaps you could slightly edit the terrain to make the east more of a block of land by removing that north-east "lake", and place a new Isthmus to the west? This would make the geography of the region much closer to accurate without major edits. Still Marathon and Athens would be rather misslocated though.Besides the geography restrictions the use of the pre-made map causes, it looks great:) 2 Quote Link to comment Share on other sites More sharing options...
shieldwolf23 Posted November 21, 2014 Report Share Posted November 21, 2014 Agree, Prodigal Son. Maybe Niek or Thamlett could edit the locations out. By the way, I'm a fan of your mod attempts, although I don't have the time to really put myself as a playtester. Quote Link to comment Share on other sites More sharing options...
Prodigal Son Posted November 22, 2014 Report Share Posted November 22, 2014 Agree, Prodigal Son. Maybe Niek or Thamlett could edit the locations out. By the way, I'm a fan of your mod attempts, although I don't have the time to really put myself as a playtester. Thanks and np:) I've got some pretty major changes coming up soon btw. End of off-topic:p Quote Link to comment Share on other sites More sharing options...
Andrettin Posted November 22, 2014 Report Share Posted November 22, 2014 Pretty nice Quote Link to comment Share on other sites More sharing options...
niektb Posted November 28, 2014 Author Report Share Posted November 28, 2014 (edited) Update #1A week has past and so it's time for another update.The map has received a number of painting updates including Geographical changes suggested by Prodigal Son. Also the field of Marathon is moved a little to the North East to better match the original circumstances: We also included a visibility flag like you once saw in AoK:It's non-selectable and indestructible but has a vision range and a player owner.That concludes it for this week. More updates are Work in Progress and will be included in coming updates so keep in touch! Edited November 28, 2014 by niektb 2 Quote Link to comment Share on other sites More sharing options...
Radagast. Posted November 30, 2014 Report Share Posted November 30, 2014 Another magic quality project by the 2-man-dreamteam. Looking forward to that one!As of the 3 battle choices I'd set up 3 new storyline machines and deactivate the old ones (if any). Then reassign the 2 not-by-player chosen storylineMachines to the 2 remaining players randomly.Always wanted to see this happen, we need more of that (there are many famous strategic masterpieces in history that have prevented the doom of a civilization). Quote Link to comment Share on other sites More sharing options...
shieldwolf23 Posted November 30, 2014 Report Share Posted November 30, 2014 Thanks Radagast! Please feel free to contribute, if not for the map but for inputs like just what you did now. Niek has a surprise that will come within the weekend. So stay tuned, brother!Offtopic: Please, I know how disappointed you are these past weeks, but stretch more your patience. If you believe in a noble goal, you'll see to its existence whatever it takes. Quote Link to comment Share on other sites More sharing options...
niektb Posted November 30, 2014 Author Report Share Posted November 30, 2014 *week. I don't have the time for that this weekend. Oh, and don't expect too much! Quote Link to comment Share on other sites More sharing options...
niektb Posted December 2, 2014 Author Report Share Posted December 2, 2014 (edited) Update #2: About GUI notificationsNOTE: In my code info I assume you've read (and understood) http://trac.wildfiregames.com/wiki/Triggers.As a Mapmaker you of course need to tell the player something. I think two types are going to be used most. I call them (1) Dialogue Window and (2) GUI Notification.Dialogue WindowThis is the most complicated version of the two. Thanks to sanderd17 for implementing it. (Excuse me for the Dutch Localisation)In the code the window needs to be specified as well as a number of buttons and some side-info. For the above window I used the following code:Trigger.prototype.VisitVillageDialog = function() { var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGUIInterface.PushNotification({ "type": "dialog", "players": [1,2,3,4,5,6,7,8], "dialogName": "yes-no", "data": { "text": { "caption": { "message": markForTranslation("Welcome, young man. I already heard of your arrival. What is it you are looking for?"), "translateMessage": true, }, }, "button1": { "caption": { "message": markForTranslation("I'm looking to increase my combat skills!"), "translateMessage": true, }, "tooltip": { "message": markForTranslation("Say this"), "translateMessage": true, }, }, "button2": { "caption": { "message": markForTranslation("I'm looking to increase my wisdom!"), "translateMessage": true, }, "tooltip": { "message": markForTranslation("Say this"), "translateMessage": true, }, }, }, });};However, to receive the answer the mapper has to create a Listener that keeps track of the Player Commands (as pressing one of the two buttons is a player command). It can be done the following way:Trigger.prototype.PlayerCommandHandler = function(data) { if ((data.cmd.type == "dialog-answer") && (data.cmd.answer == "button1")) //do something};I also check whether the Player Command issued is a button press (as there are multiple types possible like a move command) and I check which button is actually clicked on. If you have multiple dialogs I also suggest that you check for the name of the dialogue to make sure you don't mess around with the various Dialogue Windows. This PlayerCommandHandler needs to be registered of course like described in the Wiki.GUI NotificationThis one is much easier to understand and to code, as it doesn't require feedback of the player. I've defined the following function (credit to Radagast for coding it, one fix aside) to make life easier://Post a GUI notification//@param players: Array of playerIDs to post the message to//@param message: the to be posted message in a Stringfunction PushGUINotification(players, message) { if (!players || !message || message == "") return; var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); var recipients = players; if (!players.length) recipients = [players]; cmpGUIInterface.PushNotification({ "players": recipients, "message": message, translateMessage: true });}This can be called in the storyline (or wherever you want to post a GUI notification) like the following:PushGUINotification([1], markForTranslation("Shame on you! You've been killed!"));That's it, now a notification pops up like shown in the image. No additional code required. In order to test and learn all these stuff I've created a small map (surprise!). I hope you don't mind I actually didn't bother too much with the aestetics and storytelling (it's quite short) but rather focused on the code. Once more credit to Radagast (or was it Stanislas?) for creating a Do Nothing AI to make sure nothing interferes with the storyline.I hope you all enjoy it! Happy playing (as long as it lasts)!In future updates I'll grab more code snippets from this map and explain these in detail. Edited December 4, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
Loki1950 Posted December 2, 2014 Report Share Posted December 2, 2014 Nice looking map niektb It feels that you see a complete eco system Enjoy the Choice Quote Link to comment Share on other sites More sharing options...
niektb Posted December 2, 2014 Author Report Share Posted December 2, 2014 Thank you! Quote Link to comment Share on other sites More sharing options...
s0600204 Posted December 3, 2014 Report Share Posted December 3, 2014 Short but sweet! Just one thing (possible spoiler)... it would seem that the Trigger FleeToTheEast is not disabled after use - and so one quickly ends up with a couple hundred reinforcements, rather than the five scripted. (which the pathfinder really doesn't like ). Also, I'm not sure if you're working with a newer version of the Trigger component, but on A17 I'm getting warnings popping up... One warning from line 196 of the map's JS script and another from line 8 of the Entity.js helper script are about using Objects (they're actually arrays, but JS's typeof never could tell the difference) instead of Integers. Changing [data["building"]] to data["building"] on line 196, followed by adding [0] to the end of line 199 (before the semicolon) below it cleared these up for me. Removing the <visibility/> tag and merging the contents of the two VisualActor tags in visibility_flag.xml resolved several warnings received from the XML Parser. Problems aside, it's a good indicator of the potential to come. Keep it up! 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted December 3, 2014 Author Report Share Posted December 3, 2014 (edited) Thanks for you testing, I indeed forgot to disable that trigger. Thanks for your other fixes too. Here is a new version (much smaller too by removing some git folders)Edit: see next post. Edited December 3, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
niektb Posted December 3, 2014 Author Report Share Posted December 3, 2014 (edited) And another one Edit: I keep fixing map_A_Silent_Day_In_Gaul.zip Edited December 3, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
niektb Posted December 4, 2014 Author Report Share Posted December 4, 2014 I fixed some text and defeat conditions. I consider this my final release, I'd better focus on the main scenario map_A_Silent_Day_In_Gaul.zip Quote Link to comment Share on other sites More sharing options...
Yves Posted December 4, 2014 Report Share Posted December 4, 2014 I'm glad people are experimenting and working with triggers. Also your work and the approach makes a very good impression. I hope I'll have some time for testing it soon. Keep up the good work! 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted December 4, 2014 Author Report Share Posted December 4, 2014 There was an issue with the Localisation of the GUI Notifications, I corrected the post. (markForTranslation should be done directly on the to be translated text) Quote Link to comment Share on other sites More sharing options...
niektb Posted December 4, 2014 Author Report Share Posted December 4, 2014 (edited) I've also created a github repo for it: https://github.com/0ADMods/map_A_Silent_Day_In_Gaulfeel free to create forks / pull requests, or anything you like. Edited December 4, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
niektb Posted December 5, 2014 Author Report Share Posted December 5, 2014 Screenie time! Quote Link to comment Share on other sites More sharing options...
shieldwolf23 Posted December 6, 2014 Report Share Posted December 6, 2014 Perfect, just perfect! Quote Link to comment Share on other sites More sharing options...
niektb Posted December 7, 2014 Author Report Share Posted December 7, 2014 (edited) Update #3: About ResourcesSometimes you want to give a player resources, either to enable him to do something or reward him for things he did earlier. I wrote a little function to do that easily.//Add a certain amount of a given resource to a given player//@param PlayerID: the ID of the player that receives the resources//@param resources: object that holds resource data: var resources = {"food" : 500};function AddPlayerResources(PlayerID, resources) { var Player = TriggerHelper.GetPlayerComponent(PlayerID); for(var type in resources) { var resource = Player.GetResourceCounts()[type]; if ((resources[type] < 0) && (-resources[type] > resource)) resources[type] = -resource; Player.AddResource(type, resources[type]); }}In case you already looked at the code in A Silent Day In Gaul, I improved the behavior a bit to allow for passing data objects if you want to add multiple resources (so you don't have to call the function multiple times).Calling can be done like this:this.PlayerID = 1;var resources = { "wood": 500, "stone": 500, "metal": 500};AddPlayerResources(this.PlayerID, resources); Edited December 7, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
niektb Posted December 14, 2014 Author Report Share Posted December 14, 2014 Update #4:I believe it has been quite a while since the last week so here is another one. Let's start with the bad news: my development PC broke down last week with a faulty HDD so that delayed the coding side. Luckily I had the code on a different hard drive so my work from the past week is not lost. (I did lost a number of photoshop files I created, like the Mapping Contest banner/symbol, though)The Good news: the map has received a number of painting updates in order to populate the world more by adding a number of small villages:I hope you enjoyed the map A Silent Day In Gaul! Keep in touch for other updates! 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.