September 3rd, 2025, 23:12
(This post was last modified: September 3rd, 2025, 23:13 by Seravy.)
Posts: 10,536
Threads: 395
Joined: Aug 2015
(August 6th, 2025, 01:19)Suppanut Wrote: Version 1.5.9, city wall in combat cause unit in city area (4 tiles in the center) to have unit display "Wall Bonus" perk but not give any bonus on it (unless stay on actual wall-adjacent city tiles). I think bug part in on ability display part rather than unit bonus but I could be wrong if you intend bonus to be all units inside city wall area.
Center units should have the bonus. How do you know whether they get the bonus or not however? It's not visible on unit stats, and should only be applied when the unit is being attacked by an enemy who is outside the walled area.
Quote:I think AISSpell.CAS doesn't work the way it's intended to. It's supposed to give AIs spells according to the pick system the player follows, but in reality it just gives them the good stuff for free, regardless of their actual books. No wonder they tend to be too samey and seem to always get strong spells. Please look into fixing this, I think it greatly limits the game and reduces the variety it can offer.
Are you 100% certain about that?
See the script manual :
Quote:ADDAISPELL(W,S)
Attempts to add an AI starting/guaranteed spell pick. Has no effect if the AI has already used up the picks, so no check for picks being available is needed or possible. Disabled or banned spells also get ignored automatically, picks can't be spent on them.
It does not do anything if the AI has no picks to select more.
Quote:I don't know why this code in unitcalcpre.cas is working in apply flying to all units in same stack as windwalking unit except unit with sailing attribut
I don't see a bug, what exactly does not happen which should? A flying boat should be able to participate in combat unless it's a Floating Island.
September 3rd, 2025, 23:58
(This post was last modified: September 4th, 2025, 00:13 by Seravy.)
Posts: 10,536
Threads: 395
Joined: Aug 2015
Confirmed Necromancy not working. This was probably broken when the CCIrrecoverable setting in modding.INI was made safe to use, whenever that was. By checking for current owner when reviving units, it broke Necromancy which set the base owner instead.
Combat on tower :
Looks like I remembered this one wrong. It uses the plane from the attacker's side, not the defender's. To be precise, the plane set as the move destination, which should be the same plane the unit came from.
Quote: All these battles were on other plane: A. Enemy attacked me on other plane. B. I attacked the enemy on my plane. C. I attacked the enemy on other plane.
"B" should not be possible. If it happens again, provide a save file for it.
September 4th, 2025, 01:49
Posts: 1,173
Threads: 15
Joined: Nov 2020
(September 3rd, 2025, 23:12)Seravy Wrote: (August 6th, 2025, 01:19)Suppanut Wrote: Version 1.5.9, city wall in combat cause unit in city area (4 tiles in the center) to have unit display "Wall Bonus" perk but not give any bonus on it (unless stay on actual wall-adjacent city tiles). I think bug part in on ability display part rather than unit bonus but I could be wrong if you intend bonus to be all units inside city wall area.
Center units should have the bonus. How do you know whether they get the bonus or not however? It's not visible on unit stats, and should only be applied when the unit is being attacked by an enemy who is outside the walled area.
Two gold shield pips would be added to Armor (+2 Armor buff) to unit on inside tile close to the city wall (inside area 4x4 after excluded 2x2 tiles at the center) but there are no gold shield pips add to Armor if the unit that stay on 4 center tiles (2x2) of the city with wall. As bonus is displayed any units that stay those 12 tiles inside the wall (not include 2x2 at the center) wheather they are on attacker or defender side, I assume that bonus is working on those 12 tiles only and also notice that me on attacker side could be tougher when stay on that tile compare to 4 tiles in the middle of the city and me on defending side feel it more more difficult for unit at center of 2x2 to attack opponent unit that have already occupied those inside walled tiles as it taken less damage from me than what I felt it should be. So I'm quite sure that wall bonus does not apply on those 2x2 in the middle of the city. I don't notice how it would effect range defense though, I just assume it based on what display on unit stat panal.
Quote:Quote:I think AISSpell.CAS doesn't work the way it's intended to. It's supposed to give AIs spells according to the pick system the player follows, but in reality it just gives them the good stuff for free, regardless of their actual books. No wonder they tend to be too samey and seem to always get strong spells. Please look into fixing this, I think it greatly limits the game and reduces the variety it can offer.
Are you 100% certain about that?
See the script manual :
Quote:ADDAISPELL(W,S)
Attempts to add an AI starting/guaranteed spell pick. Has no effect if the AI has already used up the picks, so no check for picks being available is needed or possible. Disabled or banned spells also get ignored automatically, picks can't be spent on them.
It does not do anything if the AI has no picks to select more.
I think he meant that your AISSpell.cas extended into rare and very rare spell list that beyond picking part. But here I want to elaborate what I notice that also give me that conclusion
1) earlier I add 1 free researchable common spell for each realm on 0 book and what I notice is that for some reason ai seem always have the same 1 free spells of those realm. for all 13 wizards to have end up has same free spell with no variation that happened to be first priority spell inside AISSpell.cas make me notice that it does not just follow the same rule as human player but it will keep fill all available slot for researchable, not just "picked" option that human player have.
2) late game ai always have spells match their personality even if I set pick to 0 and all just available for research not selectable by human player.
Quote:Quote:I don't know why this code in unitcalcpre.cas is working in apply flying to all units in same stack as windwalking unit except unit with sailing attribut
I don't see a bug, what exactly does not happen which should? A flying boat should be able to participate in combat unless it's a Floating Island.
It does not a bug for ship to normally not participate in land combat if not fly, it is working as you intended. What I try to do is to circumvent this rule by drop sailing ship carry by windwalker above the land as stationary unit in ground combat instead of not participate in combat at all. The method is working when I just make all sail units flying on overland tile except in combat, that would drop ship stuck on land not able to move but shootable in combat. But something is wrong in my attempt to check if they are on the same tile as windwalker as it seem that those sail/transport unit seem to not have ID within range between 1 to MAXUNIT(). On the opposite, when I make those sail unit to check for unit with windwalker on the same tile, it works but it make game much much slower to load each turn and not code efficient nor practical.
When I set "FOR CU=1 TO MAXUNIT()", those CU seem to not included Sailing/Transporter unit for reason I don't know. Condition checking X/Y/P working on all kind of units on the same tile except those ships. Those sailing units's ID are not within range between 1 to MAXUNIT()? Then where those units ID are?
September 4th, 2025, 02:28
Posts: 10,536
Threads: 395
Joined: Aug 2015
Quote:I just assume it based on what display on unit stat panal.
That's what I'm saying.
Wall Bonus is not displayed in unit stats. (unless you modded in that feature)
That 2 armor is coming from elsewhere.
As far as I remember, destroyed walls are worth 1 armor, normal walls are worth 3, but only during damage calculation.
Quote:1) earlier I add 1 free researchable common spell for each realm on 0 book and what I notice is that for some reason ai seem always have the same 1 free spells of those realm. for all 13 wizards to have end up has same free spell with no variation that happened to be first priority spell inside AISSpell.cas make me notice that it does not just follow the same rule as human player but it will keep fill all available slot for researchable, not just "picked" option that human player have.
This sounds like what you'll get when
TotalCommonBook0=1
PicksCommonBook0=1
while you wanted
TotalCommonBook0=1
PicksCommonBook0=0
instead.
...actually, there is one more thing you can do. If you enable debugging, in the log file, all AI spell picks are recorded. So you can verify what was picked and what wasn't.
Quote:When I set "FOR CU=1 TO MAXUNIT()", those CU seem to not included Sailing/Transporter unit for reason I don't know. Condition checking X/Y/P working on all kind of units on the same tile except those ships. Those sailing units's ID are not within range between 1 to MAXUNIT()? Then where those units ID are?
That's not the problem. Timing is.
I assume this is in UnitCalc or UnitCalcPre?
Those scripts are meant for adjusting that stats and abilities of unit U and only unit U. The function starts by resetting all abilities to the base values and then adding all modifiers, first from the "Pre" script then hardcoded spells and effects, then the normal UnitCalc script.
However if you change stats on a unit which isn't U, then when that unit is running its own recalculation, it'll be reset and not update.
For example :
Ship #139 recalculates - It's not flying yet so nothing changes.
WindWalker #172 recalculates - Adds flying to ship 139, 191 and 192.
Ship #191 recalculates - flying is removed
Ship #192 recalculates - flying is removed
So every ship with ID<the Windwalker will not fly, assuming the script runs from lowest ID to the highest in that order.
If Entercombat.CAS is used before it's determined which units can participate in the battle, granting flying there might work better.
Internally, similar abilities, for example Holy Bonus, they do what you described, this :
Quote:On the opposite, when I make those sail unit to check for unit with windwalker on the same tile, it works
That's the only way to avoid the modifier resetting after it's set. Unfortunately it is, indeed, slow.
September 4th, 2025, 02:42
Posts: 10,536
Threads: 395
Joined: Aug 2015
Quote:Version 1.5.9, when I banish a wizard, ai said as if that wizard has already defeat and could not return as in previous versions.
I see no problem in the code. I also read through the diplomacy messages and found no displaced one. Can I have a save file for this?
Quote:Version 1.5.9, Any spell that SpellTypeGroup=14 that not under this in unmodded version could be targeted on both ally and opponent when cast in combat.
Confirmed and will be fixed in the next update.
September 4th, 2025, 03:37
(This post was last modified: September 4th, 2025, 03:38 by Suppanut.)
Posts: 1,173
Threads: 15
Joined: Nov 2020
(September 4th, 2025, 02:28)Seravy Wrote: Quote:I just assume it based on what display on unit stat panal.
That's what I'm saying.
Wall Bonus is not displayed in unit stats. (unless you modded in that feature)
That 2 armor is coming from elsewhere.
As far as I remember, destroyed walls are worth 1 armor, normal walls are worth 3, but only during damage calculation.
Sorry, I remember detail on number wrong. I will recheck it tonight along with disable unitcalc and give you screenshot to if it is.
Quote:Quote:1) earlier I add 1 free researchable common spell for each realm on 0 book and what I notice is that for some reason ai seem always have the same 1 free spells of those realm. for all 13 wizards to have end up has same free spell with no variation that happened to be first priority spell inside AISSpell.cas make me notice that it does not just follow the same rule as human player but it will keep fill all available slot for researchable, not just "picked" option that human player have.
This sounds like what you'll get when
TotalCommonBook0=1
PicksCommonBook0=1
while you wanted
TotalCommonBook0=1
PicksCommonBook0=0
instead.
...actually, there is one more thing you can do. If you enable debugging, in the log file, all AI spell picks are recorded. So you can verify what was picked and what wasn't.
Actually, the code in in my spells.ini is the latter, not the former. And due to result become as I report. I have to add check number of book of that realm >0 to all common spells and later add spell pick countdown for all rarity of spells. I will recheck it as you said to verify what really happens.
Quote:Quote:When I set "FOR CU=1 TO MAXUNIT()", those CU seem to not included Sailing/Transporter unit for reason I don't know. Condition checking X/Y/P working on all kind of units on the same tile except those ships. Those sailing units's ID are not within range between 1 to MAXUNIT()? Then where those units ID are?
That's not the problem. Timing is.
I assume this is in UnitCalc or UnitCalcPre?
Those scripts are meant for adjusting that stats and abilities of unit U and only unit U. The function starts by resetting all abilities to the base values and then adding all modifiers, first from the "Pre" script then hardcoded spells and effects, then the normal UnitCalc script.
However if you change stats on a unit which isn't U, then when that unit is running its own recalculation, it'll be reset and not update.
For example :
Ship #139 recalculates - It's not flying yet so nothing changes.
WindWalker #172 recalculates - Adds flying to ship 139, 191 and 192.
Ship #191 recalculates - flying is removed
Ship #192 recalculates - flying is removed
So every ship with ID<the Windwalker will not fly, assuming the script runs from lowest ID to the highest in that order.
If Entercombat.CAS is used before it's determined which units can participate in the battle, granting flying there might work better.
Internally, similar abilities, for example Holy Bonus, they do what you described, this :
Quote:On the opposite, when I make those sail unit to check for unit with windwalker on the same tile, it works
That's the only way to avoid the modifier resetting after it's set. Unfortunately it is, indeed, slow.
Thanks for clarification, but on EnterCombat.cas part, I have already tried add flying in that file before due to would be ideal place to do that based on coding speed but, unfortunately, it does not work. I will try it again tonight to see if I could make it work this time or not but last time when I tried it does not.
September 4th, 2025, 03:52
Posts: 1,173
Threads: 15
Joined: Nov 2020
(September 4th, 2025, 02:42)Seravy Wrote: Quote:Version 1.5.9, when I banish a wizard, ai said as if that wizard has already defeat and could not return as in previous versions.
I see no problem in the code. I also read through the diplomacy messages and found no displaced one. Can I have a save file for this?
I will created one for you. But would it be alright if it is from Warlord mod, previous playthrough I have?
September 4th, 2025, 04:17
Posts: 10,536
Threads: 395
Joined: Aug 2015
(September 4th, 2025, 03:52)Suppanut Wrote: (September 4th, 2025, 02:42)Seravy Wrote: Quote:Version 1.5.9, when I banish a wizard, ai said as if that wizard has already defeat and could not return as in previous versions.
I see no problem in the code. I also read through the diplomacy messages and found no displaced one. Can I have a save file for this?
I will created one for you. But would it be alright if it is from Warlord mod, previous playthrough I have?
It's ok if you also link the version of mod which can load the file.
September 4th, 2025, 07:32
(This post was last modified: September 4th, 2025, 07:40 by Suppanut.)
Posts: 1,173
Threads: 15
Joined: Nov 2020
(September 4th, 2025, 02:28)Seravy Wrote: If Entercombat.CAS is used before it's determined which units can participate in the battle, granting flying there might work better.
Tried this and result seem to be that check for rule out sailing unit that not flying from combat seem to occur sometimes before EnterCombat.Cas script is operating.
Here is example of the code, I simplified it a bit as proof of concept....
Code: FOR U=1 TO MAXUNIT();
IF (GETSTAT(U,ASailing,1)=0) THEN { GOTO "NOTSAIL"; }
SETSTAT(U,AFlying,1,1);
!NOTSAIL!
NEXT U;
Before combat, here is stack of unit with windwalking carry ship to combat.
The unit did not fly before then, just ordinary sail.
As you see, even with script above in EnterCombat.Cas unit does not carry over and fly in combat.
Here is after combat, as you noticed, they have already flying from effect in EnterCombat.cas. So I think check for sailing unit that not fly occur sometimes before that script loaded.
My current solution for this is that ship is a compromise that the ships would only participate in land combat on defending side by make it fly on land if not on their turn outside combat.
September 4th, 2025, 08:17
Posts: 1,173
Threads: 15
Joined: Nov 2020
|