FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Kresp

Pages: [1] 2
1
Game creators corner / Re: Basics of instance and object manipulation
« on: December 26, 2012, 01:37:01 am »
Code: [Select]
cellgrid = self._model.getCellGrid('hexagonal')
cellgrid.thisown = 0
cellgrid.setRotation(0)
cellgrid.setXScale(1)
cellgrid.setYScale(1)
cellgrid.setXShift(0)
cellgrid.setYShift(0)
layer = self._map.createLayer('ground_layer', cellgrid)
layer.setPathingStrategy(fife.CELL_EDGES_AND_DIAGONALS)
layer.setLayerTransparency(1)
Resulting layer doesn't render any objects than i add later. What do i miss?

UPD: figured out. Had to use addActiveLayer for a new layer.

2
Game creators corner / Re: Basics of instance and object manipulation
« on: December 24, 2012, 02:00:32 am »
Thanks.

3
Game creators corner / Re: Basics of instance and object manipulation
« on: December 23, 2012, 08:34:18 pm »
When i use addColored method, resulting objects are either too dark, or too bright (depenging on what base color was used for template image). How do i instruct engine not to recolour existing colour, but replace it, saving only alpha-channel from original pixels?

4
Game creators corner / Re: Basics of instance and object manipulation
« on: December 23, 2012, 09:31:01 am »
Pychan buttons keep focus after being clicked, and thus stop fife.IKeyListener from intercepting keystrokes. Is it possible to make a button unfocusable, to unfocus a button programmatically or to make FIFE use global keyboard hooks?

5
Game creators corner / Re: Basics of instance and object manipulation
« on: December 21, 2012, 09:31:57 pm »
Code: [Select]
<Setting name="WindowTitle" type="str"> FIFE - Rio de hola </Setting>
"SDL_app" title is visible for a second or two, then changes according to the setting.

6
Game creators corner / Re: Basics of instance and object manipulation
« on: December 20, 2012, 04:14:04 am »
InstanceRenderer::addColored()
Thanks, i'll look into it.

Can i get a full list of available pychan styling attributes somewhere?
Also, is it possible to change SDL_app caption of the main application window and relocate it, before it has been properly initialized and loaded?

7
Game creators corner / Re: Basics of instance and object manipulation
« on: December 18, 2012, 12:17:48 am »
I have an idea how to make perfect borders. I just have to create 2^6 sprites with borders prerendered on them with a single color. And when a map is loading, app will generate sprites with whatever colors i may need from the original ones. May take a while to process 64*[number of players] images though, but it don't have to redraw everything every time a new game is started. Just once a new color is involved and then store them for later usage.
Pluses: if border tiles and ground tiles are of the same size, zoom should work like a clock; probably a bit better performance, as engine won't have to make all this coordinates calculations.
Minus: speed hit when sprites are drawn for the first time.

8
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 05:41:04 pm »
Code: [Select]
        clickpoint = fife.ScreenPoint(event.getX(), event.getY())
        if event.getButton() == fife.MouseEvent.LEFT:
            instances = self.get_instances_at(clickpoint, self._layers['ground_layer'])
            instance = instances[0]
            loc = instance.getLocationRef()
            grid = loc.getLayer().getCellGrid()

            vertices = grid.getVertices(loc.getLayerCoordinates())
            anchor = self._cameras['main'].toScreenCoordinates(grid.toMapCoordinates(instance.getLocation().getLayerCoordinates()))
            points = []
            for i in vertices:
                firstpt = self._cameras['main'].toScreenCoordinates(grid.toMapCoordinates(i))
                p = fife.Point(firstpt.x - anchor.x, firstpt.y - anchor.y)
                points.append(p)
            for i in range(0, 6):
                i1 = fife.RendererNode(instance, points[i])
                i2 = fife.RendererNode(instance, points[i - 1])
                self._generic_renderer.addLine('123', i1, i2, 0, 0, 0)
This works. Not perfect, though. And will have to finetune manually anyway.

9
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 12:08:55 pm »
getVertices returns absolute coordinates (like 1036:441), and if i want to attach lines/points/whatever to a tile, not to a camera, i need them to be relative to instance's center. How can i get an instance's coordinates relative to camera's coordinate system?

10
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 11:46:14 am »
Changed getExactLayerCoordinates to
Code: [Select]
getLayerCoordinates()
Doesn't break anymore.
Will try and see if it does what i want.

11
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 11:04:08 am »
Oh, sorry, my mistake.
Error is different this time:
Code: [Select]
TypeError: in method 'CellGrid_getVertices', argument 3 of type 'FIFE::ModelCoordinate const &'

12
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 10:44:18 am »
Tried fresh install, same error.
engine_build_log.txt: http://pastebin.com/Y05au54E
engine_install_log.txt: http://pastebin.com/abuwgvUt
_fife.pyd hashes:
Code: [Select]
CRC-32: ae340d34
   MD4: 74b7a7b51e7a59f37f9f827a396c0bbd
   MD5: f754d26e48c1745400a855fe854be46f
 SHA-1: 65ee7551dbe06a688a1a85a7c1afd828ffae3cac

13
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 08:09:29 am »
Code: [Select]
C:\Program Files\SlikSvn\bin>svn.exe co http://fife.svn.cvsdude.com/engine/trunk
...
Checked out revision 4075.
Code: [Select]
C:\Program Files\SlikSvn\bin\trunk>c:\Python27\python.exe setup.py install
running install
running build
running build_py
running install_lib
running install_data
running install_egg_info
Removing c:\Python27\Lib\site-packages\fife-0.3.3r3-py2.7.egg-info
Writing c:\Python27\Lib\site-packages\fife-0.3.3r3-py2.7.egg-info
Still get the same error.
Have i used wrong repository?

14
Game creators corner / Re: Basics of instance and object manipulation
« on: December 17, 2012, 12:04:23 am »
Code: [Select]
vertices = grid.getVertices(loc.getLayerCoordinates())
Code: [Select]
TypeError: CellGrid_getVertices() takes exactly 3 arguments (2 given)
http://www.fifengine.net/epydoc/fife.fife.CellGrid-class.html#getVertices
What exactly this method should receive?

15
Game creators corner / Re: Basics of instance and object manipulation
« on: December 16, 2012, 09:56:23 pm »
I'm not sure what is your goal
Basically i want to draw borders, while border color should indicate which player owns the outlined tiles.
Attached - screenshot from civ5.

Pages: [1] 2