Jump to content


martin509's Content

There have been 41 items by martin509 (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#158616 Drawing Monochrome Graphics.

Posted by martin509 on 30 December 2013 - 10:18 PM in Ask a Pro

After a very long hiatus, I have decided to return to toying around with ComputerCraft programs. I want to modify the game 'tunnel' to use filled in white pixels on a normal (non-colour) computer. I know that it's possible (the stock worm program does it), but I can't figure out how to get paintutils to do it.
Sorry if this is a painfully stupid question.



#102291 Sending Tables?

Posted by martin509 on 27 March 2013 - 01:19 AM in Ask a Pro

Thanks, I'll try that out.



#102177 Hurdles - Arcade Edition

Posted by martin509 on 26 March 2013 - 03:00 PM in Programs

Just to clarify, Noodle made the original, I just tweaked it slightly and expanded on it a bit more.
So I did not make the original, I'm far from skilled enough to make this on my own.



#102077 Sending Tables?

Posted by martin509 on 26 March 2013 - 09:58 AM in Ask a Pro

I'm trying to send a table over rednet then have a variable changed to one of the table's values.
Here's my code:
--Sender Code
local rednetoutputs = { up = 0, down = 0, diffselected}
rednet.open("bottom")
--unrelated code
diff = io.read()
if diff == "5" then gDiff = 500
rednetoutputs.diffselected = "5"
rednet.send(26, textutils.serialize(rednetoutputs))
end
--Receiver Code
rednet.open("bottom")
os.pullEvent("rednet_message")
local id1, difftable, dist1 = rednet.receive()
textutils.unserialize(difftable)
diff = rednetoutputs[diffselected]
if diff == "5" then gDiff = 500
I'm working off of Casper's Pong as a code base.



#102046 Connect Four

Posted by martin509 on 26 March 2013 - 08:21 AM in Programs

One question: Why use channels? It's two-player, so it's not like you need them. I run a tekkit server with my friends and really want to play this game, but tekkit has to be a light-year behind and use CC 1.3 or so.



#101622 Post code tricks here!

Posted by martin509 on 25 March 2013 - 11:35 AM in General

Lua is not the most flexible of languages when it comes to low-level stuff. So, CC coders, how about you tell the world about how you optimize your programs to run cleanly and efficiently?
I'll start:
I made an arcade conversion of Hurdles, and in order for it to restart, when the game exited its final line was os.reboot().
Then, I made a startup program to run hurdles again on the monitor. I thus worked around having the program directly use the monitor in its code, and saved a ton of hassles.
So anyway post your Lua tricks here!



#101620 Hurdles - Arcade Edition

Posted by martin509 on 25 March 2013 - 11:28 AM in Programs

I coded this in Tekkit unfortunately and I am not exactly in love with touch support. I doubt many people have a touchscreen.
I want to continue Tekkit coding so if you want touch support code it yourself, I can't imagine it being too hard.



#101227 Minemail

Posted by martin509 on 24 March 2013 - 02:12 PM in Programs

This guy seems to have a lot of ambition but is not the best coder.
No offense rhysjack7, but making an OS is a little over your head. Try modding code first, such as graphical replacement or bolting new functionality onto existing programs. Games especially, since they are easy to work with and generally don't have any small nuanced bugs that totally break your Turtle Army Coordination Empire Mining Company - Diamond Edition.
Still, I'm not really an advanced coder and can't really offer any help more than that.



#101225 Nova IRC

Posted by martin509 on 24 March 2013 - 02:06 PM in Programs

Looking at the code it seems to be pretty nice.
Still, have a description. Plenty of people don't know what IRC is.



#101224 Hurdles - Arcade Edition

Posted by martin509 on 24 March 2013 - 02:03 PM in Programs

Done.



#100704 Hurdles - Arcade Edition

Posted by martin509 on 23 March 2013 - 03:26 PM in Programs

Remember that old game Hurdles, about jumping over hurdles?
It was very simple and not too impressive, with a player jumping over an endless number of hurdles while out on a run. It is controlled with one button, nothing fancy.
I decided to make an 'arcade' version, modding its code so it would run on a monitor(I used 4x3) , be controlled with buttons, and restart at a title screen when you die.
Redstone input from the button is on the left, monitor is on top.
Main Game:
http://pastebin.com/7RTQYgB4
Single-line startup program, also needed:
shell.run("monitor", "top", "hurdles")
Screenies!
Spoiler
This being my first program, some feedback would be nice.
Especially as I've got some more games lying around, among them Pong (Jasper version) and Tunnel.



#100668 "Too long without Yielding"

Posted by martin509 on 23 March 2013 - 02:11 PM in Ask a Pro

wait, where can I put that in?
I know about os.pullEvent, but where does that fit in my loop?
Edit: Oh, nevermind.



#100661 "Too long without Yielding"

Posted by martin509 on 23 March 2013 - 01:45 PM in Ask a Pro

Hello, I am converting the old game "Hurdles" into an arcade cabinet. I have gotten down the following parts:
Button-press jumping
restart on monitor via separate one-line startup program that starts monitor with hurdles
"while true do" loop before game starts that waits for redstone input with a "Press Button" notification on screen in order to start game.
All this works well, except the loop. Instead of running indefinitely, the OS terminates it because it went too long without "yielding"
What?
Can I have some help here? How can I make an indefinite "wait for input" sort of loop?
By the way, here is the loop itself.
while true do
term.setCursorPos(x/2,y/2)
write("Press Button")
if redstone.getInput("left") == true then
break
end
end
The error is
"Pressbios:83: Too long without yielding"
So, yeah.



#92810 bundleAPI making RedPower bundle cables EASY!

Posted by martin509 on 03 March 2013 - 03:08 AM in APIs and Utilities

I might be sounding ignorant here, but can't you set the output in the redstone API, instead of true or false, to a colour?
The colours api used to be for bundled cables specifically.



#92807 Arrow to the screen causes touch event

Posted by martin509 on 03 March 2013 - 02:57 AM in Suggestions

Why not punch to the screen?
Or even, gasp, a special touch glove or stylus to trigger touch events?
Nah. That would handicap players to one touch at a time.



#92801 [1.51]file protection

Posted by martin509 on 03 March 2013 - 02:40 AM in Suggestions

Well, outside of CC someone could set files to read-only.
That's more of an OS thing, though. I don't think this is feasible at all.
Also, about Java.
Java programs have to get compiled into Assembly and made into a exe for other users to edit them.
Unless they know assembly.
Java doesn't encrypt, it obfuscates.
Just wanted to let you know.



#92735 Cloud Computing?

Posted by martin509 on 02 March 2013 - 05:45 PM in Ask a Pro

View PostLyqyd, on 02 March 2013 - 05:34 PM, said:

All the computers run in coroutines. Only one computer is ever executing code at a time, so there is no benefit to having a different computer do the work. Passing the work off adds a bit of complexity and time, so you come out having spent more time to do the same amount of work.
Oh. Thanks for clearing that up!



#92732 Cloud Computing?

Posted by martin509 on 02 March 2013 - 05:20 PM in Ask a Pro

Could you explain?



#92727 Cloud Computing?

Posted by martin509 on 02 March 2013 - 04:45 PM in Ask a Pro

Title: Is cloud computing (multiple computers processing data for one program) possible in CC via rednet?



#92725 Ideas for programs

Posted by martin509 on 02 March 2013 - 04:38 PM in General

How about a spreadsheet?
Not too hard, I haven't really seen any.. Make it!



#92723 Game engines?

Posted by martin509 on 02 March 2013 - 04:27 PM in General

Pardon me, Computercraft Game Engines.
Game Maker is wonderful, though.
Wait.. Game Maker.. CC..
I just blew my own mind.



#92720 Wolf3d-style 3d engine (proof of concept)

Posted by martin509 on 02 March 2013 - 04:17 PM in Programs

I feel like another of the horde of Tekkit users saying this, but.. Can has standard PC version?
Also, maybe add some things like slash+dash lines on the outer edges of polygons, to give it texture.
Oh, and maybe take it a step further with walls of varying height.



#92718 Game engines?

Posted by martin509 on 02 March 2013 - 04:11 PM in General

Hello, I am looking to make games, but all this super-complex code is way over my head.
Still, I want a game engine. No. Lots of them.
Also, on the standard PC if you can.
Here is my petulant "I want games!" shopping list:
RPG engine
-fairly self explanatory
-top down, Zelda style
-multiple maps with doorways to each
-maps determined by external file(s)
-easy addition of melee and ranged weapons

Arkanoid Engine
-arkanoid was breakout with power ups, essentially
-map making
-powerup addition

Shooter Engine
Top-down shooter engine.
-maps, power-ups, yadda yadda.
-enemy types

So, why not make it?
If you can't make an engine, try to direct me to one if you know of it.
Thank you, I think we all need this sort of thing.



#92069 More text functions

Posted by martin509 on 28 February 2013 - 01:09 PM in Suggestions

I think there should be more options for text formatting. Underline, overline and bold would be really nice, wouldn't they?



#92067 Alternate background colour on standard computers

Posted by martin509 on 28 February 2013 - 01:02 PM in Suggestions

Why not add support for changing background and text colour between black and white for standard computers?
That would be a helpful little feature right?