Thanks for the feedback. I really appreciate it.

I'll have to do more "non happy path" testing for prototypes. It sounds like 
you were instancing a prototype that was instancing a prototype, which should 
work of course, but none of my demos actually do that so it must have broken at 
some point. I added it to the bug list. I also see you hit a max vm iterations 
bug. I thought I had fixed that, but I guess not. I'll take another look.

The trees look awesome BTW!

The "where should I put my prototypes?" thing is a real issue. You'll 
definitely have a proper way to hide them at some point, but I'm not sure when 
exactly. Once there's an inventory your prototypes will show up there, so I may 
add some way to toggle them. I was also thinking of a dedicated zone (maybe 
called The Lab or something) for stashing prototypes, away from your main 
level. That's pretty easy technically, but I don't know what the UX should be 
for getting to and from the zone.

For now, I'm just doing it in code. You can add something like this near the 
top of your prototype, under the `name` call:
    
    
    if not isInstance:
      show = false
      quit()
    
    
    Run

This will hide the prototype, then stop the script. If you want to edit it 
while it's hidden you'll need to turn on god mode, which will show the 
prototype again but make it semi-transparent. You can do this through 
`config.json`, or by dropping a block and running `player.god = true`. Once 
there's a REPL toggling god mode will be easier.

If you want to make a public function you can just use a regular exported proc. 
The scripts all import each other automatically, so `proc whatever*(me: Build) 
= ...` should work from anywhere. Commands are just procs, except they make 
params `auto` if no type or default is specified, and they automatically shadow 
all params with a `var` version. I really should support the export marker for 
commands too, but I don't think it works yet. Eventually commands will also 
become part of the public API for the unit, but for now they're just a tweaked 
syntax for procs.

There are currently two ways to prevent players from messing with your level. 
One way is to add `lock = true` to your unit. This is what the tutorial does, 
so you can't mess things up too badly while going through it. The unit will 
work normally, but you won't be able to modify the blocks, delete it, or edit 
the code unless you're in god mode. Another option is to run `player.playing = 
true`. This hides the toolbar and makes it so nothing can be edited. A quick 
and dirty way to allow toggling this would be to drop a block and give it this 
code:
    
    
    let menu = """
    
    # Menu
    
    - [Start/End Game](<nim://player.playing = not player.playing>)
    
    """
    
    say(menu, more = menu)
    
    
    Run

Awesome job with this! I'm really excited to see what you come up with next.

Reply via email to