Search found 76 matches

by Suf
Mon Apr 12, 2021 6:36 am
Forum: Modding help
Topic: Scale in Lua VS Scale in Image Manipulation program
Replies: 7
Views: 1689

Re: Scale in Lua VS Scale in Image Manipulation program

Lua Scale: Makes the image appear smaller but uses same amount of VRAM. If you zoom in very close to a building there's a clear visual difference between a lua-scaled HQ and an image-scaled LQ. Image Scale: Reduces file size, VRAM usage and visual quality. If you use a high-quality downscaling algo...
by Suf
Sun Apr 11, 2021 3:49 pm
Forum: Modding help
Topic: Scale in Lua VS Scale in Image Manipulation program
Replies: 7
Views: 1689

Re: Scale in Lua VS Scale in Image Manipulation program

But isn't the result the same?let's say i've made an HR sprite sheet lab that is 1000 Width 1000 Hight and scaled it down with the same animations(which probably would be demanding for performance)to 500 Width and 500 Hight for low resolution ,wouldn't that be pointless as well?what i'm trying to s...
by Suf
Sun Apr 11, 2021 11:48 am
Forum: Modding help
Topic: Scale in Lua VS Scale in Image Manipulation program
Replies: 7
Views: 1689

Re: Scale in Lua VS Scale in Image Manipulation program

You've phrased this in a way which is hard to understand but based on a surface reading of what you've said the answer is no, there would be no benefit. There would be no point in specifying an hr_version with the same scale and dimensions as the regular version. Further, it would be a waste of you...
by Suf
Sun Apr 11, 2021 6:24 am
Forum: Modding help
Topic: Scale in Lua VS Scale in Image Manipulation program
Replies: 7
Views: 1689

Scale in Lua VS Scale in Image Manipulation program

Hi Is there any benefit/downside from using the same high resolution image which is innately scaled down by half in entity.lua and use it again with the same scale for low resolution version? From the player perspective they both scaled the same and for modding i could use an image manipulation prog...
by Suf
Wed Apr 07, 2021 10:27 pm
Forum: Modding help
Topic: Animated Lamp
Replies: 13
Views: 3151

Re: Animated Lamp

So i fixed the error,but even with that the entity still static.
again if there's an example of how this works i could achieve what i'm after.
by Suf
Wed Apr 07, 2021 9:49 am
Forum: Modding help
Topic: Animated Lamp
Replies: 13
Views: 3151

Re: Animated Lamp

i've made the animation in data.lua,i got this error (animation): Value must be a list or dictionary in property tree at ROOT.animation. which i'm guessing because i wanted that to load the sprite sheet instead of array of pictures? Do you have a mod/example that shows how this process works ? mods ...
by Suf
Wed Apr 07, 2021 8:28 am
Forum: Modding help
Topic: Animated Lamp
Replies: 13
Views: 3151

Re: Animated Lamp

In data.lua make an animation prototype . In control.lua use rendering.draw_animation{} to add the animation to whatever entity you want. You will need additional scripting if you want to change the animation in certain cases (circuit condition, no power, day, etc.). If it just looks like a lamp bu...
by Suf
Wed Apr 07, 2021 7:52 am
Forum: Modding help
Topic: Animated Lamp
Replies: 13
Views: 3151

Animated Lamp

Hi I've made a lamp model with full animation for lamp entity,but seems lamp prototypes don't support animation https://wiki.factorio.com/Prototype/Lamp and assembling machine prototype does support them https://wiki.factorio.com/Prototype/AssemblingMachine so the question here is there a middle gro...
by Suf
Tue Mar 30, 2021 7:07 am
Forum: Modding help
Topic: Sprite Sheet Controlled On How Many Items Are In The Entity
Replies: 6
Views: 1312

Re: Sprite Sheet Controlled On How Many Items Are In The Entity

While you can't replace the sprite sheet of an entity at runtime, you can define different entities (each with its own sprite sheet) and replace one with the other. To do that, you need to maintain a list of the built entities in the global table (so it will be saved with the game). It's a common t...
by Suf
Mon Mar 29, 2021 5:04 pm
Forum: Modding help
Topic: Sprite Sheet Controlled On How Many Items Are In The Entity
Replies: 6
Views: 1312

Re: Sprite Sheet Controlled On How Many Items Are In The Entity

What you're trying to do is not supported by the API. There are no events for non-player inventory changes. You can not change the graphic of an entity at runtime. You'd have to use various hacks and workarounds. Not an easy starting point if you're new to modding. You might want to have a look at ...
by Suf
Mon Mar 29, 2021 3:17 pm
Forum: Modding help
Topic: Sprite Sheet Controlled On How Many Items Are In The Entity
Replies: 6
Views: 1312

Sprite Sheet Controlled On How Many Items Are In The Entity

Hi I've been searching for events https://lua-api.factorio.com/latest/events.html related if the entity has specific number of items and i found the closest event is "on_player_fast_transferred" to what i'm after here,but the problem it's only fast transferred which i'm assuming is when th...
by Suf
Sat Mar 27, 2021 3:59 pm
Forum: Modding help
Topic: Adding/Replacing The Win Condition Other Than Launching the first Rocket
Replies: 11
Views: 2682

Re: Adding/Replacing The Win Condition Other Than Launching the first Rocket

I really appreciate the detailed answer,now i know how to deal with these type of codes; thanks again :) You're welcome! But I just noticed a copy/paste error: script.on_event(id, defines.events.on_built_entity, function(event) should be script.on_event(defines.events.on_built_entity, function(even...
by Suf
Sat Mar 27, 2021 3:15 pm
Forum: Modding help
Topic: Adding/Replacing The Win Condition Other Than Launching the first Rocket
Replies: 11
Views: 2682

Re: Adding/Replacing The Win Condition Other Than Launching the first Rocket

/c game.set_game_state { game_finished = true, player_won = true, can_continue = true, victorious_force = game.forces.player, } Typing it as this results in error Typing this as it is doesn't result in an error for me -- but I didn't get the victory screen either. Could it be possible that this onl...
by Suf
Sat Mar 27, 2021 2:57 pm
Forum: Modding help
Topic: Adding/Replacing The Win Condition Other Than Launching the first Rocket
Replies: 11
Views: 2682

Re: Adding/Replacing The Win Condition Other Than Launching the first Rocket

https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.set_game_state That didn't answer any of my questions let alone set an example, the pervious answer had the same coding too. what i don't know is where to put these type of codes that begin /c? and i quote" set_game_state{gam...
by Suf
Sat Mar 27, 2021 12:44 pm
Forum: Modding help
Topic: Adding/Replacing The Win Condition Other Than Launching the first Rocket
Replies: 11
Views: 2682

Re: Adding/Replacing The Win Condition Other Than Launching the first Rocket

/c game.set_game_state { game_finished = true, player_won = true, can_continue = true, victorious_force = game.forces.player, } Typing it as this results in error bounding it to an entity seems to do that error, but what if i wanted the following to happen: if the player built a specific entity it ...
by Suf
Mon Mar 22, 2021 8:38 pm
Forum: Modding help
Topic: Adding/Replacing The Win Condition Other Than Launching the first Rocket
Replies: 11
Views: 2682

Re: Adding/Replacing The Win Condition Other Than Launching the first Rocket

DaveMcW wrote: ↑
Mon Mar 22, 2021 8:07 pm

Code: Select all

/c
game.set_game_state { 
  game_finished = true,
  player_won = true,
  can_continue = true,
  victorious_force = game.forces.player,
}
So this code isn't bound to any prototype?good to know and thanks for the help :D
by Suf
Mon Mar 22, 2021 1:59 pm
Forum: Modding help
Topic: Adding/Replacing The Win Condition Other Than Launching the first Rocket
Replies: 11
Views: 2682

Adding/Replacing The Win Condition Other Than Launching the first Rocket

Hi

Is there a way to add or replace the winning condition in Factorio other than just the vanilla's win condition?
and if so would the Prototype "rocket-silo" be the main target for the Lua codes or something else?

Thanks in advance.
by Suf
Tue Nov 03, 2020 3:42 pm
Forum: Modding help
Topic: Override Storage Value for Storage Tank Prototype
Replies: 4
Views: 814

Re: Override Storage Value for Storage Tank Prototype

If you make the fluid box height higher than 1 then pipes won't be able to fill it! But pumps would be able to, up to a height of 4. It's definitely the area that you want to change in order to make the storage bigger. I was just curious about anything related to visuals, but based on what you've r...
by Suf
Tue Nov 03, 2020 7:48 am
Forum: Modding help
Topic: Override Storage Value for Storage Tank Prototype
Replies: 4
Views: 814

Re: Override Storage Value for Storage Tank Prototype

Storage is based on the fluid box size. storage = fluid_box.base_area * fluid_box.height * 100 In the case of the vanilla storage tank, that's 250 * 1 * 100 = 25k storage. So if you want a specific storage, let's say 100k, divide that by 100 and set that as the base_area (since messing with "h...
by Suf
Tue Nov 03, 2020 6:39 am
Forum: Modding help
Topic: Override Storage Value for Storage Tank Prototype
Replies: 4
Views: 814

Override Storage Value for Storage Tank Prototype

Hi All
The title says it all;i've made a storage tank entity but i need to override the storage value but it's not in https://wiki.factorio.com/Prototype/StorageTank :?:
Thanks in advance.

Go to advanced search