tai4ji2x
06-20-2007, 07:51
hi there, i'm trying to make some additions to the show_me_how script for the SPQR mod by LT. i'm running into some problems. wondering if someone here might help me... :help:
1) what do i have to do to spawn a character whose name doesn't exist for the faction under descr_names.txt? for instance, i wanted to spawn an "Eunus" to simulate a First Servile War on sicily. the name doesn't exist at all in descr_names.txt, so i added it to the surnames available to the slave faction. i then also just tacked it onto the end of descr_names_lookup.txt
and then there's names.txt in the ...\data\text\ folder. i tried adding it in similar format via notepad, as
{Eunus} Eunus
but when the character spawns, the character scroll is completely blank - not even lines that say "traits" or "retinue".
1a) also, i noticed that the chirugeon never gets added even though i have the line via the console_command option, and if i manually bring up the console the next turn (after the character already spawned) and manually type in "give_ancillary", then the chirugeon can be added. why isn't it working via the script?
2) i'm trying to simulate revolts to the "rebel roman" (aka scipii faction slot) faction once the roman player reaches a certain number of provinces. but something goes wrong...
monitor_event FactionTurnStart FactionType romans_scipii
and I_LocalFaction romans_julii
and I_NumberOfSettlements romans_julii > 48
and I_TurnNumber = 400
if I_SettlementOwner Valencia = romans_julii
console_command control romans_scipii
console_command capture_settlement Valencia
console_command control romans_julii
spawn_army
faction romans_scipii
character Quintus Sertorius, named character, age 35, x 64, y 145
unit roman generals guard cavalry exp 3 armour 3 weapon_lvl 0
unit roman light infantry auxillia exp 3 armour 0 weapon_lvl 0
unit roman light infantry auxillia exp 3 armour 0 weapon_lvl 0
unit roman archer auxillia exp 3 armour 0 weapon_lvl 0
unit roman archer auxillia exp 3 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman cavalry auxillia late exp 5 armour 1 weapon_lvl 0
unit roman medium cavalry exp 5 armour 1 weapon_lvl 0
unit roman medium cavalry exp 5 armour 1 weapon_lvl 0
unit roman infantry auxillia exp 4 armour 1 weapon_lvl 0
unit roman infantry auxillia exp 4 armour 1 weapon_lvl 0
console_command give_ancillary "Quintus Sertorius" chirugeon
console_command give_ancillary "Quintus Sertorius" historian
console_command give_ancillary "Quintus Sertorius" orator
console_command give_trait "Quintus Sertorius" GoodCommander 3
console_command give_trait "Quintus Sertorius" GoodDefender 2
console_command give_trait "Quintus Sertorius" Brave 1
console_command give_trait "Quintus Sertorius" PublicFaith 1
console_command give_trait "Quintus Sertorius" HaleAndHearty 2
console_command create_unit Valencia "roman praetorian cohort urban i" 5,4
console_command create_unit Valencia "roman light infantry auxillia" 2,2
console_command create_unit Valencia "roman archer auxillia" 2,2
console_command create_unit Valencia "roman infantry auxillia" 2,4
end_if
if I SettlementOwner Tarraco != romans_julii
console_command control romans_scipii
console_command capture_settlement Tarraco
console_command control romans_julii
console_command create_unit Tarraco "roman praetorian cohort urban i" 5,4
console_command create_unit Tarraco "roman light infantry auxillia" 2,2
console_command create_unit Tarraco "roman archer auxillia" 2,2
console_command create_unit Tarraco "roman infantry auxillia" 2,4
end_if
if I SettlementOwner Carthago_Novo != romans_julii
console_command control romans_scipii
console_command capture_settlement Carthago_Novo
console_command control romans_julii
console_command create_unit Carthago_Novo "roman praetorian cohort urban i" 5,4
console_command create_unit Carthago_Novo "roman light infantry auxillia" 2,2
console_command create_unit Carthago_Novo "roman archer auxillia" 2,2
console_command create_unit Carthago_Novo "roman infantry auxillia" 2,4
end_if
end_monitor
so... what happens is that the spawned general (quintus sertorius) somehow spawns twice in the same turn, so there ends up two almost-identical stacks, except the second one gets none of the traits and ancillaries, since the console command lines only recognizes and affects the first one spawned.
anyone know what i did wrong?
3) i'd also like to randomize the event some more, so that it won't occur in a fixed date/turn, but that once it occurs, it won't happen again.
taking a hint from EB's script for the epeiros alliance (see the relevant section in their script, EBBS_SCRIPT.TXT), it seems that they use the presence of a script-constructed building (via "console_command create_building...") as a check for whether the event has or hasn't already occured. for this purpose (and others) they seem to have created an entirely new class of hinterland-type (ie, indesctructible, like farms and roads) buildings for the mod. seeing as i wanted to avoid that level of additional modding, i decided to just use some of the other temples which the romans can't, and have it be generated in the senate capital (Roma) if/when the event occurs.
however, since it is a religious building, i also added a monitor_event to first make sure rome has already built its native temple (leadership, ie., jupiter) by the turn before the timeframe of the scripted event, otherwise the presence of the other generated temple would prevent the player (AI or human) from ever building/upgrading it unless they first destroy the script-generated temple, which was used as a placeholder to indicate whether or not a certain scipted event had already occured.
the problem is, this monitor_event (second one below) seems to create something like 15+ identical jupiter shrines in Roma within that one turn.
(i forget why i chose it to occur during macedon's turn, but i think i remember that it didn't seem to trigger at all when i put "FactionTurnStart slave".)
i didn't want to try other buildings like taverns, caravans, etc, since that would also involve dealing with trait and ancillary triggers associated with them. although if i can't solve this "building-spamming" problem in my current attempt, i may resort to that after all.
declare_counter Eunus
monitor_event FactionTurnStart macedon
and SettlementBuildingExists Roma = temple_of_battle_shrine
set_counter Eunus 2
end_monitor
monitor_event FactionTurnStart macedon
and I_LocalFaction romans_julii
and I_TurnNumber = 140
and not SettlementBuildingExists Roma >= temple_of_leadership_shrine
console_command create_building Roma temple_of_leadership_shrine
end_monitor
monitor_event FactionTurnStart FactionType slave
and I_LocalFaction romans_julii
and I_CompareCounter Eunus != 2
and I_NumberOfSettlements romans_julii > 20
and I_SettlementOwner Taras = romans_julii
and I_SettlementOwner Messana = romans_julii
and I_SettlementOwner Syracusa = romans_julii
and I_SettlementOwner Lilybeon = romans_julii
and I_SettlementOwner Carali = romans_julii
and I_SettlementOwner Patavium = romans_julii
and I_SettlementOwner Mediolanum = romans_julii
and I_TurnNumber > 140
and I_TurnNumber < 240
and RandomPercent < 10
spawn_army
faction slave
character Eunus, named character, age 35, x 180, y 112
unit generic rebel general exp 5 armour 3 weapon_lvl 0
unit merc cilician pirate exp 3 armour 2 weapon_lvl 0
unit merc cilician pirate exp 3 armour 2 weapon_lvl 0
unit merc balearic slingers exp 0 armour 0 weapon_lvl 0
unit merc balearic slingers exp 0 armour 0 weapon_lvl 0
unit merc peltast exp 0 armour 0 weapon_lvl 0
unit merc peltast exp 0 armour 0 weapon_lvl 0
unit carthaginian archer exp 0 armour 1 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit carthaginian infantry exp 1 armour 0 weapon_lvl 0
unit carthaginian infantry exp 1 armour 0 weapon_lvl 0
unit carthaginian peasant exp 1 armour 1 weapon_lvl 0
unit carthaginian peasant exp 1 armour 1 weapon_lvl 0
unit greek peasant exp 1 armour 1 weapon_lvl 0
unit greek peasant exp 1 armour 1 weapon_lvl 0
unit greek medium cavalry exp 1 armour 1 weapon_lvl 0
unit merc samnite exp 0 armour 0 weapon_lvl 0
console_command give_ancillary Eunus chirugeon
console_command give_ancillary Eunus historian
console_command give_ancillary Eunus orator
console_command give_trait Eunus GoodCommander 2
console_command give_trait Eunus GoodDefender 1
console_command give_trait Eunus HatesRomans 1
console_command give_trait Eunus Brave 1
console_command give_trait Eunus PublicFaith 1
console_command give_trait Eunus HaleAndHearty 1
console_command create_building Roma temple_of_battle_shrine
end_monitor
so... advice and help, anyone? many thanks.
1) what do i have to do to spawn a character whose name doesn't exist for the faction under descr_names.txt? for instance, i wanted to spawn an "Eunus" to simulate a First Servile War on sicily. the name doesn't exist at all in descr_names.txt, so i added it to the surnames available to the slave faction. i then also just tacked it onto the end of descr_names_lookup.txt
and then there's names.txt in the ...\data\text\ folder. i tried adding it in similar format via notepad, as
{Eunus} Eunus
but when the character spawns, the character scroll is completely blank - not even lines that say "traits" or "retinue".
1a) also, i noticed that the chirugeon never gets added even though i have the line via the console_command option, and if i manually bring up the console the next turn (after the character already spawned) and manually type in "give_ancillary", then the chirugeon can be added. why isn't it working via the script?
2) i'm trying to simulate revolts to the "rebel roman" (aka scipii faction slot) faction once the roman player reaches a certain number of provinces. but something goes wrong...
monitor_event FactionTurnStart FactionType romans_scipii
and I_LocalFaction romans_julii
and I_NumberOfSettlements romans_julii > 48
and I_TurnNumber = 400
if I_SettlementOwner Valencia = romans_julii
console_command control romans_scipii
console_command capture_settlement Valencia
console_command control romans_julii
spawn_army
faction romans_scipii
character Quintus Sertorius, named character, age 35, x 64, y 145
unit roman generals guard cavalry exp 3 armour 3 weapon_lvl 0
unit roman light infantry auxillia exp 3 armour 0 weapon_lvl 0
unit roman light infantry auxillia exp 3 armour 0 weapon_lvl 0
unit roman archer auxillia exp 3 armour 0 weapon_lvl 0
unit roman archer auxillia exp 3 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman legionary cohort i exp 5 armour 0 weapon_lvl 0
unit roman cavalry auxillia late exp 5 armour 1 weapon_lvl 0
unit roman medium cavalry exp 5 armour 1 weapon_lvl 0
unit roman medium cavalry exp 5 armour 1 weapon_lvl 0
unit roman infantry auxillia exp 4 armour 1 weapon_lvl 0
unit roman infantry auxillia exp 4 armour 1 weapon_lvl 0
console_command give_ancillary "Quintus Sertorius" chirugeon
console_command give_ancillary "Quintus Sertorius" historian
console_command give_ancillary "Quintus Sertorius" orator
console_command give_trait "Quintus Sertorius" GoodCommander 3
console_command give_trait "Quintus Sertorius" GoodDefender 2
console_command give_trait "Quintus Sertorius" Brave 1
console_command give_trait "Quintus Sertorius" PublicFaith 1
console_command give_trait "Quintus Sertorius" HaleAndHearty 2
console_command create_unit Valencia "roman praetorian cohort urban i" 5,4
console_command create_unit Valencia "roman light infantry auxillia" 2,2
console_command create_unit Valencia "roman archer auxillia" 2,2
console_command create_unit Valencia "roman infantry auxillia" 2,4
end_if
if I SettlementOwner Tarraco != romans_julii
console_command control romans_scipii
console_command capture_settlement Tarraco
console_command control romans_julii
console_command create_unit Tarraco "roman praetorian cohort urban i" 5,4
console_command create_unit Tarraco "roman light infantry auxillia" 2,2
console_command create_unit Tarraco "roman archer auxillia" 2,2
console_command create_unit Tarraco "roman infantry auxillia" 2,4
end_if
if I SettlementOwner Carthago_Novo != romans_julii
console_command control romans_scipii
console_command capture_settlement Carthago_Novo
console_command control romans_julii
console_command create_unit Carthago_Novo "roman praetorian cohort urban i" 5,4
console_command create_unit Carthago_Novo "roman light infantry auxillia" 2,2
console_command create_unit Carthago_Novo "roman archer auxillia" 2,2
console_command create_unit Carthago_Novo "roman infantry auxillia" 2,4
end_if
end_monitor
so... what happens is that the spawned general (quintus sertorius) somehow spawns twice in the same turn, so there ends up two almost-identical stacks, except the second one gets none of the traits and ancillaries, since the console command lines only recognizes and affects the first one spawned.
anyone know what i did wrong?
3) i'd also like to randomize the event some more, so that it won't occur in a fixed date/turn, but that once it occurs, it won't happen again.
taking a hint from EB's script for the epeiros alliance (see the relevant section in their script, EBBS_SCRIPT.TXT), it seems that they use the presence of a script-constructed building (via "console_command create_building...") as a check for whether the event has or hasn't already occured. for this purpose (and others) they seem to have created an entirely new class of hinterland-type (ie, indesctructible, like farms and roads) buildings for the mod. seeing as i wanted to avoid that level of additional modding, i decided to just use some of the other temples which the romans can't, and have it be generated in the senate capital (Roma) if/when the event occurs.
however, since it is a religious building, i also added a monitor_event to first make sure rome has already built its native temple (leadership, ie., jupiter) by the turn before the timeframe of the scripted event, otherwise the presence of the other generated temple would prevent the player (AI or human) from ever building/upgrading it unless they first destroy the script-generated temple, which was used as a placeholder to indicate whether or not a certain scipted event had already occured.
the problem is, this monitor_event (second one below) seems to create something like 15+ identical jupiter shrines in Roma within that one turn.
(i forget why i chose it to occur during macedon's turn, but i think i remember that it didn't seem to trigger at all when i put "FactionTurnStart slave".)
i didn't want to try other buildings like taverns, caravans, etc, since that would also involve dealing with trait and ancillary triggers associated with them. although if i can't solve this "building-spamming" problem in my current attempt, i may resort to that after all.
declare_counter Eunus
monitor_event FactionTurnStart macedon
and SettlementBuildingExists Roma = temple_of_battle_shrine
set_counter Eunus 2
end_monitor
monitor_event FactionTurnStart macedon
and I_LocalFaction romans_julii
and I_TurnNumber = 140
and not SettlementBuildingExists Roma >= temple_of_leadership_shrine
console_command create_building Roma temple_of_leadership_shrine
end_monitor
monitor_event FactionTurnStart FactionType slave
and I_LocalFaction romans_julii
and I_CompareCounter Eunus != 2
and I_NumberOfSettlements romans_julii > 20
and I_SettlementOwner Taras = romans_julii
and I_SettlementOwner Messana = romans_julii
and I_SettlementOwner Syracusa = romans_julii
and I_SettlementOwner Lilybeon = romans_julii
and I_SettlementOwner Carali = romans_julii
and I_SettlementOwner Patavium = romans_julii
and I_SettlementOwner Mediolanum = romans_julii
and I_TurnNumber > 140
and I_TurnNumber < 240
and RandomPercent < 10
spawn_army
faction slave
character Eunus, named character, age 35, x 180, y 112
unit generic rebel general exp 5 armour 3 weapon_lvl 0
unit merc cilician pirate exp 3 armour 2 weapon_lvl 0
unit merc cilician pirate exp 3 armour 2 weapon_lvl 0
unit merc balearic slingers exp 0 armour 0 weapon_lvl 0
unit merc balearic slingers exp 0 armour 0 weapon_lvl 0
unit merc peltast exp 0 armour 0 weapon_lvl 0
unit merc peltast exp 0 armour 0 weapon_lvl 0
unit carthaginian archer exp 0 armour 1 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit greek hoplite militia exp 2 armour 0 weapon_lvl 0
unit carthaginian infantry exp 1 armour 0 weapon_lvl 0
unit carthaginian infantry exp 1 armour 0 weapon_lvl 0
unit carthaginian peasant exp 1 armour 1 weapon_lvl 0
unit carthaginian peasant exp 1 armour 1 weapon_lvl 0
unit greek peasant exp 1 armour 1 weapon_lvl 0
unit greek peasant exp 1 armour 1 weapon_lvl 0
unit greek medium cavalry exp 1 armour 1 weapon_lvl 0
unit merc samnite exp 0 armour 0 weapon_lvl 0
console_command give_ancillary Eunus chirugeon
console_command give_ancillary Eunus historian
console_command give_ancillary Eunus orator
console_command give_trait Eunus GoodCommander 2
console_command give_trait Eunus GoodDefender 1
console_command give_trait Eunus HatesRomans 1
console_command give_trait Eunus Brave 1
console_command give_trait Eunus PublicFaith 1
console_command give_trait Eunus HaleAndHearty 1
console_command create_building Roma temple_of_battle_shrine
end_monitor
so... advice and help, anyone? many thanks.