Insert Image /Campaign map risk/language possibilities

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
lysiar
Posts: 5
Joined: September 10th, 2013, 2:46 pm
Location: France

Insert Image /Campaign map risk/language possibilities

Post by lysiar »

Hi,
In my campaign, I am trying to do several things and, after looking for the answers on the wiki and on this forum, i'm calling for help now :P

First, is it possible to include images in the field "description=" for an ability ? For exemple :
Spoiler:


Then, i would like to change the name of terms like neutral/lawful/...
I've already done it (with success) for my attack type (with [language] Type_Test="TEST" [/language].
Did somebody know how to do it ?

And (as risk/dawn of war 2 or the old dune 2) : is it possible to have a campaign map with several areas clickable (you can do it in an html image for example) ? And when you click on, let's say "area 1" the game will load a specific scenario ("scenario 1").

Lysiar
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Insert Image /Campaign map risk/language possibilities

Post by Dugi »

First, is it possible to include images in the field "description=" for an ability ?
No.
Then, i would like to change the name of terms like neutral/lawful/...
Anything else than the four available ones will be replaced by neutral. You can create a weapon special whose properties depend on time of day as a workaround.
is it possible to have a campaign map with several areas clickable (you can do it in an html image for example) ? And when you click on, let's say "area 1" the game will load a specific scenario ("scenario 1").
No.
User avatar
lysiar
Posts: 5
Joined: September 10th, 2013, 2:46 pm
Location: France

Re: Insert Image /Campaign map risk/language possibilities

Post by lysiar »

Thanks a lot :)

I have an other question : I would like, when a unit level up (AMLA) get +1 level to this very unit.

I've read this post : http://forums.wesnoth.org/viewtopic.php?f=21&t=39097
and this one : http://forums.wesnoth.org/viewtopic.php?f=21&t=33844

But it seems to me that in both of these posts the unit id should be specified. And I would like it to be more "global" ( put a {MY_AMLA} in each of my unit .cfg; and define it in the AMLA.cfg)

I don't know if I'am understandable or not because it's kind of hard to explain this in english (not my mother tongue at all) :P
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Insert Image /Campaign map risk/language possibilities

Post by Dugi »

I have an other question : I would like, when a unit level up (AMLA) get +1 level to this very unit.
It can be done, but it will need more complex tricks than just some standard AMLA.

You might be able to do it by firing an event containing this code:

Code: Select all

[store_unit]
 [filter]
  #Use this filter to make sure it will store the unit(s) in question
 [/filter]
 variable=checked
[/store_unit]
{FOREACH checked i} #Circle through all units worked on
 [store_unit_type] #Its level might be already adjusted, so we need to get the level of its unit_type instead
  type=$checked[$i].type
  variable=checked_type
 [/store_unit_type]
 {VARIABLE checked[$i].level checked_type.level} #Set its level to its unmodified value learned above
 {VARIABLE_OP checked[$i].level add checked[$i].modifications.advance.length} #Increase its level by the number of AMLAs taken
{NEXT i}
{CLEAR_VARIABLE checked_type,checked} #Clean up
As a side note, to see the limitations of modding here in things that concern units' properties, try to see an add-on named World of Wesnoth (better don't try to understand its code).

And your english is easily understandable, no need to worry.
User avatar
lysiar
Posts: 5
Joined: September 10th, 2013, 2:46 pm
Location: France

Re: Insert Image /Campaign map risk/language possibilities

Post by lysiar »

Now, I am having troubles implementing a weapon special abilities who slows the bearer of this weapons when he uses it.
Spoiler:
With this code, it's always the opponent who is slowed.
I've tried to change it in "apply_to=self". But it doesn't work either. Any clue ?
The strange part is that when I change this : "apply_to=attacker" to this : "apply_to=both" It's actually working (but for both). :annoyed:
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Insert Image /Campaign map risk/language possibilities

Post by 8680 »

lysiar wrote: [slow]
apply_to=attacker
[/slow]
This doesn’t slow the attacker, this gives the attacker the power to slow its enemies. If you want a unit using this weapon to be slowed when it gets hit, try apply_to=opponent.
User avatar
lysiar
Posts: 5
Joined: September 10th, 2013, 2:46 pm
Location: France

Re: Insert Image /Campaign map risk/language possibilities

Post by lysiar »

Indeed, it's working when the opponent hit my unit with this "heavy weapon". But, what I want it's getting the slow penalty to my unit when he's hiting the ennemy.
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Insert Image /Campaign map risk/language possibilities

Post by Elvish_Hunter »

lysiar wrote:I have an other question : I would like, when a unit level up (AMLA) get +1 level to this very unit.
In that case, a solution may be to use an event-based special.
First you'll need to create a weapon special that does nothing except reporting that it's here with a [dummy] tag (or any other tag that isn't listed at http://wiki.wesnoth.org/AbilitiesWML), then use an event:

Code: Select all

[event]
    name=attacker hits
    first_time_only=no
    [filter_attack]
        special=heavyweapon
    [/filter_attack]
    [modify_unit]
        [filter]
            id=$unit.id
        [/filter]
        [status]
            slowed=yes
        [/status]
    [/modify_unit]
[/filter]
I didn't test the code above, but it should give you an idea on how to proceed. :)
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Post Reply