<div dir="ltr"><div>Those are excellent suggestions! And I'll fix my mis-use of valid_for_ai also.<br></div><div><br></div><div>I think calling update_battle_menu() sounds like a good idea, and maybe we could consider it a bug that it doesn't get called each turn when a hero is under player control</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 26, 2022 at 9:14 AM Ralph Versteegen <<a href="mailto:teeemcee@gmail.com">teeemcee@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Fun! It can be expanded in various directions later. We could have a setting in each spell list (or even each spell list slot) to say whether the spell list/slot should be used by hero AI.<br></div><div><br></div><div>I see some bugs in the battle menu code though.</div><div>You don't actually use valid_for_ai for anything! "WITH *bspr.batmenu.items[randint(choice_count)]" is wrong.<br></div><div>You forgot to check .disabled, and it ignores .check_costs_as_weapon (which is misnamed and has dubious effect), however currently .disabled is only updated and .check_costs_as_weapon is only applied in update_battle_menu(), which is called from inside battle_display() and apparently is not called when a hero is under player control. I think maybe you intentionally didn't want to use update_battle_menu, but only that checks tag conditions, and I don't see a reason to duplicate that code in update_battle_menu.</div><div><br></div><div>Since valid_for_ai is a vector, you could just use v_remove to delete options that fail atkallowed, and stop when none are left, then you can do away with 'safety' entirely.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 23 Jan 2022 at 04:22, James Paige <<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Right now the hero just randomly picks any regular attack.</div><div>I do plan to support picking from spell lists also</div><div>I have no plans to support item use in automatic attacking mode</div><div><br></div><div>I intend to keep hero AI very simple. I might add a mode that only ever uses the first valid attack, since I can see that being handy for cutscene battles, but any really fancy hero ai (like if ally hp is low, then use healing, or conserve MP if enemies are weak) will have to wait for battlescripting</div><div><br></div><div>Also, known bug with both player controlled enemies, and auto controlled heroes is that they screw up the "ESC to go back" feature in turn-based battle mode. I'll find a fix for that soon though.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 22, 2022 at 10:14 AM <<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2022-01-22 07:14:27 -0800 (Sat, 22 Jan 2022)<br>
82<br>
Implement very simple (random) hero AI for when a hero should attack automatically<br>
---<br>
U   wip/<a href="http://bmod.bi" rel="noreferrer" target="_blank">bmod.bi</a><br>
U   wip/bmod.rbas<br>
<br>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</blockquote></div>