[BEHAVIOR] Chipmunk Physics

Post your completed addons to share with the community

Post » Sat Apr 25, 2015 6:15 pm

@sponghammer
Can you run your nw.js exported exe from the command line with the --enable-logging switch? It will make a debug.log file that should have the error.

A simple way to do that is to create a .bat file.
Open notepad and type in:
Code: Select all
newproject --enable-logging

where newproject is whatever the exe file is named.
Next "save as" and call it debug.bat and save it to the same folder as the export. Be sure to change the "save as type" to "all files" or it will save as a text file.
Finally run the debug.bat file and the debug.log file will be created.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Sun Apr 26, 2015 8:05 am

@R0J0hound

This is the debug.log contents.

[7892:0426/090241:ERROR:nw_shell.cc(335)] ReferenceError: tri is not defined
at c.Go (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:408:155)
at c.ix (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:411:79)
at c.fl (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:415:345)
at c.tq (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:413:344)
at l.Ae (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:125:460)
at l.It (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:174:437)
at m.an (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:158:259)
at l.nv (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:108:181)
at l.go (file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:105:334)
at file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js:107:184
[7892:0426/090241:INFO:CONSOLE(408)] "Uncaught ReferenceError: tri is not defined", source: file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js (408)
[7892:0426/090243:INFO:CONSOLE(4)] ""[Construct 2] Suspending"", source: file:///C:/Users/chris/AppData/Local/Temp/nw7892_2461/c2runtime.js (4)
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Sun Apr 26, 2015 9:24 pm

@spongehammer
Hmm, best I can tell "tri" is some minified variable name, so I have no way of knowing where to look. I'm not getting an error on my machine when exporting as a minified nw.js.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Sun Apr 26, 2015 9:39 pm

@R0J0hound

I could pm you the capx if you think it might help ?
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Sun Apr 26, 2015 9:44 pm

@spongehammer
It might. It could be there is some function that I need to tweak that isn't being used in my tests.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Mon Apr 27, 2015 3:52 pm

Upadated to 2.2d

@spongehammer
I think I fixed it. It was caused by using polygon collision shape and there was an uninitialized variable named "tri". After that I found another bug by turning on "use strict". It should work now. Also I fixed a bug with paster when webgl isn't available that your capx exposed.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Mon Apr 27, 2015 3:59 pm

@R0J0hound

What a genius :) thanks. I had seen the problem with paster but not realized it was a bug.
B
51
S
16
G
9
Posts: 1,098
Reputation: 11,252

Post » Mon Apr 27, 2015 5:35 pm

I was about to write about minify blackscreen but new version fixed that!
B
7
S
2
Posts: 68
Reputation: 645

Post » Mon Apr 27, 2015 10:14 pm

@R0J0hound not to keep bugging you about features, but I ran into something else unexpected. In porting from the Scirra physics engines to Chipmunk, I noticed that the center of mass is not longer set to... well... the object's center of mass, but rather the origin.

Is there any way I could, say, set this as a global default? Or per object? It would be so much easier because right now my player is sorta hard-coded to explode into pieces, and unfortunately otherwise I would have to hand-change about 24 different object & frame origins.

Not a huge deal, but so time consuming, especially when I have other oddities using Chipmunk that have not come up with Scirra's vanilla physics.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,836

Post » Mon Apr 27, 2015 11:40 pm

@DatapawWolf
It's not using the object's origin, it's just using the center of the object regardless of where the origin is. It was an oversight to not take into account the center of a polygon shape. I'll be taking a look into it.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Sean Noonan and 2 guests