Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

pedrosgali

Members
  • Content Count

    42
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by pedrosgali

  1. Updated OP with latest download, AI traders are behaving for now but I would appreciate any bugs spotted to be reported here.

    Fixed the menu bug, now the menu takes over the whole screen and resume must be pressed to continue.

    Also Fixed the framerate issues.

     

    I have messaged Vexatos to set up a repo on Open Programs, as soon as I am able I will move this to there as well.

     

    :)

  2. Hey man, thanks for the bug report.

     

    Yeah, "key_down" event handlers are a bit weird at the minute. I was using the "press any key to accelerate time" method of testing. :P

     

    Not sure what is happening with the menu button yet but it'll be fixed by the next release.

     

    On a side note, got my first AI trader (sorta) working today. :D

  3. This is 100% running in OC, I wouldn't post anything here that wasn't.

    Someone posted a while ago that they were looking for some game libraries on OC and I'd never written one before so I started typing one out.

    This program is the main reason I wrote Paint Plus... To load and edit assets easier.

    I will be putting the library I wrote on the forums soon but I wanted to test it first.

     

    Sorry about the confusion but is there any chance this can get moved back?

  4. Space Trader

    Open Alpha

     

    An Open Universe sandbox trader.

     

    Explore and trade forever.

     

    Current Features Include:

     

    Completely randomly generated universe.

    Fully functional trading system.

    Micro economy that determines local prices.

    Functioning AI traders out to steal all your best buys! [New]

     

    Planned Features Include:

     

    Equipment. (Shields, Armour, AI Upgrades etc.)

    Shipyards/Armouries (Buy and Equip ships)

    Combat!

    Weapons. (^For the combat. ^)

    Faction rating (Your actions will have consequences...)

    More Factions (More consequences.)

    Better controls for multiple ships

     

    Download:

     

    SpaceGame0.1.1.zip

     

    Copy the folder to your drive, navigate to it and launch "space".

     

    I'd very much like to hear your views / suggestions on it and of course any bug reports :)

  5. Updated to add Layering and animations

     

     

    A note on animations:

     

    After a bit of testing I have found that animations that run smoothly are a balancing act between image size and the overall complexity of the image.

    Full screen is completely out of the picture, I designed these animations to be played in "windows" as a game dev tool. (Watch this space.)

    The largest I have tried so far is 30 x 15 and managed about 4 fps.

    I am working on a new render method at the minute which is faster but a bit buggy so I've posted the stable but slower version. 

     

    The next update will have a render compiler and a stand alone player as I have noticed that these animations can get quite big.

    That 30 x 15 with 21 layers came in at 313.5K!

  6. You don't really need to count the height, you can do

    function fellTree()
        robot.swing()
        robot.forward()
        while robot.detectUp() do
            robot.swingUp()
            robot.up()
        end
        while not robot.detectDown() do
            robot.down()
        end
    end

    This way you never need to count the height, it'll just stop at the top and come back down.

  7. Hey all.

     

    First off, I am thoroughly loving this mod.

     

    I would very much like access to better tier graphics cards, I know however that this has been (repeatedly) requested so I'll ask for this instead.

     

    I noticed while writing my paint program that I can use gpu.get(x, y) to call the specific character set at position x, y so I'm assuming that there is a table somewhere with all the current screen data written to it.

     

    Would it be at all possible to store the current back/foreground colours in with this data?

     

    I can use gpu.getBackground()/gpu.setForeground() but that only returns the current colour not the colour of a specific pixel.

     

    I honestly think that with that small change I could halve my image refresh rate and make more complex animations by only drawing pixels that need drawing, all without the need for shiny new hardware.

     

    I hope you find this suggestion useful. =)

  8. **UPDATED**

    ++Now With Image Lib!!++

     

    DrawPlus - http://pastebin.com/3CKz7MDy

     

    Image library - http://pastebin.com/yxCUs4hw

     

    Call this program with a filename, a width and a height eg: paintPlus myMasterpiece 100 50.

    You can leave the numbers out if you are calling a previously saved picture eg: paintPlus myMasterpiece

     

    The image library goes in your /lib folder and is used just like this:

    local img = require "imglib" --or whatever you called it..
    
    local data = img.load("/Images/yourImage")
    img.draw(data, x, y) --x and y being where you want it.
    

    All images loaded by the image lib will be compressed to save your precious RAM. I got it down to about a third of the size of the image! :)

     

    "Lets paint a happy little tree here" - Bob Ross.

     

    2014_07_14_21_56_32.png

     

    Features:

     

    Menu:

    This is a menu to navigate the features. right click anywhere to toggle visibility of the menu.

     

    Palette:

    Supports up to 99 palettes of 9 colours (more slots than there are colours by far.)

    use the screen buttons < > to navigate the active palettes or use "New" to add a palette to the end of the list

    right click on a colour in the palette to bring up the RGB chooser.

     

    RGB cooser:

    3 sets of buttons to control the RGB. click "Ok" to apply or "Exit" to cancel.

     

    Save:

    Does what you think it does.

     

    Load:

    Brings up the file browser to select a different masterpiece.

     

    Tools:

    Gives 4 basic tool types,

     

    Brush.

    Edit brush size x and y

     

    Line.

    Click once to set start point then again to set end point.

     

    Box.

    Click once to set start point then again to set end point.

     

    Circle.

    edit radius and choose filled or hollow.

     

    Layers:

    Brings up the layer menu.  Use "New Layer" to add a new layer to the image. All pixels in the new layer will be set to transparent initially.

    Click on a layer number to change the active layer and press the red "H" to show a layer or the green "V" to hide a layer.

    Each page only shows up to 10 layers so use "<" and ">" to switch pages.

    if you make a mistake on a layer then press "Trans" to toggle transparency as the active colour.

     

    Animate:

    Hit "Play" to go through each cell layer by layer.

    Hit "Loop" to have it loop.  Click on the screen again to stop playback.

  9. MOD NOTE: The information in this thread is for OC 1.2 which is now unsupported.

     

    Okay, I don't know if anyone else has found this or if I'm just a being a noob but I had real trouble loading an API that I wrote for my networking program.

    After a bit of head scratching I found a solution that worked and thought I'd post it here to hopefully save someone else that time.

     

    I traditionally store APIs in a folder of the same name, and when calling them I found 2 things that you should know.

     

    1)  The API should always be suffixed with .lua in the filesystem so my path would read:  c/API/myAPI.lua

    2)  When you call the API you should drop that suffix eg:  

     myAPI = require("c/API/myAPI")

    As I said, I may be just a noob but that is the one major problem I have run into so far.

     

    I hope this saves someone some time.

  10. This is a file/dns server program I wrote.

     

    just run it to start hosting a dns server, launch it with an additional argument to show the debug.

     

    DNS/File server:

    http://pastebin.com/pxFY89UZ

     

    The next file is the networking API I wrote to deal with server communications, it has 6 functions;

     

    register(name, port):

    This will register the machine with a name on the dns server, all further communications can be sent to the server and will be routed automatically.

     

    send(receiverName, message, opt1, opt2):

    This will send a message to the server which will then route it to receiverName.

     

    getRepoList(): returns table

    This will get a list of all files saved to the server in the REPO folder, returns a table.

     

    pull(destinationName, filename):

    Pulls a file from the server. destinationName is the target computer so you can pull from any machine to any other on the network.

     

    push(filepath, filename, version, installDir)

    Pushes a file to the server, here's what happens. The server will make a new folder in REPO eg  "c/REPO/filename"

    inside that folder it will create a file labelled latest.txt, this file stores the version number and installDir so the pull function knows where things need to be installed and which version to send. (I did this so I can put in dependencies later... or you can.)

    the file itself is saved as the version number.

     

    listen(targetMsg): returns up to 3 messages

    Listens on the network until it hears a message. targetMsg is optional, if blank then the first modem message will be returned.

    call example: msg, opt1, opt2 = listen()

    will return three variables. as targetMsg is blank it will return on the first modem message it hears.

     

    net API:

    http://pastebin.com/1JMKXGEp

     

    Here's a program that uses the API to easily push and pull files from the server. It takes up to 4 arguments. I call it repo.

    so calling:

     

    "repo list"                                                                will display a list of all files stored on the server.

    "repo pull filename"                                               will pull filename from the server to this computer.

    "repo push filename filepath version installDir"  will push a local file to the server and update the latest.txt with the new version and installDir.

     

    Repo program:

    http://pastebin.com/cgjUBeT3

     

  11. It will only play from within the program at the minute, if you save a song then you reload it by launching it again.

    It checks the songs folder for the existence of the filename you passed it, if it is there the program will load it.

    If not then you get a new score.

    I didn't really think a stand alone player was needed but if you really want one then I suppose I could put one together.

     

    Oh, and glad you like it. =)

  12. This is a little program I wrote yesterday for making music a little easier. You'll need to have open components and a note block and adapter set up.

     

    Its a step sequencer, pass it a filename, and 2 numbers.  Beats per bar and the number of intervals you want per beat.

     

    pastebin: http://pastebin.com/c4vyk2AD

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.