general questions about modding

Place to get help with not working mods / modding interface.
Post Reply
meems
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Feb 15, 2017 2:02 am
Contact:

general questions about modding

Post by meems »

so factorio modding is a mystery. There are many questions I'll need to ask b4 I'll understand it.

Q1.) What is a 'doodad' layer? This one is bugging me. Googling it doesn't help. Just gives some reference to map editing.

What is an example of a 'doodad'?
How come 100s of modders all seem to know what a doodad is so instinctively, that no-one on the web has bothered to define it? Is it as obvious as Yes and No, Night and Day to you people? Jeez. You are on another level. Bless us mere mortals with some of your godly knowledge :p

evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: general questions about modding

Post by evildogbot100 »

The title is completely different than the content of your question. You should write "doodad" in the title so people know what are you asking at a glance. Answer : Doodad is decoratives, cosmetic only stuffs. "doodad-layer" is one possible collision mask usually used so that 2 decoratives don't overlap with each other.

meems
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Feb 15, 2017 2:02 am
Contact:

Re: general questions about modding

Post by meems »

Well I meant I'd just return to this thread to post more questions instead of creating a new thread for each question.

So... doodad = " Decoration and cosmetic "

Ok thanks.

Next Question Q2 : Why do collisions need masks? The term 'collision mask' begs the question, what does an unmasked collision look like? I assume it looks bad, thats why it needs a mask, so we don't have to look at it.

Do we have an example of a masked collision?

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: general questions about modding

Post by Bilka »

It's not a mask. It determines what entities collide with. Things with water-layer in their collision mask collide with the water tiles, things without it don't. Entities that share a collsion mask collide with each other.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: general questions about modding

Post by evildogbot100 »

meems wrote: Next Question Q2 : Why do collisions need masks? The term 'collision mask' begs the question, what does an unmasked collision look like? I assume it looks bad, thats why it needs a mask, so we don't have to look at it.
I think you better read a modding tutorial and read the modding api first, lots of your question gives me an impression that you haven't even try to read the basics first.

meems
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Feb 15, 2017 2:02 am
Contact:

Re: general questions about modding

Post by meems »

@bilka
thanks. The only thing I've seen collide with water is the fishes. So I guess only fishes have collision masks with water.

@evildog
I've tried, but the Factorio API docs baffles me as much as anything else.
Take this example from http://lua-api.factorio.com/0.15.28/
for example

Code: Select all

local first_player = game.players[1]
first_player.print(first_player.name)
I just can't get my head around that print is a subcomponent of first_player
Everything I've ever known about programming for 32 years suggests that the correct code would be...

Code: Select all

local first_player = game.players[1]
print(first_player.name)

Patashu
Fast Inserter
Fast Inserter
Posts: 130
Joined: Mon May 08, 2017 11:57 pm
Contact:

Re: general questions about modding

Post by Patashu »

Maybe 'print' sends a message only to a specific user, so you need to call it on a specific user so only that user sees the message?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: general questions about modding

Post by Rseding91 »

meems wrote:@bilka
thanks. The only thing I've seen collide with water is the fishes. So I guess only fishes have collision masks with water.

@evildog
I've tried, but the Factorio API docs baffles me as much as anything else.
Take this example from http://lua-api.factorio.com/0.15.28/
for example

Code: Select all

local first_player = game.players[1]
first_player.print(first_player.name)
I just can't get my head around that print is a subcomponent of first_player
Everything I've ever known about programming for 32 years suggests that the correct code would be...

Code: Select all

local first_player = game.players[1]
print(first_player.name)
player.print(...) prints the message to that players in-game console.
print(...) is the generic lua function which sends text to the Lua output console (which mostly doesn't exist) so it goes nowhere.
If you want to get ahold of me I'm almost always on Discord.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: general questions about modding

Post by Nexela »

Everything I've ever known about programming for 32 years suggests that the correct code would be...

Code: Select all

local first_player = game.players[1]
print(first_player.name)

I would suggest reading up on object oriented programming/classes

In a nutshell
The player is an object, that has a print function (among many other variables and function). This print function is special to the player object that calls it as it prints a message to the current "player object"

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: general questions about modding

Post by Bilka »

meems wrote:@bilka
thanks. The only thing I've seen collide with water is the fishes. So I guess only fishes have collision masks with water.
Uhm... No. Please look up what collision means, then try to find something that collides with water; not one of the few things that doesn't collide with it.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

meems
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Wed Feb 15, 2017 2:02 am
Contact:

Re: general questions about modding

Post by meems »

thanks for help everyone. I understand why print is a sub function of a player object now.

@bilka,
ok, if fishes don't collide with water, that means they can swim thru it.
So things that can't swim thru water should collide with water. Such as players, cars, trains. I'm guessing that stationary objects such as assemblers also collide with water, effectively stopping them from being placed in water.

Post Reply

Return to “Modding help”