R0J0hound's Forum Posts

  • DWing and Beerman,

    That error is mainly caused by insufficient VRAM. I was able to measure the vram usage on my system with my Intel graphics card driver, and I got these numbers:

    VRAM Usage:

    8 Mb for normal system use.

    43 Mb after opening construct and selecting "New"->"Direct X app".

    --"Run Layout" 48 Mb, the runtime reports 0.00 mb vram usage.

    45 Mb after adding a 512x512 Sprite.

    --"Run Layout" 51 Mb, the runtime reports 1.00 mb vram usage.

    63 Mb after adding one or more layer effects.

    --"Run Layout" 71 Mb, the runtime reports 6.69 mb vram usage.

    So in general if you add 5 Mb to what the runtime says you are using you should get approximately how much vram your game is currently using.

    With 64 Mb of vram you can still edit and run your game at the same time if you avoid Effects and Transitions, but you still might run out of vram if you use a lot of graphics. In that case you would have to export your cap, close construct, and run the exported program to test it.

    -cheers

  • Here's a basic example that crawls 1 pixel a frame:

    http://dl.dropbox.com/u/5426011/examples2/basicWallCrawl.cap

    made in 0.99.96

  • I found this link: http://freespace.virgin.net/hugo.elias/graphics/x_water.htm

    It describes how to do a 2d ripple effect.

    Taking that and reducing it to 1d resulted in this:

    http://dl.dropbox.com/u/5426011/examples2/water.cap

    0.99.96

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Move lines 3 and 71 into the start of layout block and it should work.

  • Why not just keep the next and previous values +1 and -1 away. When you destroy an object pick all the objects with greater values than the one being destroyed and subtract 1 from each. That will creating gaps.

  • I used something similar to the following with the PathMovement behavior. It uses Sprite2 to define the points but lists can be used instead without much trouble.

    http://dl.dropbox.com/u/5426011/examples2/pyMotionThroughPoints.cap

    made in 0.99.96

  • When you run a script everything freezes until the script is done. I'd recommend avoiding sleep() because "time.sleep(1)" will cause a one second freeze every time it's used.

  • I threw a couple ideas into a cap, maybe one of them will help.

    http://dl.dropbox.com/u/5426011/examples2/parallax_ex.cap

    made in 0.99.96

  • Set the "zoom x rate" and "zoom y rate" of your HUD layer properties to zero. That way your HUD won't zoom at all.

  • Here's a non-python version with a different font for good measure:

    http://dl.dropbox.com/u/5426011/examples2/imagefont2.cap

    I originally was going to upload a non-python version like this but I had a random crash and lost the whole thing.

    Silent Cacophony

    This version no longer uses recursion and the objects do get destroyed now.

    EDIT:

    Here's where I'm getting the fonts:

    http://www.algonet.se/~guld1/freefont.htm

  • Here is an example of the using image fonts with the Tiled background object. It uses the "set image offset" action to select letters from the image. The only requirement is the image has to be power of two height and width.

    http://dl.dropbox.com/u/5426011/examples2/imageFontpy.cap

    made in 0.99.96

    This is not intended to be a replacement of Lucid's Sprite font object. But it gives the advantage of being able to load a different font at run-time with a single load image action, and the ease of editing all the characters in one image.

  • Here is a way to use Windows pop-up menus with python:

    http://dl.dropbox.com/u/5426011/examples2/pyPopupMenu2.zip

    made in 0.99.96

    No python install is required, all necessarily files are included.

    Notes:

    Had to use some event trickery so that when the menu was opened the timescale would remain 0 till the next tick. Otherwise objects that depend on timedelta would jump after the menu closed.

    This probably isn't very useful to most people using construct, but it's interesting none the less.

  • [quote:3qxdgnrk]How the hell do you get proper alpha right off the bat with these things?

    Convert the color mode of the PNG from Indexed to RGB. Then the transparency is preserved when the image is imported.

    [quote:3qxdgnrk]Now, the next main problem to make this viable is Z-Order. In other words, layers. Oh, yeah, and collision, I forgot. You either want some things to collide, or some things to not collide, basically...

    Z-Ordering is easy, just load each layer to a different layer.

    For collisions just set the collision mode for all the sprites on one layer to per-pixel and none on the other layers.

    Give the Sprite the Solid attribute and set it's collision mode to none.

    Here's a updated script:

    from xml.dom import minidom
    
    mapfile = minidom.parse(System.AppPath + 'ConstructTestMap.tmx')
    
    a = mapfile.getElementsByTagName('map')[0]
    
    width = int(a.attributes['width'].value)
    height = int(a.attributes['height'].value)
    tilewidth = int(a.attributes['tilewidth'].value)
    tileheight = int(a.attributes['tileheight'].value)
    
    #load all layers
    layernum=1
    for layer in mapfile.getElementsByTagName('layer'):
    	index=0
    	for tile in layer.getElementsByTagName('tile'):
    		val = int(tile.attributes['gid'].value)
    		if val > 0:
    			System.Create('Sprite',layernum,0,0)
    			if layernum==2:
    				SOL.Sprite.SetCollisionMode(3) # 3 is per-pixel
    			SOL.Sprite.x=(index % width) * tilewidth 
    			SOL.Sprite.y=(index / width) * tileheight
    			SOL.Sprite.SetAnimFrame(val)
    		index+=1
    	layernum+=1[/code:3qxdgnrk]
  • Arima, it does work but you need to add object folders from the project tab.

    <img src="http://dl.dropbox.com/u/5426011/pics/screen.PNG">

  • Python is the ideal route to take as it has good xml support.

    Here is a cap that will load the map that Candescence posted in the previous post.

    http://dl.dropbox.com/u/5426011/examples2/tilemapLoad.cap

    made in 0.99.96

    Be sure to put the cap in the same directory as the map. Also you might need to install python because the xml modules aren't included in construct.