Physics Tools Extension (Beta Release 4)

LIBERADO

  • *
  • Posts: 2720
I have downloaded it again and installed the new downloaded file, but Stencyl continues throwing the same error even if I don't use the two new blocks, actually I have not modified the code of the game. However, if I install the old Beta Release 1, the game works. For some reason, the Beta Release 2 doesn't work.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

merrak

  • *
  • Posts: 2738
That's strange. It definitely works on my end. I wonder if you need to force the new .hx file to compile. Did you try removing the game from the "games-generated" folder?

Edit2: Just to double check, I downloaded a fresh copy of the extension and compiled the test project with it. It worked fine.

Edit: This is what the updated .hx file should look like starting at line 261:

Code: [Select]
/*
2015 - 10 - 26
*/

public static function velocityComponent( vel:Float, angle:Float, mode:Int ):Float
{
if ( mode == 0 )
return vel * Math.cos( angle * Math.PI / 180 );
else
return vel * Math.sin( angle * Math.PI / 180 );
}

// Return "angle" as used in launchVelocity.
// Intended purpose is to find an ideal angle from point A to point B
public static function aspectAngle( x1:Float, y1:Float, x2:Float, y2:Float ):Float
{
return -1 * Math.atan( ( y2 - y1 ) / Math.abs( x2 - x1 ) ) * 180 / Math.PI;
}
}

The original error was due to that last } being placed above the comment with the date (2015 - 10 - 26), which left the two public functions out of the class. I ran my test project again just to double check, and the blocks are compiling and returning appropriate values.

The un-updated version looks like this, with the } before the comment:

Code: [Select]
}

/*
2015 - 10 - 26
*/

« Last Edit: October 27, 2015, 12:27:09 am by merrak »

LIBERADO

  • *
  • Posts: 2720
Did you try removing the game from the "games-generated" folder?
Yes, I have removed the game from that folder, and Stencyl still throws the same error.

In my game, I used only these two blocks:



If I disable the only Event which contains these two blocks, the game works. (but without the extension functionality, obviously)

If I install the old Beta Release 1, then the game works.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

merrak

  • *
  • Posts: 2738
I can't seem to reproduce the error. I even removed my original copy from Stencyl, downloaded a copy using the links in the first post, restarted Stencyl, and compiled from scratch--and it seems to work fine. I can't think of a way to rule out Stencyl holding onto the original version somewhere. Maybe try compiling for a different platform?


LIBERADO

  • *
  • Posts: 2720
Edit: This is what the updated .hx file should look like starting at line 261:
Inside the extension folder, there are three .hx files:

physics-tools\PhysicsTools.hx
physics-tools\bk\PhysicsTools-2015-10-24.hx
physics-tools\bk\PhysicsTools-2015-10-25.hx

Which one are you referring to?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

merrak

  • *
  • Posts: 2738
The first one: physics-tools\PhysicsTools.hx

LIBERADO

  • *
  • Posts: 2720
The problem has been solved by uninstalling Stencyl and reinstalling it again.
Thank you very much for your efforts and for providing this great extension.

(Curiously, the block "first actor on arc from..." detects the camera center as an actor.)
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

merrak

  • *
  • Posts: 2738
Yikes--glad to hear it's working now. I still suspect there was some reason the newer version wasn't compiling... I just don't know how to verify that. I've sometimes had issues with games not compiling correctly--using old resources or even deleted resources, such as image and sound files. Clearing their entry in the "games-generated" folder always solves the problem when I encounter it.

I noticed last night the raycast was picking up internal actors. The raycast check doesn't consider collision groups, but I think I can get a couple new blocks for these cases added to Beta Release 3.

LIBERADO

  • *
  • Posts: 2720
I am glad to know that there will be a Beta Release 3. Thank you for your work.  :)
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

purplelava

  • Posts: 82
Liberado, I am attempting my own clumsy solutions to draw paths, but I wonder how you executed yours.

I failed at making the path stop when colliding with a tile/actor. How did you do that?

Great extension by the way.

« Last Edit: October 29, 2015, 07:14:08 pm by purplelava »

LIBERADO

  • *
  • Posts: 2720
I failed at making the path stop when colliding with a tile/actor. How did you do that?
I use the "first actor on arc from..." block to detect the first actor on the trajectory, then I stop drawing the path at the position of said actor.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

merrak

  • *
  • Posts: 2738
I use the "first actor on arc from..." block to detect the first actor on the trajectory, then I stop drawing the path at the position of said actor.

I just uploaded Beta Release 3, which adds an "all actors on arc" block. It will still pick up terrain, internal actors, etc.--but now you can search through the list to pick up what actors you really need.

I also added a sample launcher AI behavior to the archives page.

Old releases are now archived on my site (links are on the top post).

LIBERADO

  • *
  • Posts: 2720
Great! Downloading the Beta Release 3 (and testing it)

Thanks, again.

« Last Edit: October 29, 2015, 10:26:46 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

LIBERADO

  • *
  • Posts: 2720
I think these three blocks would also be very useful:

                       

(In fact, I have needed them.)

« Last Edit: October 29, 2015, 10:55:28 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

bonzero

  • Posts: 488
great extension! can't wait to play with it