Knyghtmare's WML problems

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
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Weapon Special: Charm (Remaking the original)

Post by zookeeper »

You don't need to store the unit. Primary and secondary units are automatically stored in $unit and $second_unit, both of which you're already using to retrieve the unit id.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Weapon Special: Charm (Remaking the original)

Post by 8680 »

[filter]race= accepts a list, e.g. race="human,elf,dwarf,elf of a different color".

I wrote a charm weapon special for Battlestar’s Scarlet Sea that does what you want, minus the ToD-awareness.

Having the special active only at night could be implemented by adding some filters:

Code: Select all

[dummy]
    ...
    [filter_self]
        [filter_location]
            time_of_day=chaotic
        [/filter_location]
    [/filter_self]
    ...
[/dummy]
[event]
    name=attacker_hits
    ...
    [filter]
        [filter_location]
            time_of_day=chaotic
        [/filter_location]
    [/filter]
    ...
[/event]
[event]
    name=defender_hits
    ...
    [filter_second]
        [filter_location]
            time_of_day=chaotic
        [/filter_location]
    [/filter_second]
    ...
[/event]
Making it last only until dawn is more difficult; I’ll see what I can do.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Weapon Special: Charm (Remaking the original)

Post by Lord-Knightmare »

You don't need to store the unit. Primary and secondary units are automatically stored in $unit and $second_unit, both of which you're already using to retrieve the unit id.
[filter]race= accepts a list, e.g. race="human,elf,dwarf,elf of a different color".
Having the special active only at night could be implemented by adding some filters:
Okay and acknowledged.
I wrote a charm weapon special for Battlestar’s Scarlet Sea that does what you want, minus the ToD-awareness.
I read that. But, I don't understand Lua, so I'm trying to achieve this using only WML.

I have used both of your tips and suggestions and made this. Still haven't tested this though...
Demo

Code: Select all

#define WEAPON_SPECIAL_CHARM
[dummy]
    id="charm"
    name= _ "charm"
    description= _ "This attack ensorcels the minds of mortal men, turning them against their allies."
    [filter_self]
        [filter_location]
            time_of_day=chaotic
        [/filter_location]
    [/filter_self]
[/dummy]

[/specials]

[/attack]

{CHARM_EVENTS}

[+attack]

[+specials]
#enddef

#define CHARM_EVENTS
[event]
    name=attacker_hits
    id="charm-attacker_hits"
    first_time_only=no

    [filter]
        [filter_location]
            time_of_day=chaotic
        [/filter_location]
    [/filter]

    [filter_attack]
        special="charm"
    [/filter_attack]

    [filter_second]
        race=human,elf,dwarf,southern elf,aragwaith
        gender=male        
    [/filter_second]

    [store_unit]
        [filter]
            id=$second_unit.id
        [/filter]
        kill=no
        variable=restore
        mode=append
    [/store_unit]

    [modify_unit]
        [filter]
           id=$second_unit.id
        [/filter]
        side=$unit.side
    [/modify_unit]
[/event]

[event]
    name=defender_hits
    id="charm-defender_hits"
    first_time_only=no
 
    [filter_attack]
        special="charm"
    [/filter_attack] 

    [filter_second]
        [filter_location]
            time_of_day=chaotic
        [/filter_location]
        race=human,elf,dwarf,southern elf,aragwaith
        gender=male        
    [/filter_second]

    # victim is stored, this will be required to covert him to his initial side

    [store_unit]
        [filter]
            id=$second_unit.id
        [/filter]
        kill=no
        variable=restore
        mode=append
    [/store_unit]

    [modify_unit]
        [filter]
           id=$second_unit.id
        [/filter]
        side=$unit.side
    [/modify_unit]
[/event]

[event]
    name=new turn

    [if]
         [filter_location]
              time_of_day=lawful
         [/filter_location]

         [then]
    
# a vampire queen can have many victims, as she is very seductive

            {FOREACH restore i}
                [modify_unit]
                    [filter]
                         id=$restore[$i].id
                    [/filter]
                    side=$restore[$i].side
                [/modify_unit]
            {NEXT i}

            {CLEAR_VARIABLE restore}

       [/then]
       [else]
       [/else]
    [/if]
[/event]
#enddef
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Weapon Special: Charm (Remaking the original)

Post by Lord-Knightmare »

Result: Ability no work :(

I also tried the one in Scarlet Sea, but that gave a Lua error. :(
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Heindal
Posts: 1353
Joined: August 11th, 2011, 9:25 pm
Location: Germany, Karlsruhe
Contact:

Re: Weapon Special: Charm (Remaking the original)

Post by Heindal »

Hm, I created a becharm special for strange legacy. But it works without a secondary filter. Maybe you should first try to make it work and than place special filters.
I'm not quite sure if time_of_day=chaotic works. I never filtered with chaotic (which seems to be the "alignment" of a unit not the time of day), but I always had problems with filtering and saving time_of_day for my encounters. Try to replace that.

You might also need to build a small testing campaign with one scenario, where you are able to recruit units with that special. That works fine for testing and saves time.
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Weapon Special: Charm (Remaking the original)

Post by 8680 »

Lord-Knightmare wrote:I also tried the one in Scarlet Sea, but that gave a Lua error.
You'd need to include this file in your main.cfg.
Heindal wrote:I'm not quite sure if time_of_day=chaotic works. I never filtered with chaotic (which seems to be the "alignment" of a unit not the time of day), [...]
StandardLocationFilter wiki page wrote:time_of_day: filter matches only on a given time of day (one of lawful, chaotic, neutral or liminal). Note: chaotic, lawful, neutral and liminal; these are not times of day, these are alignments. To match against 'dawn', 'dusk', 'first watch' etc., use the time_of_day_id key described below.
User avatar
Heindal
Posts: 1353
Joined: August 11th, 2011, 9:25 pm
Location: Germany, Karlsruhe
Contact:

Re: Weapon Special: Charm (Remaking the original)

Post by Heindal »

Thanks 8680, maybe one should replace the link in the wiki, when clicking on "time_of_day". One will just land on that page:

http://wiki.wesnoth.org/ThemeWML#.5Bstatus.5D

:(
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Weapon Special: Charm (Remaking the original)

Post by 8680 »

Heindal wrote:Thanks 8680, maybe one should replace the link in the wiki, when clicking on "time_of_day".
The sidebar is only for tags, as it says at the top. Attributes are documented under their tags, in this case [filter_location].
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Scenarios won't load.

Post by Lord-Knightmare »

I have recently tried to separate the episodes of my campaigns. I made sub-folders in the 'scenarios' folder and separated them. I have done the same for maps as well and edited my _main.cfg file to suit the new location. But, I have ran into a problem. The scenarios won't load. I looked at how the scenarios were separated in Legend Of Wesmere, and cloned that method, but still, no avail.

So, I'm attaching some screenshots:

1. What I first did:
Screen Shot 2013-02-15 at 3.28.37 PM.png
Screen Shot 2013-02-15 at 3.31.07 PM.png
2. After I saw how the scenarios in Legend of Wesmere were organized:
Screen Shot 2013-02-16 at 7.08.51 PM.png
Screen Shot 2013-02-16 at 7.08.51 PM.png (31.87 KiB) Viewed 2730 times
Screen Shot 2013-02-16 at 7.09.18 PM.png
what the _main.cfg file in scenarios folder looks like.
what the _main.cfg file in scenarios folder looks like.
Screen Shot 2013-02-16 at 7.13.29 PM.png (11.33 KiB) Viewed 2730 times
I can always convert to the old method, but I want to organize my scenarios more...
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Scenarios won't load.

Post by zookeeper »

Not knowing how those two add-ons are supposed to interact, I'll make a wild guess that the symbol CAMPAIGN_TLB isn't set anywhere.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Scenarios won't load.

Post by Lord-Knightmare »

zookeeper wrote:Not knowing how those two add-ons are supposed to interact, I'll make a wild guess that the symbol CAMPAIGN_TLB isn't set anywhere.
The add-ons mix together flawlessly.
Nope, I attached that in each campaign tag...
Screen Shot 2013-02-15 at 3.31.31 PM.png
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Scenarios won't load.

Post by 8680 »

Firstly, don’t include images. Secondly, include scenarios after macros. I don’t know if fixing these will solve your problem, but they need fixing anyway.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Scenarios won't load.

Post by Lord-Knightmare »

8680 wrote:Firstly, don’t include images. Secondly, include scenarios after macros. I don’t know if fixing these will solve your problem, but they need fixing anyway.
Okay, having loaded the macros folder before the scenarios folder seems to have solved the problem. Thanks guys. I still can't figure out why I shouldn't load images. Campaign loads just fine with'em.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Help with Terrain Transitions (Again)

Post by Lord-Knightmare »

Okay, this is third time I have posted about terrain transitions.

I have copied/edited castle and keep terrains for use in my campaign, but I'm facing issues with transitions (especially adjacent mountains)

This what they appear like:
Compared to human castle
Compared to human castle
Screen Shot 2013-01-29 at 10.38.18 PM.png (311.11 KiB) Viewed 2692 times
The enemy base
The enemy base
Terrain Types & Codes:
Spoiler:
Can someone help me out here?
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Help with Terrain Transitions (Again)

Post by 8680 »

Have you tried increasing the layer?

Also, it is preferred that each member uses a single WML Workshop thread, rather than one thread per question, so I am merging this with your previous threads.
Post Reply