Search found 1161 matches

by white_haired_uncle
Today, 2:37 am
Forum: WML Workshop
Topic: traits
Replies: 3
Views: 83

Re: traits

Yeah, "doesn't work" isn't much to go on. I wonder if this will help (from a [unit] declaration): [modifications] [advancement] [effect] apply_to=new_ability [abilities] {ABILITY_NINJA} [/abilities] [/effect] [/advancement] [/modifications]
by white_haired_uncle
Yesterday, 1:22 pm
Forum: WML Workshop
Topic: [solved] [have_unit], count, recall list, WFL syntax and wildcards
Replies: 4
Views: 119

Re: [have_unit], count, recall list, WFL syntax and wildcards

Thanks. The WFL stuff looks quite useful, but I think I'll just stick to lua.
by white_haired_uncle
Yesterday, 6:58 am
Forum: Lua Labs
Topic: [closed] remove unit from array
Replies: 11
Views: 242

Re: remove unit from array

ZombieKnight wrote: Yesterday, 6:41 am Jup, [foreach] would work even better, but I want to learn lua better...
Thanks!
foreach doesn't play well with removing elements of the array it is iterating over. I don't try to remember the rules, I just use for if I'm going to remove anything.
by white_haired_uncle
Yesterday, 6:52 am
Forum: WML Workshop
Topic: Next question: how to trigger a "sighted" event.
Replies: 5
Views: 145

Re: Next question: how to trigger a "sighted" event.

Actually, I made the assumption that any side != 1 is an enemy of side 1.

I have a hard time keeping the filter rules straight, I always have to look for an example, but something like this?

Code: Select all

[filter]
   [enemy_of]
        side=1
   [/enemy_of]
[/filter]
[filter_second]
    side=1
[/filter_second]
by white_haired_uncle
Yesterday, 2:48 am
Forum: WML Workshop
Topic: Setting multiple objectives
Replies: 5
Views: 111

Re: Setting multiple objectives

You can use die or last breath for when the enemy leader dies and capture for when a village is captured as triggers. Then when one of those things happens you just need to check if the other two conditions are met and if so [endlevel]. [have_unit] can test if the enemy leader is alive/dead. Checkin...
by white_haired_uncle
April 14th, 2024, 4:06 pm
Forum: WML Workshop
Topic: [solved] [have_unit], count, recall list, WFL syntax and wildcards
Replies: 4
Views: 119

[solved] [have_unit], count, recall list, WFL syntax and wildcards

I want to print a message only if the number of undead, both on the map and on the recall list. This has led me to some questions. So many it's time to ask for help. (I know, use lua. But I want to learn some stuff) [message] speaker=Efraim message= _ "Good point. Perhaps we should have brought...
by white_haired_uncle
April 13th, 2024, 4:32 pm
Forum: WML Workshop
Topic: variable expansion
Replies: 4
Views: 151

variable expansion

Consider the following, taken out of context: [foreach] array=guards [do] {VARIABLE_OP index rand (0..4)} [switch] variable=index [case] value=0 [modify_unit] [filter] id=$this_item.id [/filter] [object] id=temp_obj [effect] apply_to=attack range=melee [set_specials] mode=append {WEAPON_SPECIAL_UNHO...
by white_haired_uncle
April 13th, 2024, 1:23 am
Forum: WML Workshop
Topic: Let the gold rain down!
Replies: 13
Views: 289

Re: Let the gold rain down!

I just search the mainline campaigns, for example:

Code: Select all

grep -r name=side /export/share/build/spartan/wesnoth-git/data/campaigns/
by white_haired_uncle
April 12th, 2024, 11:44 pm
Forum: WML Workshop
Topic: Let the gold rain down!
Replies: 13
Views: 289

Re: Let the gold rain down!

I assume you're familiar with the various turn events, like new_turn or side_2_turn:

Code: Select all

                   [gold]
                        side=2
                        amount=100
                    [/gold]
 
by white_haired_uncle
April 12th, 2024, 10:59 pm
Forum: WML Workshop
Topic: WML messenger_ai problem
Replies: 5
Views: 168

Re: WML messenger_ai problem

However, if you only store those units purely to associate them with the micro_ai I think you could replace all your code with: I think that's quite different. The first looks like "If you're not in the water/swamp or near some location RIGHT NOW you get assigned the mai". The second look...
by white_haired_uncle
April 12th, 2024, 4:46 pm
Forum: WML Workshop
Topic: Next question: how to trigger a "sighted" event.
Replies: 5
Views: 145

Re: Next question: how to trigger a "sighted" event.

https://wiki.wesnoth.org/EventWML#sighted The primary unit is the unit that became visible, and the secondary unit belongs to the side that now sees the primary unit. Sounds like you want to make sure that a unit not on side 1 is seen by a unit on side 1. JUST GUESSING HERE, but something like: [fil...
by white_haired_uncle
April 12th, 2024, 3:00 am
Forum: WML Workshop
Topic: [AI] performance cost of mutliple CAs
Replies: 1
Views: 90

[AI] performance cost of mutliple CAs

I'm looking at creating a few units whose mission is to target a human-controlled leader. At the moment, using the simple_attack micro_ai. Each time I create one of these units, I create a CA for it, so I end up with something like this: [candidate_action] enabled=yes engine="lua" id="...
by white_haired_uncle
April 11th, 2024, 6:49 pm
Forum: Scenario & Campaign Development
Topic: Legend of the Invincibles
Replies: 8125
Views: 2117791

Re: Legend of the Invincibles

It should work in 1.18, though there may be just a little strangeness most people won't notice.

But, yeah, AFAIK there's no 1.18 version published on the addons client/web, so git or the web version for 1.16.