- ComputerCraft | Programmable Computers for Minecraft
- → oli414's Content
oli414's Content
There have been 25 items by oli414 (Search limited from 29-March 23)
#241420 ComputerCraft 1.76 Beta Information (Minecraft 1.8) (Updated December 24th)
Posted by oli414 on 25 December 2015 - 12:13 PM in Beta Testing
Let's try out those new Ender Modems :-D
#240401 [CC 1.76+] BLittle API
Posted by oli414 on 13 December 2015 - 03:21 PM in APIs and Utilities
Great way of making the new characters more useful.
#240384 [CC 1.76] Pixel Canvas API
Posted by oli414 on 13 December 2015 - 11:11 AM in APIs and Utilities
Bomb Bloke, on 13 December 2015 - 11:06 AM, said:
Yeah it is, took me a while to realise it was even there, at first I thought the characters contained 9 pixels because of that.
#240382 [CC 1.76] Easy Drawing Characters
Posted by oli414 on 13 December 2015 - 10:59 AM in APIs and Utilities
Is does look a lot smaller though. Thanks.
#240381 [CC 1.76] Pixel Canvas API
Posted by oli414 on 13 December 2015 - 10:57 AM in APIs and Utilities
If I have the time I'd like to spend some on a graphics render API with several overlay-modes taking care of the limited color problem.
Can't wait to see what others come up with with these new characters. The possibilities are endless.
#240341 [CC 1.76] Pixel Canvas API
Posted by oli414 on 13 December 2015 - 12:25 AM in APIs and Utilities
It adds a whole lot of new possiblities. Especially for the OS makers.
However, it will require some great API to make it easy to use (which this isn't). Can't wait to see what people will come up with.
#240330 [CC 1.76] Pixel Canvas API
Posted by oli414 on 12 December 2015 - 10:51 PM in APIs and Utilities
To make it easier to use these characters in an effective way I've created this simple to use API:
http://pastebin.com/TFFJwxvp
It contains two classes, the character class and the canvas class.
Character Class (Please note that this class isn't really ment to be used outside of the API):
textColor :: color :: The foreground color
backgroundColor :: color :: The background color
pixelMode :: bool :: true if the character is made out of seperate pixels
pixel :: bool[2][3] :: a two dimensionay array, each element represents a pixel. A character consist out of 2 by 3 pixels
character :: char :: the actual character
invert :: bool :: wether or not the text- and backgroundcolor are switched around (required for some pixel combinations)
create() :: returns a new character object
update() :: sets the "character" and "invert" member based on the values in the "pixel" member array
draw() :: writes the character (or pixels) with the right text and background color
Canvas Class:
x :: number :: x position of the canvas on the terminal
y :: number :: y position of the canvas on the terminal
character :: Character[<canvasWidth>][<canvasHeight>] :: an two-dimensional array containing all the characters
create() :: returns a new canvas object.
setSize() :: set the size of the canvas. Clears all the characters.
setPixel(number x, number y, bool value) :: set a pixel within the canvas. Please note that these positions are in pixels and not in character row/columns. For example, to set the right most pixel the X would have to be twice the canvas width. The lowest pixel would be three times the canvas height (each pixel consist out of 2x3 pixels).
setCharacter(number x, number y, char char) :: set a character on the canvas.
draw() :: draws the canvas to the screen.
Example:
local canvas = Canvas.create() for i=1,20 do canvas:setPixel(i, i, true) canvas:setPixel(28 - i, i + 4, true) canvas:setPixel(26 - i, i + 2, true) canvas:setPixel(8, i + 8, true) canvas:setPixel(i + 8, 28, true) end canvas:draw() term.setCursorPos(1, 18)which would draw:
And that's it, hope you like it :-)
-Oli414
#240285 [CC 1.76] Easy Drawing Characters
Posted by oli414 on 12 December 2015 - 07:34 PM in APIs and Utilities
#240266 [CC 1.76] Easy Drawing Characters
Posted by oli414 on 12 December 2015 - 04:50 PM in APIs and Utilities
function getDrawingCharacter(topLeft, topRight, left, right, bottomLeft, bottomRight) local data = 128 if not bottomRight then data = data + (topLeft and 1 or 0) data = data + (topRight and 2 or 0) data = data + (left and 4 or 0) data = data + (right and 8 or 0) data = data + (bottomLeft and 16 or 0) else data = data + (topLeft and 0 or 1) data = data + (topRight and 0 or 2) data = data + (left and 0 or 4) data = data + (right and 0 or 8) data = data + (bottomLeft and 0 or 16) end return {char = string.char(data), inverted = bottomRight} end
Using this function you can specify which pixel you want to be on. As described before there are 6 pixels per character. Because of this the function has 6 boolean parameters to specify which pixel you want to be on. The function returns two values, the "char" and a boolean "inverted".
The char is the character you'd need to draw to get the pixels you want, however. It is possible that you'll have to switch the background and text color because there isn't a character for every possible combination. If this is the case "inverted" will be true.
Here's a little example:
pixels = getDrawingCharacter(true, true, true, false, true, true) if not pixels.inverted then term.setBackgroundColor(16384) term.setTextColor(1) else term.setBackgroundColor(1) term.setTextColor(16384) end term.write(pixels.char)
The function could probably be improved, please let me know if you have a better method.
Feel free to use this function wherever you want :-)
-Oli414
#240260 ComputerCraft 1.76 Beta Information (Minecraft 1.8) (Updated December 24th)
Posted by oli414 on 12 December 2015 - 02:55 PM in Beta Testing
Edit:
Looks like I've managed to figure it out. Using string.char(<number>) you can turn numbers into characters.
#222306 CommunityCraft CC 1.73
Posted by oli414 on 20 June 2015 - 06:28 PM in Servers
EDIT:
Server got back online but crashed instantly after I tried to use the elevator blocks again
EDIT:
Looks like I'm now crashing the server everytime I join it :-/
#222285 Function to write string in enclosed space
Posted by oli414 on 20 June 2015 - 04:45 PM in APIs and Utilities
I was messing around with Computercraft and needed a function to write a string in a box but wanted to make sure that the text wouldn't go outside of this box,
So I created this simple function that will automatically add enters to prevent it from going outside of it's predetermined area.
Thought that it wouldn't hurt sharing.
Let's say that you've got a string: "The quick brown fox jumpes over the lazy dog named SUPERAMAZINGUBERDOG!"
and want it to be in a 10 characters wide space, than it'll write:
The quick brown fox jumpes over the lazy dog named SUPE RAMAZINGUB ERDOG!
function writeEnclosed(x, y, text, width) term.setCursorPos(x, y) local linePos = 0 local line = 0 for word in text:gmatch("%w+") do if word:len() <= width - linePos then term.setCursorPos(x + linePos, y + line) term.write(word) linePos = linePos + word:len() elseif word:len() > width then local seperated = {} for i = 1, word:len() do term.setCursorPos(x + linePos, y + line) term.write(word:sub(i, i)) linePos = linePos + 1 if linePos >= width then line = line + 1 linePos = 0 end end else linePos = 0 line = line + 1 term.setCursorPos(x + linePos, y + line) term.write(word) linePos = linePos + word:len() end if linePos < width then term.write(" ") linePos = linePos + 1 end end end
Feel free to use this if you ever need this function
-Oli414
#211135 Adventure Game [Pocket]
Posted by oli414 on 27 March 2015 - 10:30 AM in Media
This was kinda unexpecting :-P That's the reason I don't often share my projects, now I gotta finish it....
In case this projects stays abandoned, here's all you need to try this out (or expand it):
The actual code, this is what you launch,
http://pastebin.com/LJmAwqmY
Than there are three folders in the same directory as the script above:
areas
objects
tiles
To create an area you'll have to add a folder to the areas folder with the name of what you'd like to call that area,
inside of this folder you'll put all the screens that are in this area. The name of this folder is shown when you enter this area. Every screen has the size of a pocket computer and uses this format, the name of this file doesn't really matter:
number (X coordinate of where this screen is) number (Y coordinate of where this screen is) number (Z coordinate of where this screen is (Functionallity NYI, use 1 as Z coordinate)) tile-numbers (520 numbers seperated by a space, the number corresponds to the tile ID) object-numbers (520 numbers seperated by a space, the number corresponds to the object ID)Example: http://pastebin.com/ED8qq9mm
Than in the objects folder there are files for every object in the game, objects have this format:
number (ID of this object, this number needs to be unique, there can't be another object with the same ID) character (The character drawn on the screen) color (The background color drawn on the screen) color (The character color drawn on the screen) number (ID of the object the player needs to break this object, if always breakable use 0) number (ID of the object this object gives to the player when the player breaks it, 0 for nothing) number (Amount it gives the player) number number number... (Crafting recipe for this object, all the required object IDs seperated by a space, 0 if this object can't be crafted)Example: http://pastebin.com/i16uJVHb
And than there are tiles, which use this format:
number (Tile ID unique ID to identify all the tiles) character (character drawn to the screen) color (background color drawn to the screen) color (character color drawn to the screen) type (1 for solid, 0 if the player can walk on it)Example http://pastebin.com/6p7mEgKC
And here is the full project including all the areas, objects and tiles I made:
http://oli414.com/do...nture_game.html
If there're any questions please feel free to ask them!
#210015 Adventure Game [Pocket]
Posted by oli414 on 17 March 2015 - 10:26 PM in Media
Nah, I rarely work on projects again after I've abanonded them. Ideas most of the time aren't as awesome as you thought they were when you start a project, however, I'd pay millions of euros if there was a medicine that made you finish all your projects.
Back on topic,
the chance that I'll finish this project is very small, I might release the code if people are interested in seeing it, but don't expect anything special
#209396 [MC 1.7.10][CC 1.75] Peripherals++ v1.3.6, MiscPeripherals reimagined! In...
Posted by oli414 on 13 March 2015 - 10:15 AM in Peripherals and Turtle Upgrades
#209345 Adventure Game [Pocket]
Posted by oli414 on 12 March 2015 - 10:05 PM in Media
Today and yesterday I spent time in making my workspace more efficient. I've setup a webserver to store scripts, the webserver works in combination with a lua program I've written, which I've put into the rom so I can access all my lua programs from any Computercraft computer.
The program has 3 functions, upload, download and edit:
bbox upload <file to upload> <filename on server> bbox download <filename on server> <location to download to> bbox edit <filename on server>The last one is a wrapper around the standard edit program, it downloads the file I'd like to edit from my webserver and stores it into a temp folder, that it just runs the edit program and when you exit the edit program it'll upload the file and remove the temp folder. Pretty simple, but it's usefull as classes! < See what I did there?
#209253 [MC 1.7.10][CC 1.75] Peripherals++ v1.3.6, MiscPeripherals reimagined! In...
Posted by oli414 on 12 March 2015 - 10:56 AM in Peripherals and Turtle Upgrades
I've tried multiple versions of Peripherals++ (1.2.3, 1.2.4 and 1.3) all with the same result. I noticed that someone else had a similair, if not the same problem. I'm not sure if it is meant to be fixed already, that's why I'm reporting it just in case.
I'm using Minercaft 1.7.10, CC 1.7
I love the possibilities with this mod, can't wait to make a GlaDOS like program, keep up the good work :-D
#209009 Adventure Game [Pocket]
Posted by oli414 on 10 March 2015 - 08:15 PM in Media
I haven't been able to work on it today, I was trying to make a compression algorithm, but it I haven't been able to finish it because it takes over 2 hours to compress a 500 line program... oh well, might retry someday.
#208832 Adventure Game [Pocket]
Posted by oli414 on 09 March 2015 - 09:36 PM in Media
I'm not planning on making it work with regular computers, the reason I'm creating this is because Computercraft is a great way to simulate real life networks and test around with it without the need of multiple real life devices (Like smartphones), I also just wanted to focus on the game idea I had instead of having to set up a lot of stuff that doesn't have anything to do with my game. I'll be making this game for mobile devices if it turns out to be fun. The network simulation is very important for this games development, I can't tell right now for what it'll be used unfortunately. The reason I've choosen for pocket computers is because they are like mobile devices, the platform I'll be making this game for if it turns out to be fun.
The game is Zelda inspired because you'll be exploring areas and then entering a dungeon with puzzles and (maybe) a bit of combat. The way these areas work is kinda similair to how it works in The Legend of Zelda (Get to the new area > explore area > find dungeon entrance > find out how to get to the dungeon entrance and what you'll be needing to get there > enter the dungeon > solve puzzles / combat > get item to progress through dungeon > solve more puzzles / combat > get to the end of the dungeon and get the item you needed).
The pokémon part is (I honestly don't know a lot about Pokémon, I'm just assuming...) collecting all the objects, which will probably be the main goal of this game, gotta get them all :-P You would get a better understanding of how this'll be fun and why it is kinda inspired by Pokémon if I were to explain the feature that I'm not going to talk about... I'm really sorry :-P, I think this game might actually be something that people will actually play on there mobile devices and I want to prevent someone else from stealing my idea and publishing it before I can.
So about battles, enemies will probably just be like the whole game. An object, probably with a special marker. Enemies will do one step in a (random / strategically choosen direction) everytime the player moves. The reason for this is that the player doesn't have to pay intense attention to the game, which never works for mobile games because people are playing them while they're on the move.
I haven't completely figured out yet how combat will work but enemies will probably work just like other objects, for example you would need a sword object to get rid of an enemy by walking on top of it, everytime you get kill an enemy it'll cost you one sword. So you'll have to be prepared. I'll probably add something that if you don't have a weapon and you try to kill an enemy that you'll "die", but I'm not sure if "dying" will add anything to the gameplay.
So in theory the battles will be turn based, but you won't get a screen pop up with a lot of attack and defend options or anything like that. I'll just be using the good ol' objects for this system aswell.
I hope this will help you understand it a little bit better. English isn't my first language as you might have noticed but I really hope it's understandable.
#208814 Adventure Game [Pocket]
Posted by oli414 on 09 March 2015 - 07:16 PM in Media
I've used Computercraft for a few years now but never really posted any of my creations on the forums. Most of the time I don't complete my projects because I lose interest in them and don't want to dissappoint people by making a topic and not finishing my projects.
But I recently started working on game I had in mind for quite some time, and I'm pretty sure I will finish this project...
I'm creating an Adventure Game inspired by games like Pokémon and The Legend of Zelda.
The user controls the player (the &) using W A S D.
In the game there are certain objects which can be picked up by walking on top of it, but only if you have the required object to pick it up, otherwise you won't be able to walk through it. When you do have the required object the object you're picking up wil be added to your inventory and it'll remove one of the required item to pick it up. For example, a chest takes a key, the player needs to have atleast one key to walk onto the chest, if the player has this key he'll be able to walk onto the chest and 1 gold will be added to the player's inventory and the chest will be removes from the screen.
The player can open his inventory and it'll show a list of all the objects the player has with the amount in front of it. The player can select certain objects using enter, if the player presses enter and the selected objects form a crafting recipe, the recipe objects will be removed from your inventory and you'll be given the crafted object.
Each object has 8 properties:
Object ID (Unique ID)
The graphics (one character and two numbers)
ID of the required object to break this one (0 if nothing is required)
ID of the object the player gets when he picks it up (0 if the player gets nothing)
Amount of the objects the player gets when he picks it up
Crafting recipe to create this object (List of object ID's, 0 if it's not craftable)
These objects can be used for all sort of things, I could make an Stone object which would require a pickaxe to break and the pickaxe can be crafted using wood and a rock,
but I could also use it for a door, the door requires a key to break and the door gives the player nothing when it breaks, neither is it craftable.
The world also consist of different files, it contains the X and Y of the screen, tiles and objects.
And that's basically all the technical parts to this game, the technical part of this game is supprisingly simple, but that's not what makes this game fun to play.
I've finished all the technical parts and now I've to create objects and screens that make this game fun to play.
This will be the gameplay of this game:
The player enters a new area, the player will explore the area and find out what unique objects there are in that area. It'll also find a spot where the player won't be able to continue because a certain item is needed. The player will have gather objects needed to craft a special object which is then needed to continue in this area, this special objects could be something like a tool (pickaxe, shovel) but also something like a boat, a grappling hook or just a sword.
Eventually the player will find the dungeon of that certain area, in the dungeon the player will have to find keys to continue, maybe solve puzzels using the tool it created before or maybe fight some monster objects using a sword object. Once the player finished the dungeon he'll get a special object which is needed to continue to the next area.
And that's all you need to make a game, a player, a map, objects, and creativity.
The script is only 475 lines long and it won't get any bigger, however the assets is what this game is all about.
I'll keep you up-to-date about progress I make on this project, there's one feature (which is the main reason why I'm creating this game) that I haven't implemented yet, I won't tell you what it is because I might use this game concept for an actual game if it turns out to be fun.
If you've got any questions please feel free to ask!
More screenshots:
The inventory screen (The white objects are selected for crafting, the grey object is what the cursor)
When you enter a new area you'll get to see the name of that area for a few seconds
- ComputerCraft | Programmable Computers for Minecraft
- → oli414's Content