Muzzle fire animation / fuel deactivation
Muzzle fire animation / fuel deactivation
Hey guys,
I'm just working on a mod that implements bunkers into Factorio and am pretty happy with it, except two points which you can maybe help me with:
Just one note, so you can follow me better: I used the "car" entity, so the player is able to enter the building and fire out of it. Of course it can't drive.
First problem: Can I adjust the Muzzle fire animatin? Right now it's in the middle of the texture, but ideally it should be at the windows, which would also depend on the direction of the target. (Model is the Terran bunker from SC2)
Second Problem: Even though i set the burner consumption to 0 it gives me the no fuel symbol, when there is none. This isn't to bad, because you just have to put some coal or whatever in it, and then it's gone, since it can't drive - therefore can't consume anything - but if I release it, I would like to make at as realistic as possible.
Thx guys!
I'm just working on a mod that implements bunkers into Factorio and am pretty happy with it, except two points which you can maybe help me with:
Just one note, so you can follow me better: I used the "car" entity, so the player is able to enter the building and fire out of it. Of course it can't drive.
First problem: Can I adjust the Muzzle fire animatin? Right now it's in the middle of the texture, but ideally it should be at the windows, which would also depend on the direction of the target. (Model is the Terran bunker from SC2)
Second Problem: Even though i set the burner consumption to 0 it gives me the no fuel symbol, when there is none. This isn't to bad, because you just have to put some coal or whatever in it, and then it's gone, since it can't drive - therefore can't consume anything - but if I release it, I would like to make at as realistic as possible.
Thx guys!
Re: Muzzle fire animation / fuel deactivation
Does it fire its own guns, or the player's ones?
Those triangle icons are the bane of the modding, you cannot really make them go away without inserting some dummy fuel\connecting to dummy power source.
Those triangle icons are the bane of the modding, you cannot really make them go away without inserting some dummy fuel\connecting to dummy power source.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: Muzzle fire animation / fuel deactivation
Thank you for your answer.
I guess, I'm just going to live with the fuel problem then.
It's using its own gun, just like the car does. I assume this might be somehow connected to the gun_turret node? I'm new to modding and didn't deal with that until now.
I guess, I'm just going to live with the fuel problem then.
It's using its own gun, just like the car does. I assume this might be somehow connected to the gun_turret node? I'm new to modding and didn't deal with that until now.
Re: Muzzle fire animation / fuel deactivation
Well, car turret is defined in /data/items/gun.lua and its definition has field `projectile_creation_distance`. That probably will help with gunshots.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: Muzzle fire animation / fuel deactivation
Oh I should have taken a closer look. Gonna try it out. Thanks mate!
Re: Muzzle fire animation / fuel deactivation
Create an on build script that inserts 1 piece of coal into entity when placedSecond Problem: Even though i set the burner consumption to 0 it gives me the no fuel symbol, when there is none. This isn't to bad, because you just have to put some coal or whatever in it, and then it's gone, since it can't drive - therefore can't consume anything - but if I release it, I would like to make at as realistic as possible.
control.lua
Code: Select all
local function on_built(event)
if event.created_entity,name == "my-entities-name" then
event.created_entity.insert({name="coal", amount=1})
end
end
script.on_event({defines.events.on_built_entity, defines.events.on_robot_built_entity}, on_built)
Re: Muzzle fire animation / fuel deactivation
Okay, I got that fire animation going now!
And thanks to Nexela, I will try to implement that. I have never worked with "if, then"-functions though - do i just put it at the top of my entity.lua?
And thanks to Nexela, I will try to implement that. I have never worked with "if, then"-functions though - do i just put it at the top of my entity.lua?
Re: Muzzle fire animation / fuel deactivation
The code he provided you, is self contained, you indeed can put it in any place of control.lua. The important part is the `script.on_event({defines.events.on_built_entity, defines.events.on_robot_built_entity}, on_built)`, which binds the defined function to relevant ingame events.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: Muzzle fire animation / fuel deactivation
All righty. God bless the factorio community!
EDIT: In case someone else wants to use Nexelas control.lua. I found a small typo, this one is working:
EDIT: In case someone else wants to use Nexelas control.lua. I found a small typo, this one is working:
Code: Select all
local function on_built(event)
if event.created_entity.name == "my-entities-name" then
event.created_entity.insert({name="coal", amount=1})
end
end
script.on_event({defines.events.on_built_entity, defines.events.on_robot_built_entity}, on_built)
Re: Muzzle fire animation / fuel deactivation
****SOLVED***
hi I im making a gun mod and was wondering where u found the script animation for the muzzle fire. ive got tracers going and bullet casing dropping I just want that muzzle flash. I am new at this and deff not lazy and have been searching perhaps you could point me in the right direction.
hi I im making a gun mod and was wondering where u found the script animation for the muzzle fire. ive got tracers going and bullet casing dropping I just want that muzzle flash. I am new at this and deff not lazy and have been searching perhaps you could point me in the right direction.
-
- Filter Inserter
- Posts: 454
- Joined: Tue Jun 20, 2017 1:56 am
- Contact:
Re: Muzzle fire animation / fuel deactivation
oh hi, if you did the terran building mod, nice work
there was a recent problem i found where i couldnt load the mod with another mod, and posted here with a screenshot of the error, if you happen to have a chance to help?
viewtopic.php?f=51&t=45001&start=820#p303008
there was a recent problem i found where i couldnt load the mod with another mod, and posted here with a screenshot of the error, if you happen to have a chance to help?
viewtopic.php?f=51&t=45001&start=820#p303008
(also me from the mod portal - im not dustine lol) = https://mods.factorio.com/mods/Dustine/ ... ssion/9108
my 1st Mod Idea viewtopic.php?f=33&t=50256
my 1st Mod Idea viewtopic.php?f=33&t=50256