Jump to content

Multiline commented properties are still used


Recommended Posts

This is why I think using comments to define things isn't the way to go about it. I think it should be defined with Lua tables 100%.

 

Script.Speed = {}

Script.Speed.type = int

Script.Speed.value = 5

Script.Speed.label = "Speed"

 

 

type, value, label are all hardcoded values that LE can look for while looking through the Script table of properties. I think this is cleaner and more readable even though it's more lines of code. We could also shorthand it via:

 

Script.Speed = { type="int", value=5, label="Speed" }

  • Upvote 1
Link to comment
Share on other sites

@ Rick: You don't have to define properties as comments. Without the '--' it works as well. However I do like the approach of the table. It is simple can be easily adjusted.

 

The current way works okay as well, but some documented properties don't function well. So either documentation or the properties are incorrect.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...