A complete guide to the transform trigger

By nottud
created 12/31/08

How I found it

It all started when Two_ace_u showed me the console and how to use it. He told me that you could use it to bring up commands and insert them. He said that if I put in helptext(“.”) that I would get every command in the game. I put it in and it brought up loads of commands. I started to get excited because I realised it was likely to be how Reyk got his commands to make the new editor. Indeed, it seemed Reyk knew all about the console because he also said to put helptext(“.”) to get the commands. Anyway, I looked through the command list but I didn’t see anything mega useful. Anyway, I was curious about something. Were there any commands in which the help text did not have a . in it? So, I tried that instead and put helptext(” “). This brought up more commands than helptext(“.”) because like I thought, some of the commands did not haven a . in their helptext. I was browsing though these extra commands when I found “unitTransform(proto1,proto2):replaces all of one with the other, via mutation” which as you can see does not contain a full stop which is likely to be why I was the first to find it and all because of my crazy curiosity. After several attempts – I did actually give up and came back to it later, I managed to eventually get it to work. I then made the command into a trigger and the transform trigger was born. (It is extremely lucky that it works as a trigger – very few commands do!)

Facts about the trigger

A few facts which you should find useful when you want to use this trigger.

  • Works by mutation – so it keeps everything that you have selected on the unit.
  • It can change ANY unit unlike the change units in area
  • Affects ALL players.
  • Keeps the size of the previous unit
  • Keeps the lifespan of the previous unit – when you want to – prevent the transformed unit from dying from it’s lifespan, modify the unit it USED to be or it won’t work!
  • Keeps most coding that it attached to the unit – e.g. fade ins, coding to destroy the unit after time, etc.
  • Some units if changed to will crash the game – e.g. cows, relics except under special circumstances, some of which I will mention later.
  • Can often keep it’s position on the Y axis – e.g. making floating units!
  • Keeps the LOS of the old unit.
  • WORKS ONLINE!

How to get this trigger or use it without getting it

There are several ways which you can obtain or use the trigger:

(1)Download my trigger here: Here with my editor super pack.

(2)Make up the trigger using xs user code if you have it:

unitTransform(“proto1″,”proto2”);

Simply type it into the trigger text box and replace the proto1 and 2 with what you want to transform from and 2. This is case sensitive!

(3)If all else fails – e.g. you can’t download and you don’t have xs user code then there is a third way. Insert 3 trigger effects that you can type in in some way (e.g. send chat) and put the following into each of them:

“); /*
*/unitTransform(“proto1″,”proto2”);/*
*/ //

Like, xs user code, replace proto1 and proto2 with units of your choice. If you wish to have more that 1 transform, you only have to use the second line again which goes between the first and last command line. I.e. The first and last part is what allows you to insert the code, the lines in between are the actual lines of code.

If you are random map scripting, you can add this trigger by inserting the following void command and trigger commands:

Void

void code(string xs=””) {
rmAddTriggerEffect(“SetIdleProcessing”);
rmSetTriggerEffectParam(“IdleProc”, “true); “+xs+” trSetUnitIdleProcessing(true”);
}

Trigger code

code(“unitTransform(\\”proto1\\”,\\”proto2\\”);”);

Replace proto1 and 2 with units of your choice – coding is case sensitive!


TRICKS WITH IT!

Below is a list of tricks and guides you can do with the trigger. I am sure that there are many other tricks you can do but here are some of the main ones:

CHANGING PROJECTILES

Any moving projectile from a unit can be transformed to throw something else. Steps to using it are:
(1)Modify the projectile lifespan so it has a minus amount – e.g. -100 on the lifespan modify protounit
(2)Put a transform trigger on loop changing the projectile into something else.

CHANGING GOD POWERS

Any protounit that a god power makes can be changed into something else. It will also keep the coding given by a god power. It will even keep the size and fade given by the god power. How to use:
(1)Put a transform trigger on loop changing the protounit of the god pwoer into a unit of your choise
(2)Change lifespan of any units you want to die after time or not die at all, etc

TEXTURE CHANGE

Unit textures can be changed with this trigger too! If there is something that changes the texture of a unit and you change the unit with that texture to another one, it keeps the texture! The following texture changes currently known to work are:

  • Bronze – from bronze god power
  • Stone – from medusa
  • Woody brown – From the forest fire god power

How to use:
(1)Do whatever is needed to produce a unit with the texture.
(2)Transform the unit with that texture to one of your choice

The texture disappears at the same time the texture on the other unit would do normaly.

NOTE:If you change medusa stone, the unit must be transformed before it completely stops moving or it won’t work but not too early that you don’t get the texture.

CARRYABLE UNITS

Relics that have been picked up can be transformed into another unit so that the unit that is carrying the relic is now carrying that unit. The picked up unit CANNOT be selected untill the original unit drops the relic (or what now the unit!).

How to use:
(1)Get a hero to pick up the relic
(2)Transform the relic into a unit of your choice

MAKING ANY UNIT BLOCK GOD POWERS

Any unit using the transform trigger can be made to block god powers in the same radius of a hesperides tree.

How to use:

(1)Place a hersperides tree of the player you want the isis monument to be the equivilent of.
(2)Transform it to the unit you want to block god powers

The unit will keep the god power block radius on it as if it is an isis monument or that is what the game message says!

WARNING: If a capturable unit is captured, the effect of the block is cancelled for all the units on the map!

CHANGING THE CONTENTS OF GARRISONED UNITS INTO UNITS YOU CAN’T GARRISON

This is quite an interesting effect. You could change the relics in a temple to titans for example, when the temple is killed titans would come out and wreck havoc on the map!

How to use:
(1)Garrison the unit you want to change inside something
(2)Transform it to another unit of your choice

CHANGING THE UNIT SOMETHING IS GARRISONED IN TO SOMETHING YOU CAN’T GARRISON IN

You can also change a unit is garrisoned in keeping the garrisoned units in!

How to use:
(1)Garrison the unit in the unit you want to change
(2)Transform the unit one the units are garrisoned inside to a unit of your choice!

MAKING GIANT UNITS APPEAR OUT OF NOWHERE

The transform trigger can also be useful in making giant units deploying/appearing out of thin air.

How to use:
(1)Place a unit in editor which you cannot see ingame and increase the size of it. This can be hard because depending on the unit it is likely you will not be able to see it increasing in size. It is really so don’t worry.
(2)When you want the giant unit to appear, make the invisible unit transform into the giant unit of your choice.

SOULS APPEARING FROM KILLED ENEMIES

You can make souls of killed enemies appear where the enemy unit is killed. This is done by transforming generic corpse sfx into a unit of your choice It is good idea to use an establishment like Hero Death sfx or Osiris sfx for this. It is best to have something that will only appear for a short time. If that is a problem, change the lifespan of generic corpse so it dies after short time. You cannot select the unit that is created by this effect either and it will not crash if changed into crashable units.

How to use:
(1)Loop a transform trigger changing generic corpse into a unit of your choice.

NOTE:Not all units will produce a generic corpse when they die but most will so it is worth doing.


Afterword

This is an amazing find and I am sure that you will have to agree. Feel free to experiment with the trigger and post any finds you get. Please also credit Two_ace_u because it was him who showed me the console in the first place which led onto the find of this trigger. I hope that this article will clear up any mishaps that you have about this trigger and hopefully you have learnt a lot from this trigger. I am looking forward to seeing plenty of maps from you using this trigger! – in fact, this is already happening for I have already played several maps with it on.