Search found 19 matches

by boernsen2
Mon May 02, 2022 7:48 pm
Forum: Modding help
Topic: Any possibility to get the length of a sound?
Replies: 1
Views: 193

Re: Any possibility to get the length of a sound?

The goal is to chain sounds of varying lengths without overlapping or huge gaps.
by boernsen2
Mon May 02, 2022 7:30 pm
Forum: Modding help
Topic: Any possibility to get the length of a sound?
Replies: 1
Views: 193

Any possibility to get the length of a sound?

Hi everyone, I am wondering if it is at all possible to get the length of a sound like this (in ticks or seconds)? data:extend({ { type = "sound", name = "mysound", filename = "__MyMod__/sounds/mysound.ogg", category = "alert", volume = 1.0 } } Cheers
by boernsen2
Wed Apr 27, 2022 12:39 pm
Forum: Modding help
Topic: How to properly print a train stop's name containing symbols
Replies: 3
Views: 343

Re: How to properly print a train stop's name containing symbols

I found this solution, which seems to work for what I have tested: function corrected_train_stop_name(str) if not string.find(str,"=") then return str else return string.gsub(string.gsub(str, "=", "/"), "%[", "[img=") end end It converts [item=copper...
by boernsen2
Wed Apr 27, 2022 12:16 pm
Forum: Modding help
Topic: How to properly print a train stop's name containing symbols
Replies: 3
Views: 343

Re: How to properly print a train stop's name containing symbols

I just found this page and I guess it has something to do with it:
https://wiki.factorio.com/Rich_text
by boernsen2
Wed Apr 27, 2022 11:42 am
Forum: Modding help
Topic: How to properly print a train stop's name containing symbols
Replies: 3
Views: 343

How to properly print a train stop's name containing symbols

Hi everyone, if I use a copper-plat symbol for a train stop name: Screenshot_20220427_133355.png then print its name: game.print(train_stop.backer_name) it prints the symbol plus an item description next to it: Screenshot_20220427_133613.png How can I print the symbol only as it is displayed for the...
by boernsen2
Sun Apr 10, 2022 7:14 pm
Forum: Minor issues
Topic: [1.1.34] play_sound{...} not playing sound globally
Replies: 5
Views: 916

Re: [1.1.34] play_sound{...} not playing sound globally

Just for reference, I just found a solution accidentally!!! :) I stumbled over this: https://wiki.factorio.com/Prototype/Sound#audible_distance_modifier Just configure your sound with an exorbitantly high audible_distance_modifier in data.lua, e.g. data:extend({ { type = "sound", name = &q...
by boernsen2
Sun Apr 10, 2022 7:00 pm
Forum: Modding help
Topic: Play a sound position-independently for all passengers of a train
Replies: 4
Views: 335

Re: Play a sound position-independently for all passengers of a train

Got it!!! I accidentally stumbled over this: https://wiki.factorio.com/Prototype/Sound#audible_distance_modifier Just configure your sound with an exorbitantly high audible_distance_modifier in data.lua, e.g. data:extend({ { type = "sound", name = "my_sound", filename = "__M...
by boernsen2
Sun Apr 10, 2022 11:25 am
Forum: Minor issues
Topic: [1.1.34] play_sound{...} not playing sound globally
Replies: 5
Views: 916

Re: [1.1.34] play_sound{...} not playing sound globally

Did you find any way to play a custom sound globally for all players and position-independently?
by boernsen2
Sun Apr 10, 2022 11:24 am
Forum: Modding help
Topic: Play a sound position-independently for all passengers of a train
Replies: 4
Views: 335

Re: Play a sound position-independently for all passengers of a train

Btw I already searched for other threads beforehand and also found this one: Modifying mod so sound is heard everywhere in multiplayer But it only mentions https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.play_sound, which according to the documentation: position:: MapPosition? Where t...
by boernsen2
Sat Apr 09, 2022 4:24 pm
Forum: Modding help
Topic: Play a sound position-independently for all passengers of a train
Replies: 4
Views: 335

Play a sound position-independently for all passengers of a train

Hi everyone, would it be possible at all to play a sound for all players sitting in a certain train, but in a position-independent way, so that the sound doesn't become silent when the train moves away from the original play_sound position? The intention is to have a sound being played for all passe...
by boernsen2
Sat Apr 09, 2022 4:09 pm
Forum: Modding help
Topic: Play random audio file out of some folder
Replies: 2
Views: 186

Re: Play random audio file out of some folder

Thank you very much!!! :)
by boernsen2
Sat Apr 09, 2022 2:34 pm
Forum: Modding help
Topic: Play random audio file out of some folder
Replies: 2
Views: 186

Play random audio file out of some folder

Hi everyone,

I am wondering if it is at all possible to play a random audio file out of some folder or if you have any workarounds in mind?
I would like to be able to put any *.ogg files in there and have a random choice of these files played upon a certain event.

Thank you for any ideas!
by boernsen2
Thu Dec 16, 2021 4:47 pm
Forum: Modding help
Topic: Lua way to Shift+Click a blueprint?
Replies: 6
Views: 638

Re: Lua way to Shift+Click a blueprint?

Just realized, I didn't reply. Many many thanks! Works like a charm.
by boernsen2
Tue Dec 07, 2021 8:24 pm
Forum: Modding help
Topic: Lua way to Shift+Click a blueprint?
Replies: 6
Views: 638

Re: Lua way to Shift+Click a blueprint?

Many thanks for your replies!

Is there a way to hard-code a constant blueprint in Lua code? (I need some way to ensure it is the correct blueprint)
by boernsen2
Sat Dec 04, 2021 8:10 pm
Forum: Modding help
Topic: Lua way to Shift+Click a blueprint?
Replies: 6
Views: 638

Re: Lua way to Shift+Click a blueprint?

Waoh, that looks easy. Thank you!

How do I access the blueprints though? Preferably the team blueprint book's ones (alternatively my own blueprint book's ones)?
by boernsen2
Fri Dec 03, 2021 3:10 pm
Forum: Modding help
Topic: Lua way to Shift+Click a blueprint?
Replies: 6
Views: 638

Lua way to Shift+Click a blueprint?

Hi everyone, I'm looking for the Lua way to simulate a Shift-Click-Placement of a certain blueprint at a certain position without relying on the mouse pointer. Does anybody have an idea on how that could be achieved? What I actually want to achieve is that a moving spidertron continuously places a s...
by boernsen2
Thu Dec 02, 2021 8:01 pm
Forum: Modding help
Topic: Lua command to place ghost landfill?
Replies: 3
Views: 362

Re: Lua command to place ghost landfill?

I've found out already that I placed multiple tiles over each other. This is why it's looking differently.
by boernsen2
Thu Dec 02, 2021 7:53 pm
Forum: Modding help
Topic: Lua command to place ghost landfill?
Replies: 3
Views: 362

Re: Lua command to place ghost landfill?

Thank you very much, that helps! Do you also know why the created ghost tile looks different to a landfill ghost placed by the cursor manually? The screenshot shows a ghost landfill entity placed manually (top-left), a "tile-ghost" landfill entity placed by the mod (middle), and a landfill...
by boernsen2
Thu Dec 02, 2021 5:43 pm
Forum: Modding help
Topic: Lua command to place ghost landfill?
Replies: 3
Views: 362

Lua command to place ghost landfill?

Does anybody know the lua command to place ghost landfill? I found this command to place normal landfill assuming the position is on water and it works: some_entity.surface.set_tiles({{name = "landfill", position = {-59,70}}}, true) How about ghost tiles though? For entities such as insert...

Go to advanced search