Vidar's Recent Forum Activity

  • That works perfectly. Thank you

    The next question is, of course, why are families not shown in the Python editor autocomplete feature?

  • How do I make a loop in python that iterates through all objects in a family? I can't find any reference to families in any of the objects in the list on the right.

  • What does the mask effect do? I applied it to a sprite, and it just makes the sprite it is applied to invisible. What is it for, and how do I use it?

  • I have a problem using python. I have a python script in my cap that uses xml.dom.minidom , and I get an error message when running my game:

    Traceback (most recent call last):

    File "<string>", line 2 in <module>

    ImportError: No module named xml.dom.minidom

    I got this to work before, but I had to reinstall my pc recently, and now I can't get it to work anymore.

    I have python 2.6.6 installed in c:\python6\ , and the lib\xml\dom\minidom.py is right there.

    What am I missing? It's driving me nuts.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I added multiple tilesets to this just for the heck of it.

    The sprites with the tilesets need to be named according to the names in the Tiled file, or it won't work.

    from xml.dom import minidom
    #from array import array
    
    #mapfile = minidom.parse(System.AppPath + 'ConstructTestMap.tmx')
    mapfilename = System.globalvar('TilesetFile')
    Spritename = '';
    mapfile = minidom.parse(System.AppPath + mapfilename)
    
    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)
    
    TSlook = {}
    
    #load all tilesets
    
    for tileset in mapfile.getElementsByTagName('tileset'):
    	tsfirstid = int(tileset.attributes['firstgid'].value)
    	tsname = str(tileset.attributes['name'].value)
    	Debug.SetText(repr(tsname))
    	TSlook[tsname] = tsfirstid
    
    #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:
    		# find out what spritesheet to get sprite from.
    			lastchecked = 0
    			for k,v in TSlook.iteritems():
    				if val>=v and lastchecked <v:
    					lastchecked = v
    					Spritename = k
    					
    			System.Create(Spritename,layernum,0,0)
    			Spriteobj = eval('SOL.' + Spritename)
    			if layernum==3:
    				Spriteobj.SetCollisionMode(3)
    			Spriteobj.x = (index % width) * tilewidth
    			Spriteobj.y = (index / width) * tileheight
    			Spriteobj.SetAnimFrame(val - lastchecked + 1)
    		index+=1
    	layernum+=1
    [/code:w9yt9x0n]
  • Your plugin should be in the ..\..\IDE\Plugins\Runtime folder.

    You can change this in the properties of the TemplateSDK under Configuration Properties -> Linker -> General -> Output File.

    I have the same problem with the grey text in Eddittime.cpp. The grey text will not compile because the compiler directive RUN_ONLY isn't defined anywhere.

    Can anyone help us n00bs?

    Edit:Never mind, I figured it out.

    You're actually making 2 plugins: 1 for the edit mode of Construct, and 1 for when your game is running.

    The code is laid out so that when you are editing the Layout part, the runtime code is greyed out, and vice versa. To switch between the 2, you can select "Debug" and "Debug Runtime" at the top of the screen in Visual Studio. It takes a few seconds for the editor to catch up, so don't panic if the text doesn't immediately turn normal.

  • I've been playing around a bit, and came up with this:

    http://www.2shared.com/file/rAe5RiRk/Swing.html

    It's a physics based take on the "bionic arm" thing from the NES classic Bionic Commando, except with colored boxes because I can't draw worth a damn.

    Improve, if you dare!

  • I'm fiddling around with Construct a bit, and I'm trying to make a Bosconian clone.

    It's an old video game where the player is in control of a stereo typical space craft and flies around shooting asteroids, space mines, suicidal kamikaze enemy ships, and space stations.

    The space stations look a bit like this:

      O   O
       \ /
     O---H---O
       /   O   O
    [/code:3lfrmvgi]
    
    The 'O' are bullet spawning spheres, and the H is the central hub that can only be shot from above or below. If the central hub is shot, or all six spheres Have been shot, the space station is destroyed. 
    
    I've been mucking about with containers, but that hasn't really worked out for me. According to the wiki, if 1 sprite in a container is place anywhere, all the other sprites associated with it should also be spawned, and if 1 sprite in a container is moved, all other associated sprites should move with it, but I don't see that happening in my .cap.
    
    Does anyone know how to make containers work for me, or how to make a space station like describe above?
    
    The help would be appreciated.
    
    cap can be found here: [url=http://www.mediafire.com/?rw31pml90pwmuij]http://www.mediafire.com/?rw31pml90pwmuij[/url]
    
    Edit: Never mind, I was doing it wrong. Sorry for the inconvenience.
  • Madster, you're a genius. It finally seems to work consistently. Thank you very much.

  • I have the strangest thing going on. In the cap posted in my first post, when I jump to the next screen, all is well, but when I walk off the screen, the player character tends to teleport to a random off-screen location.

    Is it just me, or can anyone else reproduce this?

  • Thanks anyway, tulamide.

    Of course, according to sod's law, the problem is back, and deleting the persist file won't help this time.

  • I got it working. For some reason construct messed up. I closed the file, deleted the persist file, and reloaded the project, and now it works.

    Has anyone else had a similar problem?

Vidar's avatar

Vidar

Member since 21 Feb, 2009

None one is following Vidar yet!

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies