Recent Posts

Pages: [1] 2 3 ... 10
1
Your projects / Re: Some Maps I've been working on...
« Last post by llamazing on Today at 12:09:48 pm »
The link does still work.

@eliwolfe92 You can embed the image in the post with the image tag. Make sure you are using a url that ends in .png for each image. Right click one of the images and choose "Copy image addess" (Chrome) or "Copy Image Location" (Firefox). Syntax is:
Code: [Select]
[img]https://i.imgur.com/3DONMP8.png[/img]

Note that the original link has 6 images, and I am only displaying one of them.
2
Your projects / Re: Some Maps I've been working on...
« Last post by brlmnd on Today at 07:15:03 am »
eliwolfe92, I came back to see your maps again, but the link does not work anymore.
3
Development / Re: Solarus Ubuntu Installation
« Last post by llamazing on Today at 03:56:34 am »
I ran the make command for the engine then compiled and ran the make command for the quest editor.

After running the 'make' command for the engine did you then run the 'make install' command for the engine (but before you run the 'make' command for the quest editor)? No need to run 'make install' for the quest editor, just run 'make' for it.

Also when I am ready to load the program how to I create a shortcut for it as using the terminal to load it every time is going to get tedious.

You can setup a .desktop file for that. I use the program Arronax to create the .desktop file, but you can create it using just a text editor.
4
Development / Re: Solarus Ubuntu Installation
« Last post by BadWolf on Today at 03:26:42 am »
I ran the make command for the engine then compiled and ran the make command for the quest editor. Everything for the engine worked fine but at the very end of the make for the editor I got this back.

Code: [Select]
[100%] Linking CXX executable solarus-quest-editor
[100%] Built target solarus-quest-editor
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/bin/solarus-quest-editor
CMake Error at cmake_install.cmake:42 (file):
  file INSTALL cannot copy file
  "/home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3/build/solarus-quest-editor"
  to "/usr/local/bin/solarus-quest-editor".


Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1

Seems one file didn't go where it needed to. Is this important to fix or can I load up the program? Also when I am ready to load the program how to I create a shortcut for it as using the terminal to load it every time is going to get tedious.
5
Your scripts / Re: "End Credits" script (rolling credits)
« Last post by llamazing on November 15, 2018, 11:24:03 pm »
Cool!

You should have it start playing a music file and then synchronize the scroll speed so that it ends as the music ends.

hmm... I don't think there is any way to get the duration of a music track from the Solarus API, though.
6
Your scripts / "End Credits" script (rolling credits)
« Last post by alexgleason on November 15, 2018, 09:54:14 pm »
I didn't share this before because it'd likely need to be adapted and parts of the code aren't super nice, but I figure maybe this will benefit someone.

It requires a dialog called "end_credits", and it just rolls through it until it's done.
Code: Lua
  1. -- ♡ Copying is an act of love. Please copy and share.
  2.  
  3. -- Game credits. Plays at the end of the game.
  4.  
  5. local end_credits = {}
  6.  
  7.  
  8. -- https://stackoverflow.com/a/8316375/8811886
  9. function build_array(...)
  10.   local arr = {}
  11.   for v in ... do
  12.     arr[#arr + 1] = v
  13.   end
  14.   return arr
  15. end
  16.  
  17.  
  18. -- Called when the menu is started
  19. function end_credits:on_started()
  20.   local lh = 12 -- line height in pixels
  21.   local speed = 24 -- scroll speed in px/s
  22.  
  23.   -- Credits dialog
  24.   self.dialog = sol.language.get_dialog("end_credits")
  25.  
  26.   -- Break dialog text into a table of lines
  27.   local lines = self.dialog.text
  28.   lines = lines:gsub("\r\n", "\n"):gsub("\r", "\n")
  29.   lines = build_array(lines:gmatch("([^\n]*)\n"))
  30.  
  31.  
  32.   -- Box where the credits go
  33.   self.credits_surface = sol.surface.create(
  34.     160, -- center the surface on the screen
  35.     (#lines * lh) -- surface is large enough to hold all lines
  36.       + 144 -- surface scrolls in from the bottom, so has a padding top equal to the screen size
  37.       + 16 -- room for 8px top and bottom padding
  38.   )
  39.  
  40.   -- Loop through all dialog lines and draw them
  41.   for i, line in ipairs(lines) do
  42.     local line_surface =  sol.text_surface.create({font="Comicoro", font_size=16, text=line})
  43.     -- Draw the given line
  44.     line_surface:draw(
  45.       self.credits_surface,
  46.       8, -- left padding
  47.       i * lh -- bump it down by line number and line height
  48.         + 8 -- top padding for whole box
  49.     )
  50.   end
  51.  
  52.   -- Animate the text box upwards
  53.   local m = sol.movement.create("straight")
  54.   m:set_angle(math.pi / 2)
  55.   m:set_speed(speed)
  56.   m:start(self.credits_surface)
  57.  
  58.   function m:on_position_changed()
  59.     local credits_surface = end_credits.credits_surface
  60.     local x, y = credits_surface:get_xy()
  61.     local w, h = credits_surface:get_size()
  62.  
  63.     log(string.format("Credits text box: (%d, %d)  ;;  y+h = %d", x, y, y+h))
  64.  
  65.     if y + h < 0 then
  66.       -- Credits are out of view, end the menu
  67.       log("Credits animation finished.")
  68.       self:stop()
  69.       sol.menu.stop(end_credits)
  70.     end
  71.   end
  72.  
  73. end
  74.  
  75.  
  76. -- Called each frame
  77. function end_credits:on_draw(dst_surface)
  78.   dst_surface:clear()
  79.   self.credits_surface:draw(dst_surface, 48, 144)
  80. end
  81.  
  82.  
  83. return end_credits

It's a menu, so put it in a .lua file (eg scripts/menus/end_credits.lua) and use something like this:

Code: Lua
  1. local end_credits = require("scripts/menus/end_credits")
  2.  
  3. sol.menu.start(game, end_credits)
  4.  
7
Development / Re: Solarus Ubuntu Installation
« Last post by llamazing on November 15, 2018, 02:08:05 pm »
After compiling the solarus engine you can run the command
Code: [Select]
make install
You'll want to do this step after the make step (and while in the solarus-1.5.3/build/ directory).

That will install the solarus components in the typical locations where the quest editor compiler will look for them. Otherwise you have to manually specify where to find each component while building the quest editor, which is rather tedious.
8
Development / Re: Solarus Ubuntu Installation
« Last post by BadWolf on November 15, 2018, 07:33:26 am »
Did that. The Engine itself compiled properly. However I tried to do the same thing for the Quest Editor and I got this:

Quote
-- Could NOT find SOLARUS (missing:  SOLARUS_LIBRARY SOLARUS_INCLUDE_DIR)
-- Could NOT find SOLARUS_GUI (missing:  SOLARUS_GUI_LIBRARY SOLARUS_GUI_INCLUDE_DIR)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
SOLARUS_GUI_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
SOLARUS_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3
   used as include directory in directory /home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3

-- Configuring incomplete, errors occurred!
See also "/home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3/build/CMakeFiles/CMakeOutput.log".
See also "/home/deep_thought/Documents/Solarus/solarus-quest-editor-1.5.3/build/CMakeFiles/CMakeError.log".

Nearest I can tell while trying to compile the Quest Editor it is trying to build paths to the Solarus Engine but doesn't know where that is installed. How do I tell it?
9
Development / Re: Solarus Ubuntu Installation
« Last post by llamazing on November 15, 2018, 05:49:40 am »
You want to do:
Code: [Select]
cd path_to_build
cmake ..

There's a file named compilation.txt inside the solarus-1.5.3 directory that details the commands to run, try checking that out if you haven't.
10
Development / Re: Solarus Ubuntu Installation
« Last post by BadWolf on November 15, 2018, 01:37:15 am »
 Okay so I installed the dependants and then cmake which seems to have worked nicely. I'm in the Solarus source code folder which I opened in Terminal. In that folder I created another one called "build" which on cmake I specified to do the compiling in and I got this back.

Quote
cmake path to build
CMake Error: The source directory "/home/deep_thought/Documents/Solarus/solarus-1.5.3/build" does not appear to contain CMakeLists.txt.

Are there files I need to move into the build folder before I can compile?
Pages: [1] 2 3 ... 10