How do I use runtime.trigger for behaviors?

Get help using Construct 2

Post » Sat Feb 07, 2015 3:22 pm

I'm working on a behavior, and I am invoking
Code: Select all
this.runtime.trigger(cr.behaviors.RPGChar.prototype.cnds.Damaged, this);
In the hopes of running an event whenever a character takes damage. However, when I shoot a character, I get an error on line 4421 of preview.js, and it seems to be about families. I couldn't figure out how to run a stacktrace, but I had my behavior spit out this.type and sure enough, this.type.families was undefined. It seems odd to me that triggering a condition in a behavior should expect to find a family. My understanding from reading the manual is that families only apply to plugins/objects, not behaviors. Am I using runtime.trigger incorrectly?

Please help. I feel like I've done enough detective work, and i need someone with understanding.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Sat Feb 07, 2015 3:28 pm

this.runtime.trigger(cr.behaviors.RPGChar.prototype.cnds.Damaged, this.inst);
B
107
S
25
G
225
Posts: 4,326
Reputation: 128,331

Post » Sat Feb 07, 2015 3:49 pm

Awesome! Thank you!
B
14
S
5
G
1
Posts: 189
Reputation: 1,536


Return to How do I....?

Who is online

Users browsing this forum: OddConfection, RetroSpock and 10 guests