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!

Author Topic: Help with the FIFE python tutorials  (Read 3685 times)

Zoeyface

  • Newbie
  • Posts: 3
    • View Profile
Help with the FIFE python tutorials
« on: March 30, 2013, 08:37:09 pm »

Hello all, I have only just started to explore FIFE and it pretty much fits my needs exactly for the game I wish to build.

However, I have run into problems with the tutorials provided on this page https://github.com/fifengine/python-tutorials.

I think I understand how the code is working and all that, but from tutorial c onwards (once you are supposed to have the skeleton character moving about the square of grass) I cannot seem to get the character model to move. It will simply rotate to face the location I clicked on and continue it's idle animation.

The rotation to face the clickpoint infers to me that the location is being passed correctly, so there must be an issue somewhere with the move call, or the walk animation call or something.

I have checked to ensure that blocking is set to 0 on the grass tiles the skeleton is standing on. I am now at a loss for what may be going wrong.

Any help would be much appreciated. Many thanks.

To clarify: I have not edited the code given with the tutorials so it may be my compiler or something? The demos provided by the engine download work fine.
Logged

helios

  • Developer
  • Jr. Member
  • *
  • Posts: 61
    • View Profile
Re: Help with the FIFE python tutorials
« Reply #1 on: March 31, 2013, 02:12:51 am »

Hi Zoeyface,
sorry for the trouble. We've forgotten to update the tutorials  :-[
The code is correct but the map file was outdated. I've just updated it.
So please update your tutorial files and try it again.
Logged

Zoeyface

  • Newbie
  • Posts: 3
    • View Profile
Re: Help with the FIFE python tutorials
« Reply #2 on: March 31, 2013, 09:53:03 pm »

Many thanks good sir. However, just for my own sanity, what was wrong with the map?

I myself had checked if the model was colliding with something (Im assuming that's the blocked thing in the xml file) but that all seemed to be fine.
Logged

helios

  • Developer
  • Jr. Member
  • *
  • Posts: 61
    • View Profile
Re: Help with the FIFE python tutorials
« Reply #3 on: April 02, 2013, 10:01:04 am »

The layer type was missing.
You can not automatically walk on a layer, so you have to set if the layer is walkable (creates an own CellCache) or if it is a interact layer (Layers are combined to one CellCache).
If you look at the changes here https://github.com/fifengine/python-tutorials/commit/f47a161a86f5775b61a36736d806565b67af8e82 you can see that the ground layer is now a interact layer of actor layer and actor is walkable. No need to do this in the map file per hand, you can use the map editor and there the LayerTool.
These means, the actor layer creates a CellCache with the data of the ground layer (e.g. size and blocking property). The actor layer have only a size of one cell because only one instance is on the layer (the player). By default the size is calculated from the positions of all instances of a layer. So you have three options to create the right size of a walkable layer.
The first one is to set the size by your own (UH does it so), the second way is to place edge instances on the walkable (4 instances, one for each corner), third is to combine layers. It depends on what you want to achieve.
Lets say you have three layers, water, land and actor. The player is on the actor layer and should be able to walk on the land but not on the water. First step is to ensure that the water object/instances are blocking and the land objects/instances don't. Then set the water and land layer as interacts from actor layer. The result is a CellCache which as data source using the three layers. So min/max size of the layers are combined to the cache size and blocking is also merged. So each cell which is placed on a water instance, blocks.

The old way was to create a invisible blocking object and place the instances on actor layer on all water positons. That was just very awkward ;)
In summary, one can say the Layer is used for visual ordering and the CellCache is used for pathfinder ordering.
Logged