Page 1 of 1

[0.10.1 MINOR] help function and createentity train

Posted: Sat Jun 21, 2014 2:46 am
by FreeER
So, I thought I'd use the new makefile method to make a list of the help 'documentation' and found that these do not have a help method/property, or at least I've no idea how to find it lol.

Code: Select all

Lua/Entity
  Lua/Player
  Lua/Train
Lua/GUI (Lua/GuiElement?)
Lua/Inventory
Also, in the control script you have to access 'help' as a property, not as a function, aka whatever.help and not whatever.help() (but you do have to use whatever.help() in the console...), not sure if that was actually intended...

While testing I found that game.createentity{name="diesel-locomotive", position=game.findnoncollidingposition("diesel-locomotive", game.player.position, 100, 1)} will fail "for an unknown reason", unless there are tracks close enough for it to be placed on, in which case it works (basically...I've found the reason lol).

script I used for testing if you care to see it
script
script output cause why not

Re: [0.10.1 MINOR] help function and createentity train

Posted: Wed Jun 25, 2014 9:21 am
by cube
Thanks for the reports.
  • I added the missing help methods for 0.10.2.
  • the help methods are mehtods everywhere. you use it as a property only as an argument to pcall (it takes a function as an argument and calls it -- basically it adds the method call brackets by itself)
  • Train can be only placed on rails, that is a feature :-) I changed the error message so that it doesn't sound so "unknown reason" :-)

Re: [0.10.1 MINOR] help function and createentity train

Posted: Wed Jun 25, 2014 4:32 pm
by FreeER
cube wrote:I added the missing help methods for 0.10.2.
Awesome thanks!
cube wrote:you use it as a property only as an argument to pcall
...this makes me feel like an idiot now :lol:
cube wrote:Train can be only placed on rails, that is a feature :)
I did assume that :) Of course it could be argued that mining drills 'can only be placed on ore' but I wouldn't really want that implemented in createentity :lol: A more descriptive error message which was the reason I mentioned it though, so thanks for that too :P

Re: [0.10.1 MINOR] help function and createentity train

Posted: Thu Jun 26, 2014 8:33 am
by cube
FreeER wrote:A more descriptive error message which was the reason I mentioned it though, so thanks for that too :P
It won't be more descriptive, it just won't say that it is an unknown reason :-)