Menu

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.

Show posts Menu

Topics - xavius

#1
Hi,

It has been a long time since I got the time to develop my game but here I am.

I am having difficulties to update from v1.2 to v1.3. I used the map upgrade from the editor but all my maps that contain entities will just crash the editor when loading and without getting any error. I checked further by trying to run them with the game executable. Here is what I get for one map (see attached)

I checked the dat file and got to the lines in question:
switch{
  layer = 0,
  x = 1544,
  y = 1608,
  name = "secret_chest1",
  subtype = "1",
  needs_block = false,
  inactivate_when_leaving = false,
}

The second argument is suppose to be the ground type if I understood correctly. In my map, it is the x position of the entity itself.

What should I do to change this and be compatible with v1.3?

Thank you!

#2
Your projects / My first video
August 02, 2014, 05:03:46 AM
Hi evrybody,

I just uploaded a video of a part of one of my dungeons. Not the best video ever recorded and have no sound but anyway, Enjoy!

By the way, does anybody have a good desktop recorder I could use, VLC does not want to record my speaker sound.

https://www.youtube.com/watch?v=6IJ_8VDKCAI&feature=youtu.be
#3
Hi,

I know you can save ground to reset the hero to a position when he falls but is it possible to do the same with lava and water?

Thank you!
#4
Development / Enemies examples
June 14, 2014, 07:17:55 PM
Hi everybody,

I want to share some enemies that I have created with you. Could be useful for your projects. All of theses enemies are compatibles with this script http://forum.solarus-games.org/index.php/topic,51.0.html made by Christopho to reset enemies positions when crossing a separator.

I will add enemies time to time as I go in learning lua.

Homing bat
Simply, it is a bat that stands and do nothing. If you come close enough, it will go at you in a straight line. I used the Ganon firebat graphics for this, I changed the graphic script though to make it more realistic.

fire_bat.dat modified script:
animation{
  name = "stopped",
  src_image = "enemies/fire_bat.png",
  directions = {
    { x = 160, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 1 },
    { x = 160, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 1 },
    { x = 160, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 1 },
    { x = 160, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 1 },
  },
}

animation{
  name = "walking",
  src_image = "enemies/fire_bat.png",
  frame_delay = 50,
  frame_to_loop_on = 2,
  directions = {
    { x = 96, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 4 },
    { x = 96, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 4 },
    { x = 96, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 4 },
    { x = 96, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 4 },
  },
}

animation{
  name = "hurt",
  src_image = "enemies/fire_bat.png",
  frame_delay = 50,
  frame_to_loop_on = 0,
  directions = {
    { x = 192, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 2 },
    { x = 192, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 2 },
    { x = 192, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 2 },
    { x = 192, y = 0, frame_width = 32, frame_height = 32, origin_x = 16, origin_y = 16, num_frames = 2 },
  },
}



homing bat script
local enemy = ...
local going_hero = false
local m

function enemy:on_created()
  self:set_life(1)
  self:set_damage(2)
  self:create_sprite("enemies/fire_bat")
 
  self:set_size(16, 8)
  self:set_origin(8, 0)
  self:set_obstacle_behavior("flying")
  m = sol.movement.create("target")
  m:set_ignore_obstacles(false)
  m:set_speed(0)
  m:start(self)
end


function enemy:on_restarted()
  local sprite = self:get_sprite()
  sprite:set_animation("stopped")
  m:set_speed(0)
  going_hero = false

  self:go_random()
  self:check_hero()
end

function enemy:check_hero()
  local hero = self:get_map():get_entity("hero")
  local _, _, layer = self:get_position()
  local _, _, hero_layer = hero:get_position()
  local near_hero = layer == hero_layer
    and self:get_distance(hero) < 150

  if near_hero and not going_hero then
    self:go_hero()
sol.audio.play_sound("bat")

  elseif not near_hero and going_hero then
    self:go_random()
  end
  sol.timer.stop_all(self)
  sol.timer.start(self, 100, function() self:check_hero() end)
end

function enemy:go_random()
  going_hero = false
  local sprite = self:get_sprite()
  sprite:set_animation("stopped")
  m:set_speed(0)
end

function enemy:go_hero()
  going_hero = true
  local sprite = self:get_sprite()
  sprite:set_animation("walking")
  m:set_speed(88)
end




#5
Hi,

I was wondering if it is possible to reset the enemies position when changing region in a map, when crossing a separator.

What I actually do is put a sensor at the start of each region of the map and reset the not already killed enemies position of the region. Is there an easier way?

I do the same trick instead of using enemy:set_optimization_distance() to stop the enemies of next rooms.

Thank you!
#6
Hi, I am trying to port my data from V1.1 to V1.2. I checked the porting guide but there is no mention of this problem.

When I start the game I get:
Fatal: Cannot load font from file 'text/fixed8.fon': Couldn't set font size

There is a fixed8.fon that exist in /text in my data folder after I updated the files with the V1.2 editor. I am not sure of what the problem means. Could it be simply that the engine is trying to find the file in ./text instead of ./data/text?

hank you for your help.

Best regards.