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

#841
Then, maybe this is not related to the joypad.
#842
There is a workaround with custom entities which create destructibles. You can use a timer to check if the associated destructible has been lift or destroyed and create a new one if necessary. You also need the timer to wait in case the hero or some enemy overlap the custom entity, to avoid overlapping the new destructible with something.
#843
I have tested destructibles with the "can regenerate" option and the same problem appears. I agree that this seems a bug.
#844
Is there some error in error.txt? If so, in which line?
Also, I think that the line

minecart:set_direction(minecart:get_direction() - 2)

should be

minecart:set_direction((minecart:get_direction() - 2)%4)
#845
Hi! Maybe you can use the event on_direction_changed of the custom entity or its sprite to change the direction of the hero.
#846
Hi! Which type of entity are you using? Destrucribles? Or custom entities?
#847
Development / Re: Lens of Truth?
November 17, 2015, 07:29:37 PM
Hi! This seems a cool feature to script for a fangame, and it should not be too hard. You can also use the same kind of functions to hide false objects and walls. Enabling/disabling is worse because you could get stuck if you make the hero overlap some solid entity, so it would be better just changing the visibility with set_visible.

The only restriction you have is that you cannot show or hide only a part of each entity, so maybe it would be better to make the outer part of the circle completely opaque. This is better if you hide/show very large entities (like a bridge).
#848
Development / Re: How to Do a Hud
November 14, 2015, 10:56:49 AM
Actually, you should give thanks to Christopho. He is the one who wrote that HUD script, and he is also the creator of this masterpiece of engine called Solarus. All the credit goes for him. ;D
#849
Development / Re: How to Do a Hud
November 12, 2015, 07:29:38 PM
In my opinion as a quest maker I recommend first to copy a Hud of other people and make it work in your game, then study all the code until you understand everything of it (this may take weeks or even months with a lot of patience and hard work), and finally start modifying and customizing that code, but with small changes and testing if it works each time you change something. With time you will get what you want (this is what I did, so I say this from my own experience). You have examples of scripts, including a Hud, in Christopho's repositories, like this one:
https://github.com/christopho/zelda_mercuris_chest
#850
Development / Re: Menu help
November 10, 2015, 11:51:44 PM
wrightmat- I found a better and easy solution. First define two new methods
"game:get_menu_command_effect(command)" and "game:set_menu_command_effect(command, effect)"
and we will use them only for effects during menus. Then, we give more priority to these menu command effects. To do this, just write
game:get_menu_command_effect("attack") or  game:get_command_effect("attack") or game:get_custom_command_effect("attack")
instead of
game:get_command_effect("attack") or game:get_custom_command_effect("attack")
in the attack_icon script (and similarly for the action effect in the action_icon script). Also, don't forget to set the menu_command_effects to nil when you close the menu. With this you will not need to move the hero before teleporting, and everything will work as before.
#851
Development / Re: Menu help
November 10, 2015, 11:22:44 AM
Username- If you want to suspend all entities, you can use game:set_paused(true) when you open the menu, and game:set_paused(false) to unpause the game. A menu can be used during the pause.
#852
Development / Re: Menu help
November 10, 2015, 10:30:08 AM
Quote from: Username on November 10, 2015, 10:22:54 AM
Hmmm, strange thing is that you can't set the custom effect from the debug console in-game, it always return that set_custom_command_effect doesn't exist

I don't understand what exactly you mean. The function set_custom_command_effect is not a built-in function as Christopho said, it is fully scripted in Lua (in this case it is in the game_manager script); if you get an error is because you have not written it in your scripts. The command_effect is the built-in one, which cannot be changed directly.
#853
Development / Re: Menu help
November 10, 2015, 08:54:39 AM
The reason why I changed those lines of code was to allow talking with npcs while carrying custom entities (to allow giving them objects of type "portable_entity"), so I needed to give priority to the built-in action effect. (In an older version of my script I used the action button to throw the entity, which is also used to talk with normal npcs, so I changed the priority for the built-in talking effect.) But probably you are not using that feature. Anyway, it should be possible to modify the scripts to make everything work correctly with the original code (but that would mean to remove this feature, although that may be fine for your purposes if you don't plan to use it).

In case you change back that code, there might happen that you open the pause menu while carrying a portable_entity, so the custom_command_effects change during the menu, and hence after closing the menu you cannot throw the entity because the custom_command_effects have been changed. The solution should be easy: just store the value of the custom_command_effects in some variables when you open some menu and restore those values after closing the menu.
#854
Development / Re: Menu help
November 10, 2015, 08:02:29 AM
For the attack_icon issue, I think what could be causing the problem, in this file
https://github.com/wrightmat/zbom/blob/master/data/scripts/hud/attack_icon.lua
I was using a modified version of Christopho's script where I changed two parts that had this code
game:get_custom_command_effect("attack") or game:get_command_effect("attack")
for this new one
game:get_command_effect("attack") or game:get_custom_command_effect("attack")
(see the "attack_icon:initialize(game)" and "attack_icon:check()" functions) and since you used some of my scripts (for carrying custom entities), you have this part different too. So if you have some command_effect for the attack icon (value different from nil), then the script will not change the hud (this was the behaviour I wanted to make my own interactions compatible with the hud, because I wanted to give priority to built-in command effects). If that was the problem, then it was my fault (sorry for the inconvenience!). I also modified the action_icon script in the same way.

If that solves the problem, that could create a new one since my script custom_interactions.lua might not work correctly, but I am not sure at all. (The custom_command_effect attack is not used there, but the custom_command_effect action is used, so if you change back the modified script of the action_icon, then the "lift" caption might not be shown fof portable entities. On the other hand, I was using the attack icon to show the "throw" label of "portable_entities", which might not work correctly if you change back the atack_icon script.)

Quote from: wrightmat on November 10, 2015, 12:16:44 AM
Diarandor - is it possible to change maps while paused? Have you seen an instance of this in my game, or another game?

Yes, I made a menu to switch heroes from one map to a different map, which uses a teleport function, and it worked. The map changed with the usual transition, with the menu open and game paused all the time (even after teleporting). As I said, there seems to be a bug, so if there are custom entities in the new map, they won't be suspended (they can move and their animations are not stopped) although the game is paused (this only seems to affect custom entities). As a workaround for the bug, I closed the menu and unpaused the game after switching hero (after teleporting).
#855
I still have nothing playable, but the new things done are:

Customized half of the HUD: there appears a bag of money instead of the usual rupee, which appears when you pick some money and disappears in 2 seconds (I prefer to hide it since the money is not important information). Also I made custom hearts, which appear with a beat effect in the hud (which is cool). I also made pickables for the hearts, heart containers and money. The money are no longer rupees, but what I call ore drops (pieces of ore) of different colors similar to the rupees (the ore drop with value 1 is the malachite ore, which is green like the normal rupee, etc).

On the script part, I can now also switch hero from the menu. This works also if the new selected hero is in a different map (the action button switching only works for heroes in the same map). Also, some custom entities I made, which I call portable entities (they can be carried but not destroyed when thrown), can be carried by heroes to other maps, etc. Also, several types of entities, like independent entities (which can be left alone and reappear when coming back to the map), and companions that follow you between maps if some condition is satisfied (I made a silly one which works), etc. I also customized my dialog box, also allowing to show a sprite of the npc or hero who is talking.

I will be improving my code and solving bugs for some time. But now I will be mainly working on the graphics, making some tilesets and a small part of the world. I want to replace all Zelda sprites and tilesets for my own ones, but this will take many months of hard work.