Trigger to change units into other units

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trigger to change units into other units

BeornTheBold
Is it possible to use a trigger to change all instances of a particular unit into a different unit?  For example, to upgrade all early tanks (wherever they may be located) into later model tanks?
Reply | Threaded
Open this post in threaded view
|

Re: Trigger to change units into other units

crazy_german
The easiest work around is to get all early tanks to create the later tank, then remove the early tanks.

So trigger the following property to all early tanks after your advanced tanks are developed
                 <option name="createsUnitsList" value="1:advancedtank"/>

Then, after the turn ends have a trigger remove all early tanks from the map. Something like this
                 <option name="removeUnits" value="all:earlytank" count="100"/>
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|

Re: Trigger to change units into other units

BeornTheBold
I can see how that would work; however I also have a more complicated case as well:

I want capital ships (cruisers, battleships, carriers) to take more than one turn to build.  I have this working by using intermediate phase units, such as battleship_phase1, battleship_phase2, battleship_phase3, and then the completed battleship.  Players have to buy the correct phase unit to cause the battleship to progress towards completion each round, and the later phases consume the earlier ones (e.g. battleship_phase2 requires a battleship_phase1 to already exist in the sea zone in order to place it, and consumes it on placement).  The only problem with this approach is that in playtesting, it is a major hassle for players to remember which phases they need to buy each turn (a lot of flipping back and forth between the map and the production window), and it is difficult to tell the unit artwork apart.

If I used the approach you outlined for the tanks, it won't work for units with more than one phase.  (battleship_phase1 automatically creates a battleship_phase2, a trigger removes all battleship_phase1's, but I also need battelship_phase2 to create a battleship_phase3, and a trigger to remove all battleship_phase2's, and things are getting removed before they can advance).

If a trigger can simply change one unit into another, this will solve my problem.
Reply | Threaded
Open this post in threaded view
|

Re: Trigger to change units into other units

crazy_german
There is no way to trigger that, it was never coded. So you can't simplify that without putting some kind of a limit in play. What you could do is have phase1 produce a phase, and a condition checks if both phase1 and phase2 are present. If so, it removes phase1. Then, the next turn phase2 creates a phase3, a conditon checks for phase2 and phase3, and a trigger removes phase2.

This of course means you can only have 1 in progress ship in a territory at a time, I don't know if that limit would work for you.
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|

Re: Trigger to change units into other units

Cernel
In reply to this post by BeornTheBold
I suggest you implement this via the use of Resources as stack limits (very handy, look at Feudal Japan Warlords).

Each of your battleship_phase1 should produce a "bs1" resource before the purchase phase (I suggest you collect income at start turn, not at end turn, and this would fit just fine, but you can just put an End Turn phase without PUs collection), and each of your battleship_phase2 ships requires also a "bs1" resource to be purchased. Then, after purchase, you have a bunch of triggers removing all such hacky resources for purchasing limits enforcing.

This is going to be hacky, but it is both a trigger light and user friendly process, because you can make it with 1 trigger per fake resource, and the users will just need to take care to max out all the phase2+ units they can buy, before thinking what to buy next, in most cases.

The fact that you can't upgrade a battleship_phase1 to a battleship_phase2 and then to a battleship_phase3 on the same turn is already fully supported by the engine, for your info.

It would be nice if the engine would support limiting upgrades purchase to the max number of upgradable units (as you don't want to buy more), if any developers is listening, but this can be easily hacked out the way I just explained.

Remember that, obviously, a battleship takes about 2 years to complete so, for example, in a map like World At War, in which each turn is likely 1 month, you should have a battleship_phase1 upgrading to a battleship_phase2, upgrading to a battleship_phase3, upgrading to a battleship_phase4, upgrading to a battleship_phase5, upgrading to a battleship_phase6, upgrading to a battleship_phase7, upgrading to a battleship_phase8, upgrading to a battleship_phase9, upgrading to a battleship_phase10, upgrading to a battleship_phase11, upgrading to a battleship_phase12, upgrading to a battleship_phase13, upgrading to a battleship_phase14, upgrading to a battleship_phase15, upgrading to a battleship_phase16, upgrading to a battleship_phase17, upgrading to a battleship_phase18, upgrading to a battleship_phase19, upgrading to a battleship_phase20, upgrading to a battleship_phase21, upgrading to a battleship_phase22, upgrading to a battleship_phase23, upgrading to a battleship. And, of course, you can't place battleships in like Pearl Harbor or Truk or Rome, but only in very few places (actually, the USA weren't able to produce battleships in the Pacific coast at all, even tho some 20 years before they did it once).

I use this a lot in my MEAD (a map I'm making), for some reasons...
 ->
History plays dice