Skip to content
NP Editor Docs
This is not the latest version — view the latest

World logic

World logic is a list of rules that adds gameplay to a map. You write no code. The editor exports the rules as data (scene.json), and the server plugin NPBridge runs them as they are. To see the same rules as nodes, use the Logic graph (same data).

A rule runs in the following order.

OrderPartMeaningExample
1TriggerWhat starts the rule (one)Entering a zone · right-clicking an actor · timer
2FiltersRule limitsOnce globally · once per player · cooldown · permission
3ConditionsContinue only when all are trueTime of day · held item · chance
4ActionsRun in order from the topSound · screen title · show actor · wait

Use the zone trigger wizard to create an “enter Entrance → bell + title” rule, then test it in Play. The screenshots were taken on the road in front of the castle gate in the sample world castle.npworld.

  1. Click Tools > World logic. The World logic tab opens in the bottom dock area. The Zone trigger button is at the top left.

    The World logic tab and the Zone trigger button

  2. Press Ctrl+Shift+T to start drawing a zone (same as the Zone trigger button), then drag on the viewport floor to draw the zone. While you drag, a yellow draft box and its size appear. Esc cancels drawing.

    Drawing a zone by dragging on the viewport floor

  3. When you release the mouse, the Zone trigger window opens. Type Entrance in the Name field, then click Play sound and Show title under Actions. Rows appear below, and the Result field shows a one-line description (”→ When a player enters 「Entrance」 → 종소리 + Title 「Entrance」”). Click Create.

    The Zone trigger window — Name, Actions and Create

    Known issue in 0.10.2: the result line shows the untranslated Korean “종소리” (“bell”), and the action rows are headed in Korean (“1. 소리 재생” for Play sound, “2. 제목 띄우기” for Show title).

  4. The zone actor and the rule are created together (one Ctrl+Z undoes both). The rule list on the left shows the rule row, and the property fields on the right show its one-line description, Trigger, Conditions and Actions. The viewport shows the translucent zone and its name tag.

    The new rule — rule list and property fields

  5. Scroll down the property fields and add conditions and actions with Add condition and Add action. You can also edit each field of the Sound and Screen title cards that the wizard created here.

    The Add condition and Add action buttons

  6. Place the camera on the ground in front of the zone and click Play test on the left. Walk into the zone with W: a bell rings and the screen title “Entrance” appears. Press Esc to stop. A fire entry stays in the log at the bottom left.

    Play view with the screen title Entrance shown after entering the zone

  • After you create a rule, the same rule appears as an event node in the Logic graph tab. When the flow gets long, edit it in the graph; to edit fields as text, use this panel (fields wired to values in the Logic graph can also be edited as text here).
  • Create and test in the wizard creates the rule and starts Play in one step.
  • Play copies the rules when it starts. Rule changes made during Play apply from the next Play.
PartContents
Zone triggerZone trigger wizard (Ctrl+Shift+T)
VariablesVariables, enums and data types window — Variables, functions and data types
+ · Duplicate · Delete · Up · DownNew rule · duplicate the selected rule · delete · order (rules that fire at the same moment run in list order)
Rule rowEnable · trigger icon · name · one-line description · error/warning icon. A trigger that only fires by hand shows “Fire” at the end of the row
ZonesShow zones · blocking boxes in viewport · notes on the selected zone · zone check
SimulationTime of day (Atmosphere preview time · Day · Night) · weather (Clear · Rain · Thunderstorm) · Has all permissions — the values conditions see in Play
Play test · logStart Play · log of fires, skips and actions (time in seconds)
Property fieldsEnabled check · name · one-line description · id · Trigger · Conditions · Actions · Filters
FieldOptions
NameName of the zone (or blocking box) actor
SizeNumber of blocks in X · Z · Y
WhenWhen a player enters · leaves · collides (blocking box) · breaks a block
Who · LoopAnyone · first person only / every time · once only (per player)
ActionsPlay sound · Show title · Show actor · Show blocks · Play animation · Teleport · Open doors · Checkpoint · Chat message
ResultOne-line description and check (“No problems”, etc.)
Fieldscene.jsonMeaning
Once globallyonceOnce on the whole server
Once per playeronce_per_playerOnce per player
CooldowncooldownSeconds the same player waits before it can run again
PermissionpermissionOnly players with this permission node (for example noplatea.vip)
  • If you include the scene when you build an .npbuild, scene.json goes in with it, and once it is installed on the server, NPBridge runs the rules — Export and import.
  • While connected live, rule edits apply on the server immediately — Server connection (live). Logic that contains the new flow nodes of 0.10.2 needs NPBridge 2.0.8 or later — Logic graph.
  • The full list of triggers, conditions and actions is in World logic type list.
ShortcutAction
Ctrl+Shift+TCreate a zone trigger (drag a zone → wizard)
EscCancel zone drawing · close the wizard window
Ctrl+ZUndo rule changes
1~9Run the rules in the “Fire” list during Play — Testing in Play mode