Jump to content

Cyrem
 Share

Recommended Posts

NPL Scripter 2.1
The Rock Raiders NPL Scripter is a tool to assist in building NPL scripts for Rock Raider Levels. It includes a simple interface, much like that of any normal text file editor with syntax highlighting, autocomplete and a NERPS function search.

This NPL Scripter is used for creating NPL scripts for use with custom Rock Raiders levels.

 

Features

  • NERPS Syntax Highlighting.
  • AutoComplete
  • NERPS Function Search
  • Indicators for used Registers and Timers
  • NPL Decompiler
  • Compile Test (Test your NPL will compile without a full export)
  • Templates

Requirements

  • .NET Framework 4.5

Screenshot
?do=download

 

Download

 

Credit to ogun for the NPL Compiler this program uses.

Edited by Slimy Slug
Fixed versioning typo
  • Like 2
Link to comment
Share on other sites

Awesome!

Only one suggestion: make the list of functions in a tree format; I think it'll be easier to view items that way when you don't know its exact name.

Link to comment
Share on other sites

Only one suggestion: make the list of functions in a tree format; I think it'll be easier to view items that way when you don't know its exact name.

Oh wow that's a good idea.

Additionally, I think you should make more categories - for example level statistic getters, random, selection, etc. and for the tutorial selection, divide it into tutorial *block* functions and literally tutorial functions.

Oh, and the symbols are useless - they're just goto symbols that can be defined arbitrarily by the scriptwriter, so you can remove those completely. No names are predefined, so you can use anything there.

I'm probably going to post more about the categorizing, so don't hold your breath! :P

Anyway, nice work in all! I haven't actually tested any scripts made by it yet though, just tried out the stuff.

Oh, and I guess my NPL scripter is now obsolete. Finally :D

EDIT: One more thing, with regards to the wizard: The Oxygen level should make a fail immediate:

GetOxygenLevel < 1 ? SetLevelFail
rather than
GetOxygenLevel < 1 ? AddR1 1

Because the latter would only make the level failed if the oxygen is gone AND the other fail conditions are met.

Link to comment
Share on other sites

Awesome!Only one suggestion: make the list of functions in a tree format; I think it'll be easier to view items that way when you don't know its exact name.

Thanks for the great suggestion. I will put that in.

Oh wow that's a good idea.Additionally, I think you should make more categories - for example level statistic getters, random, selection, etc. and for the tutorial selection, divide it into tutorial *block* functions and literally tutorial functions.Oh, and the symbols are useless - they're just goto symbols that can be defined arbitrarily by the scriptwriter, so you can remove those completely. No names are predefined, so you can use anything there.I'm probably going to post more about the categorizing, so don't hold your breath! :PAnyway, nice work in all! I haven't actually tested any scripts made by it yet though, just tried out the stuff.Oh, and I guess my NPL scripter is now obsolete. Finally :DEDIT: One more thing, with regards to the wizard: The Oxygen level should make a fail immediate:

GetOxygenLevel < 1 ? SetLevelFail
rather than
GetOxygenLevel < 1 ? AddR1 1

Because the latter would only make the level failed if the oxygen is gone AND the other fail conditions are met.

Where I the symbols? I thought I removed them... (you are talking about < > != = aren't you?)

If you can make up a good structure before I do, I will use it. EDIT: Don't worry, I've already begun.

Thanks for the thing on the oxygen level, my mistake. Also fixed a duplication when generating with "no minifigures" condition.

Version 1.02 is out with those two fixes. :)

Link to comment
Share on other sites

Where I the symbols? I thought I removed them... (you are talking about < > != = aren't you?)

I'm talking about the GOTO symbols - the stuff you put in the events tab. The only actual NERPS thing in there is Stop - the others are symbols which can be arbitrarily named - it doesn't have to be cestfini, Next or Events, it can be whatever the scriptwriter wants.

Link to comment
Share on other sites

  • 3 weeks later...

Getting an error whilst compiling this script:



GetCrystalsCurrentlyStored = 1 ? SetLevelCompleted


GetToolStoresBuilt  = 0 ? AddR2 1


GetR2 = 1 ? SetLevelFail


TRUE ? SetTimer1 0 


:CameraControl

GetTimer1 < 77 ? Stop 

SetCameraGotoTutorial 1

GetTimer1 < 77 ? Stop 

SetCameraGotoTutorial 2

GetTimer1 < 77 ? Stop 

SetCameraGotoTutorial 3

I ran it through another compiler to see what the error was, apparently:


Traceback (most recent call last):

  File "npl.py", line 582, in <module>

  File "npl.py", line 458, in assemble

ValueError: Unknown opcode encountered: GetC

Please help.

Nevermind...I forgot to add "CameraControl:" at the end to finalize the function...

Really nice work Cyrem! Just another quick Q, do decimals work?

Link to comment
Share on other sites

  • 1 year later...

Mine keeps crashing if I click on another program, So I have to keep the thing open and can't do anything else at the same time. :/

Link to comment
Share on other sites

  • 2 years later...

I was trying to use the old NPL scripter the other day, but for whatever reason it crashed whenever I tried compiling, it was written in a language I no longer use so I thought... stuff it, I'll re-write it.

 

And so I did.

 

NPL Scripter 2.0 Released!

 

?do=download

 

  • It's faster
  • Text editor is less buggier
  • All new syntax highlighting
  • Live function search (better than that tree)
  • Indicators for registers/timers in use
  • Autocomplete
  • The ability to have templates
  • It now tells you if the compile was a success or not!
  • You can now test to see if it will compile before actually doing it
  • Removed Wizard because it's not good for anything other basic scripts which has now been replaced by the New from Template feature.

Download in first post.

 

Enjoy as usual.

Edited by Slimy Slug
  • Like 8
Link to comment
Share on other sites

Dayum, you're on a roll! I never liked NPL scripting but it looks like this will make it a lot easier, so thank you. :)

It's making my life easier, so I would hope it would for you to.

Link to comment
Share on other sites

Can we view all possible NPL commands in a list or category format? I could use this to work on the NPL commands on the wiki.

When the search is empty, thats the full list.

Link to comment
Share on other sites

  • 3 months later...
RockRaiderWolf

In NplScripter what is the difference between GetPowerstationsBuilt & GetCrystalRefineriesBuilt?

from what I could figure out crystal refinery seems to be the original/old name for the power station so would these functions not do the same thing?

 

also i'm assuming ther must not be a function for setting the ore refinery level like there is with the other buildings?

Link to comment
Share on other sites

  • 2 years later...
Hammerkraft

Heya!

 

Could you explain:

In some levels of my Overhaul I have to find some RRs.

For that I thought, Ill make a TutoMarker in the Map on the Wall to the RR.

If the Player breaks down the wall, he should "Add R2 1" up to "GetR2 3" as example for 3 RRs which are to find.

Is it possible to use the Function:"GetTutorialBlockIsPath" in cause of a wall leaves rubble on the ground, which is in the Map Creator a "Path"?
Im not good with that scripter, but finally need the knowledge to complete the NPLs for my Mod :/

 

As Example:

 

GetTutorialBlockIsPath = 1 ? AddR2 1

 

Is it able for all 3 Markers on the Map?

I dont know how to say :" If TutoBlock 1 is Path = 1 ? AddR2 1" and for TutoBlock 2 the same... Hm, Ill better explain in Pictures:
 

Spoiler

http://prntscr.com/f0rsbu

 

There is a Room with a RockRaider inside.

On the breakable Blocks to the RR is the TutoMarker 2.

 

How can I declare that only this TutoMarker (There are 2 Markers ik, but the have both the same function as set them both as "Marker 2") add a Count to R2?

So if theres another TutoMarker, but with another function, so that it dont add a Count to R2, will add a Count if I would only say "GetTutorialBlockIsPath" without undeclare that that TutoMarker.

 

I hope it is anyway understandable what I mean xD

 

Edit: (Translated by a friend: How may I select this special tutorial marker, that only the tutorial marker 1-3 have a counter, which adds to R2 but tutorial marker 4 won't add onto this counter?)

 

I already seen in the nrM of the Tutorial and GameLevels to learn something about how the Scripter works, but Im even not good enough to write it in that way I need.
Ask if you need more Information :)

 

With friendly and hopefully greetings,

Magiehammer

 

 

Edit:

*facepalm*

I have to use

 

GetTutorialBlockIsPath 1 = 1 ? AddR2 1

GetTutorialBlockIsPath 2 = 1 ? AddR2 1

GetTutorialBlockIsPath 3 = 1 ? AddR2 1

GetR2 = 3 ? SetLevelComplete

 

Right?

 

 

Edited by Hammerkraft
*Facepalm*
Link to comment
Share on other sites

  • 1 year later...

The utility is great! But if you ever feel like making changes to it, here are some ideas:

- In a commented out line, colours still activate. For instance, numbers are always red and labels are always green. In a comment, if you have a number, or a word with a semicolon before or after it, the colours will activate (red and green respectively).

 

- "Open New Window" would be a fantastic button.

 

oh and

 

- if you told it to compile to an existing file and the compile fails, the existing file will be deleted but no new file will be created

 

- when the compile fails it would be nice if it told you where

Link to comment
Share on other sites

Thanks for the suggestions, if I do update this, I'll be sure to consider adding those :)

 

I just notice my source is version 2.1, maybe I never released an update to it :0

Link to comment
Share on other sites

On 12/21/2018 at 6:03 PM, aidenpons said:

In a commented out line, colours still activate. For instance, numbers are always red and labels are always green. In a comment, if you have a number, or a word with a semicolon before or after it, the colours will activate (red and green respectively). 

Can you give me an example line for this?

 

btw, have you made a bunch of sample scripts that could be included in the templates?

Link to comment
Share on other sites

4 minutes ago, Cyrem said:

Can you give me an example line for this?

Sure!

large.Capture.PNG.d77eb730296936b3a8298c0d709840d6.PNG

 

5 minutes ago, Cyrem said:

btw, have you made a bunch of sample scripts that could be included in the templates?

No, because I could never get the Templates section to work :P I can quickly knock up some basic ones if you want them, and perhaps have some more advanced scripts (eg monster spam) as well

Link to comment
Share on other sites

  • Cyrem changed the title to Npl Scripter v2.1 - UPDATE!
26 minutes ago, Cyrem said:
10 minutes ago, Cyrem said:

Hey @aidenpons

 

I did a little update for you: http://prntscr.com/lywyfw

 

Download coming tonight.

Wait, what are those #region thingies you're using? ? Never seen those before anywhere :S

 

I'm looking forward to an early Christmas present, given it's 10:46pm on 24 Dec here right now :P

EDIT: Ding! Huzzah, it works! After telling Windows Smartscreen to go away and never bother me again, that is :P Thanks for the update, Cyrem!

Edited by aidenpons
Link to comment
Share on other sites

3 hours ago, aidenpons said:

what are those #region thingies you're using?

Put simply it allows you to make an area of code collapsible, it will be treated like a comment to the compiler.

 

I haven't touched the tool and compiler since 2014, so I was surprised to be able to open them up an make some changes withing any issues.

 

And yes, I variety of level scripts would be good if you could make some (they're just txt files in the templates folder) as it'll offer more people a starting point for their levels.

Link to comment
Share on other sites

On 12/25/2018 at 2:18 AM, Cyrem said:

Put simply it allows you to make an area of code collapsible, it will be treated like a comment to the compiler.

 

I haven't touched the tool and compiler since 2014, so I was surprised to be able to open them up an make some changes withing any issues.

 

And yes, I variety of level scripts would be good if you could make some (they're just txt files in the templates folder) as it'll offer more people a starting point for their levels.

Oh, okay then.

 

Your newly compiled version fails to run on my XP trashtop, which complains "NPL Scripter.exe is not a valid Win32 application;" I'm guessing you compiled it as a 64-bit application? :P Would be nice if you could recompile it as 32-bit as even my NERPs scripts aren't bigger than 4 GB :P

 

 

As for templates, here are my ideas for templates that can be knocked up very speedily. I can put explanatory comments for the ones where tuto block editing is required (& explanatory comments in general):

- collect X crystals to win (very easy)

- Powering Docks slowly generates ore (with Time Raiders in mind)

- Upon entering a cavern, you get a vast horde of monsters

- Chief sends you messages on condition X then another one on condition Y and comes back for condition Z

- Bring object X back home to win (annoyingly requires the object in question to be in a discovered cavern)

- very basic slug script ( GetSlugsOnLevel < GetMonstersOnLevel ? GenerateSlug )

- paving over slug holes :P  

- essentially replacing the functionality of Emrg.map via NPL scripting to mean walking on a trigger spawns more than one monster

 

I can also work on a better slug script, but such a thing has so far eluded me... will see what I can work on :/ as ironic as it seems, Whack-A-Slug is actually my best slug script to date XD

 

Anything else you'd like?

Link to comment
Share on other sites

3 hours ago, aidenpons said:

Your newly compiled version fails to run on my XP trashtop, which complains "NPL Scripter.exe is not a valid Win32 application;" I'm guessing you compiled it as a 64-bit application?

Thats odd, no I have not targeted x64. Possibly the .NET version since 4.5 is unsupported on XP. Were you previously using 2.0 on XP?

 

In any case, I've re-uploaded it with a drop to .NET 4 which should be supported. This is untested though.

 

Ones from your list that I had in mind were:

Quote

 

- Upon entering a cavern, you get a vast horde of monsters

- Chief sends you messages on condition X then another one on condition Y and comes back for condition Z

- Bring object X back home to win (annoyingly requires the object in question to be in a discovered cavern)

- very basic slug script ( GetSlugsOnLevel < GetMonstersOnLevel ? GenerateSlug )

- essentially replacing the functionality of Emrg.map via NPL scripting to mean walking on a trigger spawns more than one monster

 

 

Link to comment
Share on other sites

On 12/29/2018 at 12:47 AM, Cyrem said:
On 12/29/2018 at 12:47 AM, Cyrem said:

Thats odd, no I have not targeted x64. Possibly the .NET version since 4.5 is unsupported on XP. Were you previously using 2.0 on XP?

If you mean NPL Scripter 2.0, yup, that worked quite happily on my XP trashstop. I wouldn't have a clue about what NET Framework I was using on those machines though  :P

 

Quote
 

In any case, I've re-uploaded it with a drop to .NET 4 which should be supported. This is untested though.



Thank you a lot! My XP trashtops are separated both in space and time (the separation in time arising because of a significant separation in space :P), and I'll let you know if it works. 

 

Quote
 

Ones from your list that I had in mind were:

Aaaaand done! I haven't actually tested these aside from Bring Object Home, but they are all existing scripts that I quickly touched up, so they should work without any problems (well, without any problems in the script.... LRR having its own problems is another matter :P (and believe me, the scripter does have problems... re-ordering lines seems to do silly stuff)). I just tweaked a couple of conditions, swapped out slugs with monsters. and put a lot more comments in.

(& also because they were existing scripts writing them was a lot speedier :P )

 

 

EDIT: oh and another feature request, in the Open dialog box it only accepts .nrm files, not .nrn (which turn up in LRR's levels from time to time); it would be nice if it would open .nrn by default :)

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.