I'm using a CAbilTransport on different types of unit.
Players can only load units if some conditions are verified, so I need to use validators... but for every type of unit I would like to use a different check and return a different type of error message too.
For example, if a player tries to load units on unit type X1, X2 requirement is checked and, if it fails, message X3 is shown. If a player tries to load units on unit type Y1, Y2 requirement is checked and, if it fails, message Y3 is shown. And so on...
So you want the unit type, that can be loaded, depend on the transporter unit type?
If so, I think the easiest way would be to create a validator of the type "Condition". First create a "Unit Type" validator, thats X1. Also modify the field "Result - Failure" for your error message (X3). Set it to Custom Text and enter your error message. Then create a "Player Requirement" validator, that checks the requirement (X2). Finally create the "Condition" validator and modify the "If+" field. Fill in your unit type validator (X1) in the Test field and the requirement validator (X2) in the Return field.
Mh... no, not exactly. Well, could just try to produce something similar. The load/unload ability is shared among various transports, and those transports can load units only if the player owning them has a specific upgrade.
For example:
1) I have a Thor Transport. A player can load its units inside it only if it has the Thor Transport Upgrade.
2) I have a Cruiser Transport. A player can load its units inside it only if it has the Cruiser Transport Upgrade.
Etc... so, when I use the load/unload ability I need to find the transport type and check a different upgrade depending on it.
I see. So you want a specific transporter only be able to load units when the required upgrade is researched? In that case I would just duplicate the "Medivacs - Load/Unload" ability and add requirements and upgrades. Check out the map.
I'm using a CAbilTransport on different types of unit.
Players can only load units if some conditions are verified, so I need to use validators... but for every type of unit I would like to use a different check and return a different type of error message too.
For example, if a player tries to load units on unit type X1, X2 requirement is checked and, if it fails, message X3 is shown. If a player tries to load units on unit type Y1, Y2 requirement is checked and, if it fails, message Y3 is shown. And so on...
So you want the unit type, that can be loaded, depend on the transporter unit type?
If so, I think the easiest way would be to create a validator of the type "Condition". First create a "Unit Type" validator, thats X1. Also modify the field "Result - Failure" for your error message (X3). Set it to Custom Text and enter your error message. Then create a "Player Requirement" validator, that checks the requirement (X2). Finally create the "Condition" validator and modify the "If+" field. Fill in your unit type validator (X1) in the Test field and the requirement validator (X2) in the Return field.
Mh... no, not exactly. Well, could just try to produce something similar. The load/unload ability is shared among various transports, and those transports can load units only if the player owning them has a specific upgrade.
For example:
1) I have a Thor Transport. A player can load its units inside it only if it has the Thor Transport Upgrade.
2) I have a Cruiser Transport. A player can load its units inside it only if it has the Cruiser Transport Upgrade.
Etc... so, when I use the load/unload ability I need to find the transport type and check a different upgrade depending on it.
I see. So you want a specific transporter only be able to load units when the required upgrade is researched? In that case I would just duplicate the "Medivacs - Load/Unload" ability and add requirements and upgrades. Check out the map.