wesnoth.terrain_types?

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
Smok
Posts: 53
Joined: June 14th, 2016, 11:52 am

wesnoth.terrain_types?

Post by Smok »

Is there any wesnoth.unit_types equivalent for terrains? I want to make dialog like here, but with terrains instead of units: https://wiki.wesnoth.org/LuaWML/Display ... how_dialog
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: wesnoth.terrain_types?

Post by gfgtdf »

afaik there isn't, whta you could do however is to first get all terrain code used in the curent map with wesnoth.get_terrain and wesnoth.get_map_size. end then get information about those ces with wesnoth.get_terrain_info
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: wesnoth.terrain_types?

Post by zookeeper »

If you don't need to include terrains from campaigns and/or add-ons but only need core terrains, then you could include the core terrain.cfg into some container, using [set_variables], which would then give you all the core terrain definitions as a simple WML array.
Post Reply