Only half of tech image shown
Only half of tech image shown
I'm reworking the Tutorial on the Wiki (that adds a bomber) and for some reason only the right half of my technology icon is being shown in the research menu
Can anyone tell me why? if for some reason you'd like to download the rest of the mod (maybe because you are lazy and do not want to change code to make it use the bomber_tech.png) the Tutorial is here. I encountered this issue in Chapter 5 (which is where the technology is added).
Can anyone tell me why? if for some reason you'd like to download the rest of the mod (maybe because you are lazy and do not want to change code to make it use the bomber_tech.png) the Tutorial is here. I encountered this issue in Chapter 5 (which is where the technology is added).
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me

Or drop into #factorio on irc.esper.net
Re: Only half of tech image shown
Maybe because the icons should be 32 by 32 ? 

Re: Only half of tech image shown
lol, I wondered that myself, but if that was the caseNirahiel wrote:Maybe because the icons should be 32 by 32 ?
1) it would show a quarter of the image not half and
2) the images in /data/base/graphics/technology are 64x64
I wish it were that simple though...
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me

Or drop into #factorio on irc.esper.net
Re: Only half of tech image shown
Here are some improvements for your code :
You create a drop var and set it to false, then for each entity of the bomb table, you reset it back to true, and then back to false again if biters < 5.
Here is what I'd do :
But then you could make your script even better by not calling a for loop and just doing
Find all enemies in a radius of 5 around the player.
Then something like
should work 
Code: Select all
local drop = false
local biters = 0
for k,v in pairs(bomb) do
if v.force.equals(game.forces.enemy) then
drop = true
if v.name == "small-biter" or v.name == "medium-biter" or v.name == "big-biter" then
biters = biters + 1
if biters < 5 then --if five or more will be killed then drop
drop = false
end
end
end
end
Here is what I'd do :
Code: Select all
local drop = false
local biters = 0
for k,v in pairs(bomb) do
if v.force.equals(game.forces.enemy) then
if v.name == "small-biter" or v.name == "medium-biter" or v.name == "big-biter" then
biters = biters + 1
end
end
end
if biters > 4 then
drop = true
end
Code: Select all
local enemies = game.findenemyunits(game.player.character.position, 5)
Then something like
Code: Select all
if #enemies > 4 then
drop = true
end

Re: Only half of tech image shown
In your first 'improved' code, it only gets set to true if there are more than 4 biters, if you happen to run across a spawner (and it for some reason does not have enough biters) you'd be unable to destroy it. Also I seemed to have issues with targeting worms...Nirahiel wrote:Here are some improvements for your code :
Ah I forgot about findenemyunits (actually I don't think it existed when I originally made this mod) lol. That would certainly make it much better, BUT I also intend to change it to use capsules so that the player can actually control the bombs. Before the capsules were created I thought about using code to auto switch out the player's weapon with a rocket launcher (or similar) but...capsules just seem like a better idea to me xD
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me

Or drop into #factorio on irc.esper.net
Re: Only half of tech image shown
@FreeER There is one thing that has been bothering me for while Talk:Modding_Tutorial
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: Only half of tech image shown
Same thing for you dude, if you set it to true, but then set it to false again before the end of the for loop, then after the for loop exits, your variable will be set to false.FreeER wrote:In your first 'improved' code, it only gets set to true if there are more than 4 bitersNirahiel wrote:Here are some improvements for your code :
I really just improved your code, I didn't change it's behavior.
The get enemies thing should also target worms and spawners ... i guess
Re: Only half of tech image shown
Try to delete crop-cache, it's location depends on system, but it is in the directory where you saves directory is.
Re: Only half of tech image shown
ah ha! You sir are a geniuskovarex wrote:Try to delete crop-cache, it's location depends on system, but it is in the directory where you saves directory is.

Oh, I'll fix that lol! I don't think I really truly understood those two files when I wrote the tutorial lolrk84 wrote:@FreeER There is one thing that has been bothering me for while Talk:Modding_Tutorial
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me

Or drop into #factorio on irc.esper.net
Re: Only half of tech image shown
Back to Topic

I run in the same issue 32 Pixel just work fine but in a very ugly way, if i try to use 64x64 ( wich even the base research imgaes are ) i got only the top left quarter shown, as you can seeFreeER wrote: I'm reworking the Tutorial on the Wiki (that adds a bomber) and for some reason only the right half of my technology icon is being shown in the research menu
Can anyone tell me why?

Re: Only half of tech image shown
This didn't help?:Animar wrote:Back to Topic
I run in the same issue 32 Pixel just work fine but in a very ugly way, if i try to use 64x64 ( wich even the base research imgaes are ) i got only the top left quarter shown, as you can seeFreeER wrote: I'm reworking the Tutorial on the Wiki (that adds a bomber) and for some reason only the right half of my technology icon is being shown in the research menu
Can anyone tell me why?
kovarex wrote:Try to delete crop-cache, it's location depends on system, but it is in the directory where you saves directory is.
Re: Only half of tech image shown
I shouldn't do anything if i where half asleep, i apologize that i didn't saw that you already posted a solution for that 
