actually I do listen
@sgs - Tsk tsk. Public beatings are not required. I understand the frustration, but I come here to help, so I’ll continue to try.
PS - I don’t measure folks by the number of posts they make, but their progress in those posts. comeUp264 is struggling. Part of that is on him, but part of that is on those of us who help.
It’s funny. Today, it is both easier and harder to make a game than when I first started learning about programming and game making.
- It is easier because you can do a lot and there is all kinds of information to learn from.
- It is harder because you can do a lot and there is all kinds of information to learn from.
I started programming back in the 70s. No internet, no real educational resources to call on, few books on the topic, and basically esoteric manuals. However, I only had to learn a small set of concepts and command and I was on my way.
My games were text based and black and white 2D.
Today’s users are faced with a massive slope to climb and the sense that their game must be huge and complicated. i.e. It is somehow not cool to make a text game or a simple two-color 2D game.
I feel bad for and envy today’s newbies at the same time.
@comeUp264
First, I really want to help and see you succeed. The more successful users there are here the better.
Second, I think there are a few issues here:
-
It does in fact often seem you’re not listening to what we (those who help) are telling you, BUT… I think the real problem is we are not clearly communicating. More on this below.
-
I get the distinct feeling you are new to programming, but you’re trying to make things that would give old an experienced developer pause. i.e. You’re trying to make apps and games that are beyond your current skill set and experience. So, it is going to be really hard to succeed.
-
You demonstrate inexperience with Corona itself. Specifically, I can tell you haven’t done lots and lots of small projects to explore the features and that you have not learned yet how to read error messages and debug them.
The only advice I can give you here is that you make lots and lots of micro projects, tests, and mechanics explorations. Just work in in main.lua to start. Don’t make multi file projects till later. When you’ve got your chops, then move on to modules, and much after that move on to using composer.
On Communication
I honestly think that when folks give you an answer, you may read it, but you get something completely different out of it.
I think you effectively latch onto the parts that make sense to you and that you are interested in while the rest drops by the wayside.
This sounds terrible, but it is natural and what typically happens when the two parties communicating are at different levels.
I don’t know a lot about you, so I may assume you know things you do not not.
There may be a deeper problem however. I sense a certain lack of curiosity and the absence of due diligence.
Why do I say this?
Well, I often answer questions with a few paragraphs discussing the issue and my answer. Then I provide some generic code to go with said discussion.
My expectation is that you should read everything I say, and then look at the code.
I don’t expect you to paste it verbatim into your app and then just run it. Unfortunately, you often do just that.
It is clear you are doing this because I will post a response and minutes later you will post back with a response:
- it didn’t work
- I tried that and got this error
- Some other short answer
This is both insulting and frustrating.
It is insulting, because I put real effort into my answers and take the time to make them legible and clear. However, you don’t reciprocate on the effort side. i.e. The effort and energy that goes into these discussions seems very one-sided.
Final Suggestion
It might be a good idea for you to put your current project on hold and return to basics for a bit.
Like I said above, make short examples and explore basic concepts. Learn to debug small projects first. Then consider something bigger.
Anyways, best of luck to you in the future.
@comeUp264, @roaminggamer wrote the best possible answer in the case scenario. I won’t be of much help, because I am a newbie too. But, @roaminggamer is definitely right, start with smaller projects first. I am struggling with my game, because I jumped on it too quickly. All I can say is this. Weeks before I even came up with the idea for my game, I worked on a little project. I wanted to add a text box that allowed a user to type in a number, and it would set it as the x-coordinate of a crate, each crate would fall to the ground with a number (its position in the table), and long story short, the knowledge I achieved about tables was invaluable and helped me a lot when starting on the basics of my new project.
Also, I have to agree with @roaminggamer here on a second topic. It seems like you have been somewhat ignoring the explanations, I am not accusing you of doing this on purpose. But, the first times I would write questions on the Corona Forums, I almost never bothered to read explanations, I would always seek out the code box in people’s responses. (to be honest, I still kind of do)
Good luck on your project. I hope the posts here inspired you.
PS: @roaminggamer, I hope one of the two-color games you made included green, (the physical manifestation of envy toward newbies
I noticed here you set the text object as username, and put the text object’s text as username too. This does not make sense, you should try this: (Note: @roaminggamer did mention this, if you did not read it, look at the 6th post in this thread.
local username = display.newText(userName, etc.) --notice the capital 'N' --Do not copy and paste directly, you still need to fill in the display.newText parameters
Also, if the value is not predefined as a string, you should use the ‘tostring’ function:
local userName = tostring(?) local userNameText = display.newText(userName, ...) --changed text variable name to avoid confusion
Hope this helps.
@Ed if I was beating then my response would of been completely different. I have no time for people taking up my time and not listening. I’m done with people that ask for help but are 1) not willing to accept and 2) don’t take the time to work through the help we have give and apply it to their work.
We don’t exist to write stuff for them and that is something they really need to understand! I am sure @sdktester15 knows my frustrations.
Lol! Sorry, for the recent flurry of questions!
Nah you are cool dude as long as you learn and grow (and accept your limitations)
You simply cannot think “oh will make Clash of Clans”
why do I have to use a capital N in userName ?
The reason why you have to use a capital ‘N’ in user N ame inside user n ame, is because of the fact that you just defined username as a local text object, and then you are trying to set it as its own text which is the reason why username is nil. As @roaminggamer said, Corona is case-sensitive, plus it is simple logic.
Reference to the code I sent you, and it should work.
Remember, username(text object) cannot use username as text. Call the display object userNameText to prevent confusion, and the code should work out fine.
To clear things up:
local userName local userNameText userNameText = display.newText(userNameText, ......) screenGroup:insert(userName)
:lol: I wish.
I love that after Ed specifically typed out:
I think you effectively latch onto the parts that make sense to you and that you are interested in while the rest drops by the wayside.
the guy’s very next question doesn’t address anything in Ed’s post and just asks:
why do I have to use a capital N in userName ?
Luckily for the rest of us, Ed cannot be disheartened so easily
I asked in reference to my question, I just hope I tries out my code.
“Luckily for the rest of us, Ed cannot be disheartened so easily :-)”
I’m very glad this is the case.
Just to be clear:
Lua variable names *are* case sensitive. username and userName are different variables. However, they are so close, it’s too easy to mix them up. You should use descriptive variable names in particular when there is room for confusion. In this case I would:
username – The text string being sent to or received from online.
usernameTextField – the native.newTextField() object used to allow the user to input a user name
usernameTextDisplay – the display.newTextObject that will display the user name on the screen when it’s just being shown (not the input object)
usernameLabel – A display.newTextObject() with the word “Username” used with the native.newTextField() to instruct the user what the field is for.
As for other things, you need to take the time and try and read the error message and break it down. It gives you a line number and a description of the problem.
error loading module 'profile' from file 'C:\Users\user\Documents\Corona Projects\app\profile.lua': C:\Users\user\Documents\Corona Projects\app\profile.lua:29: unexpected symbol near '.'
What is line 29 of profile.lua? We can’t help you with out knowing that and the code around it. But you have a period where it’s not expected. Maybe you need a comma there, it’s easy to mix a period (.) and comma (,) up.
The other thing is you frequently don’t try what your being asked to try. Saying “that didnt’ work” doesn’t help us help you. You need to provide what the current message, and show us how you changed your code.
Rob
Post your profile.lua code and mark line number 29.
I don’t see that error there anymore so nit’s not an issue .
I tried your code :
local composer = require( "composer" ) local scene = composer.newScene() local widget = require("widget") -- forward declare the text fields local json = require("json") local userName local userNameText local function networkListener( event ) if ( event.isError ) then local alert = native.showAlert( "Error Loading .", "Check your internet connection .", { "Try again" } ) end end function scene:create(event) local screenGroup = self.view local background = display.newImageRect("insta.jpg",display.contentWidth,display.contentHeight) background.x = display.contentCenterX background.y = display.contentCenterY screenGroup:insert(background) local userNameText = display.newText(userNameText, 200, 200) --notice the capital 'N' screenGroup:insert(userName) end
and I got this error :
bad argument #1 to 'newText' (string expected, got nil) stack traceback: [C]: in function 'newText' C:\Users\user\Documents\Corona Projects\app\profile.lua:28: in function '?' ?: in function 'dispatchEvent' ?: in function 'gotoScene' C:\Users\user\Documents\Corona Projects\app\newsfeed.lua:42: in function '\_onPress' ?: in function '\_setSelected' ?: in function '?' ?: in function \<?:182\>
Uhhhhhhh, you are making the same mistake:
--Wrong local userNameText = display.newText(userNameText, 200, 200) --notice the capital 'N' screenGroup:insert(userName) --Right local userNameText = display.newText(userName, 200, 200) --notice the capital 'N' screenGroup:insert(userName)
Also, you are missing some parameters for the display text.
Please read this tutorial:
https://docs.coronalabs.com/api/library/display/newText.html
It will give the proper syntax.
This is what I have :
local userNameText = display.newText(userName, 100, 200, native.systemFont, 16 ) myText:setFillColor( 1, 0, 0 ) screenGroup:insert(userName)
and I’m getting the same error
Where does userName get it’s value?
local userName local userNameText function scene:create(event) local screenGroup = self.view local background = display.newImageRect("insta.jpg",display.contentWidth,display.contentHeight) background.x = display.contentCenterX background.y = display.contentCenterY screenGroup:insert(background) local userNameText = display.newText(userName, 100, 200, native.systemFont, 16 ) myText:setFillColor( 1, 0, 0 ) screenGroup:insert(userName) end