Spell Pack

by OwnlyMe

New useful abilities

Utilities
3 years ago
0.16 - 0.18
18

i Integrations

4 years ago
(updated 4 years ago)

Do you want support of https://mods.factorio.com/mod/show-health-and-shield ?

We can to change the GUI in another way.

4 years ago

if you want i can add a toggle to disable the gui.
there's already an api to get/set the variables of the mod

4 years ago
(updated 4 years ago)
function error(player,str)
    player.surface.create_entity{name="flying-text",position=player.position, text=str, render_player_index = player.index}
end

Please, change that name of function because of lua "error" function.

Can you add "get_mana_ratio" function in your mod interface like "get_health_ratio" function from the Factorio API?

If you use your mod with other mods/scenarios related with buttons etc, then your mana UI will be shifted to the right.

You have "global.version". Probably, migration files can help with that check instead of using "script.on_configuration_changed"...

That it's all, too much information for today :P

4 years ago

the bars should try to center themselves as good as they can.
if you tell me what mod that is, i can add a fixed value for that element.

i kinda love the on_configuration_changed event, don't really see any reason not to use it.

i'll add the get_mana_ratio soon

4 years ago
(updated 4 years ago)

if you tell me what mod that is, i can add a fixed value for that element.

The element from a scenario :#

How do you imagine a design for mana? (Maybe it will be suitable)

4 years ago

Wait... there is also one parameter with the mana, Ah...

4 years ago

I figured it out, need little bit pulsating orbs for all parameters.

4 years ago

And also ¨get_spirit_ratio¨

4 years ago
(updated 4 years ago)

Updated :)
getstats = function(player)

returns:
{ 
    mana = mana,
    max_mana = max_mana,
    spirit = spirit,
    max_spirit = max_spirit,
    pctmana = mana/max_mana,
    pctspirit = spirit/max_spirit
}

and you can remotely disable the gui:
togglebars = function(modname, onoff)
please provide the name of your mod so it can find it with game.active_mods[] and a boolean to enable/disable it.
if a single mod requested the gui to be off, it won't show up

4 years ago

Everything works. I will publish update someday.

3 years ago
(updated 3 years ago)

Update mana data etc during on_player_joined_game
The unstable version is ready https://gitlab.com/ZwerOxotnik/show-health-and-shield/-/tags (v3.0.4 and v3.0.5 or next ones)

3 years ago
(updated 3 years ago)

I'll post screenshots later

New response