New Lua functions.
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
New Lua functions.
I have some requests listed here in order of perceived importance:
- 1. --Edit: This feature does already exist. -- Spoiler:
- 2. A function to place a "halo"-type multihex image that is layered above the tiles but underneath the units would enable modders to create a lot more beauty.
- 3. ~ROTATE and ~SCALE for wesnoth.interface.add_hex_overlay() is currently very taxing for the CPU and cause a lot of lag. Would be nice if they where optimized. Or if we could preload the animation for later use.
Last edited by mentos987 on April 3rd, 2024, 1:03 pm, edited 2 times in total.
Re: New Lua functions.
1 sounds useful.
2 has nothing to do with Lua functions.
3 I got impression if it difficult to improve performance.
2 has nothing to do with Lua functions.
3 I got impression if it difficult to improve performance.
Maintainer of Ageless Era. Ravana's Multiplayer Works
Re: New Lua functions.
I am not loooking for a specific image. I am looking for a function to place a multihex image above the terrain layer but below the unit layer. Much like how halos work.
I want a new option for this Lua function: wesnoth.interface.add_hex_overlay(x, y, {x = x, y = y, halo = "data/add-ons/addon/images/folder/pic01.png"})
Where "halo" is the layer, I want the option of a third layer.
Re: New Lua functions.
I think World Conquest does use this functionality actually. Setting sth. undocumented like z-index.
Try out the dark board theme.
- Celtic_Minstrel
- Developer
- Posts: 2263
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: New Lua functions.
For 1 you could look into the sound source functionality. It might be able to do what you want, but I'm not sure.
For 3, yes, we would like to use the GPU for IPFs, but we're not quite there yet. Compiling IPFs down into shader code is possible and would probably greatly boost performance for things using a lot of IPFs, not to mention reducing the size of the image cache…
For 3, yes, we would like to use the GPU for IPFs, but we're not quite there yet. Compiling IPFs down into shader code is possible and would probably greatly boost performance for things using a lot of IPFs, not to mention reducing the size of the image cache…
Re: New Lua functions.
Are you refering to the 2nd point? I scanned the files of World Conquest but didn't find much, not that I know what to look for.
Last edited by mentos987 on March 23rd, 2024, 10:49 pm, edited 2 times in total.
Re: New Lua functions.
Do you mean wesnoth.audio.sources ? If I understand that correctly it handles sources that can play sound files. Not any sounds that are actively playing.Celtic_Minstrel wrote: ↑March 23rd, 2024, 10:04 pm For 1 you could look into the sound source functionality. It might be able to do what you want, but I'm not sure.
The reason why this is so important for narration is that if the player skips dialogue we want to cancel the voiceover.
Re: New Lua functions.
That is fine, this is not a major issue.Celtic_Minstrel wrote: ↑March 23rd, 2024, 10:04 pm For 3, yes, we would like to use the GPU for IPFs, but we're not quite there yet.
- Celtic_Minstrel
- Developer
- Posts: 2263
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: New Lua functions.
The intended use-case for sound sources is to support spatialized sound that can fade away as you move further away from it. However, it's entirely possible to use it for other things, and I think there's a pretty good chance that it could do what you want. In fact, I think they've been used for narration before by other people.mentos987 wrote: ↑March 23rd, 2024, 10:38 pm Do you mean wesnoth.audio.sources ? If I understand that correctly it handles sources that can play sound files. Not any sounds that are actively playing.
The reason why this is so important for narration is that if the player skips dialogue we want to cancel the voiceover.
That said, there should probably be a function to stop a non-source sound as well… it just doesn't come up much because they're usually used for short sound effects.
Re: New Lua functions.
I did not dig deep into this subject but I talked to several modders and they said it is not possible. The workaround that other mods uses is to run the narration as music and to run a "silent track" to mute the narration. A very clunky solution with a lot of issues.Celtic_Minstrel wrote: ↑March 26th, 2024, 4:30 am The intended use-case for sound sources is to support spatialized sound that can fade away as you move further away from it. However, it's entirely possible to use it for other things, and I think there's a pretty good chance that it could do what you want. In fact, I think they've been used for narration before by other people.
(I have not tested this) I think that the effects "sound that can fade away as you move further away from it" only changes the initial setup of a sound and its repetition. I do not think you can stop any sound that is playing, unless it is playing on repeat, in which case you can only prevent it from repeating.
- Celtic_Minstrel
- Developer
- Posts: 2263
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
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.
Re: New Lua functions.
Just tested it and I was wrong. You can instantly cancel a playing sound by using:Celtic_Minstrel wrote: ↑April 2nd, 2024, 5:51 pm 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.
Spoiler:
Spoiler:
An added fade out option to this function would be nice, for those that wants to suddenly stop the sound.