[Ohrrpgce] SVN: james/8784 Begin cleanup of hero position. Remove catx() caty() catz() catd() array

Ralph Versteegen teeemcee at gmail.com
Wed May 31 05:58:21 PDT 2017


(Changing herocount() is the first step of raising the reserve party limit)

"count" is clear, but I find "size" a bit ambiguous. If I change the name,
I might rename some of the other new functions like active_party_size and
is_active_party_slot too is I can figure out something consistent.

I frequently find when I search for something (often FB related), that if
I've mentioned it on this mailinglist, then Google shows my own post
near/at the top of the results. I don't know what their actual rank is;
Google results are very personalised... well, it works! It's funny that
gmail search is not so useful, I have to search the whole web to find the
email I want :)

As an alternative to returning byref, you might be interested in properties
too. They are syntactic sugar for getters/setters, like @property in
python. Properties are very similar to byref-return functions, except that
you can't pass any extra arguments to them, you need to write the getter
and setter separately, and their setters can be much more flexible.
For example, I'd like to turn the x/y/z members of NPCInst into properties
which return/set the position of its walkabout slice, so that you can move
an NPC slice, without us having to update any other code. And obviously the
same for heroes too, although I see now that will be more complicated.
(Obviously, with both NPCs & heroes there are complications to work
through, since the slice may not exist)


On 1 June 2017 at 00:05, James Paige <Bob at hamsterrepublic.com> wrote:

> That doesn't look like it will conflict with what I am working on.
>
> I probably would have named active_hero_count()
> count_of_heroes_in_active_party() which is silly long :)
>
> Hopefully I'll have the patch that replaces most direct access of cats()
> with wrapper functions ready later today
>
> By the way, I love functions that return byref!
>
> I went googling for the correct syntax for disambiguating assignment to a
> byref return value from comparison, and the test-cases you wrote for byref
> functions was ranked higher than the actual docs :)
>
>
> On Wednesday, May 31, 2017, Ralph Versteegen <teeemcee at gmail.com> wrote:
>
>>
>>
>> On 31 May 2017 at 09:20, <subversion at hamsterrepublic.com> wrote:
>>
>>> james
>>> 2017-05-30 14:20:42 -0700 (Tue, 30 May 2017)
>>> 161
>>> Begin cleanup of hero position. Remove catx() caty() catz() catd()
>>> arrays and replace them with cats() array of type CaterpillarHistory
>>> (More cleanup to follow)
>>> ---
>>> U   wip/game.bas
>>> U   wip/game_udts.bi
>>> U   wip/gglobals.bi
>>> U   wip/moresubs.rbas
>>> U   wip/savegame.rbas
>>> U   wip/scriptcommands.bas
>>> U   wip/walkabouts.bas
>>> U   wip/walkabouts.bi
>>> U   wip/yetmore2.bas
>>>
>>
>> I was going to say that any "fix" to the caterpillar hero speed problem
>> would be largely a rewrite, but you really are doing it!
>>
>> I was concerned that this might clash with my herocount() work, but so
>> far it's fine, and probably the rest of the change won't conflict either.
>> I'll try to commit that soon (turns out there are various unrelated
>> conflicts).
>>
>> https://bitbucket.org/rbv/ohrrpgce/commits/743446cf368d9479a
>> 4d8d216d0e3bbd6f9ae49fc?at=herocount
>>
>> (The main reason I didn't finish was that I didn't like the name
>> active_hero_count...)
>>
>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20170601/8e4d25a6/attachment.htm>


More information about the Ohrrpgce mailing list