Jump to content




CraftOS 2.0 - Dan's Secret Project

computer help

  • You cannot reply to this topic
798 replies to this topic

#345 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 13 October 2015 - 03:28 PM

The second way is actually better in my opinion.

Also, will we have the same fs api?

#346 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 13 October 2015 - 03:36 PM

There's 'lua.unserialize()' now, probably instead of textutils API. Also, there's a 'device' API which works similarly to the peripheral API, but instead you get more of the hardware stuff, like:

local gpu = device.get("gpu")
local keyboard = device.get("keyboard")
local speaker = device.get("speaker")

gpu has different functions for maps and images and it can (or must) draw to an image:

gpu.setTarget(window.getImage())

Looks like the 'window' API has replaced the 'term' API.

local screenWidth, screenHeight = window.getSize()

window.setFullscreen(true/false) --# (?) hides/shows the top bar (multishell tabs)

Speaker (unconfirmed documentation):
speaker.play(parameters : table, channel : number)

parameters = {
  volume : number;
  attack : number;
  sustain : number;
  decay : number;
  frequency : number;
  frequencySlide : number;
  frequencyAccel/frequencyAcceleration : number;
  vibratoDepth : number;
  vibratoFrequency : number;
}

The speaker probably has different set of channels and you can only play one sound on one channel at a time, but this is only speculation.

More info might be coming later..

View PostCreator, on 13 October 2015 - 03:28 PM, said:

Also, will we have the same fs api?

Probably, but it will use the more Lua OOP standard way:

CraftOS 2.0:
file:close()

CraftOS 1.x:
file.close()


#347 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 13 October 2015 - 03:52 PM

Then there's color mapping, which might be the "pallet" thing Dan was showing us before. You can do:

gpu.setColorMapping(colors.white, colors.blue)

And it will probably (?) make so that when you write the color white it will be displayed as blue. Also, you can reset the color right after you draw the changes:

gpu.resetColorMapping(colors.white)

There's also text writing capabilities:

gpu.drawText(x : number, y : number, text : string)

...

gpu.drawText(0, 0, "Hello World!")

--# writes 'Hello World!' on the top-left corner of the screen.

You can also set a global image offset:

gpu.setOffset(offsetX : number, offsetY : number)

which will simply "move" the resulting image by as much as you specify. Default is x=0 and y=0, which is "no offset".

#348 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 13 October 2015 - 04:02 PM

If Dan doesn't create a new forums for it elsewhere (which is possible, of course), I'd imagine a separate category would be used (like the category for the site discussion sections at the bottom), as the new game would benefit from having its own bugs, suggestions, and program sections. This is speculation, I haven't heard anything more than you guys have.

#349 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 13 October 2015 - 09:09 PM

View PostMKlegoman357, on 13 October 2015 - 03:52 PM, said:

-snip-
Did you see what the pixel drawing functions, as in those to draw induvidual pixels over text, were?

#350 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 14 October 2015 - 01:31 AM

View PostMKlegoman357, on 13 October 2015 - 03:36 PM, said:

View PostCreator, on 13 October 2015 - 03:28 PM, said:

Also, will we have the same fs api?

Probably, but it will use the more Lua OOP standard way:

CraftOS 2.0:
file:close()

CraftOS 1.x:
file.close()

Not sure I can see the point of having fs.open()'s handles work like that, given that they'd then be the same as io.open()'s handles.

View PostMKlegoman357, on 13 October 2015 - 03:52 PM, said:

Then there's color mapping, which might be the "pallet" thing Dan was showing us before. You can do:

gpu.setColorMapping(colors.white, colors.blue)

And it will probably (?) make so that when you write the color white it will be displayed as blue. Also, you can reset the color right after you draw the changes:

gpu.resetColorMapping(colors.white)

Assuming it is related to Dan's palette-altering video, you probably wouldn't want to reset "right after": doing so would revert pixels already on-screen, removing the point of remapping in the first place.

(If you don't get what I mean, watch the lower left corner of the video while he tweaks the sliders.)

#351 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 14 October 2015 - 04:38 AM

View PostBomb Bloke, on 14 October 2015 - 01:31 AM, said:

Assuming it is related to Dan's palette-altering video, you probably wouldn't want to reset "right after": doing so would revert pixels already on-screen, removing the point of remapping in the first place.

(If you don't get what I mean, watch the lower left corner of the video while he tweaks the sliders.)

That's the interestig part. The functions I showed were called almost at the same time. The colors were remapped, text was drawn and the colors were reset right after.

#352 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 14 October 2015 - 04:50 AM

I wonder if he's using it like we use term.setTextColour() now?

#353 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 14 October 2015 - 05:43 AM

hmm... pixels are 8x8 (pretty sure), and we need to get prepared.
let's center something.
txt = "Hello World!"
w,h = window.getSize() --or term?
window.setCursorPos((w/2)-((#txt*8)/2))
write(txt)
shouldn't be that hard...

#354 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 14 October 2015 - 09:53 AM

speaking of text, i noticed this.
https://twitter.com/...071645708120065

@DanTwoHundread, on 14 October 2015 - 09:49 AM, said:

Tips for writing Unicode-aware Lua code: Lua does not have a string type, it has an "array of bytes" type called "string".
unicode fonts confirmed.

#355 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 14 October 2015 - 10:52 AM

View PostWait_, on 14 October 2015 - 09:53 AM, said:

speaking of text, i noticed this.
https://twitter.com/...071645708120065

@DanTwoHundread, on 14 October 2015 - 09:49 AM, said:

Tips for writing Unicode-aware Lua code: Lua does not have a string type, it has an "array of bytes" type called "string".
unicode fonts confirmed.

Finally I can write texts in Bulgarian. That will be so useful with the large Bulgarian audience on the forums.

#356 LeDark Lua

  • Members
  • 369 posts
  • LocationLeLua

Posted 14 October 2015 - 12:30 PM

View PostWait_, on 14 October 2015 - 05:43 AM, said:

hmm... pixels are 8x8 (pretty sure), and we need to get prepared.
let's center something.
txt = "Hello World!"
w,h = window.getSize() --or term?
window.setCursorPos((w/2)-((#txt*8)/2))
write(txt)
shouldn't be that hard...
*ehm* Wait_, if Dan added like: font.getWidth() or graphics.getFontWidth() or someting then there could be font scaling.

EDIT: and we could get the size of the font easily.

Edited by LeDark Lua, 14 October 2015 - 12:49 PM.


#357 CraftedCart

  • Members
  • 67 posts
  • LocationUnited Kingdom, Earth

Posted 14 October 2015 - 07:18 PM

Hex Editors?
https://twitter.com/...370715660099588

Posted Image

Also zoom buttons (or tab management) in the top right?

So what would hex editors be used for?

Edited by CraftedCart, 14 October 2015 - 07:19 PM.


#358 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 14 October 2015 - 07:19 PM

View PostCraftedCart, on 14 October 2015 - 07:18 PM, said:

Hex Editors?
https://twitter.com/...370715660099588

Posted Image

Also zoom buttons in the top right?

So what would hex editors be used for?

Hopefully this also means that the binary bug has been fixed.

#359 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 14 October 2015 - 07:29 PM

Here's what it says in the hex editor:

image format=1 width=13 height=12
      2      
      2      
    22222    
   2ff2ff2   
  2fffffff2  
2 2ff0f0ff2 2
2222fffff2222
2222222222222
2 21ff7ff12 2
  22ff7ff22  
 2 2ff7ff2 2 
    22222    


EDIT: here's what it produces with paintutils in CC 1.74:

Posted Image

Edited by MKlegoman357, 14 October 2015 - 07:34 PM.


#360 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 14 October 2015 - 08:42 PM

Not as good, although very understandable news:

"Ok, focus for the time being is back to @redirectiongame. Finances are such that I can't have two projects in development limbo at a time!"

#361 CaosTECH

  • Members
  • 131 posts
  • LocationIn your closet

Posted 14 October 2015 - 08:49 PM

Whats that supposed to be? From the code it looked like a spaceship, but now it just looks plain creepy

View Postoeed, on 14 October 2015 - 08:42 PM, said:

Not as good, although very understandable news:

"Ok, focus for the time being is back to @redirectiongame. Finances are such that I can't have two projects in development limbo at a time!"

I have been waiting to ask this question... why does redirection cost money? If we can play it for free on CC?

Edited by ArchTyler, 14 October 2015 - 08:54 PM.


#362 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 14 October 2015 - 08:56 PM

CraftOS 1.x has a back-to-front palette.. flip the colours and it should be more recognisable :)

View PostArchTyler, on 14 October 2015 - 08:49 PM, said:

I have been waiting to ask this question... why does redirection cost money? If we can play it for free on CC?

Because I have the right to earn a living? The CC version is more like a promotional demo.

#363 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 14 October 2015 - 10:18 PM

Heh, I'd had a hunch something was a bit fishy about that image:

Posted Image

I'm looking forward to Redirection, too. :)

Edited by Bomb Bloke, 10 February 2016 - 11:25 PM.


#364 apemanzilla

  • Members
  • 1,421 posts

Posted 14 October 2015 - 10:29 PM

View PostBomb Bloke, on 14 October 2015 - 10:18 PM, said:

Heh, I'd had a hunch something was a bit fishy about that image:

Posted Image

I'm looking forward to Redirection, too. :)

Ahh, so that's what it is! I had inverted the colors but hadn't recognized it :P





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users