[Ohrrpgce] [ohrrpgce/ohrrpgce] "swap by position" lets you create an empty active party (#1111)

Ralph Versteegen notifications at github.com
Mon Apr 6 19:41:52 PDT 2020


Textbox conditionals, Team/Order and the `swap out hero` and `delete hero` commands all ensure there's always one hero in the active party. But I just noticed that the `swap by position` has no such check! `swap by position(0,4)` gives you an empty party. You can walk around as usual with an invisible hero and talk to NPCs. The Spells, Equip and Status menus refuse to open.

`swap by name` is a wrapper around `swap by position` but isn't affected because it doesn't swap empty slots.

While this is obviously a bug, fixing it breaks scripts of this sort:
```
swap by position(0, 4)  # swap out leader
swap by position(findhero(hero: Tom), 0)  # new leader
```
So it might be a good idea to preserve backcompat by delaying calling `forceparty`.  A gamelist scan from 3 years ago shows 1952 uses of swapbyposition in 192 games (not counting swapbyname).
I'm not sure where a delayed call should be put, though.

Incidentally, `forceparty` automatically swapping in a hero can be annoying when your trying to make a particular hero the leader, so I thought a command to swap heroes into different slots all at once would be pretty useful, e.g `setup party(hero: bob, hero: misa, -1, -1, hero: dusty)`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/1111
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20200406/041f9495/attachment.html>


More information about the Ohrrpgce mailing list