Samonella's questions: currently solved

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.

Re: Samonella's questions: currently solved

Postby Samonella » December 9th, 2017, 10:39 pm

Hello again.

I must just be overlooking something obvious, but could someone please tell me why this code isn't working? It adds the attack, but the animation doesn't play.
Code: Select all
   [modify_unit]
      [filter]
         id=Voadar
      [/filter]

      [effect]
         apply_to=new_attack
         name=trident
         description=_"trident"
         type=pierce
         [specials]
            {WEAPON_SPECIAL_FIRSTSTRIKE}
         [/specials]
         damage=15
         number=2
         range=melee
         icon=attacks/trident.png
      [/effect]
      
      [effect]
         apply_to=new_animation
         [attack_anim]
            [filter_attack]
               name=trident
            [/filter_attack]
            start_time=-200
            [frame]
               image=units/drakes/fire.png:300
            [/frame]
            {SOUND:HIT_AND_MISS spear.ogg spear-miss.ogg -100}
         [/attack_anim]
      [/effect]
   [/modify_unit]


EDIT: I used an object for the new animation and it works now. Apparently, without the [object], there's no way to leave the animation in the unit's [modifications] container (it was empty in the inspect window).
The last few months have been nothing but one big, painful reminder that TIMTLTW.

Creator of Armory Mod, The Rising Underworld, and Vengeance of a Drake: an RPG
Samonella
 
Posts: 299
Joined: January 8th, 2016, 5:41 pm
Location: USA

Re: Samonella's questions: currently unsolved

Postby Samonella » December 16th, 2017, 4:12 am

Here's a strange problem. It might have to do with 1.13.10's big graphic updates?

My goal is to change a certain unit's image (base image, none of the animations). This is the closest I've got:

Code: Select all
[modify_unit]
   [filter]
      id=Voadar
   [/filter]
   variation=holds_hay
[/modify_unit]      

[store_unit]
    [filter]
        id=Voadar
    [/filter]
    variable=Voadar.unit
    kill=yes
[/store_unit]
{VARIABLE Voadar.unit.image "units/fire-hay.png"}
[unstore_unit]
   variable=Voadar.unit
   find_vacant=no
[/unstore_unit]
And in the [unit_type] is
Code: Select all
[variation]
   variation_id=holds_hay
   hide_help=yes
   inherit=yes
   image="units/fire-hay.png"
[/variation]


This manages to change the unit's icon in the status bar but not its image on the actual map.

Does anyone know why it only works halfway, or know a different way to do it?
The last few months have been nothing but one big, painful reminder that TIMTLTW.

Creator of Armory Mod, The Rising Underworld, and Vengeance of a Drake: an RPG
Samonella
 
Posts: 299
Joined: January 8th, 2016, 5:41 pm
Location: USA

Re: Samonella's questions: currently unsolved

Postby gnombat » December 16th, 2017, 1:58 pm

Samonella wrote:the big bar on the right of the screen, below the mini-map. Is there an official name for that?

I don't know if there's an official name for it, but I think it's usually called the sidebar.
gnombat
 
Posts: 127
Joined: June 10th, 2010, 8:49 pm

Re: Samonella's questions: currently unsolved

Postby Sapient » December 16th, 2017, 2:54 pm

While I don't have a lot of experience with this type of modification, I think it is necessary to change the unit's "standing animation"

See this previous similar question: viewtopic.php?p=517308#p517308

Hope that helps!
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Sapient
Developer
 
Posts: 4381
Joined: November 26th, 2005, 7:41 am

Re: Samonella's questions: currently solved

Postby Samonella » December 16th, 2017, 3:23 pm

Sapient wrote:While I don't have a lot of experience with this type of modification, I think it is necessary to change the unit's "standing animation"

See this previous similar question: viewtopic.php?p=517308#p517308
Awesome, thanks for digging that up! Unfortunately that method didn't work too well, the game randomly switched between the original image and the new animation when I selected or moved the unit. I thought maybe the game had applied the new animation as well as the old default on, so I put base_score=100 in the new one (see how animations are chosen) but that didn't fix it.
EDIT: I also tried adding selected and default animations, but they didn't help either.
EDIT 2: I also just realized that since the unit is a drake it already has standing/movement/post-movement animations, so that could be part of the problem. Of course base_score=100 should definitely still override those, but whatever, I still got it working how I described below.

Meanwhile, I was looking at Heir to the Throne as an example, when Konrad/Li'sar gets the sceptre. The only difference I could spot there was that the [variation]s in their unit types don't use inherit=yes. I tried doing it that way, and happily enough it worked! Storing/unstoring the unit to manually change its image was unnecessary, too.

And another edit, I forgot to say:
gnombat wrote:I don't know if there's an official name for it, but I think it's usually called the sidebar.
Official or not, it's better than "status bar." Thanks!
The last few months have been nothing but one big, painful reminder that TIMTLTW.

Creator of Armory Mod, The Rising Underworld, and Vengeance of a Drake: an RPG
Samonella
 
Posts: 299
Joined: January 8th, 2016, 5:41 pm
Location: USA

Previous

Return to WML Workshop

Who is online

Users browsing this forum: No registered users and 3 guests