Search found 2211 matches
- April 12th, 2024, 1:22 pm
- Forum: WML Workshop
- Topic: Ability damage %HP owner help needed
- Replies: 10
- Views: 1826
Re: Ability damage %HP owner help needed
That's a good question, and it made me realize that you want
$this_unit
(which is indeed filled in by [harm_unit]
) rather than $unit
(which is filled in by the event, but in your case would be blank since it's a turn event).- April 11th, 2024, 1:07 pm
- Forum: WML Workshop
- Topic: Ability damage %HP owner help needed
- Replies: 10
- Views: 1826
Re: Ability damage %HP owner help needed
The way I understood use was, $self was meant as unit with ability, not the unit being harmed. Hmm, you're right. I saw that this was about an ability and thought we were talking about an ability formula and missed the fact that, in fact, there was a [harm_unit] tag involved. So, I think changing t...
- April 11th, 2024, 1:02 pm
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1662
Re: Working lua need advice deciding which method is best
Let me just repeat myself: passing _G to stringx.vformat will not work . _("There is a $color $species.") I only speak American, not even English, but that looks like a pain for translators. Would they re-order $color and $species as necessary (in which case this appears to be a preferable...
- April 11th, 2024, 4:37 am
- Forum: WML Workshop
- Topic: Ability damage %HP owner help needed
- Replies: 10
- Views: 1826
Re: Ability damage %HP owner help needed
amount="$($self.hitpoints*0.6)" <-------- THE PROBLEM I WANT TO SOLVE That's wrong. Delete the $ signs and you should have it working. What that actually does is look for a WML container variable called self which contains a variable called hitpoints . Failing to find one, it deletes the ...
- April 11th, 2024, 4:27 am
- Forum: WML Workshop
- Topic: [AI] my first attempt at altering goals
- Replies: 4
- Views: 1621
Re: [AI] my first attempt at altering goals
So I want to tell the enemy "put more focus on attacking canrecruit=no". But not, "completely ignore the human leaders, allowing them to assassination our leaders). Seems "simple" enough, two goals (or aspects??): attack canrecruit=no / protect leader. I can see how to do e...
- April 11th, 2024, 4:11 am
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1662
Re: Working lua need advice deciding which method is best
_("There is a $color $species.") I only speak American, not even English, but that looks like a pain for translators. Would they re-order $color and $species as necessary (in which case this appears to be a preferable alternative to string.format, which I find much more readable)? What ab...
- April 10th, 2024, 11:29 pm
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1662
Re: Working lua need advice deciding which method is best
There isn't really any reason you would want to use both the concatenation operator .. and stringx.vformat together. I wouldn't say there is no reason at all, but the case discussed in this thread is definitely not a reason to use them together. What there's not point in doing is calling vformat wi...
- April 10th, 2024, 1:32 pm
- Forum: Writers’ Forum
- Topic: Scripts for Wesnoth
- Replies: 73
- Views: 30776
Re: Scripts for Wesnoth
Nope, Kitty hasn't been around for years.
- April 10th, 2024, 1:30 pm
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1662
Re: Working lua need advice deciding which method is best
You don't need to make it translatable at all. Just concatenate if that feels easier for you, but keep in mind that when you do need something to be translatable that you must use
stringx.vformat
(or string.format
is fine too).- April 8th, 2024, 5:39 pm
- Forum: WML Workshop
- Topic: status invulnerable
- Replies: 14
- Views: 3110
Re: status invulnerable
Regarding how invulnerable works, it just forces the hit chance to zero.
- April 8th, 2024, 5:20 pm
- Forum: Lua Labs
- Topic: Custom dialog close() on space/left_click
- Replies: 4
- Views: 2633
Re: Custom dialog close() on space/left_click
Sorry, that one I'm not sure about.
- April 8th, 2024, 4:50 pm
- Forum: Lua Labs
- Topic: Custom dialog close() on space/left_click
- Replies: 4
- Views: 2633
Re: Custom dialog close() on space/left_click
I'm not quite sure if this will work, but you could try this:
Completely hypothetical and untested. I'm not even sure if a close() function exists.
Code: Select all
local function pre_show(dialog)
dialog.on_left_click = function() dialog:close() end
end
- April 3rd, 2024, 6:49 am
- Forum: Ideas
- Topic: Translate wiki pages
- Replies: 5
- Views: 1506
Re: Translate wiki pages
I think translating wiki stuff is probably better done using wiki-specific methods rather than something like po4a, especially since po4a doesn't support MediaWiki markup. For example, this extension (which is not installed on our wiki though). From my perspective, the flow you've outlined seems qui...
- April 2nd, 2024, 5:53 pm
- Forum: Lua Labs
- Topic: [GUI] spinner and repeating button
- Replies: 1
- Views: 1321
Re: [GUI] spinner and repeating button
The spinner is a very new widget, so it's possible that some essential parts of interacting with it in Lua just haven't been implemented yet. I don't know any details about it.
- April 2nd, 2024, 5:51 pm
- Forum: Ideas
- Topic: New Lua functions.
- Replies: 11
- Views: 1773
Re: New Lua functions.
You can remove a sound source from the map. If it still continues to play after you do that, then that's clearly a bug.