[Ohrrpgce] Global NPC definitions

James Paige Bob at hamsterrepublic.com
Sun Aug 23 06:57:38 PDT 2020


I feel like adding a new pool argument to all those commands is the easier
way to go.

It doesn't break any scripts, it just means the scripts need to be updated
to start working with global NPCs. For local NPCs the scripts will still
work exactly the same.

But with pool id encoded into NPC id, doing that math becomes a permanent
burden of NPC scripting. I feel like I would inevitably have to write
wrapper scripts to get/set the dissected the NPC pool anyway.

It would also mean that we would be adding a hard cap on NPC definitions
per map, which we don't currently have. (Though I have no idea what the max
number of NPC definitions is in a single map that someone has actually used
in a real game)

But I am still open to having my mind changed :)

On Sat., Aug. 22, 2020, 10:42 p.m. Ralph Versteegen, <teeemcee at gmail.com>
wrote:

> (I could have sworn we discussed this previously, but I can't find
> anything on the mailinglist or SS)
>
> That would be great!
>
> However I'm concerned about the addition of a pool number to the script
> commands. At least readnpc, alternpc, createnpc, npccopycount, changenpcid
> and npcreference would need to gain a 'pool' argument, and many scripts
> using those or getnpcid would potentially need to be updated if you start
> using global npcs in a game, which is a problem for reusable scripts like
> pixel-walker, dwimmerplatformy and SS101 which would need updating.
>
> The alternative, which is to encode the pool number in the NPC ID (at
> least as seen by scripts, not necessarily internally) would avoid all of
> that work, complexity, and breakage, and I don't see much downside. For
> example pool_id = pool * 1000 + id. The map editor and NPC debug mode would
> need to show the combined ID too.
> (I feel like 1000 is too low a limit but 10000 is too many digits to
> squeeze into tight spaces (npc placement mode). Maybe * 2000, etc?)
>
>
> On Sun, 23 Aug 2020 at 06:21, James Paige <Bob at hamsterrepublic.com> wrote:
>
>> I was thinking of starting work on global NPC definitions soon.
>>
>> I believe I will add an "NPC pool" number to each NPC instance which
>> tells which pool of NPC definitions it uses.
>>
>> The per-map NPC definitions will be pool 0 and the global ones will be
>> pool 1 (with the option of adding more global pools for organization)
>>
>> NPC references and ids will still work the same, but there will be new
>> get/set NPC pool commands for full control.
>>
>> I am cautiously optimistic for an easy implementation
>>
>>
>> _______________________________________________
>> Ohrrpgce mailing list
>> ohrrpgce at lists.motherhamster.org
>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>>
> _______________________________________________
> 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/20200823/ddbb8340/attachment.html>


More information about the Ohrrpgce mailing list