Creating unit on walkable hexes [Solved]
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
- ChaosRider
- Posts: 1361
- Joined: April 15th, 2012, 1:15 pm
Creating unit on walkable hexes [Solved]
As in title Im trying to write a code to spawn unit on walkable hex (as long as they are available on map without any other units on it) but it sometimes create it on the wall. I have written all impossible hexes in the list in the code yet it doesnt work as should.
Do you see any wrong lines/bugs?
You could add to Wesnoth next version option to spawn units only on hexes where unit to spawn terrain defense is greater than 0%.
Spoiler:
You could add to Wesnoth next version option to spawn units only on hexes where unit to spawn terrain defense is greater than 0%.
Last edited by ChaosRider on November 1st, 2025, 8:54 am, edited 1 time in total.
Creator of WOTG (+6000 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.18 Wesnoth server.
Re: Creating unit on walkable hexes
It is some random mess of code. Just use passable=yes and dont give unit defense where they cant move.
- ChaosRider
- Posts: 1361
- Joined: April 15th, 2012, 1:15 pm
Re: Creating unit on walkable hexes
One line was required to do what I wanted to. Thx.
Creator of WOTG (+6000 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.18 Wesnoth server.