Jump to content

Lua in UltraEngine?


WSI
 Share

Recommended Posts

function :Message( message )
	System:Print(message)
end

 

Esto es una simple función personalizada en Lua script y que funciona en Leadwerks. Si me tocará documentar esta función haría lo siguiente. 

Message( string message ="Mi message" )

Of course, this is reinforced by an example of its use. 

 

Message("Hello World")

 

 

 

 

 

Link to comment
Share on other sites

9 hours ago, WSI said:

If the actual command doesn't use =, then why is it noted like that in the documentation?

It's telling you what the default value is if you don't include that parameter. :cool:

Even if there was a page explaining that, what are the chances you would have seen it?

You are now learning the things you need to know. This is very good. What you will find is that in the beginning you feel like you are struggling with a text editor but as you get better, the actual details of programming become second hand nature, and you will spend more time thinking about what you are going to do than actually writing code.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

5 hours ago, Josh said:

It's telling you what the default value is if you don't include that parameter. :cool:

Even if there was a page explaining that, what are the chances you would have seen it?

 

The condescension isn't justified, Josh.  You're being disingenuous.

I said in my previous post:

Quote

"That's another reason why the example code on that page should have the parameters included, to show the actual correct formatting. I could have looked at it and realized "Oh, *that's* how it's actually formatted", and everything would have worked."


The only place any info is noted about parameters is where it says, for example: string title="Leadwerks". I understood the 'string' and 'number' are just indicating the type. I also understood the 'name' and 'numbers', etc, were just examples, and didn't have to be typed in verbatim. The only bit I didn't understand wasn't actual parameters is name=, x=, etc. So it's not like I went into this completely brain-dead, or didn't try to think through it myself before posting here.

However... 

The actual code sample lower on that page just has Window:Create():

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:Move(0,0,-3)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)


There's no parameters included in the actual example code. So, the only example I have to go on is the bit at the top with all the extra info.  I'm following your documentation.

So again, if that bottom code sample had included parameters inside the (), I would have realized that's the correct way to format it, and then it would have clicked that the "String name="Leadwerks", etc... was a demonstration/explanation, not the actual format.

You know how I've said in other posts how experienced programmers forget what it's like to be brand-new, and tend to make assumptions of what the student  already knows/understands? This is a grand-slam perfect example of that.

Instead of being condescending and sarcastic to a sincere case of confusion and inexperience, you, or someone else, could go through the documentation and update it to make sure all the examples are detailed and thorough.
 

Link to comment
Share on other sites

 

Something happens, and from my point of view that I don't speak English, that I have struggled with many things in programming, and I will never consider myself a programmer. 

The documentation could be much more specific for novices coming for the first time to a development environment as do other engines, but it is what it is and what works for many here. I think you will go through the same thing I did, some time to understand how things work, some time to apply what you learn and some time to think about making a video game.  The initial learning curve is usually hard in almost everything, but after you understand a concept, you move on to any tool without any inconvenience. 

Translated with www.DeepL.com/Translator (free version)

 

  • Like 1

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...