Is ther a command to change a force explosive damage

Place to get help with not working mods / modding interface.
Post Reply
User avatar
bigmond
Inserter
Inserter
Posts: 28
Joined: Fri Aug 30, 2019 11:11 am
Contact:

Is ther a command to change a force explosive damage

Post by bigmond »

I noticed there is a command to change some of the force variables such as crafting speed.
/c game.player.force.manual_crafting_speed_modifier=1000
Is there a command to change the grenade damage, I cant seem to find it.

An extension of this can these apply to the enemy force too, although I know the enemy force wont be able to use grenades without mods.
Please no more spagetti, I cant eat any more.

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 490
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Is ther a command to change a force explosive damage

Post by Silari »

Code: Select all

https://lua-api.factorio.com/latest/LuaForce.html#LuaForce.set_ammo_damage_modifier
That call is how you set the damage modifier for an ammo category - grenades possibly use the "grenade" category.

You can call it separately for any force you need it for - the default force for players is the 'player' force, for biters it is the 'enemy' force.

Code: Select all

/c game.forces["player"].set_ammo_damage_modifier("grenade",2)
/c game.forces["enemy"].set_ammo_damage_modifier("grenade",2)
would triple damage for both the player and enemy forces. 0 is normal damage.

User avatar
bigmond
Inserter
Inserter
Posts: 28
Joined: Fri Aug 30, 2019 11:11 am
Contact:

Re: Is ther a command to change a force explosive damage

Post by bigmond »

Hi thanks for the tip.

I have been trying at first i thought the command you gave me didnt work but after some experimentation I discovered that items created with surface.create_entity seem to ignore the damage modifier.

Since you have answered my question I will open a new issue for that. Thank you for your help.
Please no more spagetti, I cant eat any more.

Post Reply

Return to “Modding help”