Jump to content

Technical Triggers discussion


Recommended Posts

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

A trigger point has coordinates right? Will check the examples ...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Thank you.

I figured a OnTerritoryLeft event would not be bad.

Could this be a bit generalized? i.e.

  • SOLUTION A
    function 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 B
    Instead 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.

Link to comment
Share on other sites

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. :D

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

A trigger point has coordinates right? Will check the examples ...

Indeed. Only sparrow droppings are left, and I need help getting them all cleaned. :D

Link to comment
Share on other sites

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 by Hephaestion
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...