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

Pages: [1] 2 3 ... 6
Code: (lua) [Select]
  id = "first_dialog",
  next = "second_dialog",
  text = [[
show this dialog first.

  id = "second_dialog",
  text = [[
Then show this dialog.
This code is relevant to the the language.dat file, not your code. In code call the dialog as you normally would, I.E.
Code: (lua) [Select]
game:start_dialog("sword.first")Now you have two options from here for calling another dialog. You can either use the callback or, the much cleaner way, use the "next" property key.

I'm just using an image extracted from my own personal project (see attachment 1), so certain properties here are irrelevant (and don't work as the dialog script your using doesn't use these properties).
The value that the property key "next" should be the next dialog that you wish to call.

Your scripts / Re: Simple Leveling up system
« on: March 09, 2019, 01:29:48 am »
Since when did lua only accept integers?
I've done quite a bit of programming in lua where I've used non-integer numbers and the functions math.ceil() and math.floor() exist, which round a number up or down respectively.

I think it's also worth noting that technically, the number of ropes can be changed via other methods that don't involve them being killed, but these are cases in which you'd be doing something in your code and not something that the engine would do on it's own.

I would also advise that the chest activation script for these ropes use a save game variable to check if this challenge has been done before, and set the map state to reflect this. The map won't automatically do this for you on it's own. You'll have to remove the enemies under map:on_started() and enable the chest again.

The method "entity:remove()" won't call the the "enemy:on_dying()" and "enemy:on_dead()" events, so you can safely remove them from the map without code accidentally being executed.

Rather than doing a repeat command and wait until,
you should preform a check on each enemy to check if all the enemies are defeated when they are slain.
like so:
Code: (lua) [Select]
function map:on_started()
  -- Find all the entities named "rope" and define their on_dead() function.
  for rope in map:get_entities("rope") do

    -- Another method of defining a function, One that I like using for dynamically handled code.
    rope.on_dead = function(rope) -- Because the function isn't defined like the other functions here, we need to set the first variable to be the object that this event is being called on.

      if rope:get_map():get_entities_count("rope") <= 0 then
        -- Do things here for making the chest appear, the local variable map will need to be defined inside this function.
        local map = rope:get_map()
        -- map:get_entity("rope_chest"):enable()"chest_appears")




Development / Re: Pre-made LttP Maps?
« on: January 29, 2019, 02:29:33 am »
try ffomega's tileset and the sample maps. (Although, it would appear that the images have been lost when the site was transferred to this server.)

I still don't see the aim of this. You can play Solarus on any OS and use controllers and gamepads, or am I wrong?
No you're not.

@Levi, solarus has native controller support. If you're trying to use the d-pad on a controller and it's not working, try using the Left stick. The in game button mappings for a joystick default to the left stick being the movement option.

Is it my phone or the movement is not completely smooth? (I do not have internet at home now to check this.)
No, It's also choppy on my PC.

Bugs & Feature requests / Re: Pixel ratio Limitations?
« on: July 07, 2018, 05:47:12 am »
The position of the collision box is based upon where the origin of the sprite is.

Should be. For a while, I was running solarus on a Chromebook. (acer c720 for those who care)

Development / Re: Using chest to open a door
« on: March 06, 2018, 11:36:49 pm »
Your usage of arguements in the function is incorrect.

The way defining functions work in lua (And in most if not all programming languages with some differences) is the section within the parentheses are variable only accessible from within the function.
So instead what you would want to do is something like this:

Code: (lua) [Select]
function clothes_chest:on_opened(treasure_item, treasure_variant, treasure_savegame_variable)
  map:get_hero():start_treasure(treasure_item, treasure_variant, treasure_savegame_variable, function() -- The function here is to indicate an event happens after receiving an item

Development / Re: Issue with doors
« on: September 23, 2017, 05:01:36 pm »
You need to have multiple directions for the sprite or simply just set the door's direction to the right.

General discussion / Re: An example of the Engine.
« on: July 29, 2017, 03:41:44 am »
Very nice :) Do you plan on making a fully-functional engine using LttP-like items?
Eventually, once I can pull myself away from other projects and look back at this one.

Here is a link to the data files;
Although be warned, its in a very clearly development test stage and should be treated as such.

Although the video is a far earlier build of what I currently have, I haven't really touched much of the data in the past few months. (Primarily because I got myself messing about with team fortress 2 and the hammer world editor.)

Development / Re: How does the overworld map menu work?
« on: July 16, 2017, 06:35:32 am »
When drawing out a map, at least for me, I use a base of 16 by 16, and cut said tiles in half for 8 by 8. This will mach up nicely with the tiles of one's map.
So, a 320 by 240 map will have a base 16 grid of 20 by 15.

Development / Re: Item command held on item?
« on: June 19, 2017, 07:09:01 pm »
What you'll probably want to do is create a timer (or a set of timers) that count for how long you want the difference of time between the instances of charge.

So doing something like this:
Code: ( lua) [Select]
-- At beinging of code
local timer = nil

--  Code before timers
local function start_timer()
  timer = sol.timer.start(item, 1000, function()
    --code relating to when timer reaches max time
  end) -- This timer lasts 1 sec and belongs to "context" item if defined. To increase the time, change the 2nd value to desired time in milliseconds.


local function end_timer()
  local time_remaining = timer:get_remaining_time()
  --code relating to translating time into charge
  --I.E. Total charge value / (time_remaining * -1)
  --return charge_strength

See for more details relating to timers.

For checking if the item is being held down, I would look to these sets of events:

Development / blend modes
« on: March 13, 2017, 02:23:49 am »
So I was working on a new light_manager script for my quest, but I've run into an issue with (what I think is) an engine limitation.
I'm trying to get it so that one surface applies to another while inverting it's alpha channel content (Opaque becomes transparent and transparent becomes Opaque). I'd write an algorithm myself in lua, but It would seem (Unless I'm missing something), that this is impossible for the moment.

Pages: [1] 2 3 ... 6