Disable aliens/biters destroying actual items/buildings

Place to get help with not working mods / modding interface.
Post Reply
ManselD
Inserter
Inserter
Posts: 26
Joined: Mon Apr 01, 2013 10:43 pm
Contact:

Disable aliens/biters destroying actual items/buildings

Post by ManselD »

How can I stop biters destroying anything, and make it so they can only inflict damage to me?

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Disable aliens/biters destroying actual items/buildings

Post by FreeER »

I'd guess a control script like this would do the job...but I haven't tested it.

Code: Select all

game.onevent(defines.events.onbuiltentity, function(event)
    if not ((event.createdentity.type == "ammo-turret") or (event.createdentity.type == "electric-turret")) then
    -- if built entity is anything other than a turret then change the force to the enemies'
      event.createdentity.force = game.forces.enemy
    end
end)
Hm, if there was an event raised whenever biters attacked (though I don't know of one) I imagine that you could force the target to be the player (or the vehicle the player is in) and the distraction to bydamage (or none), but...

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Disable aliens/biters destroying actual items/buildings

Post by ficolas »

I dont think that will work 100% fine, because that would make you track the entities with the gun, and also it will make you attack them when pressing space.
There is a easier way to do it I think, there is a way to set the objetive of all biters and the distractions, so if you remove the distractions and set the objetive to only be the player, maybe... (Im not sure if this is still there, maybe it was removed when pollution was added, I cant seem to find it anywhere)

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Disable aliens/biters destroying actual items/buildings

Post by SilverWarior »

ficolas wrote:There is a easier way to do it I think, there is a way to set the objetive of all biters and the distractions, so if you remove the distractions and set the objetive to only be the player, maybe... (Im not sure if this is still there, maybe it was removed when pollution was added, I cant seem to find it anywhere)
This is still in the game. Infact if you go and check the freepla.lua file and you will see that the game still sets target, distraction values at the start of the game and then sends bitar attacks in waves.
So all you have to do is modify the control.lua file for your game.
NOTE: You can make a copy of freeplay scenario folder and give it a new name. This will ad new scenario posibility in game. This way you can make changes to freeplay scenario wihout screwing up the original one.

Post Reply

Return to “Modding help”