[Request] Box Behavior (Platform Stripped).

Post your work in progress addons and get feedback

Post » Sun May 24, 2015 1:03 pm

Hi Everybody,

So I just spent my whole day trying to create a 'box behavior' which is essentially a solid that can't pass through other solids but without using physics. (Since physics and solids don't work with each other and solids and solids are also pass through. Plus using physics on every object would be tolling to the end game and cause undesirable results)

I figured since the only good way we have for creating a push-able/ pull-able box is to use a platform behavior on it then disable the default control and simulate controls and then do this for every object. It had a lot of issues foremost was issues when the player is bigger than the box. After a lot of experimentation and an old game maker tutorial on this subject I found an easier way of doing this without simulating controls or pinning or using physics but I still have to use the platform behavior for it to collide seamlessly to other solids.

Then I thought why not just strip down the platform behavior to just 2 settings: the gravity/fall rate and it's ability to collide with solids (removing all the unnecessary controls and parameters). This way I could easily use the more leaner behavior across various levels and games without rewriting a collision for each object and share the result here for others to use.

So, I copied the platform behavior folder named it 'BoxX' and started to delete lines which I though were unnecessary to this new behavior and disabled others I didn't understand by making them into a comment line. Needless to say I failed miserably which wasn't a shock as this was the first time I have ever seen a java script this up close.

I got the parameters stripped and I don't get any error on loading construct but the object with this behavior disappears on game load. And I get an error if I have dy of a certain block turned on after which the game doesn't load at all.

Anyway, If anybody could help me with this I'll be very grateful. I've the damaged files if anyone needs it. It's just a copy of the platform behavior.

Thank you.

(If this is the wrong way to request a function from the community please let me know and direct me to the right direction.)
B
26
S
1
Posts: 59
Reputation: 1,100

Post » Sun May 24, 2015 11:08 pm

You might try this behavior
B
110
S
28
G
280
Posts: 4,487
Reputation: 156,566

Post » Mon May 25, 2015 5:24 pm

Hi @rexrainbow,

Thanks for the reply (and all your great plugins and behaviors).

There is a couple of problems with that particular behavior.

1: it doesn't have gravity control and doesn't fall down by default. (which can be coded with event sheet)

2: I got some issues when you keep pushing the object to a vertical solid, if i keep going it starts moving up in Y axis. Like this:

Image

Sample Capx:

[edit: file got removed since I've not got 300 reputation]

It doesn't happen if the box has a platform behavior.


Also if I keep using platformer behaviour for the box will it strain the system? (since if would process unnecessary code and functions).
B
26
S
1
Posts: 59
Reputation: 1,100


Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests