here is a little xmpl how to switch between Player #1 and #2. useful if you play with a CPU ally and he makes nonsens so you have to intervene *g*: // switches active player #1 / #2. type "control" in chat window.
any ideas ?
In the VictoryCondition code they can be easily implemented and offer much more abilities than via editor. you can use ALL system calls like xs..,kb..,ui..,tr..,ai.. . write your (trigger or any) code and call it eg. "myVC.xs". you should also have a line: - include "basicvcnomain.xs" - if you want to use the standard VC code. finally tell the editor (in scenario data) to use YOUR VC code.
of course you can do anything between hack&cheat upto ambitious solutions too complex for the trigger editor.
include "basicvcnomain.xs"
rule myControlHandler
minInterval 4
maxInterval 5
active
{
int setActPlyr = -1;
if ( trChatHistoryContains("control", 1) == true )setActPlyr = 2;
if ( trChatHistoryContains("control", 2) == true )setActPlyr = 1;
if ( setActPlyr >
{
trPlayerSetActive( setActPlyr );
trChatHistoryClear();
}
}void trModifyProtounit(string ProtoUnit, int PlayerID, int puField, float Delta);
remember: several fields are not absolute values but percentage related
/* puFields
0Hitpoints
1Speed
2LOS
3Train Points
4Build Points
5Max Contained
6Population Count
7Pop Cap Addition
8Lifespan
9Recharge Time
10Build Limit
11Range
12Minimum Range
13Num Projectiles
14Healing Rate
15Healing Range
16Cost Gold
17Cost Wood
18Cost Food
19Cost Favor
20Carry Capacity Gold
21Carry Capacity Wood
22Carry Capacity Food
23Carry Capacity Favor
24Armor Hack
25Armor Pierce
26Armor Crush
27Hand Attack Hack
28Hand Attack Pierce
29Hand Attack Crush
30Ranged Attack Hack
31Ranged Attack Pierce
32Ranged Attack Crush
33Hand Bonus v. Myth
34Hand Bonus v. Hero
35Hand Bonus v. Cavalry
36Hand Bonus v. Infantry
37Hand Bonus v. Archer
38Hand Bonus v. Siege
39Hand Bonus v. Tower
40Hand Bonus v. Ship
41Hand Bonus v. Building
42Hand Bonus v. Villagers
43Hand Bonus v. Huntable Animals
44Ranged Bonus v. Myth
45Ranged Bonus v. Hero
46Ranged Bonus v. Cavalry
47Ranged Bonus v. Infantry
48Ranged Bonus v. Archer
49Ranged Bonus v. Siege
50Ranged Bonus v. Tower
51Ranged Bonus v. Ship
52Ranged Bonus v. Building
53Ranged Bonus v. Villagers
54Ranged Bonus v. Huntable Animals
*/