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 - Diarandor

Pages: 1 ... 67 68 [69]
1021
Development / Re: NPC asking question
« on: May 28, 2015, 11:25:31 pm »
Have you tried something like this?

-- Save game dialog
dialog{
  id = "pause.save",
  question = true,
  text = [[
Is your desire to save the game?
Yes
No
]]
}

1022
General discussion / Re: Distribution
« on: May 03, 2015, 09:58:21 pm »
Hi, I am trying to make a game with Solarus and, since I am new to this things, I would like to know more about licenses, copyrights and trademarks. Could you help me? I would like to make a game with a freeware license. (The graphics, sounds, music, etc. will be made by me.)

1) What must I do to obtain a copyright and where can I obtain it? How expensive can it be?

2) What must I do to obtain a trademark for the title of the game and where can I obtain it? How expensive can it be?

3) Is it possible to copyright a game that is still being developed? And if it is possible, can it be done without having to pay each time the game is actualized? I would like to do this, if possible, with a freeware license.

4) To use a (freeware) license for the game, is it enough to copy-paste the text of the license and put it in a text file with the info of the game?

Thanks in advance for your help!

1023
Development / Re: Custom Entity: Moving platform [Solved with code]
« on: March 23, 2015, 12:56:35 am »
Yes, you are right, I forgot that line (I found that I had a global variable hero in other script, by mistake), and the "touching" collision should be the best choice for the platform. Thank you!

I only have tested the platform between two normal walls, and it works fine, at least in that case. I didn't find the last issue that you said.
(Maybe the problem is with that kind of wall that only affects NPC's, I don't know...)

1024
Development / Re: Problem when scripting platforms or wind
« on: March 17, 2015, 09:40:21 pm »
It's reported now.

1025
Development / Problem when scripting platforms or wind
« on: March 16, 2015, 11:37:28 pm »
Hi, I have the following problem (it is quite a bit hard to explain), and it could be a bug.
I made scripts for platforms and wind that move the hero changing his coordinates.

-For the platforms, I change the coordinates of the hero using the event on_position_changed of the platform (the platform is moved with a movement of the engine). The problem appears when the hero is carrying an object (a pot for example) and the camera is moving following the hero at the same time (to test this the map must be big). Sometimes, the sprite of item that is being carried is showed like vibrating (from left to right to left, etc, if the direction of the movement is horizontal). This only happens sometimes (and the camera must be moving to make this happen). Maybe the sprite of the carried item is not refreshed in the correct time, or something like that... (I tested a script of wind, using the same method and the same happens, obviously.)

-I made another script of wind using a different method: the position of the hero is changed using a timer with a loop. In this case, when the camera is moving after the hero, the carried item is moved smoothly, but the sprite of the hero appears like vibrating (the same problem as above but in the sprite of the hero in this case). The same happens when I apply the movement to other custom entities that are not the hero (I emphasize that the camera must be moving to make this happen).

Obviously, my aim is to make the movement smooth for the hero, carried items, and other entities where I apply the movement, when the camera is moving, if this is possible. Do you have the same problem? (Maybe I am doing something wrong) Could this be a bug of the engine? I would like to find a solution for this... or I will be forced to use small maps when I use this kind of entities.

Thanks in advance for your help!

1026
Development / Re: Custom Entity: Moving platform [Solved with code]
« on: March 06, 2015, 05:14:01 pm »
Hi! Thanks for the code, I found it very useful. I have modified (and improved a bit) the functions of the script. Now the hero is not centered in the platform and can move more freely over it. (I tested the platform over traversable ground and it works fine.) I post my customized code, just in case someone find it useful:

Code: [Select]
local entity = ...

-- Platform: entity which moves in either horizontally or
-- vertically (depending on direction) and carries the hero on it.

local speed = 50
local time_stopped = 1000

function entity:on_created()
  self:create_sprite("entities/platform")
  self:set_size(32, 32)
  self:set_origin(16, 16)
  self:set_can_traverse("jumper", true)
  self:set_can_traverse_ground("hole", true)
  self:set_can_traverse_ground("deep_water", true)
  self:set_can_traverse_ground("traversable", false)
  self:set_can_traverse_ground("shallow_water", false)
  self:set_can_traverse_ground("wall", false)
  self:set_modified_ground("traversable")
  self:set_layer_independent_collisions(false)

  local m = sol.movement.create("path")
  local direction4 = self:get_sprite():get_direction()
  m:set_path{direction4 * 2}
  m:set_speed(speed)
  m:set_loop(true)
  m:start(self)
 
  self:add_collision_test("containing", function(platform, other)
    if other:get_type() == "wall" and other:get_type() ~= "jumper" then
      self:on_obstacle_reached(m)
    end
  end)

end

function entity:on_obstacle_reached(movement)
  --Make the platform turn back.
  movement:stop()
  movement = sol.movement.create("path")   
  local direction4 = self:get_sprite():get_direction()
  direction4 = (direction4+2)%4
  movement:set_path{direction4 * 2}
  movement:set_speed(speed)
  movement:set_loop(true)
  sol.timer.start(self, time_stopped, function() movement:start(self) end)
end

function entity:on_position_changed()
  -- Moves the hero if located over the platform.
  if not self:is_on_platform(hero) then return end
  local hx, hy, hl = hero:get_position()
  local direction4 = self:get_sprite():get_direction()
  local dx, dy = 0, 0 --Variables for the translation.
  if direction4 == 0 then dx = 1
  elseif direction4 == 1 then dy = -1
  elseif direction4 == 2 then dx = -1
  elseif direction4 == 3 then dy = 1
  end
  if not hero:test_obstacles(dx, dy, hl) then hero:set_position(hx + dx, hy + dy, hl) end
end

function entity:on_movement_changed(movement)
  --Change direction of the sprite when the movement changes.
  local direction4 = movement:get_direction4()
  self:get_sprite():set_direction(direction4)
end

function entity:is_on_platform(other_entity)
  --Returns true if other_entity is on the platform.
  local ox, oy, ol = other_entity:get_position()
  local ex, ey, el = self:get_position()
  if ol ~= el then return false end
  local sx, sy = self:get_size()
  if math.abs(ox - ex) < sx/2 -1 and math.abs(oy - ey) < sy/2 -1 then return true end
  return false
end

1027
Bugs & Feature requests / Misprint in Lua API - Enemy
« on: February 25, 2015, 07:18:08 am »
There is a misprint in the Lua API of "enemy" (here: http://www.solarus-games.org/doc/latest/lua_api_enemy.html)
in the last lines of the example of the Overview, it should be written m:start(self) instead of  self:start_movement(m).
I suppose that was the old syntax. That misprint could give problems for beginners of solarus.

1028
It's posted there now.

1029
Hi! I have the following problem:

The animation for  the sprite "carrying_walking" that I am using has 8 frames. But the carried object bounces each 3 frames (this was the behaviour in ALTTP), so  the animations are not synchronized. (I would like to keep the number of frames to keep quality of the animation.)

Could this be made more customizable in future versions of solarus?
I suggest using a variable in the engine to set the number of bounces on each loop, which should be 1 by default (in my case I would need to set it to 2 times for each loop since in the walking animation the hero moves both legs on each loop).

Thanks a lot!

1030
Development / Question: mirrors and reflections
« on: February 03, 2015, 08:49:13 pm »
Would it be possible (in the current or future versions of solarus) to program scripts for mirrors showing a reflected image of what is next to them, or water reflecting the image of what is above?

(It's just out of curiosity. I don't need these entities for the game I'm working on, but it would be cool if possible.)

1031
Development / Re: I need some help to customize the command "action".
« on: December 14, 2014, 05:11:52 pm »
Thanks again!
I will do as you say, mimicking some functions of the HUD to manage my custom actions.

1032
Development / I need some help to customize the command "action".
« on: December 14, 2014, 03:26:47 am »
Hi! I was trying to execute a function (for example, to open a menu in the game) when the "action" button is pressed, but only in case the hero is not performing another action (talking, lifting,...). To do that, I tried to use the function:

function game:on_command_pressed(command)
  if command == "action" and game:get_command_effect("action") == nil then
     ---- ...my function...
  end
end

The problem is that this does not work when interacting with custom entities because the function game:get_command_effect("action") returns nil, and I think it is not possible to assign a command effect when the hero is close to a custom entity before the "action" command is pressed (maybe I'm wrong).

Could you help me to solve this problem?
Thanks in advance!

1033
Development / Re: Help with light and darkness
« on: September 20, 2014, 05:42:18 pm »
Thanks a lot again for your help!

1034
Development / Help with light and darkness
« on: September 20, 2014, 03:28:31 am »
Hi,

I would like to know if it is possible to program dark rooms where there are several sources of light (including the hero, some moving enemies, and torches on walls). Outside the illuminated areas there would be opaque darkness. Is it possible to do this? And how?

Thanks for your help!!!

1035
Bugs & Feature requests / Problem after using hero:set_tunic_sprite_id()
« on: September 13, 2014, 07:20:34 pm »
Hi! I have the following problem:

After changing the hero's sprite with the function hero:set_tunic_sprite_id("tunic_name"), the hero is not hurt when colliding with an enemy. I realized that this only happens when the name of the tunic is not of the form "tunicX". Could this be a bug?

Thanks in advance for your help!

Pages: 1 ... 67 68 [69]