Search found 62 matches

by stout
Mon Oct 29, 2012 3:46 am
Forum: Support and Development
Topic: Inventory
Replies: 3
Views: 416

Re: Inventory

Here is a post where someone helped me work out how to do pages of text; probably will help for this.
by stout
Sun Oct 28, 2012 5:54 pm
Forum: Support and Development
Topic: (Lua) Working with empty nested tables via loop
Replies: 3
Views: 540

(Lua) Working with empty nested tables via loop

This works fine. It creates a table with worldSize subtables. worldSize = math.random(3,25) worldMap = { } for i = 1, worldSize do worldMap[i] = { } end This does not. for i = 1, worldSize do worldMap[i][i] = 1 end I'd expect it to fill every entry on the table with the number 1; basically making an...
by stout
Sat Oct 27, 2012 9:00 pm
Forum: Support and Development
Topic: (Lua) Passing variable from one function to another?
Replies: 9
Views: 1601

Re: (Lua) Passing variable from one function to another?

Ahhhh. Well that explains some random issues I've had. Thanks. (I'm sure I've figured this out before.. maybe this time it'll stick)
by stout
Sat Oct 27, 2012 8:50 pm
Forum: Support and Development
Topic: (Lua) Passing variable from one function to another?
Replies: 9
Views: 1601

(Lua) Passing variable from one function to another?

Let's say you have function foo() var = "bloop" end print(var) nil Why? Lua docs talk about how all variables are global unless specified otherwise, but that simple test would suggest otherwise.. unless I'm very confused about how it uses the word "global" (I suspect this is the case). How do I get ...
by stout
Mon Oct 22, 2012 5:29 pm
Forum: Support and Development
Topic: A string-counting question (I think)
Replies: 6
Views: 681

Re: A string-counting question (I think)

Thanks! I don't know why I didn't think about putting the tabulated variables into a table. It was originally a numeric for because... I.. can't remember why. -.- Slowly learning...
by stout
Sun Oct 21, 2012 6:39 pm
Forum: Support and Development
Topic: A string-counting question (I think)
Replies: 6
Views: 681

Re: A string-counting question (I think)

Can you walk me through a couple of things on this? I haven't done anything with : or _G yet. local var = "audience"..string.upper(mood:sub(1,1))..mood:sub(2,#str) I get what's happening here; it gets the mood value - say, "content" - and then capitalizes the first letter and appends it to "audience...
by stout
Fri Oct 19, 2012 10:01 pm
Forum: Support and Development
Topic: A string-counting question (I think)
Replies: 6
Views: 681

A string-counting question (I think)

function audienceStateCheck() audienceDiscontent = 0 audienceNeutral = 0 audienceContent = 0 for i = 1,#audience do if audience[i].mood == "content" then audienceContent = audienceContent + 1 elseif audience[i].mood == "neutral" then audienceNeutral = audienceNeutral + 1 elseif audience[i].mood == ...
by stout
Tue Oct 16, 2012 9:49 pm
Forum: Support and Development
Topic: Need help with for loops: making pages of text
Replies: 2
Views: 381

Re: Need help with for loops: making pages of text

Well, it definitely works, and I sort-of understand why. Not sure I would've figured that out on my own. Thanks a tonne. =)

EDIT: Hmm, okay, I've got it down now. Thanks again.
by stout
Tue Oct 16, 2012 3:56 pm
Forum: Support and Development
Topic: Need help with for loops: making pages of text
Replies: 2
Views: 381

Need help with for loops: making pages of text

I suspect I have some ugly-ass code. If you want to explain some changes, please do! Also, this is a sketchpad file while I figure things out, so variables are being called in not-great places and everything is being dumped into love.draw. Those things will be changed when it's ported back into the ...
by stout
Sun Oct 14, 2012 3:02 pm
Forum: Support and Development
Topic: Best practice for key inputs? keypressed, isDown
Replies: 13
Views: 2814

Re: Best practice for key inputs? keypressed, isDown

Helvetica: Thanks! Yes, that works just fine, and is what I wanted to do. It also fixes my selector problem so that works like I expect it to now. Still curious what was causing the bug with the other code, but the new code works great and finally hammers how passing arguments to functions work (I a...