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 Megalopolis
- Reactions:
- Posts: 586
- Joined: 29 Aug 2017, 21:07
- Location: Germany, Hessia
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
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 Megalopolis
- Reactions:
- Posts: 586
- Joined: 29 Aug 2017, 21:07
- Location: Germany, Hessia
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: Lua: How to get the draft id of the Ground?
Ended up that I used the wrong charset/encoding