I have assembled a mod that makes cars honk by pressing a button. Right now the honks have no effect on the world other than playing a sound that can be heard by players.
I am trying to add a function to it though: enemies in range of honking would stop what they are doing and start attacking you instead.
here are the excerpts of the mod files responsible for honking which i am currently using: (there's no code for enemy attraction yet)
entities.lua
control.lua
The wiki page about the explosion prototype is missing. So by looking at other mods I have attempted adding an area of damage to the explosion, something like this...
horn that should damage
...but it seemed to have no effect. Can explosions even do damage? Or are they only graphical effects + sounds?and even then, I wanted to try and see if biters would react to being hit by a 0-damage area of effect. (so far i haven't been able to create such aoe at all)
Would that be the case? Am I approaching this the right way? I'm looking at the list of Lua classes but... maybe i'm not looking for the right things?
Is this even possible to do? If you have anything to say to contribute it would be really appreciated. : ) Thanks in advance and good day in any case!