SOLVED: Walking Corpses SUBMERGED Upon Spawning?

The place to post your WML questions and answers.

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.
Post Reply
User avatar
Pewskeepski
Posts: 378
Joined: November 17th, 2010, 6:24 pm
Location: An icy dungeon beneath Antarctica

SOLVED: Walking Corpses SUBMERGED Upon Spawning?

Post by Pewskeepski »

Salutations,

I have an event in the scenario I'm currently working on that causes a random amount of walking corpses to spawn on deep water hexes (Wot). The problem, however, is that the player can see them, even though they're all in deep water, with deep water adjacent hexes, and I want them to make use of their submerge ability as soon as they've spawned. Basically, I want them to spawn in a submerged state and not be seen by the player until they move to terrain that reveals them (shallow water, in this case).

I've exhausted some ideas, but I can't find much about making units submerged upon spawning, so I figured I'd ask here. I'm using Wesnoth 15.9.

Here's the code:

Code: Select all

[event]
    name=velekal_surrounds_bilheld
    first_time_only=no
		
    {LIGHTNING}
		
    [sound]
        name=water-blast.wav
    [/sound]
		
    [random_placement]
        variable=undead_spawn
        allow_less=yes
        num_items={ON_DIFFICULTY 40 50 60}
        [filter_location]
            terrain=Wot

            [and]
                x=1-68,21-67
                y=5-29,32-60
            [/and]

            [not]
                [filter]
                [/filter]
            [/not]
        [/filter_location]
        [command]
            {RANDOM (swimmer,drake,none)}

            {LOYAL_UNIT 2 (Walking Corpse) $undead_spawn.x $undead_spawn.y}
            [+unit]
                animate=no
                variation=$random
            [/unit]
        [/command]
    [/random_placement]

    {CLEAR_VARIABLE undead_spawn}
[/event]
Edit: SOLVED! Turns out, Walking Corpses and Soulless don't have the SUBMERGE ability, only Skeleton units :|
"Everything is better with penguins."
Creator of Burning Souls, The Fall of Wesnoth (abandoned) and Adventures of Knighthood (now available on BfW 1.15!)
Post Reply