Page 1 of 1

Disable aliens/biters destroying actual items/buildings

Posted: Tue Mar 04, 2014 6:15 pm
by ManselD
How can I stop biters destroying anything, and make it so they can only inflict damage to me?

Re: Disable aliens/biters destroying actual items/buildings

Posted: Tue Mar 04, 2014 6:28 pm
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...

Re: Disable aliens/biters destroying actual items/buildings

Posted: Tue Mar 04, 2014 6:53 pm
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)

Re: Disable aliens/biters destroying actual items/buildings

Posted: Tue Mar 04, 2014 11:16 pm
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.