Is there a way to get a single script, running on object A, to affect object B,C,D,E, etc.
I am trying to get a script to work on all returns of an alias (body), like this :
def at_script_creation(self):
self.key = "bodyfunctions"
self.desc = "various timed events to a character"
self.interval = 8 # seconds
self.start_delay = True # wait self.interval until first call
#self.persistent = True
def at_repeat(self):
body = search_object('body')
if body.db.tomatoeaten >= 5:
etc etc etc
and the advice I am following is to remove the [0] from the search_object function, so the script will affect all "body" returns, but it's not working.
Error :
2017-12-23T08:47:03+1100
[-] [EE] Script bodyfunctions(#240) of type 'BodyFunctions':
at_repeat() error ''str' object has no attribute 'tomatoeaten''
So, I'm still using a script-per-character(body) to control bleeding, farting, etc, . . . when I'd like to see if I can get a performance boost from having just one script reach out to all bodies, you know what I mean ?
Any ideas ?