ChaosRider’s WML questions

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
The_Other
Posts: 189
Joined: February 3rd, 2012, 10:05 pm
Location: UK

Re: I need help with the creation of codes...

Post by The_Other »

However, a lot of abilities that used to be limited to one exact usage are now more flexible and customizable (teleport is no longer limited to village-to-village only, and I believe in 1.11 you can specify a value for Drain rather than it always being 50% of damage caused?) - so it is highly possible that variable-value poison may be implemented in a future version (please?). At present though, Dugi's suggestion is the best (and I think the only) approach.
Nothing is true; everything is permissible.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need help with the creation of codes...

Post by ChaosRider »

Nice if they had poisoned unit, which is a life points dropped to 1 and not being cured of the poison for 3 rounds (ie for 3 rounds was poisoned and her hp is 1) is in the fourth round by dying and infecting poison of all other units standing beside her in death. This action of the death of units does not have to be after three rounds, and may be after two rounds (in the third, not fourth).

It's the only idea thrown slightly forward. Maybe someone will use it and realizes it or not.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need help with the creation of codes...

Post by ChaosRider »

Btw some of your abiliies (leech and summoning) are bugged and they dont work.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: I need help with the creation of codes...

Post by Dugi »

ChaosRider wrote:Btw some of your abiliies (leech and summoning) are bugged and they dont work.
They worked before I copied them here, there are probably some minor errors that I made when editing them to make them easier to use. Leaving it like a practice to you...
Spoiler:
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need help with the creation of codes...

Post by ChaosRider »

Btw i have question about amla:
Is this will work well to get 1 strike more per 2 get lvls (in the highest/last unit form)

Code: Select all

		[effect]
			apply_to=attack
			increase_attacks=0.5
		[/effect]
and is this will work to increase unit lvl?

Code: Select all

		[effect]
			apply_to=level
			increase_level=1
		[/effect]
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
The_Other
Posts: 189
Joined: February 3rd, 2012, 10:05 pm
Location: UK

Re: I need help with the creation of codes...

Post by The_Other »

Increase_attacks and increase_level do not exist, as far as I am aware - just use 'increase' in both cases. I'm not sure if +0.5 attacks will work properly, the best thing is to just try it yourself and see.
Nothing is true; everything is permissible.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: I need help with the creation of codes...

Post by zookeeper »

If ReferenceWML doesn't tell you that something works, then it doesn't work. So, when EffectWML gives you a list of valid values that [effect] apply_to= can take and "level" is nowhere to be seen, it means that apply_to=level had no meaning whatsoever.
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: I need help with the creation of codes...

Post by Ceres »

The_Other wrote:Increase_attacks and increase_level do not exist, as far as I am aware - just use 'increase' in both cases. I'm not sure if +0.5 attacks will work properly, the best thing is to just try it yourself and see.
Um, "increase" isn't listed in the wiki as a valid key, and increase_attacks does indeed exist. However, increase_level does not.
Your increase_attacks try won't work though, because it is handled as an integer.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need help with the creation of codes...

Post by ChaosRider »

It's bad, because I want to unit level is increased by 1 with each level gained after it reaches the final form of the unit.

As for the attack, even if they did not work, maybe it was the easiest way to make a variable that with every action of Amla to increase by 1, and if its value was positive (ie CO 2) that would then increase by 1 strike.

Just do not know how this should look like here in this game ... in Eclipse or Java, I would know how to write heh ...
Last edited by ChaosRider on May 24th, 2012, 6:53 am, edited 1 time in total.
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
Dugi
Posts: 4961
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: I need help with the creation of codes...

Post by Dugi »

I have a few suggestions to you.

For that increase_attacks, I suggest you to write increase_attacks=1 and increase_damage=-2, and the next advancement will add the 2 points of damage back, to make the total damage increase in a stable way.

To resolve things like increase_level and similar effects, such as apply_to=maximum attacks or apply_to=alignment, I am using a trick that I made an event that triggers after that a unit advances, that stores the unit, searches through objects and advances (advancements that a unit took are stored as advance tags in its modifications) through the unit's modifications tag, and for each effect it checks if the apply_to does not have a particular value, and then modifies the unit in the desired way. An example of it (a macro that allows the use of a new variable in the effect tag, set_icon for attacks) can be seen in UsefulWMLFragments (I have added it not long ago).
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: I need help with the creation of codes...

Post by Elvish_Hunter »

ChaosRider wrote: and is this will work to increase unit lvl?

Code: Select all

		[effect]
			apply_to=level
			increase_level=1
		[/effect]
No.
dugi wrote:To resolve things like increase_level and similar effects, such as apply_to=maximum attacks or apply_to=alignment, I am using a trick that I made an event that triggers after that a unit advances, that stores the unit, searches through objects and advances (advancements that a unit took are stored as advance tags in its modifications) through the unit's modifications tag, and for each effect it checks if the apply_to does not have a particular value, and then modifies the unit in the desired way. An example of it (a macro that allows the use of a new variable in the effect tag, set_icon for attacks) can be seen in UsefulWMLFragments (I have added it not long ago).
Another solution, that I'm using for the White Troll in TSoG, is to create several variations of the unit:

Code: Select all

    [variation]
        variation_name=level_2_troll
        inherit=yes
        level=2
    [/variation]
then hook each variation to an AMLA:

Code: Select all

        [effect]
            apply_to=variation
            name=level_2_troll
        [/effect]
Of course, to have the level increase in a certain order, you'll have to use the require_amla= key.
Another option may be using [modify_unit], but I did not test it to see if this works correctly after multiple advancements:

Code: Select all

[event]
    name=post advance
    first_time_only=no
    [filter]
        # the unit that you want to advance
    [/filter]
    [modify_unit]
        [filter]
            x,y=$x1,$y1
        [/filter]
        level="$($this_unit.level+1)"
    [/modify_unit]
[/event]
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)
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need help with the creation of codes...

Post by ChaosRider »

But I do not want to change its form during the lvl up, only to increase its level, ie for example, while the 5 lvl and giving units what they attack him 5 xp for attacking (and killing a 5 * 8xp = 40 xp) increased by 1 level up the activation of 'amla', ie the activation of 'amla' units which gave him six xp per attack and for killing him 48 xp. Like with every other character level after the last form of the form (ie, that which already works "Amla").
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
The_Other
Posts: 189
Joined: February 3rd, 2012, 10:05 pm
Location: UK

Re: I need help with the creation of codes...

Post by The_Other »

Use an event to modify the unit immediately after it advances. Something like this (pseudocode, as I'm not sure of the proper syntax without checking):

Code: Select all

[event]
name=post_advance
first_time_only=no
    [modify_unit]    
        [filter]
            ##  probably type=xxxxx, but could potentially be whatever you want
        [/filter]
            ##  increase level by 1
            ##  either look it up in the WML Reference, or wait and somebody will probably tell you how
    [/modify_unit]
[/event]
Nothing is true; everything is permissible.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need help with the creation of codes...

Post by ChaosRider »

As for the code below, then first you need to somehow put it in the Amla to use that event. Second, in the filter, there should write id of all units which have been his last form (if so, how it should be saved, because I do not think its only the id written), and thirdly if this is ever going to work?

Code: Select all

[event]
    name=post advance
    first_time_only=no
    [filter]
        # the unit that you want to advance (for example: "unit name=Ancient Lich Chaotic, Lord Mage Chaotic,... ...Lord Mauler Chaotic")
    [/filter]
    [modify_unit]
        [filter]
            x,y=$x1,$y1
        [/filter]
        level="$($unit name.level+1)"
    [/modify_unit]
[/event]
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
User avatar
ChaosRider
Posts: 846
Joined: April 15th, 2012, 1:15 pm

Re: I need a little help : ).

Post by ChaosRider »

Amazing, something happens!
(era size - 14,8 mib)

Now I'm curious how fast draws my file server. Because of their smaller, the longer it will take to upload it.


Already made ​​it, I invite you to download. Is temporarily without a new animation).

Chaotic Era MP Era ( newest version 1.3.9 )

If someone you find any errors (eg lack of icons from the attack when choosing an attack in the struggle between individuals) is a post I would ask here or on the mail.

Btw, i am testing this era, and balance between factions (on map with size 199x199).
Attachments
Map (199x199).png
Creator of WOTG (+2880 units), MWC (+615 units), SurvivorsArea, RandomColosseum, RC WOTG, RC MWC, ColosseumRandomClonesBattle, BetweenDarknessAndLight, StealingWeapons, MoreUnitsForms, MoreDamageTypes, CanBeOnlyOne, ColosseumOneWinner, BonusSpam, CriticalStrike - available at 1.12 Wesnoth server.
Post Reply