URL:
  <http://gna.org/bugs/?20765>

                 Summary: Game crashing when custom unit appears
                 Project: Battle for Wesnoth
            Submitted by: None
            Submitted on: Thu Apr 25 00:29:09 2013
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Units
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.11.2
        Operating System: Windows

    _______________________________________________________

Details:

I have originally posted this problem on the forum, and I was told to put it
here as well... As the title says, the game simply crashes when a custom unit
I created appears onscreen. The problem is in the second exclamation mark in
the DRAGON_UNWALKABLE_TERRAINS, but it apparently shouldn't be causing the
game to crash.
I am placing the coding of the custom unit below; I am removing the macros
that are not in the core game and changing the textdomain to httt, so it will
be easier to test it. Just place this unit anywhere in the first scenario of
HttT to test it.


#textdomain wesnoth-httt

#define DRAGON_UNWALKABLE_TERRAINS
!,Wwf,*^B*,!,W*,W*^V*,Chs,Chw,S*,S*^V*,Q*#enddef

[unit_type]
    id=Sky Dragon
    name= _ "Sky Dragon"
    race=monster

    hitpoints=350
    movement_type=smallfly
    movement=12
    experience=3000
    level=7
    alignment=neutral
    advances_to=null
    {AMLA_DEFAULT}
    cost=300
    undead_variation=drake
    usage=archer
    die_sound=drake-die.ogg
    description= _ "The Sky Dragon Svarballi is the mightiest of the three
ancient High Dragons. After being defeated by the other two, he was placed in
a deep slumber that lasted millennia. Now that he has been awakened again,
every single being of Irdya is at great danger.

Having been created by the hands of the so-called Ancient Ones themselves,
Svarballi, by his power and nigh-invincibility, is the closest thing to a god
any dweller of Irdya has ever
seen."+{SPECIAL_NOTES}+{SPECIAL_NOTES_MARKSMAN}+{SPECIAL_NOTES_LEADERSHIP}+{SPECIAL_NOTES_REGENERATES}+{SPECIAL_NOTES_SKIRMISHER}

    [standing_anim]
        start_time=0
        terrain_type={DRAGON_UNWALKABLE_TERRAINS}
        submerge=0.01
        [frame]
            image="units/svarballi/gold-dragon-fly-[01~09].png:50"
        [/frame]
        [frame]
            sound=dragon-wing-beat.ogg
            image="units/svarballi/gold-dragon-fly-10.png:50"
        [/frame]
        [frame]
            image="units/svarballi/gold-dragon-fly-[11~27].png:50"
        [/frame]
    [/standing_anim]
    [pre_movement_anim]
        start_time=0
        terrain_type=!,{DRAGON_UNWALKABLE_TERRAINS}
        [frame]
            image="units/svarballi/gold-dragon-liftoff-[01~22].png:50"
        [/frame]
    [/pre_movement_anim]
    [movement_anim]
        start_time=0
        submerge=0.01
        [frame]
            image="units/svarballi/gold-dragon-fly-[01~09].png:50"
        [/frame]
        [frame]
            sound=dragon-wing-beat.ogg
            image="units/svarballi/gold-dragon-fly-10.png:50"
        [/frame]
        [frame]
            image="units/svarballi/gold-dragon-fly-[11~27].png:50"
        [/frame]
    [/movement_anim]
    [post_movement_anim]
        terrain_type=!,{DRAGON_UNWALKABLE_TERRAINS}
        start_time=0
        [frame]
            image="units/svarballi/gold-dragon-landing-[01~15].png:50"
        [/frame]
    [/post_movement_anim]

    [abilities]
        {ABILITY_LEADERSHIP_LEVEL_5}
        {ABILITY_REGENERATES}
        {ABILITY_SKIRMISHER}
   [/abilities]
    [resistance]
       arcane=90
        blade=50
        fire=30
        cold=30
        impact=50
        pierce=50
    [/resistance]
    [attack]
        name=bite
        description= _"bite"
        icon=attacks/fangs-animal.png
        type=blade
        range=melee
        damage=50
        number=2
    [/attack]
    [attack]
        name=tail
        description= _"tail"
        icon=attacks/tail-dragon.png
        type=impact
        range=melee
        damage=70
        number=1
    [/attack]
    [attack]
        name=heavenly fire
        description= _"heavenly fire"
        icon=attacks/fire-breath-drake.png
        type=arcane
        [specials]
            {WEAPON_SPECIAL_MARKSMAN}
        [/specials]
        range=ranged
        damage=100
        number=1
    [/attack]
      [attack]
        name=heavenly wrath
        description= _"heavenly wrath"
        icon=attacks/divine-lightning.png
        type=fire
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        range=ranged
        damage=40
        number=6
    [/attack]
   

   
   [attack_anim]
      [filter_attack]
         name=bite
      [/filter_attack]
      start_time = -700
        [frame]
            image="units/svarballi/gold-dragon-bite-s-[01~09].png:50"
        [/frame]
        [if]
           hits=no
           [frame]
               sound=dragon-bite-miss.ogg
               image="units/svarballi/gold-dragon-bite-s-10.png:50"
           [/frame]
        [/if]
        [else]
           [frame]
               sound=dragon-bite-hit.ogg
               image="units/svarballi/gold-dragon-bite-s-10.png:50"
           [/frame]
        [/else]
        [frame]
            image="units/svarballi/gold-dragon-bite-s-[11~21].png:50"
        [/frame]
   [/attack_anim]
   
   [attack_anim]
      [filter_attack]
         name=tail
      [/filter_attack]
      start_time = -950
        [frame]
            image="units/svarballi/gold-dragon-tail-se-[01~12].png:50"
        [/frame]
        [if]
           hits=no
           [frame]
               sound=dragon-tail-miss.ogg
               image="units/svarballi/gold-dragon-tail-se-13.png:50"
           [/frame]
        [/if]
        [else]
           [frame]
               sound=dragon-tail-hit.ogg
               image="units/svarballi/gold-dragon-tail-se-13.png:50"
           [/frame]
        [/else]
        [frame]
            image="units/svarballi/gold-dragon-tail-se-[14~29].png:50"
        [/frame]
   [/attack_anim]   
   
 #define DRAGON_LIGHTNING DIRECTION_NUMBER
    [attack_anim]
        [filter_attack]
            name=heavenly wrath
        [/filter_attack]

        {LIGHTNING_BOLT {DIRECTION_NUMBER} }
            [frame]
                begin=-600
                end=-400
                image="units/svarballi/gold-dragon-cast-[01~06].png:50"
            [/frame]
        [if]
            hits=yes
            [frame]
                begin=-400
                end=0
                image="units/svarballi/gold-dragon-cast-[07~22].png:50"
                sound=lightning.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=0
                end=200
                image="units/svarballi/gold-dragon-cast-[23~27].png:50"
                sound=lightning-miss.ogg
            [/frame]
        [/else]
    [/attack_anim]
 #enddef

     {DRAGON_LIGHTNING 1}
     {DRAGON_LIGHTNING 2}
     {DRAGON_LIGHTNING 3}


   [attack_anim]
      [filter_attack]
         name=heavenly breath
      [/filter_attack]

      start_time = -1900
        [frame]
            image="units/svarballi/gold-dragon-fire-se-[01~16].png:50"
        [/frame]
        [frame]
            sound=dragon-flames.ogg
            image="units/svarballi/gold-dragon-fire-se-17.png:50"
        [/frame]
        [frame]
            image="units/svarballi/gold-dragon-fire-se-[18~61].png:50"
        [/frame]
   [/attack_anim]   
   

[/unit_type]




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?20765>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to