Search found 585 matches
- April 16th, 2024, 9:33 am
- Forum: Technical Support
- Topic: Add-on and game crashes when terrain has more than 4 digits
- Replies: 8
- Views: 606
Re: Add-on and game crashes when terrain has more than 4 digits
Can you provide detailed reproduction steps? I cannot get the game to crash with a map with a terrain with more than 4 characters or when defining a terrain type with more than 4 characters. (Both of those cases show an error in the GUI for me.) Bit hazy here as it was ages ago but I had a similar ...
- April 15th, 2024, 1:17 pm
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1689
Re: Working lua need advice deciding which method is best
Correct. Note that putting Lua in an event doesn't fully isolate it from the rest of the scenario though. It will only be executed when that event fires, but that code can change global variables, move units around, and do many other things that affect code running elsewhere in the scenario. On the...
- April 15th, 2024, 1:04 pm
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1689
Re: Working lua need advice deciding which method is best
...If you put the Lua code inside a... And of course, if you put the Lua code in an event or menu item, it will be executed only when that event or menu item fires. Interesting, thanks. I hadn't realised you could "isolate" lua code from everywhere in a campaign except for one event... Bu...
- April 15th, 2024, 11:25 am
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1689
Re: Working lua need advice deciding which method is best
Hi everyone, Thanks for all your help and patience, much appreciated. I now have a short lua snippet in my campaign that does what I want (it's not fully tested yet and I need to check it's replay safe but the actual logic works). I'm a long way from being familiar/confident with lua but at least I ...
- April 15th, 2024, 11:14 am
- Forum: WML Workshop
- Topic: Let the gold rain down!
- Replies: 13
- Views: 506
- April 15th, 2024, 8:43 am
- Forum: WML Workshop
- Topic: Let the gold rain down!
- Replies: 13
- Views: 506
Re: Let the gold rain down!
[event] name=side_2_turn_20 [gold] side=2 amount=100 [/gold] [/event] -- Mal Try replacing name=side_2_turn_20 with name=side 2 turn 20 (i.e. lose the underscores). https://wiki.wesnoth.org/EventWML#side_X_turn_Y [off_topic] Note that [gold] does what it says on the tin; so if gold before is -101 a...
- April 15th, 2024, 8:26 am
- Forum: Lua Labs
- Topic: [closed] remove unit from array
- Replies: 11
- Views: 455
Re: remove unit from array
...I want to learn lua better... Heh, I am currently going through the exactly same process starting from a position of knowing zero lua. Note that the wiki isn't quite right so don't make my mistake of spending *hours* debugging something that will never work... :augh: Good luck. Cheers! -- Spanne...
- April 14th, 2024, 7:44 pm
- Forum: Lua Labs
- Topic: [closed] remove unit from array
- Replies: 11
- Views: 455
Re: remove unit from array
Just curious, but why lua?ZombieKnight wrote: ↑April 13th, 2024, 7:52 am Hi,
I'm trying to remove unit with id=$unit.id from array of units "side_7_retreat_micro_ai"...
A [for] loop would do that - and for me anyway, it's a lot easier to debug!
Cheers!
-- Spannerbag
- April 13th, 2024, 5:10 pm
- Forum: WML Workshop
- Topic: variable expansion
- Replies: 4
- Views: 332
Re: variable expansion
As you're dealing with one unit, I think you can maybe dispense with [modify_unit] and put the [filter] in [object] ? It would save a bit of space - but it's nothing like what you want to do so maybe something to consider if no-one else suggests anything better? [insert_tag] might be able to do what...
- April 13th, 2024, 9:54 am
- Forum: WML Workshop
- Topic: WML messenger_ai problem
- Replies: 5
- Views: 387
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...
- April 12th, 2024, 10:26 pm
- Forum: WML Workshop
- Topic: Next next question
- Replies: 3
- Views: 323
Re: Next next question
malthaussen wrote: ↑April 12th, 2024, 9:55 pm Turns out it was a capitalization issue. Works now.
-- Mal
Glad you got it sorted, and I learned that
[music]
works there.Cheers!
-- Spannerbag
- April 12th, 2024, 10:15 pm
- Forum: WML Workshop
- Topic: WML messenger_ai problem
- Replies: 5
- Views: 387
Re: WML messenger_ai problem
I've not used that particular micro_ai but you don't need to use a loop. Instead, inside your [micro_ai][filter] you could just have find_in=units_to_micro_ai However, if you only store those units purely to associate them with the micro_ai I think you could replace all your code with: [micro_ai] si...
- April 12th, 2024, 9:38 pm
- Forum: WML Workshop
- Topic: Next next question
- Replies: 3
- Views: 323
Re: Next next question
I want to play a short bugle call and show a picture on the scenario start screen. Picture works fine. (well, it won't scale; can the picture's size be changed? The text window covers the bottom, would like the pic not to overflow into the text window) Music won't play. It was placed in the "a...
- April 12th, 2024, 8:23 am
- Forum: Lua Labs
- Topic: Working lua need advice deciding which method is best
- Replies: 34
- Views: 1689
Re: Working lua need advice deciding which method is best
@gnombat Are you sure that's not supposed to be wml.tag.variable ? Heh, I trusted the wiki and didn't know about wml.tag.variable... Thanks for pointing this out! @Ravana wiki is wrong, wml.variable does not exist. It was supposed to be wml.tag.have_unit and wml.tag.variable. Lua also knows some com...
- April 11th, 2024, 10:14 pm
- Forum: WML Workshop
- Topic: Now THIS is funny
- Replies: 9
- Views: 488
Re: Now THIS is funny
A couple of quick things you might try: See if there's anything helpful in the logfile. Purge the cache (main menu->preferences->cache) and try again, the error might re-appear (and also be in the logfile which saves faffing around with screen grabs if you're lucky). Sorry if this is bit terse, was ...