Author Topic: What scripting languages? What tools?  (Read 3167 times)

Cactuar18 (OP)

  • *
  • Posts: 5
What scripting languages? What tools?
« on: March 06, 2014, 12:02:46 am »
Hi all, just received my very own GCW in the post and I'm itching to get something of my own working on it.
I'm very familiar with C# and Javascript, and have been told that learning Python can potentially help with working on this console.

So in what programs can I make stuff in?
And what tools can I use to plonk anything I make on the device?

Rather broad, I know, I just don't know where to start!

Lazarus404

  • *
  • Posts: 23
Re: What scripting languages? What tools?
« Reply #1 on: March 06, 2014, 10:25:30 am »
Currently, C or Python are needed.  However, I'm currently developing a runtime with a Lua backend, which I'm attempting to get working on the GCW.  If successful, this should make writing SDL based games super simple for scripters.  Not sure how fast it will be, though.

Lee

pcercuei

  • ***
  • Posts: 1432
    • My devblog
Re: What scripting languages? What tools?
« Reply #2 on: March 06, 2014, 11:21:58 am »
Next FW has lua-jit (dynarec-equipped LUA runtime) so it should be pretty fast.

Cactuar18 (OP)

  • *
  • Posts: 5
Re: What scripting languages? What tools?
« Reply #3 on: March 06, 2014, 07:00:52 pm »
Me again

I've recently started using Pygame and Open Package Creator, it transfers fine over FTP, but whenever I go to select the program on the GCW the system jumps back to the settings menu, as if it's reset.

I'm sure my code is fine as I've nicked it off another GCW Zero user who had no problems, and the line endings should be fine - is it the program's icon? Is there something I'm missing? I'm ripping my hair out over a HelloWorld!

Thraka

  • *
  • Posts: 51
Re: What scripting languages? What tools?
« Reply #4 on: March 06, 2014, 08:10:34 pm »
lua-jit! Awesome!

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: What scripting languages? What tools?
« Reply #5 on: March 06, 2014, 08:21:22 pm »
Me again

I've recently started using Pygame and Open Package Creator, it transfers fine over FTP, but whenever I go to select the program on the GCW the system jumps back to the settings menu, as if it's reset.

I'm sure my code is fine as I've nicked it off another GCW Zero user who had no problems, and the line endings should be fine - is it the program's icon? Is there something I'm missing? I'm ripping my hair out over a HelloWorld!

I guess the easiest way is to post a link to your opk, so we can look at it.

Cactuar18 (OP)

  • *
  • Posts: 5
Re: What scripting languages? What tools?
« Reply #6 on: March 06, 2014, 08:31:43 pm »
Here's a link, it's a simple Hello World I got from elsewhere, it runs fine, even if only for a second.

https://www.dropbox.com/s/kbb1fokt01u7dek/Hello.opk

The device won't even let me select it. Since it starts with H (its named Hello.opk), I go to my games section, go down to where it should be , it freezes and sends me back to Settings. Frustrating!

Code: [Select]
#!/usr/bin/env python
import pygame, sys, time
from pygame.locals import *

pygame.init()
mainClock = pygame.time.Clock()

GREEN = (0, 128, 0)

while True:
    windowSurf = pygame.display.set_mode((320, 240), 0, 32)
    fontObj = pygame.font.Font('freesansbold.ttf', 30)
    msgSurface = fontObj.render('HelloWorld', True, GREEN)
    msgRect = msgSurface.get_rect()
    msgRect.center = (160, 120)

    windowSurf.fill((0, 0, 0))
    windowSurf.blit(msgSurface, msgRect)
    pygame.display.update()
    mainClock.tick(1)
    pygame.quit()
    sys.exit()

zear

  • * Moderator
  • Posts: 2379
Re: What scripting languages? What tools?
« Reply #7 on: March 06, 2014, 10:32:16 pm »
Your .desktop file is incorrect. the Icon section points to a location on your Windows PC. Given that the GCW doesn't even attempt to mount the OPK, it must fail at parsing the .desktop file.

Anyway, after manually mounting the OPK, the python fails at:
Code: [Select]
Traceback (most recent call last):
  File "./Hello.py", line 12, in <module>
    fontObj = pygame.font.Font('freesansbold.py', 30)
IOError: unable to read font file 'freesansbold.py'

I also see you have a lot of redundant files inside the OPK, including the Windows executables for python interpreter and DLLs and even another OPK ;)

The device won't even let me select it. Since it starts with H (its named Hello.opk), I go to my games section, go down to where it should be , it freezes and sends me back to Settings. Frustrating!
The Name parameter of the .desktop file dictates the name that appears in the menu. For your file it's set as:
Code: [Select]
Name=Program Launchso I'd look in there.

Here is an example of a python game ported to GCW Zero. Take a look at the "opk" folder: https://github.com/zear/stringrolled

Cactuar18 (OP)

  • *
  • Posts: 5
Re: What scripting languages? What tools?
« Reply #8 on: March 07, 2014, 12:55:19 am »
Thanks all for trying to help me out, but I have no idea what I'm doing wrong now, I've edited both the opk and desktop files multiple times, the destinations, file names, the lot, but I have the feeling I'm a bit of a lost cause with this.
 Until someone puts up a step-by-step or something along those lines, I'll just keep using it as an emulator
Thanks again fellas

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: What scripting languages? What tools?
« Reply #9 on: March 07, 2014, 07:43:19 am »
Thanks all for trying to help me out, but I have no idea what I'm doing wrong now, I've edited both the opk and desktop files multiple times, the destinations, file names, the lot, but I have the feeling I'm a bit of a lost cause with this.
 Until someone puts up a step-by-step or something along those lines, I'll just keep using it as an emulator
Thanks again fellas

The files that should be in the OPK should be in the same directory or in subdirectories of that directory.
Just make a folder with the stuff you need, like the icon, the python scripts etc. Then use that folder in the Open Package Creator.

Cactuar18 (OP)

  • *
  • Posts: 5
Re: What scripting languages? What tools?
« Reply #10 on: March 07, 2014, 01:18:14 pm »
I have absolutely no idea what I did differently, but I've got it working!!! Everything runs fine :)

Sorry about all that fellas

Y'all about to get some quality games coming your way ;)

 

Post a new topic