Monkwarrior
06-17-2006, 07:24
This is a question for the expert scripters, because I'm unable to find the difference between one working script and one not-working.:help:
First case:
Human player: romans_julii
Objective: simulate the conquest of Saguntum by the carthaginians.
Piece of script:
monitor_event FactionTurnStart FactionType carthage
and I_TurnNumber = 0
console_command control carthage
console_command capture_settlement Saguntum
console_command create_unit Saguntum "carthaginian heavy infantry2" 1
console_command create_unit Saguntum "carthaginian medium cavalry2" 1
console_command create_unit Saguntum "auxiliar ibero" 3
console_command create_unit Saguntum "hondero aux ibero" 2
console_command control romans_julii
terminate_monitor
end_monitor
Result: in the IA turn for carthage, Saguntum rebel garrison is evicted, the settlement is then carthaginian and the units are created. Success!
Second case:
Human player: carthage
Objective: simulate a rebellion in Syracusae. The owners (romans) should be evicted and the city will be greek.
Piece of script:
monitor_event FactionTurnStart FactionType greek_cities
and I_TurnNumber = 0
console_command control greek_cities
console_command capture_settlement Siracusa
console_command create_unit Siracusa "syracusan hoplite" 1
console_command create_unit Siracusa "greek hoplite elite" 2
console_command create_unit Siracusa "greek hoplite" 3
console_command create_unit Siracusa "greek archer" 2
console_command create_unit Siracusa "thorakitai" 2
console_command create_unit Siracusa "ekdromoi" 3
console_command create_unit Siracusa "greek heavy peltast" 2
console_command control carthage
console_command diplomatic_stance greek_cities romans_julii war
console_command diplomatic_stance greek_cities romans_scipii war
set_counter rebelion 12
terminate_monitor
end_monitor
Result: garrison evicted, units created, but the settlement passes to the human player instead of the greeks. I tried also to put some waiting time after console_command control, but the result was the same.
Any idea?
Edit: I didn't remember another positive case. It is in the same campaign as the first case (human playing as romans_julii). Hannibal arrives to Italy and conquest one settlement (to give him one operations base).
monitor_event FactionTurnStart FactionType carthage
and I_TurnNumber = 8
console_command control carthage
console_command capture_settlement Segesta
console_command create_unit Segesta "infanteria gala" 3
console_command create_unit Segesta "caballeria gala" 2
console_command create_unit Segesta "peltasta aux italico" 3
console_command create_unit Segesta "auxiliar italico" 3
console_command create_unit Segesta "cab auxiliar italica" 2
console_command create_unit Segesta "merc samnite" 2
console_command control romans_julii
terminate_monitor
end_monitor
This piece of script also works properly.
First case:
Human player: romans_julii
Objective: simulate the conquest of Saguntum by the carthaginians.
Piece of script:
monitor_event FactionTurnStart FactionType carthage
and I_TurnNumber = 0
console_command control carthage
console_command capture_settlement Saguntum
console_command create_unit Saguntum "carthaginian heavy infantry2" 1
console_command create_unit Saguntum "carthaginian medium cavalry2" 1
console_command create_unit Saguntum "auxiliar ibero" 3
console_command create_unit Saguntum "hondero aux ibero" 2
console_command control romans_julii
terminate_monitor
end_monitor
Result: in the IA turn for carthage, Saguntum rebel garrison is evicted, the settlement is then carthaginian and the units are created. Success!
Second case:
Human player: carthage
Objective: simulate a rebellion in Syracusae. The owners (romans) should be evicted and the city will be greek.
Piece of script:
monitor_event FactionTurnStart FactionType greek_cities
and I_TurnNumber = 0
console_command control greek_cities
console_command capture_settlement Siracusa
console_command create_unit Siracusa "syracusan hoplite" 1
console_command create_unit Siracusa "greek hoplite elite" 2
console_command create_unit Siracusa "greek hoplite" 3
console_command create_unit Siracusa "greek archer" 2
console_command create_unit Siracusa "thorakitai" 2
console_command create_unit Siracusa "ekdromoi" 3
console_command create_unit Siracusa "greek heavy peltast" 2
console_command control carthage
console_command diplomatic_stance greek_cities romans_julii war
console_command diplomatic_stance greek_cities romans_scipii war
set_counter rebelion 12
terminate_monitor
end_monitor
Result: garrison evicted, units created, but the settlement passes to the human player instead of the greeks. I tried also to put some waiting time after console_command control, but the result was the same.
Any idea?
Edit: I didn't remember another positive case. It is in the same campaign as the first case (human playing as romans_julii). Hannibal arrives to Italy and conquest one settlement (to give him one operations base).
monitor_event FactionTurnStart FactionType carthage
and I_TurnNumber = 8
console_command control carthage
console_command capture_settlement Segesta
console_command create_unit Segesta "infanteria gala" 3
console_command create_unit Segesta "caballeria gala" 2
console_command create_unit Segesta "peltasta aux italico" 3
console_command create_unit Segesta "auxiliar italico" 3
console_command create_unit Segesta "cab auxiliar italica" 2
console_command create_unit Segesta "merc samnite" 2
console_command control romans_julii
terminate_monitor
end_monitor
This piece of script also works properly.