What's cooking, and a space for your feedback (keeping the reboot thread focused by commenting here)

Users who are viewing this thread


Grandmaster Knight
I wanted a thread that could gather all the comments for 2024 and "what am I doing now" posts to reduce clutter at the 2024 reboot thread.

Also I realized a "what's cooking" post has a limited useful lifespan. I do have some short term goals I'll post in the next post, to get things started.

You may say anything within reason you want, even if you disagree with anything in the mod, but with the mod becoming LSP if you really disagree you are free to compile it your way, so long as it stays private to your desktop. Some things have side effects not imagined when they start life as Big Ideas so don't be surprised if I am not very excited to try every last feature from every other contemporary mod.

For example, the flavor of the month elsewhere seems to be freelancer. Except other mods seem to be struggling with it afterwards.
TPE (tournament play enhancements) seemed a fine addition too but needs more work until it adds the value I wanted.

There ARE however some easy to implement suggestions, and I'll address some of those shortly.
A) This moment (Monday 29 Apr 24) I am back-porting the index and bookmark Excel files to Guspav's source to have a better snapshot of what is found where and how it differs from my v160 source. Along the way I noted a few things I decided would be fine for an upcoming release, such as much shorter respawn delay between small monster bandits and much greater density of bandits.

My analysis of Guspav's code:
In general Guspav's code had far too many distinct processes firing on every weapon strike, maybe > 32 of them, and he or someone preceding me was fond of checking every agent in a battle (live or dead, both sides) often for seldom used things like quiver of plenty etc. The sheer number of things firing often but not elegantly staying focused on just who needed special attention chew a large amount of bandwidth at battles, especially as battle size increases, and there are specific crashes in the original code from each hit having to call a very large number of discrete routines instead of collapsing them into a quicker to resolve one or at least a small few instead of hitting > 33 linked checks. Now having said that, overall he was Genius. Also he tried things before I did - such as a dodge with factored weight of what is worn. He tried a few things, and watched for third party code he could add, keeping very current. There is a partial implementation of diplomacy as well.

B) I miss the old heads up display for marking enemies that are beyond immediate view, as battles tend to get scattered over a larger map and the other agents besides myself know where to ride off too next and I feel like I have to passively follow them, perhaps just pumping out haste or area effect heals/auras instead of doing something personally. Looking at the forums, that code seems lost now, but I have it intact someplace.

I can salvage TPE I think; found the Torunament Greataxe and its "enhanced" version were both not showing anything, fixed that.
Enabled TPE debug options and it looks like TPE can be fixed fairly quickly. Thanks Floris Team!

C) I am almost out of space on my (free) google drive, and will not host the full mod image until next pass, to avoid juggling many images. I had to cut most of the old content to get my old 20 GB paid plan to accommodate the new 10 GB free plan. I'll put an image of the full mod up in about a week, after Orthodox Easter.
Some of this might be tentatively working Friday. (or sooner)

D) version A2 is moving faster than expected. So far added (Tuesday morning) :
more bandits more often, TPE possibly fixed, adjusted swashbuckler hat recipe, entertainment tweaked,
minimap was already present and working even with spell casters, silly me I just needed to press backspace to see it.

Will continue testing TPE then look to cleanup compiler warnings, and last part of the week validate dialogs for quests.
Last edited:
V160 A2 now has prayer book and spell book sort-of integrated with prsnt_battle which has the clickable orders + minimap + statistics for both sides shown. It used to be if that was open the prayer book and spell book could not be opened, and you would press back space again to close the battle presentation and now open the prayer/spell book with N or B as usual.

I now have A2 if N or n is pressed while the battle presentation was open (you see orders and the minimap of your and enemy team locations in realtime) then if you otherwise meet all the requirements to open the prayer book, the battle presentation closes and the prayer book is opened.

Likewise a B or b will check if you meet the magic user requirements to open the spell book, that are are not knocked out, that you have a spell book in inventory, and so on, and it will close the battle presentation if playing and immediately jump to open the spellbook. Important is you do not need to press two keys; the code to close the currently playing presentation and start a different presentation is at the presentation to be closed and the response is very fast, checking every 0.2 seconds

I still need a day or 3 to check quests/dialogs and TPE. So far I did not need to break savegame compatibility with v158/v160 A series saves.
Tournaments are fixed for v160 A2
Tournaments, even with TPE disabled, needed
a) menu at town activities to be visible instead of hidden behind cheat
b) the conditions logic needed to see the menu option needed changing
c) clicking "join the tournament" then called script_fill_tournament_participants_troop which immediately hangs
d) the hang came from some of the troop Heroes stuffed into the tournament by the script having capital letters at module_troops.py while the script uses a mix of upper and lower case letters when trying to access those troop lines. Setting all the entries to lower case at both troops and the script solved the hang. These were this way from Guspav's code; I just had not realized his was broken as well.

e) script_tpe_fill_tournament_participants_troop failed
the fix required edits to module_troops.py to add 7 more troop lines. This will BREAK any savegames with custom troops
also "tpe_setup_neighboring_regions" in tournament_scripts.py needed adding all the new factions above 6
and tournament_constants removed all the -1 neighboring factions definitions and put valid kingdoms there
It may be more viable to just hard set native tournament handling by substituting script_fill_tournament_participants_troop
for script_tpe_fill_tournament_participants_troop

(Native) Tournaments now work correctly. There should be no issue with the town/faction hosting a tournament; the missing textures causing invisible weapons were the two Greataxes; these were at weapons far beyond the items defined at module_items.py and were visible once I changed items cheat to end at "itm_tpe_enhanced_throwing_daggers_melee". I still have to go through script_tpe_fill_tournament_participants_troop slowly as it calls several side scripts. I think I can get ALL of TPE working today.

I'll play with different combinations of Normal/TPE today to make sure there are no further issues; TPE thankfully lets you toggle various things on/off without having to recompile, so you can do the same tournament a half dozen ways.

Up tomorrow? will be to add trace info to dialogs to check all the quests either work or are clipped correctly to not get offered. Friday/mid next week-ish. After that I'll upload a full mod image to google drive, and the following week to NexusMods and Moddb, giving them last update since they complain the most.
Last edited:
Yesterday's update had some debug info left on at module_simple_triggers.py lines 7012 and 7238 should have the # character removed at the start of those two lines, else it will dump any orc and drow troops found to screen around midnight. This was to debug why companions were making Blazing Hand troops complain, but it would be a minor nuisance for Orc and Drow parties :smile:

Next week/ 10 days scheduled changes:
A) adding trace debug tagging info to dialogs to hunt for glitched quests.

B) Once the broken quest(s) are repaired the mod can be put up as complete images at google drive, ModDb, and Nexus Mods. Nexus Mods needs me to reply to a number of "open" issues, most of which are solved but not so far as they see, and that will burn a day.

C) I want to add magic damage to Magic Missile that can be partly or completely resisted, and lower the un-resistable "normal" damage.
This would be putting magic missile in front of other special attack weapons (a magic missile is more likely to be cast in battle than sun sword (which would be #2 only because some blazing hand troops randomly have them in battles), and far more likely than Vorpal swords (some demons), and all the other special attack weapons are least likely and thus evaluated last in the chain.

D) People at Nexus Mods mentioned that their end game always has the "allies" forever locked in a non warring status once the "axis of evil" is defeated. I want to add something that after day 300 checks once in awhile for defeated "evil" factions, evil factions with no towns, and then ranks the remaining factions according to towns owned, hitting relation with the ones with most real estate (including the player) and decreasing the relation hit/randomly giving a bonus relation with the ones with least towns, such that the small factions will still clump together as allies but large successful factions will have jealous neighbors. This should make end game less static. As that needs testing with very aged characters it comes last, but I do have one character at day 650ish and another two at 350ish. Relatively quick but needs some planning WHERE to do this.

E) Sea trader boats flying over land -- relatively quick fix.
Traders stuck near the shore by cliffs. relatively quick fix but determining they are in fact "stuck" needs some cleverness.

F) checking for Warband 1.174 incompatibilities - although my test characters have collectively 1500 game days on 1.174, I should research any script lines no longer working in 1.174 and hunt these in the existing code base. This will take 1-2 full days, as the base is large.
I think I found where Epidemics was glitching at end of epidemic, causing the stuck in town sometimes.
I put a fix into v160 A3 and will test at home. Mainly there is a point where an epidemic ends silently but the timer check for epidemic evolution has not fired, so that when it finally does go off it could pull you into town or village after the player party has already left. Now each half hour
a check is made to see if the player has left town/village yet and if so cancel their "fighting the epidemic" status, and thus skipping that menu for epidemic over. This may be the entire cause of being stuck in town after an epidemic; or there can be more than one issue presenting itself and this was just the first I found. Will test.

I will also quickly add poisoned pocket bolts for hand crossbows and adjust Drow assassins and Drow kingdom female lords to have these, with appropriate skill adjusts in crossbow weapons proficiency. This along with magic missile adjust for magic damage/resist checks. Every new weapon added to the chain of special attacks risks chewing up bandwidth but I had the performance fairly well optimized and I think I can slip these two in without a measurable performance hit.
Red Serf said "I also agree to that. Crazy to see this mod in development once again."
[big edit]
Hopefully that's the 'good' crazy. When the mod had 50K+ downloads I was hoping the energy from players could give me strength to continue making changes; but that became a two edged sword. The sheer number of problems with so many people growing frustrated took all the wind from my sails, and I ran out of time / money / energy to mod and dropped out to take a minimum wage day job, the only thing a broken person like me could find. I'm only smart part of the day, so I am difficult to employ.

I wanted to present the mod as a gift to my (youngest) daughter, and she encouraged me to return to fixing it now that I am retired from all other occupations (aka "free time returns"). She plays on a modest laptop for college (no GPU just Intel I5), and this mod is about as fancy as her gear can run. It looks pretty good really. I was surprised she could run the game as well as it does, without an Nvidia or Radion GPU.

Now as for Nexus Mods, they posted 46 "bugs", many of them duplicates, and I think I can have ALL or at least most of all of them closed in the next week.
I'll try to put something on Moddb a day or two after that - I expect in around 10 days time but could be sooner.

I accept hardly anyone will play the mod, given its well deserved reputation as a bug farm. But even the cute indie film "Joe's Apartment" had some fun, besides the cockroaches. This gets better weekly, now that it gets attention. My health comes and goes but I have been pushing to get this cleaned up "as fast as possible". I am maybe 4 times as efficient now that I have the mod mapped to where even I can find things in a few minutes, instead of cooking off all my remaining focus time without finding the snippet of code I needed to modify before I forgot what I wanted to do.

Today for example I found why presentation "battle" (what opens when you press backspace in battle) would not let me throw/swing/fire; I already solved opening spell/prayer book but this would be a big step forward in usability for me. It was gimped because of two lines! But those two lines were in a completely different part of the mod, and you wouldn't at first associate the two as interacting. I needed to step back to see it.
Last edited:
Created a mod blending pure Native 1.172 with modmerger and now trying to modmerge just PBOD + Formations + FormAI with pure original source and no Phantasy content to see if presentation battle works as I was hoping it would, to see if something in the files at my side differed from the original sources for just these 3 things. It is very slow going and not easily merging. I see I originally had to help modmerger with merging and it was never a simple task. If I can get just this working, as a separate project, it may solve the current battle presentation issue where I cannot fight while in viewing/giving orders mode. Modmerger compiles with no mods merged, but some of formations gets stuck in modmerger. I recall it took quite some time to solve it originally, thinking about it. I am only 2 1/2 hours into this so maybe this time it gets solved fairly fast, before I lose my skills for the day.
edit: compiling nicely now, have not tested. that took 2 hours after my first post :wink:

from Modules folder, if you have Native copy/paste Native mod to make a copy of Native
rename that copy Greytest (or whatever you like)
patch with this minipatch
You will have Native 1.172 + modmerger + PBOD .925 + formations + FormAI (and nothing from Phantasy)

module_game_menus line 1408 has cheat mode hardwired on, delete that line only, save, and recompile (double click build_module.bat) to remove cheat turned on. I needed to build a party faster and do not trust quick battle yet, as it references a presentation that does not exist so I commented that out for one button. The rest of quick battle should work.

The purpose here was to see if something from Phantasy was walking on a pure PBOD / presentation "battle" more or less untouched from me. Out of time for testing today.
quick test at a village fighting bandits looks like the behavior is same as at Phantasy, you can give orders within presentation battle or exit and fight but not both.

I also want to retry a change of code to get poison pocket bolts working. I thought of a new way to try to get the code snippet to fire; it keeps not finding the weapons and then drops through doing nothing.

Finally magic missile is used too seldom, or at least I don't see it doing special actions very often, so I will try setting it to pierce shields and see if that makes a difference. That would be a change at module_items. Shields may also not be taking enough damage; what I see is very seldom does magic missile fire for anyone but the player, and generally even that seldom fires the magic damage component. It may just be there needs to be enough damage to penetrate (or destroy) the shield, so the agent gets hit, so my add-on damage on agent_hit can now fire.

At the same time I need to increase its frequency of being equipped at mage casters, which happens at two different places in module_mission_templates.

success in all of these would be mini-patch v160 A4r2, but there is no use issuing one without meaningful/useful change.
Last edited:
Prepping a v160_A4_r2 mini-patch for use in what gets posted at ModDB and Nexus Mods.
so far it looks like this:
v160 A4 r2 May.xx.24

1) Magic missile tweaked slightly.
Had overlooked some of the missiles produced were a different item type, now applied special magic damage damage to that item as well.
Better reporting for low level casters in order to monitor magic missile use for novice casters.
Magic point cost is increased to 5 from 3.

2a) slight increase to caster equipment buff for fireball, lightning bolt, ice storm
b) ice storm slight increase to damage and radius of effect.
Remember in sieges defenders will have overhead protection from falling ice if they are indoors; fireball is preferred against windowsill indoor archers. Ice Storm should give acceptable damage outdoors.
c) white bolt magic point cost is reduced to 20; radius of effect is higher.
d) equipment worn buffs/debuffs for caster/non-caster [head, body, glove, leggings, staff] are applied consistently to
charm person, acid arrow, flame arrow, magic missile, fireball, lightning, ice storm, black bolt, white bolt, vampiric bolt,, darkness.
e) magic points cost adjusted slightly for fireball (35 instead of 40), lightning (25 instead of 15),.
f) fixed white bolt using the wrong stat to determine effect;
fixed cost in magic points for white being applied twice in separate location, once at the spell and once when it hits.

3) a) spiders as mounts are much more maneuverable than before; charge damage slightly increased.
b) bears and wolves are more maneuverable, but remain especially dangerous to their riders
c) unicorns are slightly more maneuverable as well; slight buff to healing.

4) a) spell_limiter adjust ammunition for each equipped spell according to cost in magic points, as the numbers were no longer accurate
b) script_phantasy_spell_ammo_limiter ?? checking to align with 4a)

c) equip_mages corrected logic where weaker spells would have been preferred by higher tier casters (magic skill 5 or more).
Expect more fireballs and lightning from these.
shield spell inserted at weapons slot 2 proportional to magic skill, with skill 1 giving 1 in 6 chance, skill 2 2 in 6 until 6+ is 100%.

5) Poison pocket bolts shot from the three hand crossbows should work as intended now.
6) noticed an error at menu ship_reembark during cleanup of beached ships. This should no longer generate errors.

7)a) Noticed "I want to help fight the epidemic" menu option showing when Epidemics are toggled to OFF at Phantasy 2024 settings within camp menu. Adjusted to test at towns and castles correctly if epidemics are disabled in settings before showing the menu.
b) set Epidemics to OFF for new games as a default, so that people who managed to skip reading the 4 part walk through don't immediately post about problems they could have avoided with a little more training. Since they doubtless won't read this either, it can be our secret (wink).
c) town menu - txt related to epidemics check status of "$g_rigale_epidemics" and skip displaying any epidemic
silently clear any epidemic found when "$g_rigale_epidemics" = 0
d) dialogs: guild master - check status of "$g_rigale_epidemics" before offering to show epidemics

8 a) Singing arrows now have an effect:
These now will attempt the charm person mage spell, as if the archer was a mage class but with magic skill 1 less.
A class bonus is applied to the effective magic skill: 3 for Bard, 2 for Ranger, 1 for (Barbarian, Necromancer, Monk).
Only one class bonus will apply, and is checked best to least to skip applying a lower bonus where two classes qualify.
After that the equipment worn can de-buff the effective magic skill; after all additions and minuses the effective magic skill needs to be
at least 2 for the spell effect to occur, and the target has a chance to resist magic, comparing the modified effective magic of the attacker
to the defender's magic resist, exactly as with mage spell casters.
b) added singing arrows to four ways inn merchant @ 9500. These arrows penetrate shields by the way.
They are still sold at a more modest price in the Elven kingdom, if you can find them.

9) mage staves that had a charged proc effect had flaws in their code; this is cleaned up and damage re-tweaked.
For full effect you need to have (at least) the magic skill according to the name of the staff:
gnarled = novice = 1, journeyman = 2, adept = 3, expert = 4, master = 5, archmage = 6
other staves do not have the charged proc, but may silently add to your equipment magic bonus. The above staves are adding, silently,
the above, for damage and radius effect calculations during magic spells; useful trivia.
It is not enough to simply buy something and equip it; you need to be able to handle it correctly to get the proc effect to work.

10) Darkness spell previously only fired an effect when it hit a shield. Now the effect checks for any agent within radius of effect,
even if it hits the ground/wall/etc, making it more useful in sieges. Magic resist applies, either shortening duration or avoiding the spell effect entirely, after calculating equipment worn scaled bonus/minus effect and applying some randomness to both attacker and a little more to defender, then comparing the difference in values. Most of magic resist for spell effects works this way.
Testing of spell changes went well.
Hand crossbow / poisoned pocket bolts are finally showing feedback during battles.
This allowed singing arrows to have a proc using a similar method.

I did see a hard hang trying to leave a lord (not asking for jobs) while talking, immediately after helping at an epidemic at a castle.
My current advice is save game & exit then load save after any "I will help fight the epidemic" or just do not enable epidemics at Phantasy 2024 settings.
I'll set the default epidemics switch to OFF for new games, which is a pity since they are a fine way to convince guild masters to let you build enterprises (and to hustle funds to build them). Players can then decide if they want more money and relation early game but more often side effects or leave it off to have fewer quirks but harder grind since epidemics were an early game boost but late game annoyance.
Last edited:
Adding a handler for unarmed damage now, I see why it failed before.
This will need tweaking script_get_dodge_chance2 so that passing a parameter of "no weapon" lets the script go ahead and infer a weapon speed for bare hands/kicking. The main issue for me is if the agent takes damage from for example falling it will look like open hand damage, so I need to check if the entity dealing damage is an valid agent before assuming I am in martial arts fighting.

Martial arts is complicated, and the formula used is more complicated than I expected yesterday. Essentially the attacker base damage is strength; athletics adds once to min and twice to max, unarmed skill adds once to min and 3 times to max; and now it determines kick or punch and kicks have more min and max, last the equipment for hand or foot slot is weighed and this adjusted for hand and foot differently, next added to min and max depending on kick or punch. The attacker rolls a random value between min and max. A buff is added at the end for monk or barbarian; the monk buff is higher. To this a random (-2 to 4) is added as influence of finding a good opening in defense when sparring.

The defender now takes [defender's unarmed skill, adds (athletics / 2) as a parry], doubles this, and adds a buff for monk or barb, the monk getting the better buff. This is subtracted from the attackers final rolled damage.

There is also a chance to dodge applied, where the "weapon speed" of the open hand "weapon" is derived from a base 85 + attacker's agility +
(attacker's athletics * 3) + (attacker's unarmed * 3). A very skilled martial artist will be hard to doge.

My next 2 days will be busy with non-modding tasks and after this big change I need to test heavily the weapons and unarmed vs mount damage and falling. Oh, maybe monks and rogues take half falling damage now. I need to test that too before release.

[Edit] Probably working, normal weapons attack and my monk showed something for unarmed but I want to dump more details and see if something should get tweaked further before releasing. Friday at earliest, still.
Last edited:
Martial arts is still getting testing, so patch won't be for at least another hmm 6-8 hours.
I think it is coming along well but there are always last minute issues to resolve so I'd rather guess longer than shorter.

Plus more time lets me close a few compiler errors, for the OCD modder/tweaker audience that even notices. There are plenty of those so
a little time spent on even a few of them will impact when I can release a build. Finally, every time the source changes I really need to run a quick check that a large battle ran without new errors, in case there is an extra else_try or missing try_end someplace just touched.

It looks like I can kick while holding a sword and have the martial arts section work as planned.
I still need to find a test case where I equip a bow and try kicking between shooting at far away targets.
I don't expect martial arts to work well from horseback; the weapon reach is too small.

[edit]: final testing now. I think the editing is done but I want to check battles and a crafting, then edit one or two of the documentation slideshows to add more details on unarmed fighting, marrying kingdom lords, and how to switch to ENglish if Warband is set to some other language.

I also saw in S_T_49 where kingdom lords would have disappeared if their faction had no walled centers (at v158A they end up at four_ways_inn).
I may later check for lords stuck at four_ways_inn and set them to exile, then let them attempt to re-enter again each month (so the faction can gracefully be eliminated in between). That would be the elegant solution for an old complaint coming from v156 and reported to continue at v158.
I had also turned off paying attention to the diplomacy switch that could have prevented lords from recycling (and thus not returning from exile after their faction is dead), as I was suspicious people shot themselves in the foot toggling things. If it becomes a big issue someday I can hijack an unused simple_trigger to check for stuck lords. I don't want to do it release day; this is a problem for 400+ game days as factions are falling, not a day 1 problem.
Last edited:
Opened a v160 A6, but so far there isn't much to put into it.
This week's goals:
A) add a small to medium boost at the prejudice check when the player tries to enter any walled center and belongs to the same faction as the castle/town.
If the prejudice check would have failed, the value is boosted by [20+ (player renown/50)] and then clipped to be not > 3 as a final result. They may not think you're great, but at least they might let you in when before they turned you away. If you still fail, and you are a vassal of that town/castle's faction, your party is really packed with racial enemies. DONE

I may tweak this further so that undead faction does not count dark mages and NPC necromancer troops as being human skin, instead adding 5 to the score for each found in the party. For necromancer faction turning your living party away, consider rescuing some mummy troops or raising a few undead into your party and retry. For every other case, prejudice is working as intended, but it can be a little kinder. DONE

B) add a check for open space in inventory at village specialty selling anything, exactly as was added for crafting guilds checking space before selling raw materials. DONE

C) Change poison handling to allow more than one tier of poison. There has been a slot reserved in the agent database layout for poison strength, I just never got around to implementing it. So far only spiders and now pocket bolts for hand crossbows have a poison effect, and pocket bolts even check that they were fired only from one of the 3 types of hand crossbows before implementing the poison effect. I'd like to mark the poison strength as well, and multiply some number by the poison strength active at the victim agent for each 3 second tick in the timed effects timer. When setting the poisoned effect the change at special mounts attack for spiders, and at the special weapons handler for pocket bolts, would be to see if the agent is already poisoned with a higher value poison, else it is safe to set the poison and timer according to what hit just now. I also want a limited reduction in damage coming from ironflesh at the target. I'd also like spiders to be able to roll for double strike on poison. DONE

D1) My necromancer test shows the lich lord is not allowing more than 1 castle and always disallows town ownership even though every castle and town was taken by my character. |I will find the cause and adjust; the undead faction at least should not dislike a necromancer player.

D2) village raids - fighting on the defending side of a village raid and defeating the opposing lord should give loot and renown just like any other battle. This is more difficult as there are several places to adjust but will be done this week.

postponed) I also want to look over Berembert's dialogs to either clone for Ninnock or try to add her to Berembert's dialogs, but I am uncertain if this is feasible. I'd like Ninnock to be more useful, but I need to check what happens if for example each is cooking a different project. I expect the timer and global variable holding the latest tinkered item in progress allows only 1 at a time. From what I learn doing this I can start to look at other dialogs, as dialogs is an existing weakness at the mod.
In the next 3-7 weeks:
I'll expand Bards to have Area Effect auras and charms. I just wanted to clean up what I already had before adding "new" content. Expanding Bard content is fairly simple, using the existing M mechanic to select a class specific list of commands. I am mainly hindered by lack of icons, and need to make a blank bard songbook just like clerics and mages have. This would need to be added as an exception to presentation battle as well. I sort-of tried this back in v150 and decided I had too much on my plate at the time.
Paladin Auras are exactly a precursor to the code needed for Bard songs. It may be sooner, since it is a medium but not hard difficulty task. I just like setting lowered expectations. This is still a relatively quick transform.

F) On the topic of mid future planning:
Long term I want to add some monster summoning, but although stuffing new enemies at the enemy spawn point is simple there are many not simple side effects to changing the total number of agents/enemies, and off the top of my head everything from the wavelet reinforcement manager to restrict the number of spawns to match Warband's current battle size slider setting, to little details like how to handle live summoned agents after battle when there is no matching troop at the party, and whether just stuffing summoned troops into the party breaks party size limit, and if they are killed off to prevent then there is the risk of morale hit from "lost agents". Then resurrection needs to be taught how to skip or moderate summoned troops. Perhaps a troop_is_summoned slot needs defining. The total number of troops on each side needs to be held as a global variable so it can change during battle. This even impacts loot, as loot retrieved shrinks as party size expands. Stuff like that. I consider this a fairly deep change, although plenty of mods just stuff enemies and ignore side effects, but I don't want newly arriving summoned enemies or friends to displace reinforcements that are yet to arrive.

Rangers could be useful summoners, morphing into beast masters with something tied to the terrain they are in. There are not many extra troops though, (bears and wolves) and what there are have problems. I could make a better case for Drow Priestesses; creepy crawlies I can find in the game already. This would also give Necromancers something extra to do, although from what I hear they don't want any changes to how Necromancers were back in Guspav's era. We'll have to see.

G) Steam support must wait until July. I am all tapped out financially the next 6 weeks, and won't have funds to buy a steam Warband.
My daughter has one but I only see her a few hours a month so its not a realistic goal right now. This also gives time to clean the mod while I still have only 50 players or so to worry about.

H) Sometime after that I really should look at rogues again. They don't do much right now.
Last edited:
patch A6 is coming along well, with the latest feature being a change in how interrupting an enemy raiding a village gets handled.
I'd like to test that a few times before releasing a patch, as it is a big change. I mentioned a few other changes in the spoiler above.

The change in faction relation applying to the guild master when in a town of the same faction as you (assuming you are a vassal of some faction) is really sweet. I have used it a few times already.

Poison handling was mainly to make scarier spiders as the Drow always get rolled first. That is a pity as the faction should have been reasonably tough. Even Khergits survived longer in my tests.

Villages checking space was because I was getting tired and bought a bunch of cheap leatherworks I had too little space for, and I knew I wasn't the only one that happened to. Convenient that I could find where I left the code that let me check for open spaces. Very convenient.

I really wanted to put a werewolf/wolfwere regen in alongside the Unicorn regen, but haven't gotten around to it. The code needed is super simple, I just was busy testing and more testing (and getting rolled a few times). I don't cheat, as if I really had to cheat something was wrong.
The only way to know if the "Universe" was fair is to try it honestly.

A bit of lightning close by outside so I'll sign off and unplug my dev PC. The Universe wants to talk to me I guess :wink:

edit: Oh! and a big shout out to Reformist TM (how could I forget THAT!)
see what you're getting if you aren't sure Phantasy Calradia 2024 is for you.

and.. Patch A5 just got approved at Moddb (except you had it a half week ago here).
Last edited:
Now that the mod is "stable" (pounding on wood), there are two other activities that I should have done years ago but got lost in the "time to panic / everything needs emergency fixes". In terms of most difficult to least difficult:

tldr version follows
A) Register use. Warband mods use a special variable called a "register" to pass information from one script to another. They end up being used heavily in displaying numbers, dialog lines, and other useful things. Sometimes they pass results. There are around 58 such registers, and they get used everywhere. This part is easy to see in looking at the code, and so long as only one line of code runs at any given instant things more or less work as expected. Except... a player has to FORCE single threading at their Warband client to work as one expects when looking at the code. The default behavior should run much faster -- timers and triggers are serviced as other threads, so at any moment they could be running in the background without the script or menu or whatever you think is running in the foreground being aware of it. The thing is, when both threads happen to use the same register at the same moment, how reliable is the data in that register? And for how long until something else writes to it? Maybe half the script lines were written in such a way as to protect that register data, as I became more aware of these as sources of problems. I call that "3 dimension planning". Every register is saved before use to a local variable, and restored to how it was immediately after use, with as few lines as possible between those two points in time. Every time code skips to a new location, I should log what registers were dirtied and at that location that called a script save the register before calling and immediately restore its contents upon program flow returning from that call. This makes a smaller window of possible glitches from similar tasks running in the background at the same time. You would not think this was needed, but I see it as a source of problems. It is a difficult job to clean that up, but if I made the mess, I should clean the mess. Half of it was already done and the focus has to be modules mission_triggers, simple_triggers, triggers, and scripts only concerning with scripts calling other scripts. Other than that better documentation of what registers got dirty when, which I have an excel file for now. It's already in the mod as I upload it for v160 series.

b) Foreign language translations. About half of all messages are sprinkled in the source as "quick strings", which look like "@ in a search of text at the source. I would guess there could easily be 600-1000 such messages. There may be 2000. I made quite a few messages, as quickly as I could. Those could all be replaced by formal messages each a line in module_strings.py
It is there that translators look to translate, especially by automated tools, the mod into other languages. I was browsing caballerosdecalradia.net a few minutes ago and realized wow most the world has a legitimate gripe about my use of English.
I agree this needs doing, and will get started, right after cleaning registers.

It's not just that - it's that, with a couple weeks? of effort, the mod could be opened to thousands, maybe tens of thousands of people who never tried it, or ran screaming from all they heard about my cruel custodianship of Phantasy Calradia (and some of the rumors were true). There was quite a bit of character assassination on reddit, usually about my refusal on personal belief grounds to make necromancy the dominant theme of a D&D game. In the end they won - necromancers are probably the most overpowered/overplayed class. But it wasn't fair to me to burn me at the stake. In real life I was burned by the way, baptized by fire with 30% 2nd degree burns, during a vapor explosion. But I must admit it was the kindest thing that ever happened to me, as I came away with a different perspective. Allow me to make the mod how I choose, and you (any of you) make it at your desktop how YOU choose, and we can both experience it how we envisioned it. That is what LSP (Limited Source Project) is for.
Testing / rewriting area of effect (AoE) code impacting slow, ice storm, and lightning bolt based on the model I put recently for Darkness.
Fireball works reasonably well so I will leave as is in case something goes wrong with my experiment, but ice storm especially could use a rethink. Although this helps player casters, beware the other side will be also using any remade spells. This would allow more intuitive splash damage. Remember defenders behind a wall currently get some protection from splash already, and ice storm requires no props directly above the target for damage. But defenders huddling outside should be more concerned.

I will also boost the impact of magic resist to 3/2 what it is now. That is a quick transform at the code level. Do be aware many high bosses have magic resist in the 8 to 10 range. Spells are very dangerous at high magic skill already, if they hit someone to fire at all.

I'll be busy the next few days so this might be a Sunday/Monday thing, we'll see.
Hate to burn another post before posting the patch, but this morning started morphing lightning bolt into something that makes a rough cone shape.
It is fairly complicated, and tries to avoid math where possible. The damage is intense at the first contact and keeps reducing as the explosion widens, which happens at 3, 6, 10, and rarely 15 meters. At 0 meters impact the radius of damage is 2 meters from the point of impact and damage is 3/2 normal, at 3 meters from impact along the same 3D vector a second point is made and agents within 3 meters take normal damage. At 6 meters from the initial point of impact a third point is placed and agents within 4 meters of that point take 2/3 damage. If the initial radius of effect extends to 10 or more meters a fourth point is placed at 10 meters, and objects within 5 meters take half damage. If a combination of magic skill and equipment worn would have gotten a distance of 15 meters or more radius a final fifth point is calculated, with objects within 6 meters of that point receiving 1/3 damage.

No agent will be hit more than 1 time only, and there will not be up to 5 try_for_agents loops checking range to look for agents close enough.
Instead the list system finds all the agents within the largest radius of the impact point, then the LIST rather than the entire battle is searched at 0, 3, 6, 10, 15 meters points and any agent found at an earlier check is removed from the list (except at the last check, where there is no value to adjusting the list for the next pass to check again).

Magic defense of any agent weakens the damage further. Electrical resist then reduces damage yet again, although agents in heavy metal might find their damage is effectively more than a nearly naked agent, making lightning special. Tunic material counts as 3 times the material, leggings as 2, helmet and gloves as 1 each. Each slot is evaluated separately and the result added to a running total. I expect to If the height component of any of these projected points would be underground the z-value of that point is moved to just above ground level, happening at the feet of opponents. This might also give a better utility as the lightning passes over a wall. I could check the intermediate points to see if after adjust for at least ground level if they lack line of sight to the initial impact point, in which case I can stop processing further. This would give better viability to both sides in a siege and make lightning more valuable against a very strong single opponent. I have upped the cost in mana (magic points) to effectively lengthen the recovery time for that spell.
I have my 5 points now and the rest is fairly easy, but don't expect the patch before Thursday.
Next week I'll be gone a full week by the way (to another continent, with no internet).
Hopefully you don't need me, but if you do you can always reapply A7 until I return (assuming I am not kidnapped etc in North Africa).

Testing the full effect for the first time now, it took all day :sad:

edit: 19:48 Tues Lightning is finally working the way I wanted it to. Fireball and Ice storm are modified for radius of effect and damage.
edit: Wed 19:53 status in spoiler
I'll start recalculating resists based on what is worn tomorrow, and tweak trees to show the updated values for resists.
Started work on this but so far the equipment values are not calculating correctly. There were several parts of this process done for v158
but the completed sequence still has several holes showing. Spells are ready to instantly use the resulting resists but so far most resists come back as "0", except acid. I'll use that to work backwards using that to view where it catches the values and where it drops. The tree display is set to now show for any troop the resists, if only the resists would be calculated correctly. IN PROGRESS

Some spells have the magic point cost increased to limit how many times they can be used back to back before mana is exhausted. Increased the maximum battle size at module.ini; seems good. DONE

Still need to tweak faction to faction relations where the player is actually less of a threat than another kingdom, to reduce "the world piling on necromancers". Since that's the main character these days ;// NOT DONE

Wed evening: so far I spent the day still tweaking spells for "correct" damage. Although AoEs are working well enough now, I lost Acid Arrow, I'll research why.
I have not done the "resist by what is worn" rework yet. I have a little more time tonight, spouse is off singing. She also bought me speakers so I can hear the game again. I found the resist bug that was blocking progress a bit ago.

Thu evening: worked on resists but still not happy with it yet. I need to debug further before I will release. It is working as is without the resists and just storing 0 for equipment resists, which might be enough to work it later if I don't solve it early enough tomorrow. No patch tonight.
Fri 09:41 AM: first successful result in testing dynamic resists from gear worn. This is not the same as all cases / every troop but from here it is much easier to finish. I'll be busy a few hours and expect to have some free time this afternoon to finish the patch. Estimate early evening patch release.

Fri 17:35 dynamic resists are working well, at least for troops view. I'll do a siege now and see how the agents are spawning with resists, then make the patch. It's finally robust; there were a number of corner cases to solve.
Last edited:
Returned safely from Tunisia with a hand written sheet of ideas for a savegame export/importer that ... can't run in Warband.

WSE "might" let me do it, but then about half the players won't be able to install the mod, already down by half because half the potential audience wanted steam to do it for them.

I was going to save not just the character, but all the companions for whether joined the player, experience, and 10 inventory slots item+item modifer, then all the secondary skills added for crafting and guild membership, credit spells purchased by mages, add the bank savings account, subtract any bank loan outstanding, tabulate the high tier troops at party+every player owned walled center garrison and then write these as well at specific locations so that I don't even need to store troops id numbers, allowing me to edit module_troops.py later by comparing the minor version of the mod at export and the current import mod version to decide if I need to translate anything while importing. All of this could be done in BannerLord, although nobody there can guess why it would even be useful and seem more concerned about cheaters. When a mod or game has source available, cheating doesn't need an intermediate save file, they can just script their way to success. The export import would allow a lot more than tweaking a text file to reimport - there is a huge loss of time developing troops, companions, gear for companions, special skills outside of Native (this isn't Xbox by the way - we should be able to edit everything in a sandbox). But I digress.

fixes so far in B9:
Found I was adjusting heights by 2-3 millimeters instead of 2-3 meters when checking for partial cover from area of effect spells.
It makes a big difference in the line of sight checking. Quick fix, pity I did not notice it before leaving the country last week.

I was too busy worrying about al queda based from Libya around 70 miles away from Djerba island where I went. By the way, great place to visit, even if we did hear automatic rifles (yes I know the difference between semi-auto and full auto. I'm not a blue stater) firing once. Last time I heard that was in Macedonia maybe 20 years ago. But I digress. The price was right; and my spouse needed a break. Both of us are back and she is willing to let me "program" so long as I give her more time. It's a hobby, right?

Found the error blocking recovery from disguises after sneaking into a town. One commented line.

Fixed darkness area of effect, what I hoped was 3 meters had been interpreted as 300 mm instead of 300 cm.

Lowered mana costs on several low tier spells. Casters with magic skill less than 5 now recheck to see if they have no spells equipped after running out of thrown spells, and re-equip spells, each 41 seconds. This keeps them from becoming silk wearing infantry.

Set a starting value for movement speed that encumbrance would then correctly modify; it was modifying an uninitialized value which could have had any number at spawn especially if agent IDs start recycling due to death of agents. This should make movement much more reliable.

Edit: Export /Import using WSE via modified "simple custom log" example shows possibility of file IO exchanging values with warband script;
So it could be tweaked into a dump of slots of interest + items + flags and switches that would govern code at the "import" action. I just needed to find how to even get access to python, in even the simplest case. Much of python functionality is specifically disabled, but a simple text log is possible, and if I can write it, I can probably read it, and that will be enough. It will take a fair amount of time before I can get a simple test going.
Last edited:
Work moves slowly on the "export/ import" a character. I have enough progress for the week to merit an A10 release around Friday 28ish June.

Item 2 WIP # 3 (troops counting) is where I am right now. (edit: Thursday 18:00 DONE)

I added the larger battles tuning by way of giving something besides a mock up display of values to write to a file. Just GETTING the right values needed coding, if it can write to log it is close to ready to write to a disk file.
The necromancer tweaks were last weekend, and the tiny adjust to black bolt was a trivial change this morning.

WIP items 1 and 2 finished this morning. I expected them earlier but there were endless tunings needed. I think the values now are solid.
I am not ready to build a WSE version yet, I needed to do this layer first. I'll also post a full package as well as it is tedious to gather all the updates since v160_A4_r2 (full).

If you feel battles are too laggy at 100% slider for battle size, do move it down from 100% to something else. Today's adjusts to reinforcements logic mean about a 45% increase in effective battle size, regardless of how little difference module.ini setting of 225 looks compared to 250. It's the OTHER adjusts that count the most. I will post A10 source as usual but withhold B11 to reduce the temptation to hack the import files. Mainly I have some added anti-exploit logic at B11 that I'd prefer to see .. well, not exploited. But I suppose you could write your own export/import from this head start.

Edit: small tuning changes to speed up 2 frequent loops. At battle size slider = 200 the battles now feel very smooth, but troops on field are more than with A9. Your PC isn't mine, but start here and go up or down as you prefer.

upcoming patch log v160_a10
Patch Notes v160_a10

1) Necromancy changes:
a) necromancy refresh timer no longer 24 hours, now 11 hours but retaining the check for night-time.
Previously a check for night time each 24 hours could lock the character to never have necromancy ready after first use.
b) added a fail-safe at the "night creatures are more powerful" event at 21:00 daily.
c) removed the outlaw for reaching -100 renown status check.
d) allowed the weekly necromancer effect to now also add undead to garrisons in towns and castles, before it only added to parties outside garrisons. DONE

2) WIP Work in Progress - camp menu actions #2 adds some testing for export of character preview.
Essentially each of these will dump a screen of messages to the Notes: Recent Messages window, which can also be seen by pressing L outside towns.

* means this is captured by script here but not shown in the log messages
#1 Player information: name, face codes*, skin type, experience, honor, renown, inventory management skill, party size, paty size limit, all Rigale crafting/harvest skills*, Rigale guild statuses*,
Companions that have joined the player, their experience, their equipped weapons/armor/mounts with item modifiers, and a test of evaluating the real worth of each item to scale replacement costs.
Spouse if present, experience, items only if a kingdom lady (and thus the player could have added items to her equipment, unlike a kingdom lord). DONE

#2 Repeating the line for player name, experience, honor, renown.
Checking towns and castles for player ownership, enterprises, and walled centers belonging to player faction but not assigned to player: show enterprise type, cost, show garrison size if belonging to player.
Show mage spells purchased and store as a separate value as a combined credit, if the importing character is not a mage this can be applied to cash balance.
Show cash on hand, bank balance, bank loans, and net at bank as separate values. Show treasury from chamberlain, debts to party, and net balance at chamberlain.
Simulate selling all prisoners at constable or ransom broker to see what the value of prisoners in the player party adds to finances.
Show secondary household inventory items value for selling at fair market value (which needed some tweaking to get a good number), considering item modifiers for quality and item count for partial stacks of food/ammunition/tools.
Tally the above for secondary inventory and armory, as these inventories will be sold during export to fully empty them.
Display as a final line cash on hand, net treasury, spell credit, ransoms to see the total finances exported. DONE

#3 Count total troops by type collected from player party and player owned garrisons as lists for speed.
Display player party size, max size, garrison sizes for player owned garrisons, count of player owned towns, count of player owned castles.
Show total count of troops filtered by levels (the intention is to prevent overflow from too large a player party, and to put some mid tier troops to garrisons, possibly displacing low tier troops at that garrison):
Count of Troops level 25+ Highest tier or special faction troops
Count of Troops level 20+
Count of Troops level 15+
Count of Troops level 10+
This helps decide how to auto split off troops from the main party into garrisons at import time, to prevent party overflow.

The intent is to set the importing player's new renown, experience, honor, and inventory management skill before calculating the party size limit at import.
This means the inventory management skill will not take points away from the unspent skills pool at the importing character, once experience applied has levelled up the character. DONE

3) set maximum battle size to 250 instead of 225 to better test for lag spikes in large battles after performance tuning at patch A9.
tried 300 and it performed poorly for a 700 vs 800 battle. Consider the module.ini settings as "serving suggestions" but not exactly matching code. If you want to mess with battle size it needs to be done outside module.ini at mission_templates for each mission.

adjusted reinforcement logic per wave according to slider settings set by player for battle "max slider = 250".
Reinforcement logic green lights sending reinforcements to both sides sooner than before; earlier one side needed to fall below a certain smallish number but now both sides keep
expanding until battle size is reached. Neither side starts at full amount, which reduces initial load time for a battle.

Be warned, with slider set to 250 the ACTUAL number of agents per side is MUCH higher as mounts are also agents. AND battle advantage lets either side exceed the battle size limits for that side.
it is not at all an exact limit it is more to do with how quickly reinforcements waves are green lighted, and is set by code not just module.ini setting.
A cavalry heavy even battle on both sides at maximum slider will hit about 700-800 agents active during battle.
Every area spell, every aura, pretty much all repeating timers will have to do more work as number of agents increase, making greater lag than mods that do not have these things.

This ran reasonably well in my tests, with heavy magic and clerics for worst case (paladins like a large blazing hand party would also be heavy users.
of bandwidth). For a large siege 404 vs 34 I had all 404 on my side on the field at once with these settings, so don't consider what module.ini has as max battle size to be the last word. DONE

4) adjust resist type versus Black Bolt spell from magic to cold resist. DONE
Last edited:
Installed WSE v4.9.7 (June 6 2024 update) yesterday to explore WSE / Lua.
This was confusing for me, specifically WSE installed well enough but Lua needed me to wrap my head around why exactly it hung setting up Lua directories. I get past that and today started building a rough for character export, part in Warband scripting and part in Lua.
I have no idea if it will compile, but at least it helped me organize what goes where for passing parameters.

TLDR version below :wink:
Lua needs to have the source copied to a specific location and then builds a table of variables, indexes, constants, scripts defined and so on.
WSE settings also has a place to set the export directory for anything Lua writes/reads and I will have to try moving that around to see if Windows will block writes/reads like it does for Python when compiling. I suppose I will post source so the paranoid can compile it for themselves. I was going to close the source to reduce exploits but there is some value to leaving it at least partly open as "LSP". Besides, at this point I am so raw I might find someone sharper at Lua willing to kibbutz (a chess expression meaning to walk past someone playing and lean over to suggest better moves, which some players find annoying but I could use the advice!).

I think I finally understand how to pass parameters, how to kickstart the processes so that Lua at least waits for the Warband scripts to wake up as Lua loads first. I will start compiling, fixing doubtless many syntax errors and possibly having to rethink how the handoff between Lua and the normal warband scripting for the mod. I doubt I will be so lucky as to have it work first try. Once it is clean and something seems to be writing,
then I can do the other side - import the contents of the saved file.

So fair main.lua is small, around 233 lines, and I have digested script_assess_character_export1 and 2 from the 3 part examples I placed at patch A10 in camp: actions # 2 menu last Friday. At this stage of roughness, I prefer to wait a week before posting next update. That gives me time to smooth all the different options that might be desired on import - keep the face codes and race from original or use whatever the new char has, how to handle overflow from some packrat stuffing all their inventories (there are 4 inventories - player party, household possessions, secondary household, and armory. I intend to force sell the armory, let players save at export their first 3 inventories, and use one inventory to handle dropped items during import. I might auto-move the hard to access inventories after seeing whether everything even fits. I plan to wake up the importing character outside four ways inn and hand them cash for an airplane ticket to the town of their choice.

It is my intention to allow a full respec of the player, the companions, even letting them roll different classes/race/choose faction/change sex (how modern), and rename - or at least the new char does not have to match the old char. Once all that works I'll tweak performance for larger battles, since the rumor is WSE lets battle sizes increase by around a third. Considering I just did that at A9 the process should be quick.
I'll also examine morale / panic at formations / PBOD, which some modders said was slowing their mods at the very long forum for WSE/WSE2 (300+ posts deep!)

There are also persistent mentions of inventory being lost after intense battles, which I tentatively blame on autoloot/autosell/auto-upgrade. In any case I thought of a way to cache the inventory management skill so that even if the player is hit hard over the head he/she/they do not forget their skill, ever. I will substitute a script I make for the one line Warband usually uses to get inventory capacity, and make my own calculation instead of trusting Warband to do it for me. It won't take long. Who knows, once all that is cleaned nicely, maybe I can see if arcane deathbloom wants a reincarnation. Or not; I check daily but I feel I am being shown more clever crafting options and need to hurry up and clean up my side of things. So, I've wasted enough of your time, happy fourth of July (even if it has been 20 years since leaving USA for a saner/cheaper place in (East) Europe.)

both export and import are finished, for first test anyway. I am not yet setting faction as a vassal nor waking up the player kingdom, but other than properties and setting faction the rest is done. Just as well I was not pushing a build publicly, I want to watch 5-10 characters and examine that everything came across correctly before anyone downloads a patch.

Sunday afternoon 7/7/24: still running Lua tests.
Although it seemed like I had everything, Lua was not happy and simply rolled over and died. One or more lines has a syntax error or something wrong. No real line count or helpful info, so walking through a couple lines at a time and examining changes when it fails. Have to completely exit and completely reload after each trivial lua change, so very slow now. Still, what do I expect coming into this with no Lua skill.
Last edited:
A week ago I THOUGHT export and import were finished. It looked good on my screen anyway. But for about a week I only crashed each time I tried to run WSE and later WSE2 with a Lua directory. I had to beg for help and today was actually the first time I got Lua to do ANYTHING at all.
Some quick tips for using Lua:
WSE2 loads very fast. This makes it good for Lua, where I need to run a test, see the results, completely leave Warband, edit the lua script only, and jump back into Warband to do it again. Unless I decide to change parameters pushed to Lua or some other thing at the Warband scripts side I do not need to compile.

header_operations.py using the latest master header_operations from Taleworlds forum, two lines will fail to be parsed by Lua, causing a crash with no meaningful text as to what happened in WSE and surprising or not the text is cleaner for WSE2 giving a better clue as to what happened.
line 660 #store_random_parties_in_range = store01_random_parties_in_range I had to add a comment # here
line 814 # party_set_marshal = party_set_marshall this allows an alias for spelling but the Lua parser hangs on this.
I found both were used in different places so set all of the commands using party_set_marshall to be party_set_marshal as a replace all. That much could be inferred from the rgl_log.txt at the Warband directory. Somewhere after all the shameful mentions of duplicate resources and missing animations came messages that Lua could not parse those two lines. But even fixing that hung lua anyway.

The solution: You will compile with one header_operations.py but the one copied to Lua must remove the 3 lines at 3184
lhs_operations = [try_for_range, try_for_range_backwards, try_for_parties, try_for_agents, ... al the way until the next two lines:
# add_missile, MOTO causes local variable unused warnings?
as these plus the paste at the end asked by WSE/WSE2 install overflow the string buffer used to read each line in header_operations.

But wait, there's more: some one line mention is made of folder msfiles underneath Lua directory.
This can have header and ID files, ONLY, but not any other files. No .bat, no other.py, no .pyc, no module.ini, no add-in mini-mods, and modmerger remains iffy. So this also needs tweaking before it is ready.

Then for a day WSE loaded, did not hang with a lua error in logs, but ... nothing Lua happened. Lua needs to be in the same folder as WSE/WSE2, and THOSE need to be in the warband folder where mb_warband.exe is found in order to locate the Modules folder and find the mod. Then came trying to guess where a text file is created by Lua. At one point it mentions file I/O can only go to the Lua directory. But not Lua51.dll, at Warband directory. the Lua directory for the mod, which has only one file main.lua, and subdirectory msfiles as mentioned. THERE is where that blessed beauty will be created. Maybe. You can only create a text file, not a binary file. Everything gets written as text strings.

I am guessing either nobody with a single player mod tried Lua, or they gave up, or they did it but told noone to keep it secret so as to have bragging rights for their "uber mod to rule all" rights. At hmm, a couple hundred users, if that, Phantasy Calradia isn't very uber. It once had 50K downloads before I got in its way. But at least, now I know how to get Lua running. What else?

At Warband scripting, I kept trying this (lua_call, "@luatest1", 0), I didn't have any parameters to pass, I just wanted Lua to do something (anything) and come back. Don't try that. You get to stuff something, anything, because there needs to be a value for parameters.
better to write

(assign, reg5, 5),
(assign, reg6, 6),
(display_message, "@before luatest reg6: {reg6}"),
(lua_push_int, 0),
(lua_call, "@luatest1", 1),
(display_message, "@after luatest reg6: {reg6}),

and main.lua can look like this:
function luatest1(dummy)
local i,j = 0
i = game.reg[5]
j = game.reg[6]
j= j + i
game.reg[6] = j

if you print() while in lua the output goes to the message log (press L to see it). This lets you dump variables while at lua to inspect.

This is by way of explaining how I managed to not have a meaningful update in just about a month after banging them out every friday.
Last edited:
Top Bottom