[GUIDE] Level Creating and Modding
Re: Guide for Level Creating and Modding
How hard would it be to add something to fill all of the turrets on the map with ammo at the start of the game? Looking at making a custom map now, but the prospect of manually filling all the enemy turrets is.... daunting.
Re: Guide for Level Creating and Modding
You could do it using script, It would just search all entities at the start of the game.
It would just add the ammo to all turrets.
I can write the sample here if you want to.
Another thing would be to add copy/paste in the editor (even for larger structures, more buildings)
It would just add the ammo to all turrets.
I can write the sample here if you want to.
Another thing would be to add copy/paste in the editor (even for larger structures, more buildings)
Re: Guide for Level Creating and Modding
How do I assign items ID?
where is the file to do that?
Error in assignID "nameoftheitem" not recognized as id of item
where is the file to do that?
Error in assignID "nameoftheitem" not recognized as id of item
Re: Guide for Level Creating and Modding
Items are defines in data/prototype-definitions/items
Re: Guide for Level Creating and Modding
Weird, I alredy placed the file there...
Edit: Capital letters... Fixed it.
Edit: Capital letters... Fixed it.
Re: Guide for Level Creating and Modding
Code: Select all
Content Title
Sprite "C:/Program
Files\Factorio\data\resources\icons/electric-furnace.png" couldn't be loaded
Re: Guide for Level Creating and Modding
Do you have the file there?
(Every item needs to have icon picture)
(Every item needs to have icon picture)
Unknown Key in gui
perhaps this should be obvious but how do you fix the "Unknown key:"entity-name.iron-furnace" (on gui and when you hover over the entity)
As is fairly obvious I'm creating an iron furnace right now (currently is 2x as fast but is more wasteful on coal). I'd rather like for the name to show up as Iron Furnace rather than entity-name.whatever however So far that is my only problem
P.S. I didn't think this question warranted it's own topic so I figured I'd post in this one.
As is fairly obvious I'm creating an iron furnace right now (currently is 2x as fast but is more wasteful on coal). I'd rather like for the name to show up as Iron Furnace rather than entity-name.whatever however So far that is my only problem
P.S. I didn't think this question warranted it's own topic so I figured I'd post in this one.
<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: Guide for Level Creating and Modding
You need to add the value into locale/<language>/entity-name.cfg
<code>
iron-furnace=Iron furnace
</code>
<code>
iron-furnace=Iron furnace
</code>
Re: Guide for Level Creating and Modding
yes, electric furnace.png is there, im sure :S
Re: Guide for Level Creating and Modding
Are you sure the file name is correct?, as you wrote electric furnace.png (with space).ficolas wrote:yes, electric furnace.png is there, im sure :S
Note, that it is also case sensitive.
Re: Guide for Level Creating and Modding
the problem was that I named it electric-furnace.png, when I removed the .png it worked.
And also, for the lua stuff, for example, the "insert" function, what is the ussage?
insert( type,name,position,health,force,readablename,name,count)??
And how do I get the player position?
and to use onunitdied, I do
table=onunitdied() ?
and like so I can do
if table[name]==creeper then
and so?
And also, for the lua stuff, for example, the "insert" function, what is the ussage?
insert( type,name,position,health,force,readablename,name,count)??
And how do I get the player position?
and to use onunitdied, I do
table=onunitdied() ?
and like so I can do
if table[name]==creeper then
and so?
Re: Guide for Level Creating and Modding
You are probably reffering to the create entity function:ficolas wrote: And also, for the lua stuff, for example, the "insert" function, what is the ussage?
insert( type,name,position,health,force,readablename,name,count)??
https://forums.factorio.com/wiki/inde ... eateentity
ficolas wrote: And how do I get the player position?
Code: Select all
game.getplayer().position
You can do:ficolas wrote: and to use onunitdied, I do
table=onunitdied() ?
and like so I can do
if table[name]==creeper then
and so?
Code: Select all
game.onevent = function(event)
if event.name == "onunitdied" and
event.unit == "creeper" then
game.getplayer().print("You just killed creeper hooray")
end
end
Re: Guide for Level Creating and Modding
No, im refering to the insert, to add items to an entity (I want to add items to the player), and can to make the code be for all the games, in freeplay, in campaigns, etc. I should place the lua script in the lualib?
Re: Guide for Level Creating and Modding
It is not possible to create code for all types of games now.
Inserting example is in the lualib/freeplay.lua:
Inserting example is in the lualib/freeplay.lua:
Code: Select all
game.getplayer().insert{name="iron-plate", count=8}
game.getplayer().insert{name="pistol", count=1}
game.getplayer().insert{name="basic-bullet-magazine", count=10}
Re: Guide for Level Creating and Modding
Well, at least I can modify the freeplay.lua, but the freeplay.lua is ejecuted once or its beeing ejecuted all the time?
I added this to the end of the freeplay but it is not working
if event.name == "onunitdied" then
glob.player.insert{name = "small-alien-artifact", count = 1}
end
I added this to the end of the freeplay but it is not working
if event.name == "onunitdied" then
glob.player.insert{name = "small-alien-artifact", count = 1}
end
Re: Guide for Level Creating and Modding
Is it inside game.onevent -function? Have you defined glob.player?ficolas wrote:Well, at least I can modify the freeplay.lua, but the freeplay.lua is ejecuted once or its beeing ejecuted all the time?
I added this to the end of the freeplay but it is not working
if event.name == "onunitdied" then
glob.player.insert{name = "small-alien-artifact", count = 1}
end
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: Guide for Level Creating and Modding
glob.player is alredy. defined in freeplay, and I didnt put it inside game.onevent function, just at the end of the coderk84 wrote:Is it inside game.onevent -function? Have you defined glob.player?ficolas wrote:Well, at least I can modify the freeplay.lua, but the freeplay.lua is ejecuted once or its beeing ejecuted all the time?
I added this to the end of the freeplay but it is not working
if event.name == "onunitdied" then
coun=math.random(1,5)
glob.player.insert{name = "small-alien-artifact", count = coun}
end
Also, I dont know why but I cant make the shadows of furnaces in photoshop, how can I make them?
Last edited by ficolas on Wed Feb 27, 2013 11:09 pm, edited 1 time in total.
Re: Guide for Level Creating and Modding
Yes, you need to put it inside the function
Btw, your code will add it directly to the player inventory, even if your turret (or anybody else) kills creeper on the other side of map.
You can also specify what entity drops when it is killed by adding this to the entity definition in json:
You can even add more values there, and all are applied, this example is from enemy spawner
Btw, your code will add it directly to the player inventory, even if your turret (or anybody else) kills creeper on the other side of map.
You can also specify what entity drops when it is killed by adding this to the entity definition in json:
You can even add more values there, and all are applied, this example is from enemy spawner
Code: Select all
"loot":
[
{
"item": "alien-artifact",
"probability": 1,
"count-min": 2,
"count-max": 10
}
],
Re: Guide for Level Creating and Modding
Aaah that exists! lol
I tried adding a resource entity to the corpse, but that didnt work
Also, can I create a furnace-like machine (something that converts X into Y using Z) without modifing any non lua/json file?
I dont think I can do it with lua, because is almost only for events but maybe with the json creating a new type or something??
I tried adding a resource entity to the corpse, but that didnt work
Also, can I create a furnace-like machine (something that converts X into Y using Z) without modifing any non lua/json file?
I dont think I can do it with lua, because is almost only for events but maybe with the json creating a new type or something??