Free Developer Support

Hey Everyone,

I’ve been using the Corona for a while and I want to take some of my time to contribute. Here’s what I wanna do:

Each week, I’ll take requests to either fix, critique, or write a set of code for an hour’s worth of time, free of charge.

To submit your code or have any questions, respond in this post or message me with your issue.

-Happy Coding
JT [import]uid: 49520 topic_id: 20965 reply_id: 320965[/import]

Very generous of you :slight_smile: I’m sure many will avail of your offer [import]uid: 84637 topic_id: 20965 reply_id: 82794[/import]

Awesome! That’s very nice of you. Email me at ninjapig123 [at] gmail [.com].

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 20965 reply_id: 82807[/import]

OMG, James, this is an incredible offer. I just wouldn’t want to waste this precious opportunity to get help, so I’ll think very carefully about what help-request I’d make, but I sure will take up on your offer when I’m totally stuck.

Naomi [import]uid: 67217 topic_id: 20965 reply_id: 82809[/import]

Proper Facebook Friends List

This may be a bit ambitious for this request but I’ve been struggling with this problem for awhile now and I’m sure it would help tons of other people…

How would you go about creating a fleshed out Facebook friends list? Similar to this picture:


I’m able to make a basic list that pulls in the pictures and names of friends but I can’t for the life of me figure out how to:

  1. Sort the list alphabetically

  2. Add the category rows so that only the letters show up in them (see how it shows B, C, D and E by themselves)

  3. Implement a quick-scoll-esque legend on the right side of the screen
    Again, this may be too much for an hour’s worth of work but ANY help on the matter would be extremely appreciated :slight_smile:

Thanks so much in advance for doing this! I can’t wait to see what other requests come through here…
R
[import]uid: 47361 topic_id: 20965 reply_id: 82840[/import]

I have to admit that if you could take a quick look at my documented issue,
that would greatly help me.

[ -> attempt to call method ‘move’ (a nil value)

](http://developer.anscamobile.com/forum/2012/01/24/how-access-methods-instances-class#comment-82448) [import]uid: 95346 topic_id: 20965 reply_id: 82844[/import]

@Everyone,
Thanks for the support! I’m happy to help and I can’t wait to see the interesting cases that come from it!

Speeking of cases…

@R,
I’ll see how much I can do and keep you informed. What’s the code for the kind of view you’re using to make your facebook page? I want to make sure what I’m writing is an easy plug and play for what you have.

@Mells
I’ll take a look at it and update you when I’m done [import]uid: 49520 topic_id: 20965 reply_id: 82850[/import]

Hey,

Thanks for doing this! I would love for someone to help me with my problems :slight_smile:

My email is: michaelas@eb.org

Thanks!

  • Michael [import]uid: 23689 topic_id: 20965 reply_id: 82859[/import]

@Mells
When you call the function setmetatable, it erases the other metatable and replaces it with the most recent one. It’s usually used for assigning one ‘class’. In order to do proper multiple inheritances, you would need to do a more programming and it gets a bit complicated. Instead I use a simpler method for inheritance that is almost identical to what someone linked to on your forum post:

main.lua

[lua]–NEVER USE GLOBAL OBJECTS. ALWAYS STORE THINGS LOCALLY
local Balls_Class = require (“balls”)
require (“libraries”)

local Game = {}

function Game:startSetup()
local listBalls = Balls_Class.newBalls()

print (listBalls[1].x) – Displays “400”, great until there

listBalls[1]:move(50) – Doesn’t work.How can I access function move() in ball.lua

end

Game:startSetup()[/lua]

balls.lua

[lua]module(…,package.seeall)

–CREATE A CLASS THAT REFERENCES THE BALL CLASS. ITS ONLY USED IN THE BALLS CLASS SO NO NEED FOR IT IN THE MAIN FILE
–ALWAYS RETURN A LOCAL OBJECT OR YOU WILL POLLUTE YOUR GLOBAL SPACE!!!
local Balls_Class = {}
local Ball_Class = require(‘ball’)

function Balls_Class:newBalls()


– GO STRAIGHT INTO MAKING THE LIST TABLE. NO NEED FOR A SETUP


local listBalls = {}

– Set Balls Defaults
local params = {
{ radius=20, xdir=1, ydir=1, xspeed=2.8, yspeed=6.1, r=255, g=0, b=0, posx=400, posy=150 },
{ radius=50, xdir=-1, ydir=-1, xspeed=1.8, yspeed=1.5, r=115, g=23, b=33, posx=200, posy=200},
{ radius=20, xdir=1, ydir=1, xspeed=2.8, yspeed=6.1, r=255, g=0, b=0, posx=400, posy=350 }
}

for i, j in pairs(params) do
print(j.radius)
local param = j
local ball = Ball_Class:newBall(j)
table.insert(listBalls, ball)
–ball = nil
end

return listBalls

end

–RETURNING THE BALL CLASS SO THE VARIABLE INHERITS THE OBJECTS FUNCTIONS
return Balls_Class[/lua]

ball.lua
[lua]module(…,package.seeall)

—THIS CLASS HOLDS ALL FUNCTIONS FOR CREATING THE BALL
local Ball_Class = {}

function Ball_Class:newBall(params)

local default_xpos = display.contentWidth*0.5
local default_ypos = display.contentHeight*0.5

– Create Display Object for Ball
local Ball = display.newCircle(default_xpos, default_ypos, params.radius )

function Ball:move(dist)
print (“Move Ball”)
self.x = self.x + dist – example of accessing a property
self:setFillColor(128,0,0)
end

return Ball
end

return Ball_Class[/lua]

This method is much simpler for making classes and you can perform multiple levels of inheritance without calling every class in the main file.

Side Note: Try not to pollute your global namespace. Use more local variables because it maintains your programs speed and helps in memory management.

Let me know if this helps.

-JT [import]uid: 49520 topic_id: 20965 reply_id: 82867[/import]

Thank you very much JT, I could achieve what I was expecting :slight_smile:
The comments were really helpful.

I might have something more to ask if it’s ok, but I’m not sure if I should post my questions here or in my own thread?
I am trying to learn from lua-users and would love to see the way you would do the following with my example :
In order to do proper multiple inheritances, you would need to do a more programming and it gets a bit complicated

I do understand the reasons why you are advising me that simple way to achieve things and I will clearly use it in the future.

But I’d also like to know how to do it “the other way” if possible.

My reasons are that :

  1. most part of the docs at lua-users use metatables and I’m ok to learn things the hard way today if this is a wise time investment for later
  2. it seems that there were a lot of things said against the use of package.seeall and advised by Ansca.
    I believe that the tutorials in the future will take that in account, so I would like to be able to follow and understand it.

I believe that learning how to do things with metatables is a wise investment and the exercise I’m doing with (Balls) is a good one for a start?

I don’t want to take so much of your time so :

  • Would please you help me learn how to use metatables and do multiple inheritances in my exercise?
  • Or point me to the correct way of learning about it so I can complete my exercise?

Any help would be greatly appreciated, thanks again JT for taking the time.
[import]uid: 95346 topic_id: 20965 reply_id: 82880[/import]

Learning multiple inheritance is good to know for using lua, but probably not worth the trouble for using corona. Not sure if you can see how the code works under the hood of the SDK and you may be conflicting certain ideologies that the code is based on. I choose that way for Corona because:
A. It’s easy to implement
B. Maintains the integrity of the object I’m working with

If you would like to know more about multiple inheritance, you can definitely start with this:
http://lua-users.org/wiki/SampleCode
[import]uid: 49520 topic_id: 20965 reply_id: 82902[/import]

JT,

Your offer sounds great!! Would you consider helping me make some modifications to some code Carlos created…the following link is to the code.

http://developer.anscamobile.com/code/bezier-object-along-curves-path

This is what I need and I have spent four days reading though docs and example code.

I want to make an object follow a predetermined path(s) with the option select a choice to make a change in direction along the path to another path.

I want this to run with a user “touch” event (via a button/slider) listener with increase-able/decrease-able speed; not at the enterFrame Runtime.

I know I can make an object go from point A to B via a transition.to however; I am looking for something to be able to follow a line that potentially has an “S” curve in it.

Rob Miracle suggest the use of a Table; I have reviewed the code from the link above and almost have a handle on it. But instead of picking four point on the screen to place the curve or path. I just want to be able to “set” the path with the speed slider on the screen to make my object accelerate.

If this is asking for too much I understand; but the concept of Tables is making me nutz right now. I need a working example to be able to break it down to something I understand.

Thanks a million.
Rob
[import]uid: 16527 topic_id: 20965 reply_id: 82906[/import]

Edit : I found why I couldn’t achieve such a basic thing :
It’s not possible to set the metatable of display objects
ok, I got that when I do :
[lua]local new_inst = display.newCircle(default_xpos, default_ypos, default_radius )
new_inst.note = 20
return setmetatable(new_inst, Ball_mt)[/lua]
and
[lua]local ball = Ball_Class.new(param) [/lua]
then
[lua]print (ball.x) – nil
print (ball.width) – nil But isn’t ball a displayObject?
print (ball.note) – 20[/lua]

I found a thread talking about that, I post here for those who might need a solution :
Inheriting a display object
Thank you again for your help and good luck on your own projects! [import]uid: 95346 topic_id: 20965 reply_id: 82907[/import]

What is the

proper way to end a Corona program

when the home button is pressed? [import]uid: 6288 topic_id: 20965 reply_id: 82934[/import]

Corona Simulator[3092:903] Connection error: (corona.update2)

When running the debugger on all of the last 6 releases I receive this message:

Ansca Corona Remote Debugger
Run the program you wish to debug
2012-01-27 12:40:47.620 Corona Simulator[3092:903] Connection error: (corona.update2) fault(Token has expired.)
2012-01-27 12:40:47.624 Corona Simulator[3092:903] Connection error: (corona.update2) ({
“/FaultCode” = 1;
“/FaultString” = “Token has expired.”;
“/kWSHTTPResponseMessage” = “{url = http://developer.anscamobile.com/services/xmlrpc; status = HTTP/1.1 200 OK}”;
“/kWSResultIsFault” = 1;
})

I can’t seem to get an answer on this and am not knowing if this affects anything else that might lead to problems.

I am on Snow Leopard 10.6.8

Thanks! [import]uid: 6288 topic_id: 20965 reply_id: 82973[/import]

Oh, this is so fantastic - a pro developer offer he’s valuable time to help us.

I am in the end of my first game development - its a classic platform game. All gameplay is almost done and the rest is just leveldesign. One thing that I am not that happy with is the attachment of the player to my moving platforms. The game is running in physics mode, so the weight of the player makes him just slip of the platform. I managed to solve this issue but I am not 100% satisfied with the result.

There are a lot of fragments of code in several of listeners and functions. Do you have time to help me look at it? If so, should I post all of my fragments here or what is the best solution?

Best regards, Joakim - Sweden [import]uid: 81188 topic_id: 20965 reply_id: 82993[/import]

Hi jamestimberlakejr, this is a great help to us, thanks for the availability, I have a question that I have some doubts and is the most important part of my application, i am trying to create a object like that: http://www.youtube.com/watch?v=vQiEcqSjmo8

see the elastic effect of the object, the green elastic. i tried to use joints but it isnt good because when i pull the joints will separate a little, how i can create some like it? what i should use etc

Thanks jamestimberlakejr [import]uid: 26056 topic_id: 20965 reply_id: 83013[/import]

Wow! Awesome requests so far everyone. I should have some results for these by tomorrow.
P.S. @R Please provide me with the code you’re using to make your tableview so I can modify it. I want to make the code fit like a glove on your existing project. [import]uid: 49520 topic_id: 20965 reply_id: 83020[/import]

@Rob Haney,

I’m not sure what you mean by “set”? Do you mean have the user use their finger to draw the path?

@Moilefun,
Could you specify a bit more? I’m not sure if you’re talking about an application or the simulator or the sdk itself.

@JK,
I don’t know what your code looks like, but try increasing the friction of the surface of the platform. Show some code on here and I’ll see what I can come up with
[import]uid: 49520 topic_id: 20965 reply_id: 83320[/import]

This happens when I run the debugger from within the Corona SDK folder on my (2008) MacBook Pro.

Steps to recreate problem:
1). Open the SDK folder in the Applications Folder. Corona version: 2012.731 (2012.12.8) on my Mac
2). Double click the debugger program.
3.) View error messages in terminal window.
4.). Note: I can run any programs I want.
5.). Note: I can build for device.

[import]uid: 6288 topic_id: 20965 reply_id: 83334[/import]