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

Messages - Christopho

#1066
Development / Re: Creating two heroes
December 20, 2014, 08:43:35 PM
No, there is no built-in support for that. You would have to make a custom entity (scripted in Lua) that would play the role of the second hero.
#1067
What you should do is add a second function that remembers if the action command would do something custom in one of your scripts, like with a custom entity.
So you would have two functions:
- game:get_command_effect("action"): returns the built-in action or nil. This function is in the engine. There is is game:set_command_effect() because it is the engine who decides.
- game:get_custom_command_effect("action") and game:set_custom_command_effect("action", "something"): when the built-in action is nil, returns if your script would do something. These functions is not in the engine, they will be added by your quest. Call game:set_custom_command_effect() from your custom entity script.
And it is only when both of them return nil that nothing happens.

Actually, these additional functions game:get/set_custom_command_effect() already exist in ZSDX, I use them for the HUD.Indeed, the action icon of the HUD displays more state than just the built-in effect of the action command.

Last remark: if the player has the ability to run, the action command can be used to run. Unfortunately, the engine still returns nil in this case when you call game:get_command_effect("action"). I condiser this as a bug.
#1068
Development / Re: Sprite animation names
December 12, 2014, 08:56:52 AM
Quote from: Mimiga on December 11, 2014, 09:58:14 PM
Hi, I was wondering how the game defines what the player's sprite is. In the defaults it's something like hero/tunic1, but I want to choose between two different characters so I want to name them what I want (like "hero/player1" or "hero/player2"). I didn't think I found anything under the documentation. Where do I go to make the engine make the default hero sprite "hero/player1" other than the default "hero/tunic1"?
"hero/tunicX" is the default sprite, but you can change it with hero:set_tunic_sprite_id(): http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_set_tunic_sprite_id

Quote from: Mimiga on December 11, 2014, 09:58:14 PM
Also, are the animation names like "walking" and "plunging" concrete in that they MUST be named that in order for the editor to read them correctly in order to walk? Is it possible to add a custom animation like "crying" and have it be used by calling sprite:set_animation?
Animations like "walking" and "plunging" are mandatory (and automatically triggered by the engine) but you can add other ones. And you can start them with hero:set_animation(): http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_set_animation
#1069
Development / Re: Video mode
December 11, 2014, 05:55:47 PM
#1070
General discussion / Re: Thank you!
December 11, 2014, 03:27:49 PM
Thanks your for message! Welcome to the forum, and don't hesitate if you have questions.
#1071
Development / Re: Sidemap - Scrolling
December 09, 2014, 02:31:19 PM
Use the "Location" property of maps to do this.
For example, if map A is at 0,0 and has a size of 320x240, set the location of map B to 320,0 and the location of map C to 0,240.
I hope it helps!
#1072
One solution is to deactivate the switch as soon as it is activated. So, when it is activated (in switch:on_activated()), you call switch:set_activated(false), change something in its sprite and trigger whatever mechanism you want.
When the player hits it again, since it was deactivated, the switch:on_activated() is executed again.

From the point of view of the player, the switch has two states. From the point of view of the engine, it is always deactivated.
#1073
Development / Re: Check Item
December 03, 2014, 08:07:03 PM
get_item() is a function of game, not map.
See http://www.solarus-games.org/doc/latest/lua_api_game.html#lua_api_game_get_item

And now that I see the doc, there is an even shorter solution:
game:has_item("lamp")
#1074
Development / Re: Check Item
December 03, 2014, 08:42:17 AM
Don't forget the item name parameter in game:get_item(). So it would be:
game:get_item("bow"):get_variant() == 0
or a shorter equivalent:
game:get_item("bow"):has_variant()
#1075
General discussion / Re: Distribution
November 24, 2014, 11:50:26 PM
Hi,

First, obviously, you cannot sell a game with Zelda graphics and musics. Nintendo seems to tolerate non-profit making Zelda fangames, but for sure you will have problems if you start making money with Nintendo copyrighted content.

So the question is about creating a game with free graphics and musics.

The Solarus engine and games created with it are two different things. Your game can have any license you want, but the Solarus engine is licensed under GPL v3.
GPL does not forbid commercial uses, but you must stay compliant with it.

One goal of Solarus is to allow players to create their own game eventually and to preserve their rights to re-use and extend the engine.
You are free to distribute Solarus with you own game and to modify it, including for a commercial use, but you must always distribute the source code of Solarus (or any modification of Solarus that you make) and include its GPL license notice to inform users.

But again, your game data can have a restrictive license: only the engine part must be free software (free as in freedom).
#1076
Bugs & Feature requests / Re: [1.3] Bug SubMenu
November 20, 2014, 08:57:35 AM
Hi!
Sorry about these outdated tutorials. I have started to make new ones with latest versions, but it takes time :)

Quote from: Yruama on November 20, 2014, 01:32:27 AM
Before doing that, I 've changed a line (in Pause Menu Line 78) :

   local line1, line2 = text:match("([^$]+)\$(.*)") to    local line1, line2 = text:match("([^$]+)$(.*)")
The correct line is
    local line1, line2 = text:match("([^$]+)%$(.*)")
The goal here is to escape the $ character in the pattern. In Lua, the escape character in patterns is % and not \. (In worked before by luck because vanilla Lua allows \ too even if it is incorrect. LuaJIT does not.)

Anyway, that should fix your second error (field 'caption_text_2' being nil).

Quote from: Yruama on November 20, 2014, 01:32:27 AM
Error: In on_started: [string "scripts/menus/pause_submenu.lua"]:19: attempt to call field 'get_dialog_font' (a nil value)


In the resources to download with the tutorial, main.lua defines two new functions sol.language.get_dialog_font() and sol.language.get_menu_font(). You probably forgot to copy them.
#1077
Bugs & Feature requests / Re: [1.3] Bug set_transparency
November 19, 2014, 09:17:26 PM
Hi,
Since Solarus 1.2, surface:set_transparency_color() no longer exists. More information here: http://wiki.solarus-games.org/doku.php?id=upgrade_from_1.1_to_1.2
So the tutorial is slightly outdated. You have to edit the HUD script and replace calls to surface:set_transparency_color() + surface:fill_color() by simply surface:clear(). I can help you if you have any trouble.
#1078
Hi,
Solarus is supposed to compile with 4.8 indeed, so I think we should fix the debian package. I have just reported the problem to Nate-Devv, the packager.
In the meantime you will have to compile it yourself :)
#1079
Bugs & Feature requests / Re: Linux - Start Quest Editor
November 11, 2014, 04:34:07 PM
Type ./compile first.
#1080
Development / Re: Hud: Item counter
October 20, 2014, 08:51:23 AM
Your code displays the counter but never changes its value. Use a timer to periodically update it. See what does the small key counter of Zelda Mystery of Solarus DX/XD for example.