Colludium - Here is the code that can be inserted into the vanilla behaviors. If you don't understand anything let me know.
To start with, locate the behavior file "Physics". You should make a copy of this folder someplace safe so if you mess anything up you can restore it without reinstalling construct.
You can use this code to modify either ams.js physics or box2dweb physics. Either way, you need to open up both the edittime.js file and the runtime file (or both runtime files if you want the changes available in both physics engines).
You need to add this line of code to the actions are in the edit time file. This creates an action that can be used in the construct 2 editor:
AddAction(28, af_none, "Set body to Kinematic", "Object Settings", "Set {my} Kinematic", "Set this object to be a Kinematic body.", "SetKinematic");
This goes in at around line 195. Do you see the first parameter in the AddAction call. Currently it is set to 28. This number has to be unique. If Ashley updates physics and you have this attached to the vanilla behavior and have to re add it, you may have to change that number (you can tell by looking at the last AddAction call and see what number it is using. In my case, this number was 27.
After that, add the following to the runtime:
Acts.prototype.SetKinematic = function (k)
{
if (!this.enabled)
return;
this.body.SetType(1);
this.body.SetAwake(true);
};
I added to where all the other Actions are (denoted by "Acts.prototype...."). You can find it easier by typing "cntr + f" to find it. The physics behavior is 13,000 lines of code, so reading through it to find where to put it can take a while. (it is at the very bottom though, right above exps.prototype.... for the expressions.
and that's it!
If you want to create your own behavior instead of modifying the existing one, you should copy the whole physics folder, rename the folder what you want the new behavior to be called and then change the top lines in the edittime file to reflect the new name. Replace the name with your new name (as you want it to appear in construct) and then replace the ID. I know it says never change it, but as you are making a new behavior, you need to change it to be something unique, else construct will think the vanilla physics and this new one are the same thing and then you will have problems
Let me know if it all works out!
stupid simple... Its like 5 lines of code. I never understood why this wasn't included in the behavior >.>