Search found 42 matches
- December 2nd, 2024, 8:26 pm
- Forum: Lua Labs
- Topic: Converting LUA table to WML array[solved]
- Replies: 5
- Views: 2634
Re: Converting LUA table to WML array
wml.variables['coordinate_list[' .. i .. ']'] = {x = loc[1], y = loc[2]}
worked, thank you both!Solved
- November 29th, 2024, 11:59 am
- Forum: Lua Labs
- Topic: Converting LUA table to WML array[solved]
- Replies: 5
- Views: 2634
Re: Converting LUA table to WML array
I'm trying to turn LUA table with x y coordinates from wesnoth.paths.find_path into a set of WML arrays. The iteration seems to be working correctly, as I can print these coordinates to console, but I'm definitely missing something when it comes to converting them to WML, as this step isn't describe...
- November 29th, 2024, 6:00 am
- Forum: Lua Labs
- Topic: Converting LUA table to WML array[solved]
- Replies: 5
- Views: 2634
Converting LUA table to WML array[solved]
Apparently, you do this through wml.array_access.set, but it doesn't work, not creating new WML variables and not modifying exiting. What am I missing? wesnoth.game_events.on_mouse_move = function(x, y) local u = wesnoth.units.get(17, 3) local path, cost = wesnoth.paths.find_path(u, {3,20}, { ignore...
- November 28th, 2024, 5:25 am
- Forum: Scenario & Campaign Development
- Topic: WWII: Through the Fire (0.02 test release)
- Replies: 44
- Views: 9914
Re: WWII: Through the Fire (0.02 test release)
Thanks, still working on this. Personal issues and political turmoil in my former country have slowed progress, but things began speeding up again. Many new sprites done, working on the new aircraft system which will give planes a separate layer, allowing them to occupy the same hex as land units. h...
- January 30th, 2023, 7:34 am
- Forum: WML Workshop
- Topic: Nested loops huge perfomance decrease[SOLVED]
- Replies: 7
- Views: 1159
Re: Nested loops huge perfomance decrease
I compare an array (area) of hexes to another array of hexes and determine if they have the same coordinates. This is what find_in is for. Loop over one array and use find_in to see if the location is also in the second. You can also use a [while] to break out of the loop immediately if the find_in...
- January 28th, 2023, 1:30 pm
- Forum: WML Workshop
- Topic: Nested loops huge perfomance decrease[SOLVED]
- Replies: 7
- Views: 1159
Re: Nested loops huge perfomance decrease
Dozens, potentially hundres of elements. I compare an array (area) of hexes to another array of hexes and determine if they have the same coordinates.
- January 27th, 2023, 10:21 pm
- Forum: Scenario & Campaign Development
- Topic: WWII: Through the Fire (0.02 test release)
- Replies: 44
- Views: 9914
Re: WWII: Through the Fire (0.02 test release)
Basically, the idea is to turn land units into images while an aircraft is selected, then unstore them and turn them back into units when a land unit is selected, while turning aircraft into images. Of course, it's more complicated than that, there are many, many caveats, but after managing to imple...
- January 27th, 2023, 9:39 pm
- Forum: WML Workshop
- Topic: Nested loops huge perfomance decrease[SOLVED]
- Replies: 7
- Views: 1159
Nested loops huge perfomance decrease[SOLVED]
Hello, Is it normal that nested loops (especially of the same type, [foreach] within [foreach] and [for] within [for]) hugely decrease perfomance, to the point of being pretty much unusuable, or am I doing something wrong?
- January 27th, 2023, 9:36 pm
- Forum: Scenario & Campaign Development
- Topic: WWII: Through the Fire (0.02 test release)
- Replies: 44
- Views: 9914
Re: WWII: Through the Fire (0.02 test release)
Still working on it. Stuck a bit trying to move aircraft to separate layer
- December 23rd, 2022, 4:16 pm
- Forum: WML Workshop
- Topic: moves=0
- Replies: 4
- Views: 635
Re: moves=0
To change a unit you need first to store it, apply the changes, and then to unstore it for these changes to take effect
- December 23rd, 2022, 10:44 am
- Forum: WML Workshop
- Topic: Is it possible to dynamically change GUI2?
- Replies: 3
- Views: 777
Re: Is it possible to dynamically change GUI2?
That's awesome, thank you! I still fancy the idea to make a scrollable, clickable tech tree, which wouldn't be possible in WML, so this definitely will be useful
- December 23rd, 2022, 10:40 am
- Forum: Scenario & Campaign Development
- Topic: Poll: In a civilization-like addon, would you prefer to see Wesnoth races or real-world civilizations?
- Replies: 11
- Views: 1405
Re: Poll: In a civilization-like addon, would you prefer to see Wesnoth races or real-world civilizations?
I'm a big fan of historical settings, I hoped there'd be more of that using the Wesnoth ''engine'' as basis, though not so much of a fan of ancient times, medieval up until industrial era is more interesting for me, and yep that includes other nations other than European based ones. Since I greatly...
- December 23rd, 2022, 10:38 am
- Forum: Scenario & Campaign Development
- Topic: WWII: Through the Fire (0.02 test release)
- Replies: 44
- Views: 9914
Re: WWII: Through the Fire (0.02 test release)
I don't see much need to implement multi-hex right now, I think that default Wesnoth combat works well as it is and simulates WWII quite well, if you don't mind some abstractions. Aviation is a bit of a problem and is overloaded with abilities that allow to do this and don't allow to do that. I coul...
- December 19th, 2022, 1:02 pm
- Forum: WML Workshop
- Topic: Is it possible to dynamically change GUI2?
- Replies: 3
- Views: 777
Is it possible to dynamically change GUI2?
Hello, It seems like the GUI2 doesn't recognize any WML tags, variables, or substitutions and doesn't accept any external data. Or am I missing something? I would like to know if it's possible to do things, like, show a different button depending which side's turn it currently is, or substitute a na...
- December 15th, 2022, 5:58 pm
- Forum: Scenario & Campaign Development
- Topic: Poll: In a civilization-like addon, would you prefer to see Wesnoth races or real-world civilizations?
- Replies: 11
- Views: 1405
Re: Poll: In a civilization-like addon, would you prefer to see Wesnoth races or real-world civilizations?
Well, it seems like the community has spoken. While I'd like to do real-world civilizations, I'm not fundamentally opposed to Wesnoth races. I already have a few ideas of how to implement them in an interesting way. One other thing you might want to consider: ending up with the futuristic versions o...