R0J0hound's Recent Forum Activity

  • It works for me.

    I'm using python 2.6.4 but the latest 2.6.x version should work.

    I uncommented "//#define python" from stdafx.h and built DX9_p.exe and DX9.exe.

    I then renamed them to DX9_ps.exe and DX9_s.exe.

    Then with scripting enabled in Construct I was able to both preview and export with no issues.

    If you build the non python runtimes are you able to preview and export cap files with scripting disabled?

  • The sand blocks do have gravity, but to speed things up only the sand blocks around the player are moved.

  • I was able to make a good speed up by using an array to store the UIDs of the Blocks at each grid position. That allows for direct selection of a block at any grid position. With that it eliminated the need for a detection sprite since with the array it's simple to select one grid below.

    I also removed the platform behavior and used events to take advantage of using an array.

    http://dl.dropbox.com/u/5426011/examples7/MineGenner.capx

    A final optimization could be to only have block objects on screen exist to reduce the total object count.

  • Here's an updated python file:

    http://dl.dropbox.com/u/5426011/utility/capreader.py

    It wasn't saving long text correctly.

    If it still isn't working post the cap and I can fix it and my script.

  • Here's a way to do it using a detector sprite.

    http://dl.dropbox.com/u/5426011/c2/simpleboxdrop.capx

    In contrast Construct Classic makes this is easy to do with one event and no detector sprite.

    + System: For each Block ordered by Block.Y Descending

    + Block: [negated] Block: overlaps "Solid" : offset (0,1)

    -> Block: Set Y to Block.Y+1

    Hopefully those features will make their way into C2.

  • You can get rid of the white lines by making the collision polygon a bit smaller.

  • Here's good python reference that I use all the time that is easier use than the official docs.

    http://www.tutorialspoint.com/python/

    Here's my working of the problem.

    from random import random,randint
    from math import sin,cos
    
    def SpawnNearPlayer(objectName, layer, rangeMin, rangeMax):
       # calculate random polar coordinate.
       random_angle = random()*360 
       random_distance = randint(rangeMin,rangeMax)
       
       # calulate x,y from angle and distance from Player.
       x = random_distance * cos(random_angle) + Player.X
       y = random_distance * sin(random_angle) + Player.Y
       
       #check to see if x,y will be on the layout
       if 0 <= x <= System.LayoutWidth and 0 <= y <= System.LayoutHeight:
          #Yes. create the object
          System.Create(objectName, layer, x, y)
       else:
          #No.  Try a different point.
          SpawnNearPlayer(objectName, layer, rangeMin, rangeMax)

    I eliminated the __class__.__name__ bit as it looks too cluttered. You now pass the object's name to begin with instead of the object type.

    So instead of calling the function like this:

    SpawnNearPlayer(Sprite,1, 50,100)

    Do this (notice the quotes):

    SpawnNearPlayer('Sprite',1, 50,100)
  • SullyTheStrange

    The platform needs to be moved vertically after the player is moved.

    Move the "Plat: Set Y to self.Y+self.MoveY*dt" from event 9 and put it in a new "Every tick" event at the bottom of the event sheet. You'll also want to reposition mario to the player sprite in that event otherwise mario will appear to lag behind.

    Ketoulou

    The key to get it to work is moving the platform after the player.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • -1.#IND means undefined.

    You can get that result with an expression like sqrt(-1) or acos(-2).

    Anglediff uses a vector dot product to do it's calculation, which is then converted back into an angle with acos. Acos only works with a value in the range of -1 to 1. Some rounding occurs that sometimes pushes the value just beyond that range resulting in a value of undefined.

    It only occurs in two situations, when the anglediff is 0 (which is fixed) and when the anglediff is 180. So if the resulting value is -1.#IND the angle diff is 180.

    I will fix it when I get on my dev pc. In the mean time you can check to see if a number is undefined by converting it to a string and comparing it with "-1.#IND".

  • Before moving the platforms have the player move the same amount as the platform is going to move. The platfom the player is on is found by moving the player 1 pixel down, checking for overlap then moving back to where it was. Basically it does what "overlaps at offset" did for CC.

    http://dl.dropbox.com/u/5426011/c2/vertical%20platforms.capx

  • It should work. I know windows 7 doesn't include Directx 9, but Construct's installer should take care of that. What error message do you get when it crashes? You could also try to run Construct's installer as an administrator in case some of the install is being blocked.

  • What error message does he get?

    If Dx9 is not installed he should get a message as such. If he doesn't have at least the august 2008 update of Dx9 it will crash when loading the xaudio2 plugin, but it should give an error message like "failed to load 2.csx". The visual c++ 2005/2008 redistributables are usually not needed as most of the plugins don't use them, but if a plugin does use them and the files aren't installed he should get a failed to load plugin message.

    You can use dxwebsetup.exe which is included in construct's install directory to get the latest Dx9 update.

    You can download the c++ redists here:

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3387&mnui=1

    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=29

    But these are not normally needed as I belive most of the plugins don't need them.

    You can also manually check a plugin to see what dlls it need with "dependency walker":

    http://www.dependencywalker.com/

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound