Radagast. Posted June 27, 2014 Report Share Posted June 27, 2014 I guess the problem will be how to insert trigger points in the map xml? And how to later reference them in the map.js ? Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 27, 2014 Author Report Share Posted June 27, 2014 Select them in Atlas, and place then on the map. Simple as that.Getting then is just something like this.GetTriggerPoints("A"), to get all A points in a list (which you can filter by owner later on if you want). Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 27, 2014 Report Share Posted June 27, 2014 Oh, didn't know you added it to Atlas. Now that I have an Atlas running, I will check it out.It's no problem if programming triggers has knocked all the chruch mice out of your church shieldwolf. Programming is not the easiest thing to learn. (it first and foremost takes time) A trigger point has coordinates right? Will check the examples ... Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 27, 2014 Report Share Posted June 27, 2014 Trigger points can't be moved directly it seems. Though removing and readding could work as alternative?trigger points define an owner, there note that not the player territory where the trigger is placed is the owner but each player can have its own triggers.General (non-player specific) triggers are assigned Gaia?Other than that nice work, the trigger points even graphically show the correct letter.Is it possible to have more than seven trigger points?Can I simply create a new template for a trigger point? It seems I have to create a mod for it if I wanted more trigger points. Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted June 27, 2014 Author Report Share Posted June 27, 2014 Trigger points can't be moved directly it seems. Though removing and readding could work as alternative?You have to hold the ALT key to select special entities in Atlas. When you get it selected, you can move it. trigger points define an owner, there note that not the player territory where the trigger is placed is the owner but each player can have its own triggers. General (non-player specific) triggers are assigned Gaia?Gaia is a player that's just not controlled. So a trigger point can belong to gaia or to anyone of the players for that map. Note that it doesn't make any difference for the interface who owns the trigger point. It's in the trigger code that you can make the difference. Other than that nice work, the trigger points even graphically show the correct letter. Is it possible to have more than seven trigger points?There are currently 11 different trigger point models, if that's what you mean. We hope that's enough for now, and if more are needed, we can ask Pureon to make some extra (Pureon made these too). But you can place as many trigger points on the map as you want, you'll just have to find a different way of distinguishing them (through owner, through position, ...) Can I simply create a new template for a trigger point? It seems I have to create a mod for it if I wanted more trigger points.If you have a model that fits a bit for usage in Atlas, you can just make new trigger points. The references don't even need to be single letters (like "A", "B", ...), it can also be a word. A mod can even add the trigger point component to existing entities, and give it a reference like "CivilCentre". I didn't do that, as I liked to keep the triggers a bit more separated than that. But if it's needed in the future, it's possible. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 27, 2014 Report Share Posted June 27, 2014 Thank you.I figured a OnTerritoryLeft event would not be bad.Could this be a bit generalized? i.e.SOLUTION Afunction OnRegionLeft({arrayOfCoordinateArrays, isEnabled}){ // connect the coordinates as polyline // somehow check if the unit left the region (probably costly! that's why we probably better use solution // { uppermostStar, bottomLeftStar, bottomRightStar } return { unitID /*=> via unitID we can get the current pos3D*/, pos3D_intersectionMovementRegionBorder, pos3D_directionOfClosestRegion }; * /| / | ..*..*..... .' '.. | region | |_______| }Or if there is a way to have territory without buildings then OnTerritoryLeft(playerID, isEnabled) would be enough.Edit: I figured returning the unitID is enough as when the OnRegionLeft event is triggered then the current unit position is exactly all three stars' positions at once!SOLUTION BInstead of an event, we use an interval trigger, where we check all registered regions' unit lists. Finally we'll have #regions + 1 arrays to that in union contain all units (the +1 because that's the list where the units are assigned that are no longer in any of the registered regions).When setting up the interval a callback function should be given that determines what happens: OnRegionLeft, OnRegionEntered.The difference to solution A is that we not have to examine unit positions on every move command. Though this solution B might even be more expensive in terms of performance than if we check if the move command's target position is outside of the region that contained the unit + if it's also in a new region.// ... (interval trigger, see above) // The callbacks:function regionLeft(data = { unit_id, region_id }){ // do something}function regionEntered(data = { unit_id, region_id }){ // do something different}This functionality is pretty important for me. OnRangeLeft and OneRangeEntered is not enough as Range is only a range and not an arbitrary polygon. Quote Link to comment Share on other sites More sharing options...
niektb Posted June 27, 2014 Report Share Posted June 27, 2014 (edited) Ehm, a few months ago I and sanderd17 made some code (see the supply topic) that broadcasts a message whenever the territory an entity is on changes.http://www.wildfiregames.com/forum/index.php?showtopic=18272&page=1 Edited June 27, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
shieldwolf23 Posted June 28, 2014 Report Share Posted June 28, 2014 If you are really a great map+triggers maker, you could propose some triggers to be implemented. You do the maps, we do the triggers It would give us a better overview of what's needed, and more reference implementations.Thank you, Sander. I'll definitely need that one of these days. Ramadan is just around the corner, and with it, shortened work-times that can be devoted to better pursuits like 0 AD. Oh, didn't know you added it to Atlas. Now that I have an Atlas running, I will check it out.It's no problem if programming triggers has knocked all the chruch mice out of your church shieldwolf. Programming is not the easiest thing to learn. (it first and foremost takes time) A trigger point has coordinates right? Will check the examples ...Indeed. Only sparrow droppings are left, and I need help getting them all cleaned. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 28, 2014 Report Share Posted June 28, 2014 Nevermind, we can approximate the OnRegionLeft|Enter with OnRangeLeft|Enter.The on TerritoryLeft+ Enter broadcas messages are interesting. I have to subscribe to those messages but I think it's not required for the current map. Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 29, 2014 Report Share Posted June 29, 2014 (edited) You have to hold the ALT key to select special entities in Atlas. When you get it selected, you can move it.It's a bit tricky as ALT wants to move the window. Thus I first have to start box selection, then press ALT and finish the box selection. This way it works for me. Edited June 29, 2014 by Hephaestion Quote Link to comment Share on other sites More sharing options...
Radagast. Posted June 29, 2014 Report Share Posted June 29, 2014 For me moving those special entities not works even if I get them selected. I need to have at least 1 "normal" entity selected. I would prefer having the ALT key to refine a box selection.But it might well be that this is a GNOME issue. Quote Link to comment Share on other sites More sharing options...
feneur Posted June 29, 2014 Report Share Posted June 29, 2014 You need to keep the Alt-key pressed while interacting with the actors. But yeah, sadly it seems like Gnome have kidnapped the Alt-key completely in these cases 2 Quote Link to comment Share on other sites More sharing options...
shieldwolf23 Posted June 29, 2014 Report Share Posted June 29, 2014 I've opened a thread discussing plans of a campaign in my head, that would surely involve a lot of trigger work. Please do check it, especially Sander.http://www.wildfiregames.com/forum/index.php?showtopic=18884 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.