ID:173474
 
It just hit one day, how would you code a blank object to when Entered() or what ever it causes another object to change animations.

Say i have a blank invisble object that when you step on it, it causes say a locker to change animations. from "" to "open".
Cloudiroth wrote:
It just hit one day, how would you code a blank object to when Entered() or what ever it causes another object to change animations.

Say i have a blank invisble object that when you step on it, it causes say a locker to change animations. from "" to "open".

It would probably be easiest to use a turf for this, rather than an object. Here's an example that does (more or less) what you described:

turf/Trigger/Entered()
var/obj/Locker/L = locate() in oview(src) // Find a locker nearby
if(L) // If a locker was found
L.icon_state = "open" // Set its icon_state!
return ..() // Do the normal Entered() stuff
In response to Malver
Malver wrote:
turf/Trigger/Entered()
var/obj/Locker/L = locate() in oview() // Find a locker nearby

No put usr in Entered()! Ungh!

In oview(), usr is the implicit reference point. You need to make that oview(src).

Lummox JR