Jump to content

Recommended Posts

Pg15RX3.png
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.

3N4fZG5.png

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):
screenshot0003%20(2).png

We'll keep you up-to-date with weekly updates! Keep in touch! Edited by niektb
  • Like 6
Link to post
Share on other sites

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.

Link to post
Share on other sites

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 : :yes3:

screenshot0004%20%282%29.png

screenshot0005%20%282%29.png

screenshot0006%20%282%29.png

screenshot0007%20%282%29.png

  • Like 5
Link to post
Share on other sites

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:)

  • Like 2
Link to post
Share on other sites

Pg15RX3.png

Update #1

A 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:

AncientGreeceMapoftheBattleofMar-1.jpg
264eTsC.png

We also included a visibility flag like you once saw in AoK:

Y538Nfo.jpg

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 by niektb
  • Like 2
Link to post
Share on other sites

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).

Link to post
Share on other sites

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.

Link to post
Share on other sites

Pg15RX3.png

Update #2: About GUI notifications

NOTE: 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 Window
This is the most complicated version of the two. Thanks to sanderd17 for implementing it. (Excuse me for the Dutch Localisation)

Kow3kAn.jpg


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 Notification

6mNfCdD.jpg

This 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.

x8jyTOi.jpg
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 by niektb
Link to post
Share on other sites

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!

  • Like 1
Link to post
Share on other sites

Thanks for you testing, I indeed forgot to disable that trigger. Thanks for your other fixes too. :D

Here is a new version (much smaller too by removing some git folders)

Edit: see next post.

Edited by niektb
Link to post
Share on other sites

Pg15RX3.png

Update #3: About Resources

Sometimes 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 by niektb
Link to post
Share on other sites

Pg15RX3.png

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:

haoji3h.jpg
eeaiBrY.jpg
QFh6z8U.jpg

I hope you enjoyed the map A Silent Day In Gaul! Keep in touch for other updates!

  • Like 2
Link to post
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.

×
×
  • Create New...