As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Submod "Caster of Magic for Windows: Warlord"

(August 17th, 2024, 03:19)mewcatus Wrote:
(August 17th, 2024, 01:44)Suppanut Wrote:
(August 17th, 2024, 01:01)mewcatus Wrote: Hi, just a heads up. You can use SETTERRAIN in CombatEndTurn.CAS. Refer to the 2 screenshots below. I tested some of your code out in my project and it worked out fine. So, you really should be moving them from UnitCalc.CAS. 

Is it happened before combat start? or it happen on the first end turn?

If the player is the attacker, this occurs at the end of the Defender's 1st turn.

If you want it to occur before that, you will have to force it via unitcalc.CAS. But there is a way to mitigate that.
For the zeroth until the end of the defender's 1st turn,
1. Call your function X times, then stop after that. Use a variable in MASTER.CAS to track this via MASTERSET.
2. Remeber to reset this variable at ENDOFCOMBAT.CAS as well STARTOFCOMBAT.CAS. The reason for the latter is because AI vs AI Fights will call STARTOFCOMBAT.CAS several times on multiple fights to pick the best 1, and only call ENDOFCOMBAT.CAS on the most optimal fight. (Yes this is how the CPU cheats!)
3. (2) can be ignored if you cater to your function to avoid SETTERRAIN type functions by checking against fights without a human player.
Use IF (Attacker()<>W) %OR (Defender()<>W) THEN {}

This should be the basics but should work.

Thank you. I will use function switch on-off for that. Also human player is always player 0 in current state of game engine. so if you want script to simplified, to detect combat fight by human is to detect either attack or defender is player 0.
Reply

@Mewcatus, how to detect variable set by mastervarset? I have not seen how in script.txt.
Reply

(August 17th, 2024, 06:50)Suppanut Wrote: @Mewcatus, how to detect variable set by mastervarset? I have not seen how in script.txt.

1. Declare the variable name in MASTER.CAS
CombatDummy = 0; : Used to track a counter :

2. To access it another script like COMBATENDTURN.CAS
IF (CombatDummy=0) THEN : Detecting/Accessing it :
{
     MASTERVARSET CombatDummy = CombatDummy + 1; : Usage :
}

Think of it as a global variable you can read and write to. Try to use a more descriptive name, to avoid duplication errors.

If you need further detailed examples, pick a random globle variable I declared in my MASTER.CAS and track it in my other scripts. This should help you.
Reply

(August 17th, 2024, 07:25)mewcatus Wrote:
(August 17th, 2024, 06:50)Suppanut Wrote: @Mewcatus, how to detect variable set by mastervarset? I have not seen how in script.txt.

1. Declare the variable name in MASTER.CAS
CombatDummy = 0; : Used to track a counter :

2. To access it another script like COMBATENDTURN.CAS
IF (CombatDummy=0) THEN : Detecting/Accessing it :
{
     MASTERVARSET CombatDummy = CombatDummy + 1; : Usage :
}

Think of it as a global variable you can read and write to. Try to use a more descriptive name, to avoid duplication errors.

If you need further detailed examples, pick a random globle variable I declared in my MASTER.CAS and track it in my other scripts. This should help you.

Thank you.
Reply

https://www.moddb.com/mods/caster-of-mag...com2-10507

Warlord mod version 1.5.7.0 is released with throughly optimization and faster end turn.

Change log version 1.5.7.0
System:
• Update mod to support Seravy’s patch version 1.5.7
• Through optimization of mod script to increase end turn speed.
Units:
• Demon Lord’s rampaging cost reduces to 550.
• Arch Angel’s rampaging cost reduces to 550.
• Behemoth’s rampaging cost reduces to 480.
• Lesser Chaos Lord’s rampaging cost reduces to 600.
• Great Chaos Lord’s rampaging cost reduces to 777.
• Lesser Gaia Lord’s rampaging cost reduces to 600.
• Great Gaia Lord’s rampaging cost reduces to 777.
• Lesser Aether Lord’s rampaging cost reduces to 600.
• Great Aether Lord’s rampaging cost reduces to 777.
• Arch Demon Lord’s rampaging cost reduces to 777.
• Seraph’s rampaging cost reduces to 777.
• Now ships, catapults, and ballista get proper race assignment to be the same race as city that built them along with racial bonus.
• Floating Island now could travel freely exempt from wizard pact but this does not mean their cargo would also get exemption.
• Cloud Elephant loses regeneration.
• Fire Giant get permanent Resist Element
• Sound of Druid’s range attack change to more suitable sound
Buildings:
• Description Fix: Animist Guild add 2 foods per farmers, not double farmers food production.
• Additional effects for Lava Smelter, presence of both Mithril and Crysx grant Missile Immunity, presence of both Mithril and Orihalcon grant permanent Resist Element, presence of both Adamantium and Orihalcon grant permanent Elemental Armor, presence of both Adamantium and Crysx grant permanent Flame Blade.
• Tree of Magic nolonger generates Power, strength of its unit buff is enough to carry on its value.
• New effect of Warlord’s Hold, grant bonus equal to 12 garrison units distribute over all cities that does not have Warlord’s hold own by the wizard.
• Bug Fix: Temple generate power when no temple around.
Spells:
• Blizzard now has 1% chance to generate Nightshade if target map square is swamp or becomes swamp.
• Fire Storm now has 1% chance to generate Gem if target map square is desert or becomes desert.
• Wraith Form now cost 11/55 (the same as in Caster of Magic for Windows version 1.5.5).
• Now first copy of Doomsday give +4 Unrest instead of +5 previously.
• Aura of Majesty now negates diplomatic penalties of changing terrain outside cities.
• New Spell: Breakthrough, combat enchantment from vanilla Caster of Magic for Windows replacing Disrupt.
• Disrupt is now only castable by units.
• Description Fix: Immolation spell and enchantment is now properly informed its anti-frozen effect.
• Trade value of Fire Giant spell increases to 20
• Corrosive Blast spell ID change to 285, in game that player already have Corrosive Blast, it would be replaced by spell Breakthrough instead.
• Rust now could also stripped permanent weapon/armor buffs Resist Element, Elemental Armor, and Flame Blade.
• Freezing Rain damage deal 1 damage instead of 4.
• Blaze of Glory enchantment now also grants wall crusher.
Retorts:
• Warlord retort now also reduces construction cost of Barracks, War College, Armory, Fighter’s Guild, Armorer’s Guild, City Wall, Fortification, Hillfort, and Warlord’s Hold by 15%.
• Sage Master retort now also reduces construction cost of Library, University, Sage’s Guild, Academy, and Ludus Agoge by 15%.
Others:
• Corrupted grassland square has 3% chance to decay into desert each turn if not purified.
• Corrupted forest square has 3% chance to decay into swamp each turn if not purified.
• Corrupted hill square has 3% chance to decay into mountain each turn if not purified.
• Item transfer to heroes no longer need hero’s active turn if difficulty is less than Master level.
• Removed redundant code of Transmute Equipment spell.
• AISSpell.cas script updates.
• AIRes.cas script updates.
• AI will not build new buildings if garrison units less than 4.
• Bug Fix: Perfectionist AI does not get priority boost  in research Disenchanted Area but Narcissist get it instead.
• Description Fix: Death Gaze ability is now properly inform that it could be prevented by Death Immunity.
• Chaos node could cast Breakthrough and Fiery Fury in Nodeborne Soul score rule.
• Nature node could cast Freezing Rain in Nodeborne Soul score rule.
• Sorcery node could cast Temporal Twist in Nodeborne Soul score rule.
• Personality and Objective for ai wizard is readjusted to be more systemic and include more retort into calculation.
• New scoring options allow to ban specific race from their home plane. If no native race available for choosing, opponent wizard will pick the race from another plane instead.
• Building destruction during conquest reduces across all difficulty levels.
• Now names of global enchantment in wizard screen display in the color of spell’s realm.
Reply

https://www.moddb.com/mods/caster-of-mag...com2-10507

Warlord mod version 1.5.7.1 is released with bug fix and change in War Trolls.

Change log:
Units:
• War Trolls gain 3 Thrown and Regeneration increases from 2 to 3 but Armor reduces from 6 to 4.
• Bug Fix: Kraken’s Echo of the Deep does not trigger immediately in Sorcery Node at the beginning of combat.
• Land Drake renames to Fire Drake and its description changes accordingly.
Buildings:
• Bug Fix: Merchant’s Guild does not replace Bank when it is built.
• Bug Fix: Witches’ Convent effect trigger outside the city.
• Dragon Mound requirement change from Fantastic Stable to Stable due to Draconian could not build Fantastic Stable.
• Caravanserai cost reduces to 400 Productions.
Spells:
• Bug Fix: Help screen of Hurricane show Breakthrough’s icon instead of Hurricane’s icon
• Bug Fix: Freezing Rain causes CTD at the end of combat turn.
• Freezing Rain now freeze at 50% and deal proper strength 4 cold damage attack at double hit chance.
Artifacts:
• Bug Fix: Strombringer causes CTD at the end of combat turn.
• Stormbringer artifact power rename to Eye of Storm
Others:
• City on the hill terrain nolonger has rock outcrop inside city area.
• Book Collectors scoring rules now guarantee gaining a book if that fortress city is the last city of the wizard.
• Increase Vizir’s priority for unique buildings.
• Add AI production decision for unique buildings.
Reply

If anyone download version 1.5.7.1 earlier please redownload it, I made some error that could cause ctd on end turn so I have to fix and reupload.
Reply

If anyone download version 1.5.7.1 earlier please redownload it, I made some error that could cause ctd on end turn so I have to fix and reupload.
Reply

When you select the option to ban a certain race. Is that supposed to ban the race completly from the game or just ban the AI to start with it?
Like should neutral cities still be able to be that race then?
Reply

(September 12th, 2024, 04:40)Zypher Wrote: When you select the option to ban a certain race. Is that supposed to ban the race completly from the game or just ban the AI to start with it?
Like should neutral cities still be able to be that race then?

Banned AI from pick it on its home plane. If you banned all native race of that plane completely, it will pick any race from other plane at random, included banned ones. It does not banned player from picking it nor neutral cities of that race to be spawned.
Reply



Forum Jump: