<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 2 June 2017 at 02:50, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><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 class="gmail_extra"><div class="gmail_quote"><span class="gmail-">On Wed, May 31, 2017 at 9:27 PM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On 1 June 2017 at 08:12,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.co<wbr>m</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2017-05-31 13:12:35 -0700 (Wed, 31 May 2017)<br>
455<br>
the cats() array is now almost always accessed via helper functions<br>
herox() heroy() herox() and herodir()<br>
<br>
These are byref functions, so values can be assigned to them also.<br>
<br>
These functions take hero caterpillar rank as an argument,<br>
eliminating all the many places where catx(n * 5) was accessed.<br>
<br>
Also added herotx() and heroty() that replace all the many times<br>
when the x and y return values were immediately divided / 20 to get<br>
hero tile x and tile y<br>
---<br>
U   wip/game.bas<br>
U   wip/<a href="http://game.bi" rel="noreferrer" target="_blank">game.bi</a><br>
U   wip/<a href="http://game_udts.bi" rel="noreferrer" target="_blank">game_udts.bi</a><br>
U   wip/moresubs.rbas<br>
U   wip/savegame.rbas<br>
U   wip/scriptcommands.bas<br>
U   wip/walkabouts.bas<br>
U   wip/yetmore2.bas<br></blockquote><br></span>Altogether, adding that bitset was quite a big project! A lot of helpful cleanup.<br><div><br></div><div>This would be a good use for properties actually: turn hero{x,y,z,dir,tx,ty} into properties of herow. Then we will finally have a real hero walkabout UDT. (And can add XYpair versions, and allow assigning to tx/ty).<br></div></div></div></div></blockquote><div><br></div></span><div>I had actually considered making these methods of herow() but herow is an array of 4 HeroWalkabout objects, and (as far as I know) there is no way for an array member to be aware of what element of the array it is in (short of adding a .index member and keeping it updated whenever the array changes)<br><br></div><div>I didn't want to be writing herow(i).x(i) all over the place,especially since the first (i) in that would be effectively meaningless <br></div></div></div></div></blockquote><div><br></div><div>I didn't think of that. But it is actually possible to look up the index using pointer arithmetic: "this - @herow(0)".<br><br></div><div>But a .index member might be cleaner. doswap is the only place in the code that I think of where it would need to be updated. Wait a minute... doswap doesn't actually swap herow() elements!! It looks like swapping two heroes will cause their speeds and xgo/ygo to be swapped! I guess this bug has always been present, since the revision that added herow (r4792) didn't remove anything from doswap. (doswap does call party_change_updates, which causes herow(i).sl to be updated, but I actually think that's a bad thing. It would be better not to unnecessarily recreate hero slices when they are swapped since they might be customised by scripting. Of course, that sub is called in many places, so it's a general problem).</div><div> </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 class="gmail_extra"><div class="gmail_quote"><div></div><span class="gmail-"><div><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 class="gmail_extra"><div class="gmail_quote"><div></div><div>Also, the tx, ty accessors are a great idea. I feel like supporting larger tile sizes isn't going to be such a huge project.<br></div></div><br></div></div></blockquote></span></div><br></div><div class="gmail_extra">Perhaps NPCInst could also use .tx() and .ty() helper methods that do the same thing<br></div></div></blockquote><div><br></div><div>Yes, that was what I was implying!<br></div><div> </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 class="gmail_extra"></div><div class="gmail_extra"><br></div></div>
<br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.<wbr>org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.<wbr>org/listinfo.cgi/ohrrpgce-<wbr>motherhamster.org</a><br>
<br></blockquote></div><br></div></div>