Difference between revisions of "NPL file"

From RRU Knowledge Base
m
(compiled not encrypted)
Line 1: Line 1:
{{WIP}}
{{WIP}}
One of several [[Level Files]] located in a Mission's level folder, the '''NPL file''' the encrypted version of the [[NRN file]] (more specifically the [[NRM file]]), which controls all the [[Programming Mission Objectives|mission objectives]] for a level.  The NPL file is encrypted in Hexadecimal Computer Language and can only be read using a [[Hex-Editing Program]].  The game processes a level's mission objectives from this file, rather than the NRN file, and must be edited in order to make changes to the level.   
One of several [[Level Files]] located in a Mission's level folder, the '''NPL file''' is the compiled version of the [[NRN file]] (more specifically the [[NRM file]]), which controls all the [[Programming Mission Objectives|mission objectives]] for a level.  The NPL file is not easily human-readable, and can only be read using a [[Hex-Editing Program]].  The game processes a level's mission objectives from this file, rather than the NRN file, and must be edited in order to make changes to the level.   


==Description of Script Format==
==Description of Script Format==


All script from the NRN file is encrytped into four pairs of characters for each scripted number, parameter/function, and symbol.  Since the computer language is Hexidecimal, the characters range from 00 to FF.
All script from the NRN file is compiled into four bytes (two little-endian 16-bit words) for each scripted number, parameter/function, and symbol.


So counting up from 00 00 to FF FF:
Numbers end in <code>00 00</code>, [[Symbols]] end in <code>01 00</code>, and [[Parameters]] end in <code>02 00</code>.  Certain [[Special Parameters]] also end in <code>04 00</code> and <code>08 00</code>.  The first 16-bit word in each pair indicates the number, or the number that a symbol or parameter has been given.  For example, the number 4 is <code>04 00 00 00</code>.  Parameter #13, which is <code>GetCrystalsCurrentlyStored</code>, is <code>0D 00 02 00</code>.  Symbol #5, which is the ">" symbol, is <code>05 00 01 00</code>.   
 
00 00 - 01 00 - 02 00 - 03 00 - 04 00 - 05 00 - 06 00 - 07 00 - 08 00 - 09 00 - 0A 00 - 0B 00 - 0C 00 - 0D 00 - 0E 00 - 0F 00 - 10 00 - 11 00 ... FE 00 - FF 00 - 00 01 - 01 01 - 02 01 ... FF FF
 
Numbers end in <code>00 00</code>, [[Symbols]] end in <code>01 00</code>, and [[Parameters]] end in <code>02 00</code>.  Certain [[Special Parameters]] also end in <code>04 00</code> and <code>08 00</code>.  The first two pairs of characters for each encrypted hex-string indicate the number, or the number that a symbol or parameter has been given.  For example, the number 4 is <code>04 00 00 00</code>.  Parameter #13, which is <code>GetCrystalsCurrentlyStored</code>, is <code>0D 00 02 00</code>.  Symbol #5, which is the ">" symbol, is <code>05 00 01 00</code>.   


Putting them altogether <code>GetCrystalsCurrentlyStored > 4</code> becomes <code>0D 00 02 00 05 00 01 00 04 00 00 00</code>.
Putting them altogether <code>GetCrystalsCurrentlyStored > 4</code> becomes <code>0D 00 02 00 05 00 01 00 04 00 00 00</code>.


This encrypted code can be rather confusing at first, but once you figure out the patterns, it's as easy as searching for a string and changing it.
This compiled code can be rather confusing at first, but once you figure out the patterns, it's as easy as searching for a string and changing it.


==Also See==
==Also See==
Line 20: Line 16:
*[[Programming Mission Objectives]]
*[[Programming Mission Objectives]]
*[[Scripting Tutorials]]
*[[Scripting Tutorials]]
*[https://github.com/jgrip/legorr Ogun's NPL compiler/decompiler]


[[Category:File formats in LEGO Rock Raiders]]
[[Category:File formats in LEGO Rock Raiders]]
[[Category:NERPs]]
[[Category:NERPs]]

Revision as of 12:07, 8 December 2018

This article is an unfinished work in progress or contains transferred information that needs to be rewritten or reformatted to fit our standards. Please excuse the mess and do not mark for deletion.

One of several Level Files located in a Mission's level folder, the NPL file is the compiled version of the NRN file (more specifically the NRM file), which controls all the mission objectives for a level. The NPL file is not easily human-readable, and can only be read using a Hex-Editing Program. The game processes a level's mission objectives from this file, rather than the NRN file, and must be edited in order to make changes to the level.

Description of Script Format

All script from the NRN file is compiled into four bytes (two little-endian 16-bit words) for each scripted number, parameter/function, and symbol.

Numbers end in 00 00, Symbols end in 01 00, and Parameters end in 02 00. Certain Special Parameters also end in 04 00 and 08 00. The first 16-bit word in each pair indicates the number, or the number that a symbol or parameter has been given. For example, the number 4 is 04 00 00 00. Parameter #13, which is GetCrystalsCurrentlyStored, is 0D 00 02 00. Symbol #5, which is the ">" symbol, is 05 00 01 00.

Putting them altogether GetCrystalsCurrentlyStored > 4 becomes 0D 00 02 00 05 00 01 00 04 00 00 00.

This compiled code can be rather confusing at first, but once you figure out the patterns, it's as easy as searching for a string and changing it.

Also See