Solarus-Games English Forum

Solarus => Development => Topic started by: aLinktotheDead on July 10, 2015, 08:54:55 AM

Title: Few Questions
Post by: aLinktotheDead on July 10, 2015, 08:54:55 AM
Okay, so I have a few questions I need to ask for my project...
1. How do I make a title screen with a new and continue button? (Because following the tutorial caused my game to never load... I need this fixed...)
2. How do I add music to the title screen?
3. How do I add a background to my title screen?
4. How do I make a sword and change it's damage?
5. How do I make an NPC walk?
Title: Re: Few Questions
Post by: Maxs on July 10, 2015, 11:09:25 AM
First, I suggest you to learn more about Solarus before launching you in a big project.
Christopho has made a big work and all is clearly explained in the documentation (http://www.solarus-games.org/doc/latest/) and video tutorials (https://www.youtube.com/playlist?list=PLzJ4jb-Y0ufwPrBfO5AQMRfe2kLABQsF0)! :)

1. See the menu API (http://www.solarus-games.org/doc/latest/lua_api_menu.html) and the menu:on_key_pressed() (http://www.solarus-games.org/doc/latest/lua_api_menu.html#lua_api_menu_on_key_pressed) event for the continue button.

Maybe that if your game is never load you need to understand why?
When the engine have errors he puts them in the error.txt file.
If there is no errors in this file, may be that's due to your script which do nothing or not what you expect. ???

2. See the audio API (http://www.solarus-games.org/doc/latest/lua_api_audio.html).

3. See the surface API (http://www.solarus-games.org/doc/latest/lua_api_surface.html) and the menu:on_draw() (http://www.solarus-games.org/doc/latest/lua_api_menu.html#lua_api_menu_on_draw) event.

4. See the item API (http://www.solarus-games.org/doc/latest/lua_api_item.html) and the enemy API (http://www.solarus-games.org/doc/latest/lua_api_enemy.html).

For the sword, you need to define a new variant in the sword item and add all sprites related to this variant.
Then you can define the behavior of enemies when hurting by the sword (and check the variant to make what do you want there) with the enemy:on_hurt_by_sword() (http://www.solarus-games.org/doc/latest/lua_api_enemy.html#lua_api_enemy_on_hurt_by_sword) event.
The best way is to use metatables for that but it is not easy for beginners, it allows to define an event for all objects of the a same type.
You can find an example in the quest_manager.lua (https://github.com/christopho/zsdx/blob/098bab05fa92b610cba5d6a84a7fb89c1e06c3ba/data/quest_manager.lua#L38) script of zsdx.

5. See the NPC API (http://www.solarus-games.org/doc/latest/lua_api_npc.html) and movement API (http://www.solarus-games.org/doc/latest/lua_api_movement.html).




You can find examples of scripts in the official games:

so, there you have a title menu (https://github.com/christopho/zsdx/blob/master/data/menus/title.lua) script, sword item (https://github.com/christopho/zsdx/blob/master/data/items/sword.lua) etc ...

Finally, I advise you to take the time to learn and to progress step by step. ;)
Title: Re: Few Questions
Post by: aLinktotheDead on July 10, 2015, 01:24:27 PM
Wow, I had no idea this had so much to do with API. O_o
Look how violent my profile picture is compared to yours...
Title: Re: Few Questions
Post by: Christopho on July 10, 2015, 03:25:33 PM
Solarus is all about Lua scripting. As I explain in the very first tutorial, I would not recommend it to non programmers. There are other game creation software without programming needed, like Game Maker, Multimedia Fusion or Zelda Classic.
Title: Re: Few Questions
Post by: aLinktotheDead on July 11, 2015, 08:03:48 AM
Aw, I want an action RPG game creator that doesn't require programming.  :(
Title: Re: Few Questions
Post by: Zeror on July 11, 2015, 12:45:12 PM
If you have a little experience with programming, regardless of script language, then you should understand Solarus Quest Editor. A lot is explained in the documentation and in the tutorials. That can be very helpful.