This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
nitrogenfingers's profile picture

[1.4.5] NPaintPro

Started by nitrogenfingers, 14 October 2012 - 09:36 AM
nitrogenfingers #1
Posted 14 October 2012 - 11:36 AM
With the public beta of 1.4.5, I'm looking at making some Atari 2600 style games- to do that I needed a sprite painting tool. A bit of rapid prototyping and some totally unguided brainstorming eventually lead to the bug-riddled, feature-bloated amalgamation that is:

NPaintPro




Features
- 16 colour pictures with a range of painting tools
- Mouse support- draw on a blank, scrollable canvas that resizes itself to fit almost any screen or monitor
- Custom interface- use keyboard shortcuts for speed, or drop-down menus for convenience
- Custom display modes- draw on a blank canvas or grid paper, with alpha channel support
- Create moving pictures in animation mode, with frame manipulation tools and playback options
- Selection tools to cut/copy/paste parts of your image from the clipboard
- Comprehensive (if ugly) help screens with lists of keyboard shortcuts
- Text edit mode- add characters and paint them. Add flair to your text files, annotations to your diagrams or features to your sprites
- 3D printing with the companion program for use with wireless mining turtles
- The packaged GameUtils API allows fuss-free conversion of your assets into full-fledged game entities

Planned features:
- Ditching file extensions
- Bug Fixing

How to use:

npaintpro [-a, -t] filename

Standard paint files have the extension .nfp, animation files .nfa, and text files .nft. NPaintPro supports the standard hex colour encoding used by the pre-installed "Paint" along with other paint programs currently on the forums (Paint 2.0, I believe CCPaint1.1 and possibly others), providing they have the ".nfp" file extension. There are plans to remove this necessity very soon, but it's likely the .nfa extension will remain. Note that .nft encodes entirely differently and does NOT have any compatability with existing picture formats. It is however compatible with any text document you feel like painting.

-a for animation support and converting .nfp files (i.e. renaming them). At present there is no animation support for other programs- if you have an animation format you want widely supported let myself or Cruor know and they will be included in a file converter.

-t is for text support. There is no way to convert nfp or nfa files to nft at present, and nft files do not support animation either (either of these things may change in the future). If you have a text format you want supported, let myself or Cruor know so they may be included in a file converter.

3D printing has recently been added! Fire up a turtle with the 3D print program, load it up with items and you can create prints of your paint files.
The GameUtils API has been developed for turning your NPaintPro pictures and animations into game assets! Download the API from here: http://www.computerc...with-npaintpro/

Want to use it in your own creations?
A lot of people have asked for permission to use NPaintPro in their operating systems, servers and on other projects, to the point where clarification on the policy of usage has become necessary. I provide permission for everyone to use and modify NPaintPro to suit your purposes, given the following conditions:
- The comment near the top declaring the original name of the program and the author is left near the top of the code, though I'm happy for it to be appended (My Awesome Movie Player, based on NPaintPro by NitrogenFingers for example)

Also, I'd really appreciate you send a link to any videos or posts made in the programs section so I can check out what you've come up with in NPaintPro. I would consider it a great favour if you were to post it as a comment on this thread, so all the awesome things this program has done can be collated. But that's a courtesy, not a condition.

Questions/Comments? Post here! All feedback, from glowing with praise to outright hate is welcome!
Cruor #2
Posted 14 October 2012 - 11:42 AM
Nice work nitrogen!
Klausar #3
Posted 14 October 2012 - 12:18 PM
How do I set a background? You are talking to fast in the video :)/>/>
nitrogenfingers #4
Posted 14 October 2012 - 12:25 PM
You can press "H" for help in the app (although admittedly the help is pretty worthless)- select a colour and press Q or W to change the alpha channel to the colour on your the left or right of your pallette respectively
Klausar #5
Posted 14 October 2012 - 12:29 PM
Figured it out, thank you. Also I drew McPixel, I have bad paint skills though :)/>/>
Spoiler
Sammich Lord #6
Posted 14 October 2012 - 05:27 PM
Just wait till somebody makes a whole studio to make games!(Also my 100th post!)
brett122798 #7
Posted 14 October 2012 - 05:57 PM
Pretty awesome, I like the save file format too.
nitrogenfingers #8
Posted 16 October 2012 - 07:39 AM
Posted a fairly large update to this (PhD study be damned!)- the application has support for a selectable rectangle tool, cut/copy/paste operations with that rectangle, an exhaustive help sheet with lists of keyboard short-cuts and explanations for all pertinent functions, new painting tools and more! Just when NPaintPro couldn't be any more feature-bloated I've found a way to force a few more down, and it is now approaching a tool that can reasonably used to make VG sprites and animations.

Having said that I've yet to do any thorough testing and it's likely there are bugs, especially in the animation editor so be sure to save all progress carefully. If you find a bug that impedes your work (or you want me to fix) let me know and I'll do what I can.

Enjoy!
CastleMan2000 #9
Posted 16 October 2012 - 03:29 PM
Woah, how do colors? (Translation: Wow, how did you make the colors? Does CC have color support now?)
Lyqyd #10
Posted 16 October 2012 - 03:54 PM
Check out the 1.45 beta in that shiny newly-public section of the forums called Beta Testing or similar. New update includes colored text/backgrounds and mouse events on certain computers.
CastleMan2000 #11
Posted 16 October 2012 - 04:26 PM
Awesome. I will check it out. Thanks.
Exerro #12
Posted 17 October 2012 - 04:36 PM
Well this kinda made sketch-it useless…great work btw, its a really fun program
BigSHinyToys #13
Posted 17 October 2012 - 05:46 PM
Is anyone else having trouble with the link ?
faubiguy #14
Posted 18 October 2012 - 05:59 AM
Is anyone else having trouble with the link ?

Yeah, the download doesn't seem to be working.
nitrogenfingers #15
Posted 19 October 2012 - 12:57 AM
Sorry for any issues with the media fire link, I've had persistent problems with them, so I've included a pastebin link instead. It's in the description, or you can get it here: http://pastebin.com/Y77q7RnS
With the code as… "visible" as it is in pastebin please bear in mind this is very much a WIP and will be cleaned up with a later release.
BigSHinyToys #16
Posted 19 October 2012 - 05:57 AM
1000 lines exactly was that by accident or on purpose lolXD

This is a very cool program combined with a public picture draw /image manipulation api this has some huge potential. Great work NF +1
nitrogenfingers #17
Posted 19 October 2012 - 07:46 AM
Another big-ish update, this one brings the code up to PR4 of the beta to reflect updates in mouse support, fixes to the move tool, record tool and select tool, added the flood tool and done some general code neatening to get it legible. Updated code available from the description, or you can get it here: http://pastebin.com/ph1R7bnF, or here: http://www.mediafire.com/?iz6ks6zc8aadec3

Barring any changes in the images API this program is probably pretty near finished. I've not had any problems with it recently but please report bugs in usage, I'll be sure to fix them. Any other suggestions for tools or features are more than welcome as well, I feel a bit sad with it being finished as I want to keep working on it.

Because it's now a rather large program and more than a little confusing I'll be making a tutorial on it's use, and how that applies to game development soon (after the release of the latest version of CC). Hope someone finds it useful!
BigSHinyToys #18
Posted 19 October 2012 - 09:11 AM
making the save / exit menu operable with the mouse might be cool example.

NOT a full program just a demo
Spoiler

--[[
	    crapy paint program
	    by BigSHiny Toys
]]--
local screenX,screenY = term.getSize()
local picY = {}
local picked = 1
-- generate color -- col[1] = while col[2] = orange ect
local col = {}
local last = 1
for i = 1,16 do
    col[i] = last
    last = last*2
end
-- end color generation
for y = 1,screenY-1 do
    picY[y] = {}
    for x = 1,screenX-1 do
	    picY[y][x] = 1
    end
end
local function drawPic()
    for y = 1,#picY do
	    for x = 1,#picY[y] do
		    term.setCursorPos(x,y)
		    term.setBackgroundColor(col[picY[y][x]])
		    term.write(" ")
	    end
    end
end
local function drawCol()
    for i = 1,17 do
	    term.setCursorPos(screenX,i)
	    term.setBackgroundColor(col[i] or col[picked])
	    term.write(" ")
    end
end
local function menuBox(list,Bcol,Tcol)
    local hight,width = #list+1,0
    for i = 1,#list do
	    if #list[i] > width then
		    width = #list[i]
	    end
    end
    local offX,offY = math.floor((screenX/2)-(width/2)),math.floor((screenY/2)-(hight/2))
    while true do
	    term.setBackgroundColor(col[Bcol])
	    term.setTextColor(col[Tcol])
	    term.setCursorPos(offX,offY)
	    term.write(string.rep(" ",width))
	    for i = 1,#list do
		    term.setCursorPos(offX,offY+i)
		    term.write(string.rep(" ",width))
		    term.setCursorPos(offX,offY+i)
		    term.write(list[i])
	    end
	    local event,arg1,arg2,arg3,arg4 = os.pullEvent()
	    if event == "mouse_click" then
		    event = "click"
		    arg1 = arg2
		    arg2 = arg3
		    arg3 = arg1
	    end
	    if event == "click" then
		    if arg1 > offX and arg1 < offX + width and arg2 > offY and arg2 < offY + hight then
			    return arg2 - offY , list[arg2 - offY]
		    elseif arg1 > offX and arg1 < offX + width and arg2 == offY then
			    while true do
				    local event,arg1,arg2,arg3 = os.pullEvent()
					    if event == "mouse_click" then
						    event = "click"
						    arg1 = arg2
						    arg2 = arg3
						    arg3 = arg1
					    end
				    if event == "click" then
					    if arg1 > 0 and arg1 < screenX - width and arg2 > 0 and arg2 < screenY - hight then
						    offX,offY = arg1,arg2
						    drawPic()
						    drawCol()
						    break
					    end
				    end
			    end
		    end
	    end
    end
end
local function quickDraw(pixX,pixY,pixC)
    term.setCursorPos(pixX,pixY)
    term.setBackgroundColor(col[pixC])
    term.write(" ")
end
local function clearScreen()
    term.clear()
    term.setBackgroundColor(col[16])
    for i = 1,screenY do
	    term.setCursorPos(1,i)
	    term.write(string.rep(" ",screenX))
    end
    term.setCursorPos(1,1)
end
local function menuInterface()
    local n,word = menuBox({"new","open","save","help","about","exit"},16,1)
    term.setCursorPos(1,screenY)
    term.setBackgroundColor(col[16])
    term.setTextColor(col[1])
    write(tostring(n).." "..tostring(word))
    drawPic()
    drawCol()
end
clearScreen()
drawPic()
drawCol()
term.setBackgroundColor(col[16])
term.setTextColor(col[1])
term.setCursorPos(0,screenY)
term.write("[MENU]")
while true do
    local event = {os.pullEvent()}
    if event[1] == "mouse_click" then
	    event[1] = "click"
	    event[2] = event[3]
	    event[3] = event[4]
	    event[4] = event[2]
    end
    if event[1] == "click" then
	    if event[2] == screenX then
		    if event[3] > 0 and event[3] < 17 then
			    picked = event[3]
			    drawCol()
		    end
	    elseif event[2] < screenX and event[3] < screenY then
		    picY[event[3]][event[2]] = picked
		    quickDraw(event[2],event[3],picked)
	    elseif event[3] == screenY and event[2] <= 6 then
		    menuInterface()
	    end
    elseif event[1] == "key" then
	    if event[2] == 28 then -- enter
		    break
	    elseif event[2] == 29 then -- Ctrl
		    menuInterface()
	    end
    elseif event[1] == "char" then
	    if event[2] == "r" then
		    drawPic()
		    drawCol()
	    end
    end
end
clearScreen()
clicking the top bar of the menu then clicking another location will move the menu to that location on the screen. options are selectable but don't do anything.
nitrogenfingers #19
Posted 19 October 2012 - 09:23 AM
That's something I actually did want to work on! Instead of having 2 dozen shortcuts for every tool, clicking on the footer should bring up a menu, where options can be selected from a tree menu- including saving and loading!

I'll get on that ASAP! Thanks BigSHinyToys!
nitrogenfingers #20
Posted 19 October 2012 - 04:29 PM
Drop-down menus have been added to NPaintPro:


There's probably mode bug-testing to do but it's getting very close to finished now
faubiguy #21
Posted 20 October 2012 - 01:17 AM
I found 2 bugs.

Attempting to floodfill an area when the area is already the color you are trying to fill it with causes stack overflow on line 744.
Also, attempting to use clear tool (x) when there is no selection causes attempt to index nil on line 642.
nitrogenfingers #22
Posted 20 October 2012 - 02:17 AM
I found 2 bugs.

Attempting to floodfill an area when the area is already the color you are trying to fill it with causes stack overflow on line 744.
Also, attempting to use clear tool (x) when there is no selection causes attempt to index nil on line 642.
Thanks for the report faubiguy!

The first bug has been fixed. Please report any other issues with the flood fill tool, as it is a little temperamental.
The second bug is a little confusing. X is now the "cut" tool, and only works with a visible selection rectangle, Z now clears the image, or the clipboard depending on whether or not the selection rectangle is visible. C, V and X are now disabled when no selection tool is visible, and can also be accessed by right-clicking when in selection mode. The help file has been updated to reflect this.

A few more bugs were cleaned up as well as one or two consistency changes (e.g. leftCtrl opens up a drop-down menu now). I believe the program can now almost be operated entirely with the mouse, which is really nice.

Edit: Another update, Flood Fill now uses an iterative algorithm rather than a recursive one, so now the algorithm won't crash when attempting to flood fill more than 50 or so pixels. Few more tiny fixes here and there. Program now seems pretty stable.
faubiguy #23
Posted 20 October 2012 - 07:33 PM
2 more bugs:

Attempting to open help for file mode causes attempt to concatenate string and nil on line 601.
Attempt to floodfill the background when there is no pixel (possibly any transparent area) causes attempt to index nil on line 1119.
nitrogenfingers #24
Posted 21 October 2012 - 04:52 AM
2 more bugs:

Attempting to open help for file mode causes attempt to concatenate string and nil on line 601.
Attempt to floodfill the background when there is no pixel (possibly any transparent area) causes attempt to index nil on line 1119.

Another update, both bugs reported now fixed. A few more changes to menu look and feel and interface in general.
BigSHinyToys #25
Posted 21 October 2012 - 06:41 AM
WOW just WOW this is the most professional program I have seen in CC ever I am totally impressed. You should do some vids to show this off.
chiloxsan #26
Posted 21 October 2012 - 07:07 AM
WOW just WOW this is the most professional program I have seen in CC ever I am totally impressed. You should do some vids to show this off.

He has: http://www.youtube.com/watch?v=U2UxDlo_N8U
faubiguy #27
Posted 21 October 2012 - 07:32 AM
I've found one problem with selections. If the picture view is offset, when creating a selection, it doesn't get offset.
nitrogenfingers #28
Posted 21 October 2012 - 07:57 AM
I've found one problem with selections. If the picture view is offset, when creating a selection, it doesn't get offset.

Well caught! In fact all mouse-triggered selection tools were incompatible with scrolling. This has been resolved.


WOW just WOW this is the most professional program I have seen in CC ever I am totally impressed. You should do some vids to show this off.

The tool itself is, well it's just a tool, barely merits a video. I'll likely be using this in tutorials on game design in the future however, once 1.45 is released. Glad you like it!
faubiguy #29
Posted 21 October 2012 - 08:00 AM
Yeah, I've been using this quite a bit while experimenting with graphics for my tetris game, so I've ended up running into some bugs, which have fortunately been fixed
nitrogenfingers #30
Posted 21 October 2012 - 09:02 AM
Glad to hear you've found it useful! I'll add your name to a tester credits in the next release of the program.

NF
dcleondc #31
Posted 24 October 2012 - 02:59 AM
hey, you should add text boxes, so if people are making short films with it they can add text on the screen. Because im on my server and im making a movie where a man is walking down a road and a anvil falls on him and that idea popped into my head.
Heracles421 #32
Posted 24 October 2012 - 03:45 AM
Hey nitrogen, is there any way you could add a pixel detect function? I wanted to work on a blueprint builder, but I can't because there's no actual way of detecting where the pixels are located
nitrogenfingers #33
Posted 24 October 2012 - 07:01 AM
hey, you should add text boxes, so if people are making short films with it they can add text on the screen. Because im on my server and im making a movie where a man is walking down a road and a anvil falls on him and that idea popped into my head.

I probably won't do this, because it makes the file format 3 times more complicated than I want it to be. I'm not sure creating motion pictures is the best application for NPaintPro (efficiency reasons, there are probably much faster methods), but if you wanted to I'd recommend making the animation without text in it, and then writing an application that loads in the animation and draws the text at the appropriate frame(s). At some point I'll be releasing an API that will make this process easier, and this way will give you significantly more control over how you play the animation.


Hey nitrogen, is there any way you could add a pixel detect function? I wanted to work on a blueprint builder, but I can't because there's no actual way of detecting where the pixels are located

Uncertain what you mean by this. Do you mean detecting where a pixel is in any given image that has been saved before hand? If so the tool wouldn't belong (or be very useful at all) in NPaintPro.
The files are saved in such a way that the top, bottom, left and right most extreme pixels define the limits for the image, so you can use these restrictions when reading each line to find individual pixels by simply looping through each pair in the list of colours or strings that you make. NPaintPro performs equivalent operations when performing renders and many of its other operations rely on those limits so you can read through the code for examples.
nitrogenfingers #34
Posted 25 October 2012 - 03:39 AM
Hey nitrogen, is there any way you could add a pixel detect function? I wanted to work on a blueprint builder, but I can't because there's no actual way of detecting where the pixels are located


I really liked the idea of using NPaintPro to create blueprints for turtles, and although there's not much the paint tool can do itself to make turtles understand the image format, I can make creating blueprints easier and cooler with a new display mode:



Though it was sort of designed for building housing blueprints, the gridlines in this mode make lining up distanced images, figuring out dimensions and drawing straighter in general much easier, so it has many uses. However the ability to change the alpha channel is turned off (to make the gridlines easily visible) so for pictures that require both I'd recommend drawing the outline/shape in blueprint mode and then colouring in alpha mode.

One or two bug fixes in this version too, and tester credits to faubiguy
~Dragon #35
Posted 25 October 2012 - 03:57 AM
This is an Awesome program nitro! can you select an area then color that selection? or is that a feature that's upcoming? Cheers, ~Dragon
Heracles421 #36
Posted 25 October 2012 - 04:57 AM
Spoiler
Hey nitrogen, is there any way you could add a pixel detect function? I wanted to work on a blueprint builder, but I can't because there's no actual way of detecting where the pixels are located


I really liked the idea of using NPaintPro to create blueprints for turtles, and although there's not much the paint tool can do itself to make turtles understand the image format, I can make creating blueprints easier and cooler with a new display mode:



Though it was sort of designed for building housing blueprints, the gridlines in this mode make lining up distanced images, figuring out dimensions and drawing straighter in general much easier, so it has many uses. However the ability to change the alpha channel is turned off (to make the gridlines easily visible) so for pictures that require both I'd recommend drawing the outline/shape in blueprint mode and then colouring in alpha mode.

One or two bug fixes in this version too, and tester credits to faubiguy

I like that new mode. Maybe you could add a way of giving out where a pixel is placed so we can store the x and y coords? Something like paintutils draw function, where we can draw in a certain coord and store the location at the same time. That way I could make the builder
nitrogenfingers #37
Posted 25 October 2012 - 05:24 AM
This is an Awesome program nitro! can you select an area then color that selection? or is that a feature that's upcoming? Cheers, ~Dragon

At the moment there's the "flood fill" tool, which works the same as the bucket tool does typically in your standard paint application. Because there's no limit to the size of the canvas (unlike paint), it means you can't just fill empty space- you have to draw something first and flood fill that. At the moment there's no way to fill a selection with a given colour but that might appear in the future…


I like that new mode. Maybe you could add a way of giving out where a pixel is placed so we can store the x and y coords? Something like paintutils draw function, where we can draw in a certain coord and store the location at the same time. That way I could make the builder

I'm still not quite sure what you mean Heracles. Again NPaintPro creates image files- you ask to draw in a certain coord and store the location at the same time: that's what the image file is. Save it and then open it in an external program, and extract locational information from there. The tool has to output to a file (it can't simply feed into another program), so you'll have to read that file to know where the pixels are.
Heracles421 #38
Posted 25 October 2012 - 12:34 PM
Spoiler
This is an Awesome program nitro! can you select an area then color that selection? or is that a feature that's upcoming? Cheers, ~Dragon

At the moment there's the "flood fill" tool, which works the same as the bucket tool does typically in your standard paint application. Because there's no limit to the size of the canvas (unlike paint), it means you can't just fill empty space- you have to draw something first and flood fill that. At the moment there's no way to fill a selection with a given colour but that might appear in the future…


I like that new mode. Maybe you could add a way of giving out where a pixel is placed so we can store the x and y coords? Something like paintutils draw function, where we can draw in a certain coord and store the location at the same time. That way I could make the builder

I'm still not quite sure what you mean Heracles. Again NPaintPro creates image files- you ask to draw in a certain coord and store the location at the same time: that's what the image file is. Save it and then open it in an external program, and extract locational information from there. The tool has to output to a file (it can't simply feed into another program), so you'll have to read that file to know where the pixels are.

Ok, from the begining: I want to make a blueprint builder, and I want to know if there's a way to know the exact x and y coordinate when people draw something without an external program. That way I could tell the turtle: Go to x and y, place a block there. I am not sure if you can understand this, but I'm trying my best to explain it.
BigSHinyToys #39
Posted 25 October 2012 - 06:22 PM
Ok, from the begining: I want to make a blueprint builder, and I want to know if there's a way to know the exact x and y coordinate when people draw something without an external program. That way I could tell the turtle: Go to x and y, place a block there. I am not sure if you can understand this, but I'm trying my best to explain it.

make your program open the picture file read its continence and use those points as your coordinates.

if there is a 1 on line 2 three places in then use the (3,2)
if there is a 1 on line 6 in position 1 then use (1,6)

All the information you need is stored in the save file you don't need to get any coordinates from npaintpro just interpret its Image file witch is pretty simple btw.

example

Spoiler

making a program that printed out this file using wool would be very simple just a couple of for loops a turtle.forward turtle.place
Heracles421 #40
Posted 25 October 2012 - 08:41 PM
Spoiler
Ok, from the begining: I want to make a blueprint builder, and I want to know if there's a way to know the exact x and y coordinate when people draw something without an external program. That way I could tell the turtle: Go to x and y, place a block there. I am not sure if you can understand this, but I'm trying my best to explain it.

make your program open the picture file read its continence and use those points as your coordinates.

if there is a 1 on line 2 three places in then use the (3,2)
if there is a 1 on line 6 in position 1 then use (1,6)

All the information you need is stored in the save file you don't need to get any coordinates from npaintpro just interpret its Image file witch is pretty simple btw.

example

Spoiler

making a program that printed out this file using wool would be very simple just a couple of for loops a turtle.forward turtle.place

this might work! Thanks for showing me this. The only trouble I have is reading this file from a computer and then writing it as coords for the turtle
nitrogenfingers #41
Posted 26 October 2012 - 12:27 AM
This is the way I'm doing it:

Spoiler

local function loadImage(path)
image = { }
if fs.exists(path) then
  local file = io.open(path, "r" )
  local sLine = file:read()
  local num = 1
  while sLine do
   table.insert(image, num, {})
   for i=1,#sLine do
	image[num][i] = tonumber(string.sub(sLine,i,i), 16)
   end
   num = num+1
   sLine = file:read()
  end
  file:close()
end
return image
end

This will return a table, and any point in the table can be accessed with image[y][x]- this corresponds directly to X-Y coordinates your turtle can use.

Edit: It sounds like you're keen to give this a try Heracles, but would the introduction of a 3D Print function be valuable to NPaintPro?
Heracles421 #42
Posted 26 October 2012 - 12:39 AM
This is the way I'm doing it:

Spoiler

local function loadImage(path)
image = { }
if fs.exists(path) then
  local file = io.open(path, "r" )
  local sLine = file:read()
  local num = 1
  while sLine do
   table.insert(image, num, {})
   for i=1,#sLine do
	image[num][i] = tonumber(string.sub(sLine,i,i), 16)
   end
   num = num+1
   sLine = file:read()
  end
  file:close()
end
return image
end

This will return a table, and any point in the table can be accessed with image[y][x]- this corresponds directly to X-Y coordinates your turtle can use.

Edit: It sounds like you're keen to give this a try Heracles, but would the introduction of a 3D Print function be valuable to NPaintPro?
We don't need 3D printing, I was planning to use multiple files for multiple levels of the building
nitrogenfingers #43
Posted 26 October 2012 - 01:56 AM
This is the way I'm doing it:

Spoiler

local function loadImage(path)
image = { }
if fs.exists(path) then
  local file = io.open(path, "r" )
  local sLine = file:read()
  local num = 1
  while sLine do
   table.insert(image, num, {})
   for i=1,#sLine do
	image[num][i] = tonumber(string.sub(sLine,i,i), 16)
   end
   num = num+1
   sLine = file:read()
  end
  file:close()
end
return image
end

This will return a table, and any point in the table can be accessed with image[y][x]- this corresponds directly to X-Y coordinates your turtle can use.

Edit: It sounds like you're keen to give this a try Heracles, but would the introduction of a 3D Print function be valuable to NPaintPro?
We don't need 3D printing, I was planning to use multiple files for multiple levels of the building

I might have a crack at it anyway…
Heracles421 #44
Posted 26 October 2012 - 02:38 AM
Well, if you want to give it a try, go for it
amtra5 #45
Posted 28 October 2012 - 12:48 AM
Congrats on paint program making CC 1.45 :D/>/>
1v2 #46
Posted 30 October 2012 - 03:44 PM
Very useful program, thanks.
DSlink2010 #47
Posted 06 November 2012 - 03:19 PM
Just wait till somebody makes a whole studio to make games!(Also my 100th post!)
Im gonna make you're sig real!
DSlink2010 #48
Posted 06 November 2012 - 03:27 PM
You never know what people will make!Someone might even make Photoshop in computercraft!
nitrogenfingers #49
Posted 18 November 2012 - 06:58 AM
3D Printing has been added to NPaintPro! Link to the turtle printing program on the main page

http://youtu.be/AuofE9dqiuU

I have spent hours messing around with this, printing off random junk and though it has some severe limitations you can still do some pretty awesome stuff with it. Things to note:
- Turtles have no directionality when printing, so objects like stairs, redstone repeaters, gates and slabs cannot have a specified direction (making them a bit pointless)
- Wall-mounted things like ladders, torches and paintings can't be relied on either, as printing is done in sweeps so the wall you're mounting your ladder to may not exist when your turtle tries to place it.
- It's all buggy. Needs more testing.

I've also added one or two other little features to the program, like a new "layered" mode that displays all layers at once!
Don't use this mode.
BigSHinyToys #50
Posted 18 November 2012 - 08:51 AM
That is awesome great work nitrogenfingers
smiba #51
Posted 18 November 2012 - 09:17 AM
I guess i'm just really stupid.. but how do i printout to the 3D Printer? You have an "Print" button… But i don't

EDIT: Your pastebin text is right.. But the URL isn't x3 - Now downloaded the right one
Espen #52
Posted 18 November 2012 - 09:35 AM
@nitrogenfingers:
Nice work with the 3D printer.
Very nice design and well thought through.
Kudos! :)/>/>
Sammich Lord #53
Posted 18 November 2012 - 09:42 AM
I am going to make a castle with only turtles :)/>/>
BigSHinyToys #54
Posted 18 November 2012 - 10:05 AM
My first castle / badly designed pile of boxes.
Spoiler
This is going to be awesome to mess-around with.
It would be nice is turtle place had orientation support would make everything printable then.
Sammich Lord #55
Posted 18 November 2012 - 11:17 AM
My first castle / badly designed pile of boxes.
Spoiler
This is going to be awesome to mess-around with.
It would be nice is turtle place had orientation support would make everything printable then.
I was planning on something a lot bigger. More like a 1000x1000 block castle. :)/>/>
nitrogenfingers #56
Posted 18 November 2012 - 01:20 PM
I must admit I've had so much fun messing around with this printer that orientation support does feel like the next thing on the checklist. I'll probably have to modify the file format so optional orientation escape characters can be littered through the program, as well as a directional paint display mode. I use stairs a lot in my builds and that redstone door from the video took awhile to design without repeaters or wall-mounted torches!

Anyway thanks for responses so far- love to see your creations so post what you make!
ETHANATOR360 #57
Posted 18 November 2012 - 01:46 PM
sweet im gonna make an 8 bit mario
EDIT:made
the head not enough room for body
Spoiler
ArchAngel075 #58
Posted 18 November 2012 - 03:44 PM
Very welldone! In-fact this program is what i would be needing for my Angel-TV program for bigger than 2x4 screens….

Can you perhaps let me know if its possible to use this program in my own ?



When one closes(finish editing) a image how does the program save it? anything complicated or is it simple like the basic paint program? [read OP]
would the program be usable with mine if :

'shell.run("paint", "Frame" .. CFrame) –where CFrme is user or automaticaly defined frame number, [except after frame number a extra option would be to save as the npa. extention)

–so
CFrame = 1
–and run the shell command above would yield opening Frame 1 in paint
–once paint is closed with ctrl-enter + ctrl-right-enter (save and close file) it returns to my programs mainmenu automatically

would the above be possible if i used instead :

shell.run("NPaintPro" , "Frame" .. CFrame)

?
nitrogenfingers #59
Posted 18 November 2012 - 08:35 PM
sweet im gonna make an 8 bit mario
EDIT:made
the head not enough room for body

You can scroll the canvas with the arrow keys if you run out of space.


Very welldone! In-fact this program is what i would be needing for my Angel-TV program for bigger than 2x4 screens….

Can you perhaps let me know if its possible to use this program in my own ?



When one closes(finish editing) a image how does the program save it? anything complicated or is it simple like the basic paint program? [read OP]
would the program be usable with mine if :

'shell.run("paint", "Frame" .. CFrame) –where CFrme is user or automaticaly defined frame number, [except after frame number a extra option would be to save as the npa. extention)

–so
CFrame = 1
–and run the shell command above would yield opening Frame 1 in paint
–once paint is closed with ctrl-enter + ctrl-right-enter (save and close file) it returns to my programs mainmenu automatically

would the above be possible if i used instead :

shell.run("NPaintPro" , "Frame" .. CFrame)

?

You're of course free to use NPaintPro however you like. If you make something cool, share the link, would love to see what you come up with!

I'm afraid there's no option for specifying the selected frame from the command line- you have to change frames from within the program (with the goto menu option or the <> keys)
smiba #60
Posted 18 November 2012 - 09:34 PM
Can you also make an wireless printing script for this? (Only 1 color.. But still usefull for an minecraft office)
ArchAngel075 #61
Posted 19 November 2012 - 11:00 AM
sweet im gonna make an 8 bit mario
EDIT:made
the head not enough room for body

You can scroll the canvas with the arrow keys if you run out of space.


Very welldone! In-fact this program is what i would be needing for my Angel-TV program for bigger than 2x4 screens….

Can you perhaps let me know if its possible to use this program in my own ?



When one closes(finish editing) a image how does the program save it? anything complicated or is it simple like the basic paint program? [read OP]
would the program be usable with mine if :

'shell.run("paint", "Frame" .. CFrame) –where CFrme is user or automaticaly defined frame number, [except after frame number a extra option would be to save as the npa. extention)

–so
CFrame = 1
–and run the shell command above would yield opening Frame 1 in paint
–once paint is closed with ctrl-enter + ctrl-right-enter (save and close file) it returns to my programs mainmenu automatically

would the above be possible if i used instead :

shell.run("NPaintPro" , "Frame" .. CFrame)

?

You're of course free to use NPaintPro however you like. If you make something cool, share the link, would love to see what you come up with!

I'm afraid there's no option for specifying the selected frame from the command line- you have to change frames from within the program (with the goto menu option or the <> keys)

Thanks, Scolling is the one thing that hinders the programs, so its good to have a scroller.

-

Perhaps if i look into your program and see if i cant trick it into exiting into mine afterwards…. else support will be funny but again thanks!
nitrogenfingers #62
Posted 19 November 2012 - 07:45 PM
I fixed the link to the paint program so it stops sending users to the wrong version. For some reason I have real trouble with the editor on these forums… if you're unable to print, redownload.
BigSHinyToys #63
Posted 19 November 2012 - 10:47 PM
I fixed the link to the paint program so it stops sending users to the wrong version. For some reason I have real trouble with the editor on these forums… if you're unable to print, redownload.
The forums editor does some strange things like when typing some times the lines jump to the top. Other times links connect to old links when you type them in the same position. disabling Underline a bold then entering re enables them. spaces at the start of lines are removed causes cod to look bad. space between paragraphs vanish some times. it is a real pain to work with it in general. so it is not just you that is having trouble with it.

I copy pasted the code into paste bin so not following the link was unaffected by that problem.

This is a really awesome program I haven't had much time to mess with it thought but I will be using this in my new CC legit world to make fortifications.
Cranium #64
Posted 20 November 2012 - 05:53 AM
The forums editor does some strange things like when typing some times the lines jump to the top. Other times links connect to old links when you type them in the same position. disabling Underline a bold then entering re enables them. spaces at the start of lines are removed causes cod to look bad. space between paragraphs vanish some times. it is a real pain to work with it in general. so it is not just you that is having trouble with it.

I copy pasted the code into paste bin so not following the link was unaffected by that problem.

This is a really awesome program I haven't had much time to mess with it thought but I will be using this in my new CC legit world to make fortifications.
The issues with the forums kinda go away when you just switch to HTML format only. It's a bit of work, but it does work properly after.
krazyjosh1234 #65
Posted 21 November 2012 - 07:33 AM
For some reason, whenever I try to change layers (number buttons), its errors out, printing this:
npaintpro:1319: attempt to compare __lt on nil and number
nitrogenfingers #66
Posted 21 November 2012 - 01:06 PM
For some reason, whenever I try to change layers (number buttons), its errors out, printing this:
npaintpro:1319: attempt to compare __lt on nil and number
Thanks for the report, will look into this asap.
ArchAngel075 #67
Posted 22 November 2012 - 03:23 AM
Question :

Does the NPaintPro support the same color format as the normal "Paint" program provided with Advanced Computers?
-else can you add support for it? since this will make using my TV and your program easily :(/>/>

Also if you want you can try to add support for my TV program by making a option "If fs.exists("Angel-TV") == true" etc then make it show a button or other to make "Layers" rather appear as seperated Frames?

Second, how does it save multiple layers?
I am also going to make a "compiler" for my program that rather compresses every Frame into a single file, would it be possible to make your layering work together with this idea?
-The layering is amazing since for making movies it helps to be able to switch quickly between frames(mine doesnt have such a function yet)

-end-
nitrogenfingers #68
Posted 22 November 2012 - 04:17 AM
NPaintPro supports the same file format as Paint. If you want to load a file into NPaintPro that is a paint file however you have to specify by adding a file extension, in this case ".nfp" to the end of your paint file. This tells NPaintPro that it's a standard paint file and opens in a single layer.

There are two modes in NPaintPro, depending on your file type. "Paint" mode just works on a single image, and always saves as a single image. "Animation" mode allows you to edit multiple frames. When saving a file in animation mode, it automatically saves all frames in one file.

You're free to make any changes to the program you need to for your TV program.
ArchAngel075 #69
Posted 22 November 2012 - 05:41 AM
NPaintPro supports the same file format as Paint. If you want to load a file into NPaintPro that is a paint file however you have to specify by adding a file extension, in this case ".nfp" to the end of your paint file. This tells NPaintPro that it's a standard paint file and opens in a single layer.

There are two modes in NPaintPro, depending on your file type. "Paint" mode just works on a single image, and always saves as a single image. "Animation" mode allows you to edit multiple frames. When saving a file in animation mode, it automatically saves all frames in one file.

You're free to make any changes to the program you need to for your TV program.

Oh thanks thats perfect then, perhaps i can make use of some bits of code for future projects too, many thanks :(/>/>
will look into it later this weekend when i plan on working on my compiler :(/>/>
Mindmenace #70
Posted 22 November 2012 - 06:45 AM
I'm not certain if it is error on my part, but whenever I seem to print, the turtle just stays in place repeatedly breaking the block under it and replacing it.
Leo Verto #71
Posted 22 November 2012 - 06:48 AM
I'm not certain if it is error on my part, but whenever I seem to print, the turtle just stays in place repeatedly breaking the block under it and replacing it.
You need to fuel the turtle first.
ArchAngel075 #72
Posted 22 November 2012 - 06:50 AM
I'm not certain if it is error on my part, but whenever I seem to print, the turtle just stays in place repeatedly breaking the block under it and replacing it.
You need to fuel the turtle first.

wow there wasnt a fuel check ? perhaps nitro should add it to avoid any further mistakes ?
-just a suggestion :(/>/>
cmurtheepic #73
Posted 22 November 2012 - 08:35 AM
this is just what ever computercraft game maker needs :(/>/>
thanks nitrogen fingers and i am one of your subscribers. keep it up :(/>/>
nitrogenfingers #74
Posted 22 November 2012 - 01:13 PM
I'm not certain if it is error on my part, but whenever I seem to print, the turtle just stays in place repeatedly breaking the block under it and replacing it.
You need to fuel the turtle first.

wow there wasnt a fuel check ? perhaps nitro should add it to avoid any further mistakes ?
-just a suggestion ;)/>/>

Fuel Check! Rats I knew I forgot something! I never use fuel so I didn't notice…

Will patch one in later today.
Expenox #75
Posted 22 November 2012 - 03:14 PM
Amazing, this blows my mind.

Great work, I can't wait to see more! ;)/>/>
Shnupbups #76
Posted 22 November 2012 - 09:20 PM
When on brush mode and you type 1 instead of changing to size 1 it errors with:

npaintpro:1319: attempt to compare __lt on nil and number
CastleMan2000 #77
Posted 24 November 2012 - 09:01 AM
I think I found a bug: When attempting to print without fuel, it will turn around and such, and the indicator will move, and at the end it will say "Print succesful", but that's wrong. I think you should check for fuel level so it will tell you when you need to refuel it.
TheAraulin #78
Posted 24 November 2012 - 09:56 AM
How do you switch colors?
ArchAngel075 #79
Posted 24 November 2012 - 11:57 AM
I think I found a bug: When attempting to print without fuel, it will turn around and such, and the indicator will move, and at the end it will say "Print succesful", but that's wrong. I think you should check for fuel level so it will tell you when you need to refuel it.

Some one else pointed out this, nitro will be adding fuel checks ;)/>/>
Jasonfran #80
Posted 25 November 2012 - 02:29 AM
will it blend, that is the question
It was funny first time. Now it isn't
Cranium #81
Posted 28 November 2012 - 05:59 PM
I LOVE THIS!!! I have been using it to make all sorts of pixel art!

Edit: Slight bug when printing to 3d:
While watching the cursor move on the screen, i noticed that in vertical printing, it will show the background color of the block above it while tracking the turtle.
Edited on 28 November 2012 - 05:03 PM
mrgreaper #82
Posted 05 December 2012 - 11:57 AM
ok i figured out how to make an animation and how to make it print in world 3d using a turtle but how do you display an animation onto a monitor (or even a just one picture?)
nitrogenfingers #83
Posted 05 December 2012 - 03:14 PM
ok i figured out how to make an animation and how to make it print in world 3d using a turtle but how do you display an animation onto a monitor (or even a just one picture?)

I don't think there's an API for animation yet, and I've been distracted with other work.
You can use the paintutlis library however for drawing images on monitors (using the loadImage and drawImage functions).

When an animation API is released or I release my own, details will be posted here.
ArchAngel075 #84
Posted 05 December 2012 - 06:51 PM
ok i figured out how to make an animation and how to make it print in world 3d using a turtle but how do you display an animation onto a monitor (or even a just one picture?)

I don't think there's an API for animation yet, and I've been distracted with other work.
You can use the paintutlis library however for drawing images on monitors (using the loadImage and drawImage functions).

When an animation API is released or I release my own, details will be posted here.


Hmm nitro, how do you store the animations? Are they all pasted one by one in a single file? Cause I can then definitely add de-compiling support for your animation files to my program for outputting animation to a monitor :)/> but if its a different I'm still happy to try adding it(since I've put off support for too long)

-end-
nitrogenfingers #85
Posted 05 December 2012 - 06:54 PM
You can open an NFA file in edit, it's plain text. The format for each image is identical to the NFP/standard picture format that Paint uses, but each frame is separated by a single ~ character.
So I usually have an additional table, the frames table, which in turns stores every image in the animation. When parsing, it's identical to parsing a paint file, but whenever you hit a ~, you just create a new frame and start on the next line.
RadogoR #86
Posted 05 December 2012 - 10:44 PM
Awesome idea. Just awesome! I actually got here accidentally, surfing the news about ComputerCraft, but then I saw this 3d printing function… Oh my, I'm playing with it for an hour already )) It's actually a very handy thing in some cases.

I have just one question - how does the turtle "decide" which direction it should start printing? I tried it a couple of times with the same picture and it seems to me that it starts in a totally random direction. Or did I miss something?
ArchAngel075 #87
Posted 05 December 2012 - 11:00 PM
You can open an NFA file in edit, it's plain text. The format for each image is identical to the NFP/standard picture format that Paint uses, but each frame is separated by a single ~ character.
So I usually have an additional table, the frames table, which in turns stores every image in the animation. When parsing, it's identical to parsing a paint file, but whenever you hit a ~, you just create a new frame and start on the next line.

Thats the exact same trick i use with my .amov (compiled frame files(aka compiled .afr)) so I can just dupe my decompiler and adjust the frame break to use '~' and then make it auto output into a project folder, plus this makes me NEED to add additional file paths(since right now you can only use a project folder and not a folder within the project folder))

Thanks for the input!

In-fact I might look at your decompiler since mine derps at nil lines (i think i fixed this now though)

again thanks :)/>
nitrogenfingers #88
Posted 06 December 2012 - 12:52 AM
Awesome idea. Just awesome! I actually got here accidentally, surfing the news about ComputerCraft, but then I saw this 3d printing function… Oh my, I'm playing with it for an hour already )) It's actually a very handy thing in some cases.

I have just one question - how does the turtle "decide" which direction it should start printing? I tried it a couple of times with the same picture and it seems to me that it starts in a totally random direction. Or did I miss something?

Thanks :)/>

The printer should start in the direction it's facing. It will always start in the bottom left corner of the frontmost frame- so for a top/bottom layering it will start at the bottom left corner at the bottom frame and work up. For a forward layering I think it will move forward to the back frame (the highest frame) and print from the bottom left corner right/up.
It should do at least. If it doesn't, let me know.
ArchAngel075 #89
Posted 06 December 2012 - 01:55 AM
Looking at how I decompile the animation files, i noticed there will be a problem if it hits nil, since i use a '&amp;&amp;' to signal end of file where yours does not…

Any suggestion to detect the end of your files?

-edit-

I will just make it check if a '&amp;&amp;' exists, else toss one at the end before attempting to decompile for safety.
nitrogenfingers #90
Posted 06 December 2012 - 03:11 AM
Looking at how I decompile the animation files, i noticed there will be a problem if it hits nil, since i use a '&amp;&amp;' to signal end of file where yours does not…

Any suggestion to detect the end of your files?

-edit-

I will just make it check if a '&amp;&amp;' exists, else toss one at the end before attempting to decompile for safety.


You can check the loadFromNFA method in NPaintPro to see precisely how I parse the file, but EOF is easy. You don't need a dedicated character, I just use:


local file = io.open("file")
local line = nil
repeat
  line = file:read()
  --Your parse code here
until not line

When line becomes nil you've reached the end of the file.
Lyqyd #91
Posted 06 December 2012 - 09:27 AM
You're already using io.open(), which is excellent, so why not use this for the loop:


local file = io.open("filename", "r")
if file then
  for line in file:lines() do
    --parse code here
  end
  file:close()
else
  print("Could not open file!")
end
nitrogenfingers #92
Posted 06 December 2012 - 01:03 PM
A better solution- cheers Lyqyd :)/> I always forget the option…
ArchAngel075 #93
Posted 06 December 2012 - 03:37 PM
problem with the basic paint editor is it has huge 5+ lines of nils in between each frame.. how will it handle those i wonder ?

but when i looked at some .amovs i made none had my end of file character, and worked fine, so no worries afaik.. still need to dupe my decompiler into a TEST file and check..
nitrogenfingers #94
Posted 11 December 2012 - 01:00 PM
An API companion has now been released for turning your NPaintPro sprites and creations into video game assets!




The GameUtils API converts NFP and NFA files in-program into game assets, that can be moved, transformed, repainted, animated and eventually collided against!
You can get it here: http://www.computercraft.info/forums2/index.php?/topic/6923-gameutils-for-use-with-npaintpro/

The API is designed to be as fuss-free as possible- to get something drawing on screen immediately, just make a quick sprite, then call local mysprite = loadSprite(path, x, y), and then simply mysprite:draw().
Further updates for this (and NPaintPro) are on the way.
nitrogenfingers #95
Posted 19 December 2012 - 02:30 AM
Могли бы вы быть более конкретным?
И, возможно, на английском языке?
(Thanks Google Translate)
MudkipTheEpic #96
Posted 19 December 2012 - 05:12 AM
3dprint pastebin link is broken. D:
Tjakka5 #97
Posted 19 December 2012 - 05:28 AM
Могли бы вы быть более конкретным?
И, возможно, на английском языке?
(Thanks Google Translate)

Lol, гэта даволі пацешна.
theoriginalbit #98
Posted 20 December 2012 - 02:41 AM
Both pastebin links say unknown paste id. however i did get to them this way :P/> good thing your usernames are the same! ;)/>

http://pastebin.com/u/nitrogenfingers
john3553 #99
Posted 20 December 2012 - 04:37 PM
The 3dpaint program on pastebin says Unknown Paste ID.
I checked nitrogenfingers account but it doesn't have the program.
Please help!!
nitrogenfingers #100
Posted 21 December 2012 - 01:23 AM
Irritating, I did update them…

Probably another issue with the HTML on the forums. I'll make the update now.
theoriginalbit #101
Posted 21 December 2012 - 01:24 AM
BUG REPORT:

#1. Some painting modes do not allow clicking on the menu to change the painting mode again.
#2. When dragging the mouse, if mouse is over colour picker on the side it will change the colour instead of just drawing to the canvas :)/>
nitrogenfingers #102
Posted 21 December 2012 - 04:44 AM
I don't really count the second as a bug- if you're mouse is down over the colour picker it wouldn't make sense to keep painting. I could have the screen autoscroll but this would be inconsistent with the other parts of the canvas.

Could you let me know which paint modes specifically you've been unable to change out of? You should always be able to change back to paint mode through the menu, except for play mode (more info on that in the help screen).
Doyle3694 #103
Posted 21 December 2012 - 10:46 AM
Pastebin.com Unknown Paste ID? What happened to the program?
theoriginalbit #104
Posted 21 December 2012 - 12:02 PM
Could you let me know which paint modes specifically you've been unable to change out of? You should always be able to change back to paint mode through the menu, except for play mode (more info on that in the help screen).

The fill one mainly
Bambieven #105
Posted 24 December 2012 - 06:08 AM
Really big fan of your work but there is no place to get the 3DPrint program since the link is down and I've been unable to find a replacement. Any way you can just post code here? Or at least get the link up and working? I'm really anxious to start 3D printing again
Mindmenace #106
Posted 24 December 2012 - 12:26 PM
I managed to save an older version of the 3D Print, but could you reupload the newest version of the 3D Print?
Ghoul159 #107
Posted 30 December 2012 - 11:12 AM
could please anyone reupload the 3D Print version the id is still broken ;(
nitrogenfingers #108
Posted 30 December 2012 - 07:25 PM
Re. Missing 3D paint, I'm afraid I can't upload it any earlier than the 7th (on leave).
Also had a surprising number of people request this inclusion in OS's, servers etc. To all such requests you are welcome to, but I'd ask you share or post your creation here, or email me; I'd love to see how you used it :)/>
gngz #109
Posted 31 December 2012 - 05:34 AM
Hi NitrogenFingers,

I Have made a function to draw lines in cc. If you want a draw line function in NPaintPro you can use that function(You can use also to make rectangles and squares).

I will put here an program with the function:


xPoint = {}
yPoint = {}
xmax,ymax = term.getSize()
term.setTextColor(colors.black)
function BackColor()
for y=1,ymax do
for x=1,xmax do
term.setBackgroundColor(colors.white)
term.setCursorPos(x,y)
term.write(" ")
end
end
end
function DrawLine(InitX,InitY,FinalX,FinalY,color)
vectorX=FinalX-InitX
vectorY=FinalY-InitY
vector=vectorY/vectorX
B=InitY-vector*InitX
if(InitX>FinalX)then
for X=InitX,FinalX-1,-0.01 do
Y=vector*X+B
term.setBackgroundColor(color)
term.setCursorPos(X,Y)
term.write(" ")
term.setBackgroundColor(colors.white)
end
elseif(InitX<FinalX)then
for X=InitX,FinalX+1,0.01 do
Y=vector*X+B
term.setBackgroundColor(color)
term.setCursorPos(X,Y)
term.write(" ")
term.setBackgroundColor(colors.white)
end
elseif(InitX==FinalX) then
if(InitY>FinalY)then
for Y=InitY,FinalY-1,-0.01 do
term.setBackgroundColor(color)
term.setCursorPos(FinalX,Y)
term.write(" ")
end
else
for Y=InitY,FinalY+1,0.01 do
term.setBackgroundColor(color)
term.setCursorPos(FinalX,Y)
term.write(" ")
end
end
end
end
BackColor()
while true do
t=1
while true do
event, button, xPos, yPos = os.pullEvent("mouse_click")
xPoint[t]=xPos
yPoint[t]=yPos
t=t+1
if t==3 then
t=1
BackColor()
break
end
end
DrawLine(xPoint[1],yPoint[1],xPoint[2],yPoint[2],colors.black)
end

Regards,
acters124 #110
Posted 03 January 2013 - 06:34 PM
I found a cache copy of the paste bin in question(3d print)
but sadly I lost the link but not before I downloaded the code! :P/>
Spoiler–[[
3D Print
A printing program for use with NPaintPro
But makes for a nice remote-control routine too

By NitrogenFingers
]]–

local activeCommander = -1
local operatingPrint = false

–Whether or not the print can be ended
local function endPrint()
operatingPrint = false
end

–The list of all commands the printer can be ginve
local commandList = {
["FW"] = { turtle.dig, turtle.forward };
["BK"] = turtle.back;
["UP"] = { turtle.digUp, turtle.up };
["DW"] = { turtle.digDown, turtle.down };
["TL"] = turtle.turnLeft;
["TR"] = turtle.turnRight;
["TU"] = { turtle.turnLeft, turtle.turnLeft };
["PF"] = { turtle.dig, turtle.place };
["PU"] = { turtle.digUp, turtle.placeUp };
["PD"] = { turtle.digDown, turtle.placeDown };
["SS"] = turtle.select;
["DE"] = endPrint;
}

–Splits a string according to a pattern into a table
local function split(str, pattern)
local t = { }
local fpat = "(.-)" .. pattern
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
return t
end

–Listens for any instructions given referring to identification and activation. Once activated, the mode exits.
local function respondToQuery()
while true do
print("Listening for ACT/ID query")
local id,key = rednet.receive()
print("Received : "..key)

if key == "$3DPRINT IDENTIFY" then
print("Requested Identification")
rednet.send(id, "$3DPRINT IDACK "..os.getComputerLabel())

elseif key == "$3DPRINT ACTIVATE" then
print("Requested Activation")
activeCommander = id
rednet.send(id, "$3DPRINT ACTACK")
break
end
end
end

–Performs the print. Follows instrutions as given, and responds as necessary
local function performPrint()
operatingPrint = true
while operatingPrint do
local id,msg = rednet.receive()

if id == activeCommander and string.find(msg, "$PC") == 1 then
local cmds = split(msg, " ")

if(tonumber(cmds[3])) and turtle.getItemCount(tonumber(cmds[3])) == 0 then
rednet.send(id, "$3DPRINT DEP")
else
if type(commandList[cmds[2]]) == "function" then
commandList[cmds[2]](tonumber(cmds[3]))
elseif type(commandList[cmds[2]]) == "table" then
for i=1,#commandList[cmds[2]] do
commandList[cmds[2]](tonumber(cmds[3]))
end
end

rednet.send(activeCommander, "$3DPRINT ACK")
end
end
end
end

rednet.open("right")
term.clear()
term.setCursorPos(1,1)
if not os.getComputerLabel() then
term.write("Name this computer:")
os.setComputerLabel(io.read())
end
print("3D printer online")

while true do
–Wait for activation
respondToQuery()
–Perform the print
performPrint()
end
zacpier #111
Posted 06 January 2013 - 03:17 PM
NPaintPro is amazing! I used it to build the gui for my appstore :D/>

Also, it is in the store.
Weird how that worked out, isn't it?
Bambieven #112
Posted 07 January 2013 - 03:59 AM
Thanks so much acters124!!! It works perfectly!!!
acters124 #113
Posted 07 January 2013 - 11:02 AM
Thanks so much acters124!!! It works perfectly!!!
it was not me!
it was the coder's brilliance that made the code I simply put the code here.(it was already free, and no adfly)
MulticolouredMarshmellow #114
Posted 13 January 2013 - 10:33 AM
Why doesnt the 3DPrinter link work?

it says 'Unknown Paste ID'
Rwkeith #115
Posted 13 January 2013 - 10:40 AM
Nitrogen Fingers hasn't updated the link yet.
MulticolouredMarshmellow #116
Posted 13 January 2013 - 11:31 AM
How do i connect the turtle to the computer? is there a program i put on the turtle?
acters124 #117
Posted 13 January 2013 - 03:56 PM
I found a cache copy of the paste bin in question(3d print)
but sadly I lost the link but not before I downloaded the code! :P/>
Spoiler–[[
3D Print
A printing program for use with NPaintPro
But makes for a nice remote-control routine too

By NitrogenFingers
]]–

local activeCommander = -1
local operatingPrint = false

–Whether or not the print can be ended
local function endPrint()
operatingPrint = false
end

–The list of all commands the printer can be ginve
local commandList = {
["FW"] = { turtle.dig, turtle.forward };
["BK"] = turtle.back;
["UP"] = { turtle.digUp, turtle.up };
["DW"] = { turtle.digDown, turtle.down };
["TL"] = turtle.turnLeft;
["TR"] = turtle.turnRight;
["TU"] = { turtle.turnLeft, turtle.turnLeft };
["PF"] = { turtle.dig, turtle.place };
["PU"] = { turtle.digUp, turtle.placeUp };
["PD"] = { turtle.digDown, turtle.placeDown };
["SS"] = turtle.select;
["DE"] = endPrint;
}

–Splits a string according to a pattern into a table
local function split(str, pattern)
local t = { }
local fpat = "(.-)" .. pattern
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
return t
end

–Listens for any instructions given referring to identification and activation. Once activated, the mode exits.
local function respondToQuery()
while true do
print("Listening for ACT/ID query")
local id,key = rednet.receive()
print("Received : "..key)

if key == "$3DPRINT IDENTIFY" then
print("Requested Identification")
rednet.send(id, "$3DPRINT IDACK "..os.getComputerLabel())

elseif key == "$3DPRINT ACTIVATE" then
print("Requested Activation")
activeCommander = id
rednet.send(id, "$3DPRINT ACTACK")
break
end
end
end

–Performs the print. Follows instrutions as given, and responds as necessary
local function performPrint()
operatingPrint = true
while operatingPrint do
local id,msg = rednet.receive()

if id == activeCommander and string.find(msg, "$PC") == 1 then
local cmds = split(msg, " ")

if(tonumber(cmds[3])) and turtle.getItemCount(tonumber(cmds[3])) == 0 then
rednet.send(id, "$3DPRINT DEP")
else
if type(commandList[cmds[2]]) == "function" then
commandList[cmds[2]](tonumber(cmds[3]))
elseif type(commandList[cmds[2]]) == "table" then
for i=1,#commandList[cmds[2]] do
commandList[cmds[2]](tonumber(cmds[3]))
end
end

rednet.send(activeCommander, "$3DPRINT ACK")
end
end
end
end

rednet.open("right")
term.clear()
term.setCursorPos(1,1)
if not os.getComputerLabel() then
term.write("Name this computer:")
os.setComputerLabel(io.read())
end
print("3D printer online")

while true do
–Wait for activation
respondToQuery()
–Perform the print
performPrint()
end
Why doesnt the 3DPrinter link work?

it says 'Unknown Paste ID'
use the program that I re posted in these forums(the first quote)

How do i connect the turtle to the computer? is there a program i put on the turtle?
run "3d print" in the turtle
run npaintpro in computer(for animations use -a like so: "npaintpro -a lol")
make your 3d model in the computer and print
make sure you have materials in the right slot in turtle and enough
nitrogenfingers #118
Posted 13 January 2013 - 09:34 PM
Resubmitted under http://pastebin.com/09CMRNeS Sorry for the delay on that, chaps.
acters124 #119
Posted 14 January 2013 - 05:16 AM
Resubmitted under http://pastebin.com/09CMRNeS. Sorry for the delay on that, chaps.
*cough*you put a dot in link*cough*
thanks the link original post works! :D/>
MulticolouredMarshmellow #120
Posted 14 January 2013 - 10:44 AM
Thanks for updating the 3DPrinting! but my turtle just stays there places a block, breaks it, places a block, then breaks it. Whats happening?
Fluffyhair #121
Posted 14 January 2013 - 05:25 PM
Do you put the 3d Printing file into the turtle programs or the computer programs?
nitrogenfingers #122
Posted 14 January 2013 - 05:36 PM
No fuel in your turtle.

Removed dot from the link- thanks, would never have noticed that!
theoriginalbit #123
Posted 14 January 2013 - 09:46 PM
Bug report…

Running version: well theres no number so, the one thats on pastebin…
When loading up new file the background is "clear" and displayed in yellow.
When any number key is pressed this happens, see attachment… It seems to happen in every mode except brush mode where it ONLY happens when pressing the number 1…
nitrogenfingers #124
Posted 15 January 2013 - 04:10 AM
Thanks for the report TheOriginalBIT :)/>. Have updated both links with the following changes:
- Can no longer cause error when trying to print a blank canvas
- Can no longer cause error trying to change frames in the NFP editor (which is what hitting the numbers outside of Brush mode is effectively doing)
- Turtle will request a refuel if it has no fuel, rather than just go about failing it's movement. The user must take the material in slot 1 out and replace it with fuel, then return to the computer to indicate time for a refuel. It will the carry on printing until material 1 becomes necessary again.
- Added TheOriginalBIT tester credits. If you helped test the program and I've forgotten you, firstly sorry! And secondly let me know, so I can also add your name to the credits. They've incidentally been moved from the splash screen to the help screen, under "About NPaintPro".

Non-ideal I know. Lots of things for the next update, though not sure when it will come:
- Text support! I have specified the NFT file format, and will add editor support for it. If there's demand I'll add also create an NAT file format, for animated text files. It would make sense to replace NFP and NFA with NFT and NAT but I won't for the sake of compatability with paint.
- Choice of your editor mode (paint, animator, textpaint) from the splash screen, rather than by command line option. It's too confusing and doesn't gel with the menu-based front end of the system. Yes it's for power users but that doesn't justify obtuse interfaces.
- Standalone printing. Rather than having NPaintPro handle printing on it's own, you should just be able to copy an NFP or NFA file to a turtle along with 3DPrint, then run "3DPrint <file>"- this will print it automatically, without requiring a network connection with the printing computer. I'll probably leave in direct control of printing, because it sort of looks cool but it's impractical
- An undo-redo function. No idea at all how I'll go about that one, but the program needs it.
- Replacement of the current layer-by-layer display method with a pixel buffer similar to that used in GameUtils (except with a depth buffer), to remove flicker and make the whole thing run a bit smoother. Also makes Layering display an actually useful option, rather than the train wreck it is at the moment.
- A new logo, and maybe a slightly nicer interface. Time for a change, methinks. If you're an artist and have a redesign for the logo, contact me :)/>

Also, I've seen at least one report of issues with the Flood tool but I've not had any luck replicating them. If anyone has any errors with that tool and is able to replicate, please let me know or better yet send an NFP file with that error so I can test and figure out what's happening.
theoriginalbit #125
Posted 15 January 2013 - 11:55 AM
Also, I've seen at least one report of issues with the Flood tool but I've not had any luck replicating them. If anyone has any errors with that tool and is able to replicate, please let me know or better yet send an NFP file with that error so I can test and figure out what's happening.
Yeh I have a question in re to that… it should just be select the tool and click on the screen yes? Because clicking on the screen didn't work for me ( about to test it in new version though :)/> )

Confirmed:
Fiood mode tool will not flood the screen, could this be tied into the fact that the screen is printing yellow when its actually white (which is still happening)?


Also:
- Ditching file extensions

Please don't its a nice easy way for other programs to detect its a file from npaintpro… programs like lightshot rely on it :)/>
Edited on 15 January 2013 - 11:07 AM
nitrogenfingers #126
Posted 15 January 2013 - 03:19 PM
Correct, flood fill will no fill the whole screen. This is by design- flood fill cycles through a sequence of nodes iteratively nd only stops when there is no space left to fill. The canvas in npaintpro has a dynamic canvas size, which flood fill interprets as infinite. Ergo, filling the null color is impossible, and disallowed.
Your screen is yellow on boot up as this is the alpha channel default colour. You can change it at any time using the "alpha to" commands in the display menu. I expect this will later be replaced with a light/dark grey checker like Photoshop.

Oh, and I'll probably have to hold onto file extensions. I don't like them because I didn't design them so naming them after myself is very hacky, and they hurt comparability with paint. I just don't see an easier way, sadly.
theoriginalbit #127
Posted 15 January 2013 - 03:24 PM
Correct, flood fill will no fill the whole screen. This is by design- flood fill cycles through a sequence of nodes iteratively nd only stops when there is no space left to fill. The canvas in npaintpro has a dynamic canvas size, which flood fill interprets as infinite. Ergo, filling the null color is impossible, and disallowed.
Your screen is yellow on boot up as this is the alpha channel default colour. You can change it at any time using the "alpha to" commands in the display menu. I expect this will later be replaced with a light/dark grey checker like Photoshop.
Ahh ok fair enough… Ok that works :)/> good to know :)/>

yeh I noticed I could change that… didn't the alpha channel used to be X's?
gngz #128
Posted 16 January 2013 - 02:14 AM
Hi NitrogenFingers,

I Have made a function to draw lines in cc. If you want a draw line function in NPaintPro you can use that function(You can use also to make rectangles and squares).

I will put here an program with the function:


xPoint = {}
yPoint = {}
xmax,ymax = term.getSize()
term.setTextColor(colors.black)
function BackColor()
for y=1,ymax do
for x=1,xmax do
term.setBackgroundColor(colors.white)
term.setCursorPos(x,y)
term.write(" ")
end
end
end
function DrawLine(InitX,InitY,FinalX,FinalY,color)
vectorX=FinalX-InitX
vectorY=FinalY-InitY
vector=vectorY/vectorX
B=InitY-vector*InitX
if(InitX>FinalX)then
for X=InitX,FinalX-1,-0.01 do
Y=vector*X+B
term.setBackgroundColor(color)
term.setCursorPos(X,Y)
term.write(" ")
term.setBackgroundColor(colors.white)
end
elseif(InitX<FinalX)then
for X=InitX,FinalX+1,0.01 do
Y=vector*X+B
term.setBackgroundColor(color)
term.setCursorPos(X,Y)
term.write(" ")
term.setBackgroundColor(colors.white)
end
elseif(InitX==FinalX) then
if(InitY>FinalY)then
for Y=InitY,FinalY-1,-0.01 do
term.setBackgroundColor(color)
term.setCursorPos(FinalX,Y)
term.write(" ")
end
else
for Y=InitY,FinalY+1,0.01 do
term.setBackgroundColor(color)
term.setCursorPos(FinalX,Y)
term.write(" ")
end
end
end
end
BackColor()
while true do
t=1
while true do
event, button, xPos, yPos = os.pullEvent("mouse_click")
xPoint[t]=xPos
yPoint[t]=yPos
t=t+1
if t==3 then
t=1
BackColor()
break
end
end
DrawLine(xPoint[1],yPoint[1],xPoint[2],yPoint[2],colors.black)
end

Regards,

I Have made this code if you want to make Line Draw Function.
theoriginalbit #129
Posted 16 January 2013 - 02:54 AM
I Have made this code if you want to make Line Draw Function.
Shouldn't post and then quote yourself with 'code to use'. Just seems pushy. Maybe next time use the PM system.
nitrogenfingers #130
Posted 16 January 2013 - 03:46 AM
If I include a line draw tool it'll probably be vector based, Bresheman's or something, rather than just straight lines. Your code also isn't compatible with the way NPaintPro works. I appreciate the thought however.
theoriginalbit #131
Posted 18 January 2013 - 12:06 AM
Bug/Request report:

When using the fill tool it will not fill an alpha area even if it is surrounded by another colour. eg

000000
0 0
0 0
000000

You would not be able to fill the middle area in with a colour.

This is clearly ( to some extent ) intentional, but is it possible to allow that clause?

*in a news reporters voice* This has been another bug/suggestion report brought to you by, TheOriginalBIT :P/>
nitrogenfingers #132
Posted 18 January 2013 - 01:42 AM
Again, not really a bug, it is intentional behaviour and I'll probably not make an exception for this point. It's inconsistent (and would be confusing) to allow it, and it would require essentially a second flood fill bounded by the dynamic size of the window to decide whether or not the space is acceptable. Possible but I don't think it's that necessary. For larger areas of painting (as I assume you want to use the flood fill for) I would recommend using a large brush tool, and flood too for simply recolouring images.
theoriginalbit #133
Posted 18 January 2013 - 01:47 AM
yeh thats how I did it… was just checking if it was intentional or not ;)/>
nitrogenfingers #134
Posted 31 January 2013 - 04:52 AM
Text editing and text paint support has been added to NPaintPro!



Yes, because I clearly didn't think it was bloated enough. This lets you type text and recolour text with the new -t options. Add annotations to your diagrams, flair to your documents or detail to your sprites!

Features:
- Text type support- click or cursor keys to move the text cursor, and type away! Left colour is the text colour, right colour is the background (which can be null)
- Text paint- you can paint the text without destroying the background colour of the scene with this tool. Likewise paint, brush etc. will NOT influence text.
- Load and save with the new .nft file format. This is VERY different to nfp files, the two are not remotely comparable. You can write it yourself fairly simply- it's just plain text (the same as nfp) but the text now translates directly into the text stream of the image. The control characters U+0030 and U+0031 followed by a hex number are used for specifying the background and foreground colour respectively of following text (cheers to Lyqyd for that tip!)

I make no apology for bugs in this code, there are likely to be tons so be careful when using it. Please post any bugs you have here. Thanks, and enjoy!
TheOddByte #135
Posted 31 January 2013 - 05:01 AM
Text editing and text paint support has been added to NPaintPro!



Yes, because I clearly didn't think it was bloated enough. This lets you type text and recolour text with the new -t options. Add annotations to your diagrams, flair to your documents or detail to your sprites!

Features:
- Text type support- click or cursor keys to move the text cursor, and type away! Left colour is the text colour, right colour is the background (which can be null)
- Text paint- you can paint the text without destroying the background colour of the scene with this tool. Likewise paint, brush etc. will NOT influence text.
- Load and save with the new .nft file format. This is VERY different to nfp files, the two are not remotely comparable. You can write it yourself fairly simply- it's just plain text (the same as nfp) but the text now translates directly into the text stream of the image. The control characters U+0030 and U+0031 followed by a hex number are used for specifying the background and foreground colour respectively of following text (cheers to Lyqyd for that tip!)

I make no apology for bugs in this code, there are likely to be tons so be careful when using it. Please post any bugs you have here. Thanks, and enjoy!
Awesome as usual! :D/>
Will See If I find any bugs. ;)/>
ramdor72 #136
Posted 31 January 2013 - 06:54 AM
EDIT: I made a post about adding animation support, without actually reading the feature set. Major derp :s

Anyoo, will have to give this a try :)/> Animated signs in our world here we come :)/>
nitrogenfingers #137
Posted 03 February 2013 - 10:08 PM
Quick update with a few bug fixes:
- When scrolling with the arrow keys in Text Mode, will now move to the edges of the screen correctly
- Text Paint Mode will now paint indiscriminate of whether or not there exists a previous paint there
- A little quirk in file saving has been fixed as well.

Immediate goals are to write an addition to gameUtils so nft files can be loaded and used in other programs, but buffer support will most likely not be available for this, so you will have to manage your draw calls carefully. Beyond that… I think I've done all I can with NPaintPro for the moment. Maybe it's time for me to let this program rest and call it finished?

Incidentally, feel free to suggest other features for it, because I think I've run out of things I need it to do.
Cranium #138
Posted 04 February 2013 - 12:09 PM
I love the addition of text. All we need now is for the paintutils api to accept text input as well.
Alerith #139
Posted 19 February 2013 - 07:44 PM
My gosh! I downloaded this yesterday and I cannot believe it yet! This is AWESOME and PROFESSIONAL, really. I like it to make pixelarts and small houses or things like that. Please keep working on this because it have a lot future :D/>

Also I would like to suggest an 'abort' button in 3DPrint.
nitrogenfingers #140
Posted 22 February 2013 - 09:50 PM
I've sat down three times this week to do Capital Defense and I just end up doing more bug fixing in NPaintPro, particularly with the addition of text:
- Move still doesn't really work properly for text, but it isn't crashing either so I'll take that as a win
- Select still doesn't pick up text either. Right now you have to re-enter text you've gotten incorrect. I have to rethink the interface with this new addition.
- Some issues with saving NFTs have been resolved. It should no longer crash when trying to save these files.

I know there are still many more bugs I've yet to catch so please report any you come across.

NF
TheCountChuckula #141
Posted 09 March 2013 - 11:56 PM
Thanks for the report TheOriginalBIT :)/>. Have updated both links with the following changes:
- Can no longer cause error when trying to print a blank canvas
- Can no longer cause error trying to change frames in the NFP editor (which is what hitting the numbers outside of Brush mode is effectively doing)
- Turtle will request a refuel if it has no fuel, rather than just go about failing it's movement. The user must take the material in slot 1 out and replace it with fuel, then return to the computer to indicate time for a refuel. It will the carry on printing until material 1 becomes necessary again.
- Added TheOriginalBIT tester credits. If you helped test the program and I've forgotten you, firstly sorry! And secondly let me know, so I can also add your name to the credits. They've incidentally been moved from the splash screen to the help screen, under "About NPaintPro".

Non-ideal I know. Lots of things for the next update, though not sure when it will come:
- Text support! I have specified the NFT file format, and will add editor support for it. If there's demand I'll add also create an NAT file format, for animated text files. It would make sense to replace NFP and NFA with NFT and NAT but I won't for the sake of compatability with paint.
- Choice of your editor mode (paint, animator, textpaint) from the splash screen, rather than by command line option. It's too confusing and doesn't gel with the menu-based front end of the system. Yes it's for power users but that doesn't justify obtuse interfaces.
- Standalone printing. Rather than having NPaintPro handle printing on it's own, you should just be able to copy an NFP or NFA file to a turtle along with 3DPrint, then run "3DPrint <file>"- this will print it automatically, without requiring a network connection with the printing computer. I'll probably leave in direct control of printing, because it sort of looks cool but it's impractical
- An undo-redo function. No idea at all how I'll go about that one, but the program needs it.
- Replacement of the current layer-by-layer display method with a pixel buffer similar to that used in GameUtils (except with a depth buffer), to remove flicker and make the whole thing run a bit smoother. Also makes Layering display an actually useful option, rather than the train wreck it is at the moment.
- A new logo, and maybe a slightly nicer interface. Time for a change, methinks. If you're an artist and have a redesign for the logo, contact me :)/>

Also, I've seen at least one report of issues with the Flood tool but I've not had any luck replicating them. If anyone has any errors with that tool and is able to replicate, please let me know or better yet send an NFP file with that error so I can test and figure out what's happening.

If you can't tell what, one of your proposed upcoming features got me excited. I have been using this program set for a few days. I have been trying to build a sweet, intricate, 27-layer tower, but someone on my server doesn't know how to use thaumcraft, and the rain screws with the wireless on my setup. If I can 3dprint using only the turtle and it doesn't require rednet, then I will be overjoyed. I had about 3 false starts before I gave up on it for another time.

(Bug?) Also, If I get in the way of my turtle (or mobs do) it screws up the print sequence, and the turtle has accdentally shifted all building (and breaking) far to one side, damaging neighboring player's buildings. Can you make it know whether it has moved, and/or if it doesn't move, (if turtle.moveForward returns false) wait for user to clear the blockage, and click ok or something? I had to watch 3 very boring CompTIA videos as punishment for damaging a community 3-type XP farm, and of course it broke all 4 barrels filled with mob drops. Thank god I had a portalgun, obsidian pipe, and obsidian chests to fill up. But it's ok. I left a sign to say sorry.

Will you add away to share NFP and NFA files? A standalone program that uses a command like "shared -get tower.nfp tower.nfp" (<progname> -<arg> <shared filename> <local filename>) (arguments can be -get -send (and both could use -r to replace))a public dropbox or google drive where we can upload our builds?
TheCursed_Donkey #142
Posted 20 March 2013 - 09:37 PM
Is it posible to go UP, so that you can make houses with this?
rhysjack7 #143
Posted 01 April 2013 - 10:50 AM
How Do You Get Animation Mode On
ven0mate #144
Posted 01 April 2013 - 04:28 PM
nitrogen, I have been following your posts and vids for a while, you are amazing, thanks.
One question for all:

in the 3dprint program (on the turtle) if mobs or gravel get in its way, this puts the turtle off course.
I have been trying to work out where to put the code to allow it to go on.. like

if not turtle.forward() then
turtle.attack()
–then carry on with stuff
end

can anyone help with this for me.
I am only doing it so that I can print rooms underground, it is very handy.

thanks

(I just realized countchucka mentioned this above also)
Rexi #145
Posted 07 April 2013 - 06:38 AM
Are chest support planned for the 3DPrint companion app? Would be nice, if say the turtle would return to a chest, when it only have 1 of an item left and restock :)/>

Would save quite some time, having to pendle between the turtle and the computer, all the time, when printing bigger schematics :)/>
figgycity50 #146
Posted 08 April 2013 - 03:13 AM
Thanks nitrogen! I'm using your program (this) for my OS, KeyOS. Unfortunatley, it isn't finished. That's why it is not on the forums.
Zambonie #147
Posted 17 April 2013 - 11:39 AM
I have an q. I am using this and I want to use the 3d print option.I have an turtle,and its on with the 3d-print program.I also have paintpro on my comp,Whenever I want to go into the 3d print mode,its not in the menu options or anything….?So whats wrong?Also,the drop down menu wont work…?

Nvm.Solved.
TheCountChuckula #148
Posted 17 April 2013 - 11:23 PM
Are chest support planned for the 3DPrint companion app? Would be nice, if say the turtle would return to a chest, when it only have 1 of an item left and restock :)/>

Would save quite some time, having to pendle between the turtle and the computer, all the time, when printing bigger schematics :)/>
Thanks nitrogen! I'm using your program (this) for my OS, KeyOS. Unfortunatley, it isn't finished. That's why it is not on the forums.

To answer both questtions:
use the -a argument.
(npaintpro -a <projectname>)

this adds animation, or multiple layers.
CoolisTheName007 #149
Posted 19 April 2013 - 12:23 PM
Used NpaintPro for making editable ruleboards. The server owner's seems happy about them!
This is how it looks(freshly installed):

Basically, startup script starts npaint in the monitor, and a running a function parallely to sleep and queue a key event makes sure the init screen of npaint is bypassed. Dirty, but quick!
crimsonknight3 #150
Posted 23 April 2013 - 03:26 PM
Hey, i just posted this on you-tube but i figured it would be better to post it here as i very rarely if ever get replies from youtubers >.> :

A quick question, with the blueprint mode is 0 the position of the computer in relation to the turtle? I tried a *VERY* simple room just to test the system. I designed a basic square and the turtle built an l shaped corner where it started, then moved away about 10 blocks and then built the whole room far away from the turtles starting position. I dont understand why he did this unless i have to build the room from 0-0 however you don't in your video. Please moan if im misunderstanding somewhere this could've been something in the way, so the turtle has skipped past and continued….
crimsonknight3 #151
Posted 24 April 2013 - 01:15 AM
In other words, referring to my last post, how do i know where the turtles starting position when i hit print :)/>
Pharap #152
Posted 02 May 2013 - 05:41 PM
I'm sure you already know this but the line

if not terminal then terminal = term end
Could be replaced with

terminal = terminal or term
If you don't bracket enclose an or statement when it's on the right of an assignment, it becomes an 'if nil ignore' type operation. It's used in other languages as well, like Perl.
Ashton #153
Posted 03 May 2013 - 01:24 AM
wow paint AND wordpad AND solitaire? we'll soon be running Windows 3.1 and before you know it… Minecraft inside Minecraft! (lets just hope the universe doesnt implode because of it!) Awesome work! :D/>
Dan #154
Posted 05 May 2013 - 03:49 PM
Is there anyway you can run an animation outside of npaintpro? For example, some code which allows you to run an animation in a program.

Thanks
Asdramelesh #155
Posted 08 May 2013 - 04:35 AM
really nice
Blockboid #156
Posted 10 May 2013 - 05:40 AM
How do I draw the sprite on the main screen (not monitor)
tonkku107 #157
Posted 10 May 2013 - 05:49 AM
Used NpaintPro for making editable ruleboards. The server owner's seems happy about them!
This is how it looks(freshly installed):

Basically, startup script starts npaint in the monitor, and a running a function parallely to sleep and queue a key event makes sure the init screen of npaint is bypassed. Dirty, but quick!
Can you write in the picture?
CoolisTheName007 #158
Posted 11 May 2013 - 07:47 PM
Can you write in the picture?
Use Text Mode (see OP)
lordphoenixmh #159
Posted 30 May 2013 - 03:05 PM
Is there anyway you can run an animation outside of npaintpro? For example, some code which allows you to run an animation in a program.

Thanks
I'd like to know if this is possible too as I'd like to have a big logo on my bases wall but not have the npaitpro gui around it.
emanuel12324 #160
Posted 19 June 2013 - 10:24 PM
Is there anyway to do something like hiding the color palette and menu bar? Im trying to make something like a bilboard and I don't know how to make it hide the controls.
100chilly #161
Posted 20 June 2013 - 09:59 PM
My server doesnt like NPaintPro when i try to print to an actual cc printer. Any ideas on how to fix it? I've hooked it up with a wired modem and i tired the wireless but it keeps throwing errors.


21:35:13 [INFO] Mod Flag: Failed to save world flag data: null
21:35:13 [SEVERE] java.lang.NullPointerException
21:35:13 [SEVERE]	   at universalelectricity.prefab.flag.ModFlag.writeToNBT(M
odFlag.java:63)
21:35:13 [SEVERE]	   at universalelectricity.prefab.flag.FlagBase.getNBT(Flag
Base.java:16)
21:35:13 [SEVERE]	   at atomicscience.ZhuYao.worldSave(ZhuYao.java:717)
21:35:13 [SEVERE]	   at net.minecraftforge.event.ASMEventHandler_23_ZhuYao_wo
rldSave_Save.invoke(.dynamic)
21:35:13 [SEVERE]	   at net.minecraftforge.event.ASMEventHandler.invoke(ASMEv
entHandler.java:39)
21:35:13 [SEVERE]	   at net.minecraftforge.event.EventBus.post(EventBus.java:
108)
21:35:13 [SEVERE]	   at net.minecraft.world.WorldServer.func_73044_a(WorldSer
ver.java:1168)
21:35:13 [SEVERE]	   at org.bukkit.craftbukkit.v1_5_R3.CraftServer.unloadWorl
d(CraftServer.java:849)
21:35:13 [SEVERE]	   at net.minecraftforge.common.DimensionManager.unloadWorl
ds(DimensionManager.java:507)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.func_71190_q(Min
ecraftServer.java:848)
21:35:13 [SEVERE]	   at net.minecraft.server.dedicated.DedicatedServer.func_7
1190_q(DedicatedServer.java:320)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.func_71217_p(Min
ecraftServer.java:721)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.run(MinecraftSer
ver.java:605)
21:35:13 [SEVERE]	   at net.minecraft.server.ThreadMinecraftServer.run(Source
File:573)
21:35:13 [INFO] Mod Flag: Failed to save world flag data: null
21:35:13 [SEVERE] java.lang.NullPointerException
21:35:13 [SEVERE]	   at universalelectricity.prefab.flag.ModFlag.writeToNBT(M
odFlag.java:63)
21:35:13 [SEVERE]	   at universalelectricity.prefab.flag.FlagBase.getNBT(Flag
Base.java:16)
21:35:13 [SEVERE]	   at icbm.core.ZhuYaoBase.worldSave(ZhuYaoBase.java:256)
21:35:13 [SEVERE]	   at net.minecraftforge.event.ASMEventHandler_28_ZhuYaoBas
e_worldSave_Save.invoke(.dynamic)
21:35:13 [SEVERE]	   at net.minecraftforge.event.ASMEventHandler.invoke(ASMEv
entHandler.java:39)
21:35:13 [SEVERE]	   at net.minecraftforge.event.EventBus.post(EventBus.java:
108)
21:35:13 [SEVERE]	   at net.minecraft.world.WorldServer.func_73044_a(WorldSer
ver.java:1168)
21:35:13 [SEVERE]	   at org.bukkit.craftbukkit.v1_5_R3.CraftServer.unloadWorl
d(CraftServer.java:849)
21:35:13 [SEVERE]	   at net.minecraftforge.common.DimensionManager.unloadWorl
ds(DimensionManager.java:507)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.func_71190_q(Min
ecraftServer.java:848)
21:35:13 [SEVERE]	   at net.minecraft.server.dedicated.DedicatedServer.func_7
1190_q(DedicatedServer.java:320)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.func_71217_p(Min
ecraftServer.java:721)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.run(MinecraftSer
ver.java:605)
21:35:13 [SEVERE]	   at net.minecraft.server.ThreadMinecraftServer.run(Source
File:573)
21:35:13 [INFO] Mod Flag: Failed to save world flag data: null
21:35:13 [SEVERE] java.lang.NullPointerException
21:35:13 [SEVERE]	   at universalelectricity.prefab.flag.ModFlag.writeToNBT(M
odFlag.java:63)
21:35:13 [SEVERE]	   at universalelectricity.prefab.flag.FlagBase.getNBT(Flag
Base.java:16)
21:35:13 [SEVERE]	   at icbm.gangshao.ZhuYaoGangShao.worldSave(ZhuYaoGangShao
.java:196)
21:35:13 [SEVERE]	   at net.minecraftforge.event.ASMEventHandler_48_ZhuYaoGan
gShao_worldSave_Save.invoke(.dynamic)
21:35:13 [SEVERE]	   at net.minecraftforge.event.ASMEventHandler.invoke(ASMEv
entHandler.java:39)
21:35:13 [SEVERE]	   at net.minecraftforge.event.EventBus.post(EventBus.java:
108)
21:35:13 [SEVERE]	   at net.minecraft.world.WorldServer.func_73044_a(WorldSer
ver.java:1168)
21:35:13 [SEVERE]	   at org.bukkit.craftbukkit.v1_5_R3.CraftServer.unloadWorl
d(CraftServer.java:849)
21:35:13 [SEVERE]	   at net.minecraftforge.common.DimensionManager.unloadWorl
ds(DimensionManager.java:507)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.func_71190_q(Min
ecraftServer.java:848)
21:35:13 [SEVERE]	   at net.minecraft.server.dedicated.DedicatedServer.func_7
1190_q(DedicatedServer.java:320)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.func_71217_p(Min
ecraftServer.java:721)
21:35:13 [SEVERE]	   at net.minecraft.server.MinecraftServer.run(MinecraftSer
ver.java:605)
21:35:13 [SEVERE]	   at net.minecraft.server.ThreadMinecraftServer.run(Source
File:573)
>2013-06-20 21:35:13 [INFO] [ForgeModLoader] Unloading dimension 1
21:36:09 [INFO] ComputerCraft: Error running task.
21:36:09 [SEVERE] java.lang.NullPointerException
21:36:09 [SEVERE]	   at dan200.computer.shared.TileEntityModem.attach(TileEnt
ityModem.java:115)
21:36:09 [SEVERE]	   at dan200.computer.shared.TileEntityCable.attach(TileEnt
ityCable.java:354)
21:36:09 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$PeripheralWra
pper.attach(PeripheralAPI.java:82)
21:36:09 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$2.execute(Per
ipheralAPI.java:302)
21:36:09 [SEVERE]	   at dan200.computer.core.ComputerThread$1$1.run(ComputerT
hread.java:117)
21:36:09 [SEVERE]	   at java.lang.Thread.run(Unknown Source)
21:37:23 [INFO] 100chilly issued server command: /help modflag
21:37:27 [INFO] 100chilly issued server command: /modflag
21:38:01 [INFO] ComputerCraft: Error running task.
21:38:01 [SEVERE] java.lang.NullPointerException
21:38:01 [SEVERE]	   at dan200.computer.shared.TileEntityModem.attach(TileEnt
ityModem.java:115)
21:38:01 [SEVERE]	   at dan200.computer.shared.TileEntityCable.attach(TileEnt
ityCable.java:354)
21:38:01 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$PeripheralWra
pper.attach(PeripheralAPI.java:82)
21:38:01 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$2.execute(Per
ipheralAPI.java:302)
21:38:01 [SEVERE]	   at dan200.computer.core.ComputerThread$1$1.run(ComputerT
hread.java:117)
21:38:01 [SEVERE]	   at java.lang.Thread.run(Unknown Source)
21:38:38 [INFO] ComputerCraft: Error running task.
21:38:38 [SEVERE] java.lang.NullPointerException
21:38:38 [SEVERE]	   at dan200.computer.shared.TileEntityModem.attach(TileEnt
ityModem.java:115)
21:38:38 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$PeripheralWra
pper.attach(PeripheralAPI.java:82)
21:38:38 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$2.execute(Per
ipheralAPI.java:302)
21:38:38 [SEVERE]	   at dan200.computer.core.ComputerThread$1$1.run(ComputerT
hread.java:117)
21:38:38 [SEVERE]	   at java.lang.Thread.run(Unknown Source)
21:39:22 [INFO] ComputerCraft: Error running task.
21:39:22 [SEVERE] java.lang.NullPointerException
21:39:22 [SEVERE]	   at dan200.computer.shared.TileEntityModem.attach(TileEnt
ityModem.java:115)
21:39:22 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$PeripheralWra
pper.attach(PeripheralAPI.java:82)
21:39:22 [SEVERE]	   at dan200.computer.core.apis.PeripheralAPI$2.execute(Per
ipheralAPI.java:302)
21:39:22 [SEVERE]	   at dan200.computer.core.ComputerThread$1$1.run(ComputerT
hread.java:117)
21:39:22 [SEVERE]	   at java.lang.Thread.run(Unknown Source)
This happens only when i try to print the first time but still i cant print to the cc printer before or after error… :(/>
nitrogenfingers #162
Posted 20 June 2013 - 11:32 PM
Is there anyway to do something like hiding the color palette and menu bar? Im trying to make something like a bilboard and I don't know how to make it hide the controls.

I'm afraid not. NPaintPro is a painting tool rather than a image display, and I've not added the capacity to allow it to work as such. I recommend you create a new program using paintutils (or gameutils if you're working with animations) and draw the images wrapped to a monitor. This is safer and gives you more control over how the image appears.

My server doesnt like NPaintPro when i try to print to an actual cc printer. Any ideas on how to fix it? I've hooked it up with a wired modem and i tired the wireless but it keeps throwing errors.
[…]
This happens only when i try to print the first time but still i cant print to the cc printer before or after error… :(/>

I do not. I've not seen anything like this happen on a computer before and don't think it has to do with NPP (that or you're asking it to do a very strange operation). When you say CC printer do you mean a paper-and-ink printer? I don't see why that wouldn't be possible, but it's not going to print it colour- would just be a page of hexadecimal characters.

It's very hard to say but this may be a bug in computercraft- if so I'd recommend reporting it in the bugs section with a detailed description of how you caused it.
GreenPro1 #163
Posted 27 June 2013 - 04:31 AM
Hello , im a newbie and i need help , how do i load images created with npaintpro . . . ?
Before this , i was using this code :
bground = paintutils.loadImage(".background")
    paintutils.drawImage(bground,1,1)
now i made another background with npaintpro , with the same name ".background" . . . the question is how do i load the background i made using npaintpro . . . thank you.
Mjaf #164
Posted 03 July 2013 - 04:36 PM
Hello , im a newbie and i need help , how do i load images created with npaintpro . . . ?
Before this , i was using this code :
bground = paintutils.loadImage(".background")
	paintutils.drawImage(bground,1,1)
now i made another background with npaintpro , with the same name ".background" . . . the question is how do i load the background i made using npaintpro . . . thank you.

If your new background image was made with npaintpro it will have the .nfp extention. So try the code below



bground = paintutils.loadImage(".background.nfp")
    paintutils.drawImage(bground,1,1)

Mjaf #165
Posted 03 July 2013 - 04:51 PM
I have just started using npaintpro myself, and was wondering if there is a way of printing an animation to a monitor in a similar way printing a normal picture as shown above.
Zambonie #166
Posted 07 July 2013 - 01:23 PM
Ive always had this suggestion. Transperant 'coating'.(I dont know if theres something else like this but,) This 'coating' allows you to have 2 pictures over each other. This is useful if you want to make A small pic apear over another full-screen menu pic representing something. Its bassicly making a invisible painting in some spots, so you dont have a white blob in your pic. This also saves time so you dont have to redo the whole pic with diffrent stuff on it over and over.(Like again,I dont know if theres a way to do this already.)
nitrogenfingers #167
Posted 07 July 2013 - 07:43 PM
Ive always had this suggestion. Transperant 'coating'.(I dont know if theres something else like this but,) This 'coating' allows you to have 2 pictures over each other. This is useful if you want to make A small pic apear over another full-screen menu pic representing something. Its bassicly making a invisible painting in some spots, so you dont have a white blob in your pic. This also saves time so you dont have to redo the whole pic with diffrent stuff on it over and over.(Like again,I dont know if theres a way to do this already.)

Are you saying this is a suggested feature for this program? Because what you're referring to, alpha channelling, already is a feature- has been since I released it…

I have just started using npaintpro myself, and was wondering if there is a way of printing an animation to a monitor in a similar way printing a normal picture as shown above.

gameutils allows you to draw animations and cycle through frames. First page of this post.
NOTUSEDPLEASEDELETE #168
Posted 08 July 2013 - 12:37 AM
Animation doesn't work but great work anyway!
MmPMSFmM #169
Posted 15 July 2013 - 05:46 AM
Brilliant program!
makerimages #170
Posted 22 July 2013 - 03:07 AM
How does one display a .nft file?
Lego Stax #171
Posted 25 July 2013 - 10:23 AM
I just released an OS which has nPaintPro in it. It can be found here.
TorakTu #172
Posted 05 August 2013 - 01:21 PM
I was looking for this. TY TY TY TY !!!!!
MUpetzz #173
Posted 09 August 2013 - 09:44 AM
how can i play the "movie" automaticly?
maybe whits an redstone signal

sry for my bad english its not my motherlanguage.
dpd_84 #174
Posted 12 August 2013 - 04:20 PM
when I try to run 3DPrint I get an error: 3DPrint:18: attempt to index ? (a nil value)

Does anyone know how to fix this??
MysticT #175
Posted 12 August 2013 - 05:13 PM
when I try to run 3DPrint I get an error: 3DPrint:18: attempt to index ? (a nil value)

Does anyone know how to fix this??
Are you trying to run it on a computer? You need a turtle to use that program.
dpd_84 #176
Posted 12 August 2013 - 05:31 PM
when I try to run 3DPrint I get an error: 3DPrint:18: attempt to index ? (a nil value)

Does anyone know how to fix this??
Are you trying to run it on a computer? You need a turtle to use that program.

yes and thanks! I feel like a dunce now… but no tutorials on youtube or really anywhere I can find
TheOddByte #177
Posted 13 August 2013 - 10:12 AM
Really nice program! :)/>
But how would I run an animation without NPaintPro?
Like if I wanted to make a movie theater and simply create/save an animation onto a floppy disk then have a program that automatically runs i.. How would I do that?
nitrogenfingers #178
Posted 13 August 2013 - 12:11 PM
Really nice program! :)/>
But how would I run an animation without NPaintPro?
Like if I wanted to make a movie theater and simply create/save an animation onto a floppy disk then have a program that automatically runs i.. How would I do that?

This must be the most commonly asked question I encounter…

I've before stated that I don't recommend NPaintPro as a movie development tool- it was designed very specifically to be for animated sprites that would act as components in games built using GameUtils. Play animation libraries are packaged within that suite, and a program to load in and play a looped animation on a blank canvas would probably be about a 10 line program.

But this has come up often enough to suggests there's demand for a tool that can actually be used to make, if not movies at least animated billboards in Minecract. I agree, this is a good idea, but I will say that, at least at present, NPaintPro is just not the tool for that job.

So I'm going to compromise. I'll update the executable in the next few days to include a 'hide' feature, so the interface can be hidden, allowing the program to be run on your machine or on a monitor with the animation you've developed playing constantly. That'll make a sufficient stop-gap for this problem.

And, in the meantime I'll start thinking up some way of making an actual movie development tool in Minecraft…

NF
GravityScore #179
Posted 14 August 2013 - 07:54 PM
Really nice program! :)/>
But how would I run an animation without NPaintPro?
Like if I wanted to make a movie theater and simply create/save an animation onto a floppy disk then have a program that automatically runs i.. How would I do that?

You can use Lightshot, which has a record .nfa movie function :)/> It creates an executable from a .nfa animation which you can just run. You'd need to redirect the term to a monitor though.

EDIT: Just realised that this feature is currently buggy (it doesn't show the last frame and the UI isn't clear at all) :P/> I'll have to fix it tonight when I get back from school.
TheOddByte #180
Posted 15 August 2013 - 06:36 PM
Really nice program! :)/>
But how would I run an animation without NPaintPro?
Like if I wanted to make a movie theater and simply create/save an animation onto a floppy disk then have a program that automatically runs i.. How would I do that?

This must be the most commonly asked question I encounter…

I've before stated that I don't recommend NPaintPro as a movie development tool- it was designed very specifically to be for animated sprites that would act as components in games built using GameUtils. Play animation libraries are packaged within that suite, and a program to load in and play a looped animation on a blank canvas would probably be about a 10 line program.

But this has come up often enough to suggests there's demand for a tool that can actually be used to make, if not movies at least animated billboards in Minecract. I agree, this is a good idea, but I will say that, at least at present, NPaintPro is just not the tool for that job.

So I'm going to compromise. I'll update the executable in the next few days to include a 'hide' feature, so the interface can be hidden, allowing the program to be run on your machine or on a monitor with the animation you've developed playing constantly. That'll make a sufficient stop-gap for this problem.

And, in the meantime I'll start thinking up some way of making an actual movie development tool in Minecraft…

NF
Ok.. I think I'll try to make my own animation program in the meantime :)/>
nitrogenfingers #181
Posted 02 September 2013 - 07:19 PM
So in the past few days I've spent a lot of time in airports, and with little else to do I've been pecking away on a few updates. These updates are geared towards making NPaintPro more OS-friendly, particularly for those that use graphical icons rather than text commands and windowing. If you fit either of those categories, let me know if this update suits your needs!



I've uploaded a new version with the beginnings of a few new features:
- Removed the requirement to add command line arguments. You can now simply run NPaintPro on its own from the command line, and specify a file name and file format. This also means if you've been confused as to why you're not seeing animation or text support in your program, this should make it crystal-clear when creating new files (my most commonly asked question is 'where are the animation tools' with NFP files…)
- Added a 'hide interface' feature. This removes the sidebar and footer from view and displays the rest of the canvas. If you have an animation playing, this should continue to play. When this feature is enabled, all input to the screen apart from hitting the ~ key will do nothing. This feature is designed for viewing a full picture, previewing animations (which should keep playing even after you've hidden the interface) and creating billboards for your server.
- The hide interface feature can also be activated by the -d command line parameter. If you want to have your billboards always on you can write a startup file that fires up NPP with a given file using this option.
- Support for different screen sizes has been added, which is mostly just removing features or making the screen more manegable when working with smaller or larger sizes. In particular:
- A scroll bar is added to the colour palette if the screen is too small to display it in full
- A grey connecting bar is added if the screen is too big
- Features like help, the dropdown menus and the logo screen are all scaled back or removed if the screen size cannot support them

There is a lot more to be done in getting NPP suited for windows yet, but I'm getting closer. If you have any issues to report or comments to make, as usual I'm very glad to hear them.

You can get the update here: http://pastebin.com/pzWSRqNF. The link on the main page has also been updated.

-NF
TorakTu #182
Posted 02 September 2013 - 11:03 PM
Very nice :)/>
Lyqyd #183
Posted 03 September 2013 - 01:55 AM
FYI for LyqydOS compatibility:

window_resize event is thrown whenever a window's size changes.
window_close is a planned event feature to allow a single coroutine resume cycle after the close window button is clicked. Yield with "close_wait" to cancel the closing and await further input from the user (save dialog, etc.).

Looks like I need to get my nose to the grindstone on the API I need to build for it. Hrmph.
nitrogenfingers #184
Posted 03 September 2013 - 03:01 AM
It looks like the way I've written available service prediction supports window resizing very comfortably. I'll add code to support window_resize events in my next release, but for more general OS application I expect I'll just perform a check to determine if term.size has changed after any given event and use that as my trigger.
window_close and close_wait may be more of an issue, as even though NPP doesn't make use of coroutines it does make heavy use of timers. I may need to find some way of stalling or restarting timers if they've been made to elapse for too long a time, and with task switching, programs that don't compare timer ID's to event catching may find their programs demonstrating unexpected behaviour when run in tandem with NPP. But I'll muse on this.
PurpleTurtleShell #185
Posted 22 September 2013 - 08:45 PM
Hi, just wanted to say this is a great application, but I'm having some trouble with it (probably PEBCAK).

I'm unable to change frames - I follow the instructions in the Help menu and press number keys to try and change frames/layers so I can do the 2nd level of the blueprint I want to 3D print, but nothing happens.
I've tried using the num row &amp; numpad, with numlock both on and off, with no change.

Am I missing something obvious?
PurpleTurtleShell #186
Posted 22 September 2013 - 10:26 PM
Update / Bug Report: Launching npaintpro with no cmd line arguments, then choosing Animation at the startup screen doesn't give you Frame functionality.

However launching it via : "npaintpro -a file.nfa" works fine, so it seems like the startup options aren't actually applying properly.
nitrogenfingers #187
Posted 22 September 2013 - 11:16 PM
I've noticed this before- the file will save as a .nfa.nfp, which is a bit roundabout. I'll look into what's happening here and try to have that fixed in a few days. Thanks for the report :)/>
MiniTom #188
Posted 25 October 2013 - 02:06 AM
This may or may not be a bug, you added the hide interface to satisfy the want to have pictures and animations on monitors constantly running, but you cant 'hide interface' while in play mode, either using ~ or trying to access the menu. I know this is not what the program is intended for but you by coincidence have created the best program for the job. :)/> just make this tiny change and itd be perfect.
GamerFelio #189
Posted 26 October 2013 - 01:54 PM
It's very good!
I don't understand all of this but its very good :D/> !
Ian_Virus #190
Posted 28 November 2013 - 10:47 PM
Hi. I am new to this forum, but the turtles are not printing in 3D print. I have the blocks in the turtle. Whats wrong?
EDIT: Yes I fueled it. Whats wrong? It doesn't want to place blocks.
Edited on 29 November 2013 - 11:56 AM
Lyqyd #191
Posted 28 November 2013 - 11:17 PM
Have you fueled the turtle?
Ian_Virus #192
Posted 29 November 2013 - 12:54 PM
Have you fueled the turtle?
Yes. It moves but it doesn't place those blocks

Bug: Turtle doesn't print even with blocks and fuel inside.
Please fix this. I want to print 3d.
mrpoopy345 #193
Posted 30 November 2013 - 04:30 PM
Nice program! I have no idea how you do it :o/>
nitrogenfingers #194
Posted 30 November 2013 - 09:21 PM
Have you fueled the turtle?
Yes. It moves but it doesn't place those blocks

Bug: Turtle doesn't print even with blocks and fuel inside.
Please fix this. I want to print 3d.

My guess is you've got your blocks in the wrong turtle slots. Check the 'slots' button in the print screen to make sure the materials are in the right turtle inventory slots. If they're not, the turtle won't place them.
madvilager #195
Posted 19 December 2013 - 12:50 PM
How do I change the layers in blueprint mode?
ps. nice programming
YoYoYonnY #196
Posted 23 December 2013 - 10:04 AM
Nice program. I just got three suggestion for the post to add. first: adding this line is easy but it would help a lot if you have to download npaintpro a lot (like me):

pastebin get pzWSRqNF npaintpro
second: will there ever be a standalone (for use in other operating systems)? The standalone would just need a "Save as…" and a "New" button in the 'file' menu.
third: make flood also flood empty places
that's about it.
Edited on 23 December 2013 - 09:19 AM
xXLeNinjaXx #197
Posted 24 December 2013 - 01:59 PM
How Do I create layers in blueprint mode?
nitrogenfingers #198
Posted 24 December 2013 - 08:20 PM
Nice program. I just got three suggestion for the post to add. first: adding this line is easy but it would help a lot if you have to download npaintpro a lot (like me):

pastebin get pzWSRqNF npaintpro
second: will there ever be a standalone (for use in other operating systems)? The standalone would just need a "Save as…" and a "New" button in the 'file' menu.
third: make flood also flood empty places
that's about it.

The second is something I should do. A standalone version with multiple file access should be available. That just means me adding a browser at some stage, which I'm sure I'll eventually get around to.

I've discussed the third point before, and explained why it isn't possible due to the dynamic nature of the canvas size. Use the brush tool to fill empty spaces.

How Do I create layers in blueprint mode?

Blueprint mode doesn't change anything to do with layering. Just make sure you've opened your file as an animation rather than a paint file (i.e. using the -a command line option).
xXLeNinjaXx #199
Posted 27 December 2013 - 09:49 PM
Nice program. I just got three suggestion for the post to add. first: adding this line is easy but it would help a lot if you have to download npaintpro a lot (like me):

pastebin get pzWSRqNF npaintpro
second: will there ever be a standalone (for use in other operating systems)? The standalone would just need a "Save as…" and a "New" button in the 'file' menu.
third: make flood also flood empty places
that's about it.

The second is something I should do. A standalone version with multiple file access should be available. That just means me adding a browser at some stage, which I'm sure I'll eventually get around to.

I've discussed the third point before, and explained why it isn't possible due to the dynamic nature of the canvas size. Use the brush tool to fill empty spaces.

How Do I create layers in blueprint mode?

Blueprint mode doesn't change anything to do with layering. Just make sure you've opened your file as an animation rather than a paint file (i.e. using the -a command line option).



I'm Still Confused on how to make layers i opened it as animation?

When I Look At your video I see Frames but when i go into each of my categories (Sprite?, animation and Text) i see the same thing when I click the drop down menu (Painting, Display, Help, File). Point is i see the same thing on every one
Edited on 30 December 2013 - 08:18 AM
samara8609 #200
Posted 20 January 2014 - 12:40 PM
I'm still fairly new to computercraft, does anyone know of a tutorial on setting up the npaintpro program for 3d printing? I see that it looks like a wireless mining turtle but i am not sure if it requires a GPS or the commands once the program has been downloaded from pastebin to start the npaintpro program. Also, does the turtle need a separate program or is everything ran from the advanced computer?
3DHouse #201
Posted 20 February 2014 - 01:24 AM
Yeah could you make a help guide for installing npaintpro program for 3D printing as it is a great feature to Computer Craft.
goldensecret #202
Posted 25 February 2014 - 10:32 AM
hey dude, thanks for the amazing program. appreciate it greatly, but is there a way of automatically refilling the turtle? whether its with an attachment or a piece of code to return to its original point. i think this would be a great addition to this program and hope to see it in the future, thanks.
slavajda02 #203
Posted 25 February 2014 - 01:34 PM
how install the program?? i dont now please help :(/> :(/>
Alice #204
Posted 25 February 2014 - 01:59 PM
http://pastebin.com/pzWSRqNF or pastebin get pzWSRqNF npaintpro
TheKickstart #205
Posted 26 February 2014 - 10:04 AM
Nice Painting Software
slavajda02 #206
Posted 27 February 2014 - 01:21 PM
how i can install it

and 3d npaint pro pastebin ?

if i start 3d npaintpro
then type me error
Dzzs #207
Posted 31 May 2014 - 03:45 AM
I'm having issues with the printing. I have everything put into the right places, I even took the files included in the treasure with computercraft and put them into their program file locations. Neither the included or pastebin 3dprint files will work. I get the message "3dprint:105: No such modem: right". I was trying to use the paint/print in a mod pack and it has the most up to date version, but I thought maybe a mod is messing with it so I did a clean install of minecraft and forge with only the most recent computercraft and did the same as above with the same error. I used to use this printing long ago and loved it, I would love to get this working. Thanks for any help!
Danny #208
Posted 22 July 2014 - 10:32 AM
Could this be integrated into the OneOS App Store? That'd be really nice.
nlancaster #209
Posted 09 October 2014 - 02:21 AM
More work on the 3d printing would make it perfect!

1. If a mob or player gets in its way it should stop until they move, or maybe until you restart the program. right now it acts like it is moving and then started the program again skipping what ever steps it could do while blocked.
2. reload from chest at start point. then we wouldn't have to keep feeding it.

Other wise it is really kewl!!
nitrogenfingers #210
Posted 10 October 2014 - 03:33 PM
So I haven't read this thread in months but from the sounds of it there are some issues to solve:
- Stability issues with the main executable
- 3D printing is too complex or confusing to set up, or flat-out doesn't work
- You need a 3D printer and modem in range, and can't print things on their own
- Installation guide and using guide is insufficient.

Thanks for all your feedback. I'll get to work!
cdel #211
Posted 24 October 2014 - 12:19 PM
So I haven't read this thread in months but from the sounds of it there are some issues to solve:
- Stability issues with the main executable
- 3D printing is too complex or confusing to set up, or flat-out doesn't work
- You need a 3D printer and modem in range, and can't print things on their own
- Installation guide and using guide is insufficient.

Thanks for all your feedback. I'll get to work!

This is an awesome paint program still, but sometimes the menu is very glitchy. The menu is practically unusable due to the crazy flicker, i'm not sure if its just because i'm testing it on a server. (CC 1.64)
nitrogenfingers #212
Posted 24 October 2014 - 01:13 PM
Thanks for the report, I'll definitely look into it. Flicker is very hard to avoid with NPaintPro as it's currently written due to how much it potentially needs to draw, and it doesn't make use of a backbuffer. And there are bugs everywhere; most don't break the program but some do and all are annoying. I need to work on a fairly large overhaul to get this to where it needs to be, so bug/performance reports and suggestions are welcome as always. Cheers :)/>
Rougeminner #213
Posted 01 December 2014 - 07:42 AM
i couldn't find said api in video the one that plays the .nfa outside of npaintpro . if i over looked it can some point me in the right direction
Gumball #214
Posted 04 December 2014 - 05:59 AM
Is it posible to go UP, so that you can make houses with this?

Pretty sure you can, just make another layer.
Edited on 04 December 2014 - 04:59 AM
Vreezer #215
Posted 14 January 2015 - 07:39 AM
I made a billboard and I'd like it to autoplay with hiden Interface as I open it. I did "npaintpro -a -d techsoft.nfa" but all I get is a black screen. If I hit a number on my keyboard the animation jumps to the frame with that number, so the animation should work but it doesnt autoplay.
LDDestroier #216
Posted 14 January 2015 - 05:39 PM
I tried npaintpro once, and it was *sorta* buggy, but worked decently. I even used it to make a clumsy banner for my server! But what does npaintpro offer that what Sketch doesn't?
Phoenix323 #217
Posted 23 January 2015 - 09:34 PM
Cool Program :)/>
Agent Silence #218
Posted 23 January 2015 - 09:49 PM
I tried npaintpro once, and it was *sorta* buggy, but worked decently. I even used it to make a clumsy banner for my server! But what does npaintpro offer that what Sketch doesn't?
Sketch was made FAR after this was made.
Gabriele_02 #219
Posted 23 February 2015 - 06:59 PM
When I run Npaint pro 3d on pc after running it on the turtle me error at line 18 … how do I solve it? Please answer me !!!
SpencerBeige #220
Posted 24 February 2015 - 12:30 AM
the thing about mc, is the pixels are large, and not even square! but, this still will probably inspire me to make more games! thanks!

edit: also, may i use this in the game im working on?
Edited on 23 February 2015 - 11:32 PM
Bomb Bloke #221
Posted 24 February 2015 - 12:37 AM
When I run Npaint pro 3d on pc after running it on the turtle me error at line 18 … how do I solve it? Please answer me !!!

3dprint is for turtles only.

edit: also, may i use this in the game im working on?

nitrogenfingers has encouraged that sort of thing in the OP.
Gabriele_02 #222
Posted 24 February 2015 - 02:05 PM
When I run Npaint pro 3d on pc after running it on the turtle me error at line 18 … how do I solve it? Please answer me !!!

3dprint is for turtles only.

edit: also, may i use this in the game im working on?

nitrogenfingers has encouraged that sort of thing in the OP.

when I run it on the turtle asks me the name of the computer . , I type the name and tells me
" 3D printer online " and "listen for ACT / ID query " then I have to do ???
Bomb Bloke #223
Posted 25 February 2015 - 12:54 AM
Run NPaintPro on a computer and use the menus to print something.
Gabriele_02 #224
Posted 25 February 2015 - 05:58 PM
But me error at line 18! How do I fix it ???
Bomb Bloke #225
Posted 26 February 2015 - 12:11 AM
Again, you should be running NPaintPro on your computer, and 3DPrint on your turtle. The computer can then send the shape you wish to build to your turtle.
Cranium #226
Posted 26 February 2015 - 12:26 AM
To clarify, NPaintPro is only meant to run on computers, and will not work on turtles. This is on purpose. 3DPrint was designed for the turtles.
nitrogenfingers #227
Posted 26 February 2015 - 02:53 AM
I'm sorry about the confusion. I'll rewrite the OP to reflect specific instructions on how 3D printing works. Thanks all :)/>
Gabriele_02 #228
Posted 26 February 2015 - 02:05 PM
I'm sorry about the confusion. I'll rewrite the OP to reflect specific instructions on how 3D printing works. Thanks all :)/>

pensiche when it is ready ? please post a video or a guide that explains how to use Npain Pro 3d ?
cdel #229
Posted 26 February 2015 - 09:05 PM
Nitro actually made a few tutorials a while back.

3D Printing: http://youtu.be/AuofE9dqiuU

Painting and Anima…: http://youtu.be/U2UxDlo_N8U
Edited on 26 February 2015 - 08:06 PM
Rougeminner #230
Posted 03 July 2015 - 05:42 AM
I just can't seem to wrap my fingers around it, does anyone have code i can use to play an animation in my program from and nfa file?



EDIT: resolved

can someone explain the structure of the nft file i can not make heads or tails of it
EDIT resolved complete
Edited on 05 July 2015 - 02:23 AM
GFX #231
Posted 04 August 2015 - 05:36 AM
Nice Paint!
CaosTECH #232
Posted 20 September 2015 - 04:20 AM
NITROGENIC FINGAS

Im using your program to create backgrounds and GUIs for my programs, but what code do I use to make the image pop up,
nitrogenfingers #233
Posted 03 October 2015 - 05:23 PM
Paintutils functions work with nfp files in the same way as paint files so that's probably the easiest way. Alternatively if you're using nfa's you can make use of my gameutils API (linked in the op)
CrookedSpine #234
Posted 29 December 2015 - 01:13 AM
How do you print a .nfp file in a monitor? Please help.
Edited on 29 December 2015 - 04:30 PM
jakejakey #235
Posted 20 October 2016 - 04:48 AM
Is there a way I can easily load these and draw them? I'm very interested about the whole text over color thing, and I'd love to use it for some nice backgrounds on future OSes and games. Also, have you tried fixing the flickering menus? I expect they can be easily fixable using term.current().setVisible(). But I haven't tried to fix them myself
Edited on 20 October 2016 - 02:50 AM
Bomb Bloke #236
Posted 20 October 2016 - 10:49 AM
Here's a short API.

os.loadAPI( "NFT" )

term.clear()

NFT.draw( NFT.load("someNFTfile.nft"), 1, 1 )
jakejakey #237
Posted 20 October 2016 - 02:21 PM
Thanks so much :)/>
Sam54123 #238
Posted 27 October 2016 - 04:13 AM
So how do I display a .nfa file in a program?
Bomb Bloke #239
Posted 27 October 2016 - 01:03 PM
If I were you, I'd use a GIF instead.

http://www.computercraft.info/forums2/index.php?/topic/23056-gif-api/