Entry 132
The event's NPCs outside the towns: Meg and the Administrator in the dungeons
Filescrates/piney-world/src/field_npcs.rscrates/piney-world/src/combat/mod.rscrates/piney-world/src/combat/stage.rscrates/piney-world/src/field_world.rscrates/piney-world/src/merchant.rscrates/piney-world/src/rtownpc.rscrates/piney-battle/src/entry.rscrates/piney-game/src/area.rscrates/piney-game/src/area_host.rscrates/piney-game/src/fx.rscrates/piney-game/src/session/tests/shrine.rsdocs/engine/field-game.md
Some story events put town PCs and the Administrator in fields and
dungeons: events 14, 17, 26, 27 and 29, and S109. The port dropped them.
The area handed the entry control only the event's enemies and portals
(types 5 and 6), so every npc_* instruction fell to the host's default.
Event 29's dungeon scene played to an empty room: Meg's "Hello", the
Administrator's leave, BlackRose's "She's gone...". This entry builds
those NPCs and runs them
(field-game.md).
What the game does
- Same classes as the towns.
ccEntryEventMngdispatches types 3 and 4 by bit, 0x08 and 0x10, toccSetRtownPCandccSetMerchant. Both make anentryObjectof type 2, whichentryNpchands tonpcTbl[code].entry.func. That gives the towns' ownccRtownPCandccMerchan, in any area. - Position and heading only. After it makes the object,
ccEntryEventMngwrites the position (+0x40) and heading (+0x60) and nothing else. Outside the towns they come from the marker'sevPos(Kite's position added for 9999/9999). With no such number, the loop leaves its pointer on the 16th slot. - No navigation map needed. A PC made with
param[0]-1 starts in its event mode, so it only moves when an instruction tells it to. - The Administrator's clips.
ccMerchan::ccMerchangives ids 29 and 158 their own clip tables,sysopeAnmTblandquizmanAnmTbl. They hold the same clip names as Mac Anu's and the second town's merchants. The port had them as "not ported" (anm_tblNone), so a town could not have made him either.
What the port does now
- Two halves per NPC.
- The stand-in. The battle's entry control holds a stand-in for each
NPC (
combat::EventNpc, made byevent_npcinstart_entries). It carries the npcTbl row's base (entry::npc_char, moved into piney-battle from the battle probe), and its body is out of the hit list. The command lists,GetNpc(the party'spc_face 3 86,pc_walk_char) and the effects all read the stand-in. - The class. The world keeps the class itself in
field_npcs::FieldNpcs: anRtownPcover the newTownPcs::outside, or aMerchantfrom the newMerchant::at.
- The stand-in. The battle's entry control holds a stand-in for each
NPC (
- Each frame. The classes step after the battle's tasks, over the
field's collision and newlib
rand. Each stand-in is then moved to its class's position, heading and command-list state. The NPCs are drawn with the characters' lights. - Instructions.
FieldWorld::npc_commandandset_transtake the NPC instructions the way the town does;AreaHostgainsnpcandtrans.char_posanswers types 3 and 4, for faces and the event camera. - Effects. The NPCs' starts reach the next frame's effects as
Show::Npc: a PC'seffTransfer, and the Administrator'seffTransfer, act -5 rings and sound 217. Hisnoise2goes to the menus. When act 5 ends,deleteNpcremoves the stand-in.
Checks
event_29_meg_and_the_administrator. It starts at event 29 in area 26's dungeon and walks to point 1: floor 2, room 2, fromSetEventData. There both NPCs stand at their markers. Every instruction of block 15 is carried out and none is unported: the puts, turns and faces,trans 4 29 false,npc_act 29 4andnpc_act 86 4. The block plays through and the party leaves.- The walker. The walk needed two fixes. Floor 1's room 2 is a
two-level ring, where Kite enters in a trench under a ledge.
walk_to, the shrine walker made general, now:- looks for a waypoint among the room's cells, by line of sight at the waist;
- after four stopped checks in one room, puts Kite in front of the
leg's door with the event's own
pc_put, and logs it.
event_29_shots(ignored;PINEY_ROOM,PINEY_EVERY). The shots show:- Meg, a silver-haired Heavy Blade, and the Administrator, big, in green, facing each other in the room;
- the Administrator's transfer ring over him, then gone, with its sparks;
- Meg's transfer rings as she fades, frames 790-800.
Left
- Talking to the Administrator in a field is not tried yet. That is
event 17's
add_target 4 29andtalked_to, through the stand-in on the object list. - The test's party is the story start's (Orca), not BlackRose, so her
pc_*instructions find no one. - Events 14, 17, 26, 27 and S109 are not played through.
the second argument ccEntryEventMng passes ccSetRtownPC. The port uses -1, as in the towns. The classes also step outside the entry control's NPC turn, so their effects start a frame later than the game's.