How can I trick the Npc limit?

From OHRRPGCE-Wiki

Jump to: navigation, search

Contents

[edit] Unique NPCs

This article (or part thereof) is obsolete. It may have made sense in the past, but it does not make sense now. It is kept here only for historic curiosity and/or posterity.

This article was written when the maximum allowable NPC definitions per map was 36. Starting with the xocolatl release, the limit is increased to 100. However, these instructions may still be relevant to you if you have need for more than 100 different NPC types on a single map.

[edit] Copies

You can have 300 NPC instances on each map. This means that you can have multiple copies of each of your 36 unique NPCs, but no more than 300 total. Never waste two NPC slots on identical NPCs, because you can simply make one NPC and put more than one copy of it on the map.

[edit] Alter NPC

Using the Alter NPC plotscripting command, you can change all the attributes of an NPC. When you do this, every copy of that NPC on the map changes. You can create the illusion of far more than 36 unique NPCs by using the alter NPC command to change NPCs when you move to different parts of the map.

For example, say you want someone to arrive in town just after you (and you don't have any more free NPCs):

  • make a copy of an npc that is off-screen (a boy on the playground at the top of the map for example) with create npc
  • alter the copy (the boy NPC will also be altered but that's not important: you can't see it!) so that it has the appearance of the newcomer. Et voilĂ !

You have managed to do what you wanted with 36 NPCs whereas you needed 37! Don't forget to destroy the npc after you have altered it back, so that it looks like the boy it was before.

[edit] The (X,Y) Map Reference Trick

NPCs can also call a script whose effects are determined by the X or Y location on the map. This can be done with if/then statements and the herox, heroy, npcx and npcy plotscripting commands. For example, something like

    if (npcx (#whoever) == #desiredXvalue)
    then (#whatever)
    if (npcx (#whoever) == #nextXvalue)
    then (#scenario2)

would allow you to have the same NPC in twenty different places react in twenty different ways. Of course, this is not meant for mobile NPCs, but it can be used for treasure chests or doors, etc. Also, using tags allows the NPC to be useless in one location but remain operant somewhere else. Especially useful for invisible step-on NPCs that trigger plotscripted events: one NPC can be dozens of events, conserving NPCs for other fun stuff.

[edit] See Also

Personal tools