So I want to check the Ground Draft Id of x,y , but somehow it will always Not enter my if-clause (or iff how the documentation spells that) even though it is true (Well i think)
If (Tile.getGroundDraft(x,y).getId() == "$ground00") then
(Code)
So yeah, how to use it then? The Doc should be more clear
Lua: How to get the draft id of the Ground?
Moderator: Plugin Moderators
- Wekabu city
- Inhabitant of a Conurbation
- Reactions:
- Posts: 504
- Joined: Tue Aug 29, 2017 21:07
- Location: Spaaace
- Plugins: Show
- Version: Beta
Lua: How to get the draft id of the Ground?
Member of the Theotown community for over 3 2 years! (boy am I bad at maths)
==================================
Currently working on a megaproject, hopefully I can push it through.
I'm also partially inactive, so PM me
==================================
Currently working on a megaproject, hopefully I can push it through.
I'm also partially inactive, so PM me
Re: Lua: How to get the draft id of the Ground?
Please provide your full code to exclude other issues.
From what I can see you have to use : instead of . in front of getId() since it's a method that will be called on an object. That might look strange but this is how Lua works
From what I can see you have to use : instead of . in front of getId() since it's a method that will be called on an object. That might look strange but this is how Lua works

Code: Select all
if (Tile.getGroundDraft(x,y):getId() == "$ground00") then
=^._.^= ∫
- Wekabu city
- Inhabitant of a Conurbation
- Reactions:
- Posts: 504
- Joined: Tue Aug 29, 2017 21:07
- Location: Spaaace
- Plugins: Show
- Version: Beta
Re: Lua: How to get the draft id of the Ground?
Ended up that I used the wrong charset/encoding
Member of the Theotown community for over 3 2 years! (boy am I bad at maths)
==================================
Currently working on a megaproject, hopefully I can push it through.
I'm also partially inactive, so PM me
==================================
Currently working on a megaproject, hopefully I can push it through.
I'm also partially inactive, so PM me