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

Pages: 1 ... 63 64 [65] 66 67 68
961
Development / Re: Side scrolling functionality
« on: July 27, 2015, 01:45:09 am »
But I am not using a destructible entity. With my scripts, what you lift is a custom entity. The lifting, carrying and throwing states of the hero and the entity are fully scripted. So there is no shadow if you do not create it. (And probably the crash is due to something that I did wrong. But I don't have much time this summer to work in my game...)

You should do your own scripts for your purposes, or wait until the day that custom entities can be carried. There is no other workaround. You have to be patient and don't underestimate the programming, since it takes a lot of effort and months (or years) of work.

962
Development / Re: Side scrolling functionality
« on: July 26, 2015, 11:42:50 pm »
The shadow is made with a custom entity, created when you throw the entity and removed after the item has fallen. If you don't create it there are no crashes. Maybe it's a problem of my script...

963
Development / Re: Side scrolling functionality
« on: July 26, 2015, 10:39:51 pm »
The problem can be avoided if you do not create the shadow. I still don't know what produces the crash.

964
Development / Re: Trouble with movement (moving a dynamic tile)
« on: July 26, 2015, 08:40:51 pm »
DementedKirby, I suggest to make local the function loop, if it is possible. Just to improve the code.

965
Development / Re: Side scrolling functionality
« on: July 26, 2015, 07:31:10 pm »
Yes, I'm using that script to make things similar to that metal ball (Link's awakening is great!), but also more complex entities with several sprites that can be carried. (I haven't tried to script the flying rooster since I don't need it, but it should be scriptable, with a lot of work of course.)

Also, in my game, instead of pickable, keys will be carried, so I will be able to annoy the hero with bird enemies that steal the key you are carrying, or forcing you to throw the keys between the three heroes (since they have different abilities and must take different paths sometimes), or using other things like conveyor belts and platforms with keys, or even using the magneto with metal keys. I think this would give more originality/personality to my game than usual keys.

966
Development / Re: Side scrolling functionality
« on: July 25, 2015, 11:05:26 pm »
Hi DementKirby!

I have created my first github repository and put some of my scripts. You have the one you want in entities/generic_portable.lua. You should study the code and delete/modify the things you don't need. Also you need the sprites and animations and sounds to be compatible with the script. (Recall that there is still a crash with these entities. I will try to repair it someday.)

You will find my repository here: https://github.com/Diarandor

Also, you will find the scripts for entities button and weight. Weights are generic_portable entities (so these can be carried, etc) that can push my button entities. I will put more stuff in the repository someday soon.

967
Development / Re: Side scrolling functionality
« on: July 25, 2015, 08:38:03 pm »
Yes and no. It works "almost" fine. The only problem is that I get a crash sometimes after the item falls if you walk where the shadow was removed, because the shadow entity I used was not removed correctly or something like that. I think that bug was already solved by Christopho in the development version, so my script should work in the next version (or it may become an error of my script that I should be able to correct).

I want to put my scripts on github after the next version of solarus is released (to check if it works and repair it if necessary), but I can put it now if you want. (Note that to make this script work you will also need to modify slightly the game:on_command_pressed() event, but this is not a problem.)

968
Development / Re: Falling down animation
« on: July 23, 2015, 07:03:28 pm »
You can write everything directly in the event game:on_map_changed(map), but I would write a function in another script (made just for this) and call it in the event. You can do it as you prefer, that's not important.

I don't know how are your scripts. I have the event game:on_map_changed(map) defined in my game manager script, although you may have it in the main.lua. I cannot help you more, sorry.

969
Development / Re: Falling down animation
« on: July 22, 2015, 12:59:46 pm »
I have never done this, so maybe this is not the best way to do it. This is what I would do, I hope it works.

Use the event teletransporter:on_activated() to set a custom state on the hero (or save the info that he is falling in some boolean variable). Then, on the method game:on_map_changed(), that you may have already defined in some of your main scripts, you call a function to simulate the falling "animation" in case it is necessary (I would save that function in some other script).

To do this function for the falling animation, you should freeze the hero, maybe make him able to traverse walls or ignore obstacles, create the shadow at his coordinates, change hero's position, start the movement and, at the end of the movement restore everything to normal.

970
Development / Re: Custom Entity: Ally Creation issue
« on: July 22, 2015, 03:22:36 am »
You have a mistake in your code. Write "y = y" instead of "y = x".

971
Development / Re: Custom Entity: Companion
« on: July 22, 2015, 03:18:58 am »
@polyglot762, you have a mistake in your code. Write "y = y" instead of "y = x".

972
Development / Re: Falling down animation
« on: July 22, 2015, 02:48:49 am »
You should clarify more your question, it is quite ambiguous. Anyway, you should check Christopho's tutorials on youtube.

If you mean how to make the hero fall from a map to a different map, you may find the answer in this tutorial:
https://www.youtube.com/watch?v=4VIVdz3LPM4

973
Yes, I think you are right. (I wasn't sure how the mod (%) operator works with a negative numerator, so I added that #submenus term. I think your code works fine too.)

974
Hi!

I would use your solution too. I would try to change the animation in the event enemy:on_dying(), but I am not sure if it would work correctly since the sprites are replaced by "enemies/enemy_killed", but I don't know if that replacement is before or after the event (if it is before you should not have problems).

If that does not work, you can always use that event to remove the enemy and create other entity (temporarily) showing the dying animation you want or whatever. On the other hand, for custom entities everything is scripted, so you should not have any problem to show what you want (almost anything is possible with custom entities if you have patience to program).

It should also be possible to set an animation on an enemy depending on which weapon you use to kill it (so it would have several dying animations). One way to do this is to save in some variable (for instance, enemy.last_weapon) the name of the weapon you use to hit him each time, so that when it dies, you have in the variable the name of the last weapon that has hit the enemy, and then select the animation using the event enemy:on_dying().

Good luck with this!

975
I am not sure, but this could be the problem:

In the pause_submenu.lua file of Zelda Mystery of Solarus DX, in submenu:previous_submenu(), in line 125 you have
Code: [Select]
submenu_index = (submenu_index + 2) % #submenus + 1
which works fine only for 4 menus I think, but not in other cases. Try to change that line by:
Code: [Select]
submenu_index = (submenu_index + #submenus - 2) % #submenus + 1
But I am not sure at all if that will fix your problem.

EDIT: I suggest changing that line in the repository of Zelda Mystery of Solarus DX, to avoid more people having the same problem with the menus in case they copy the script. (But before we need confirmation that it works fine.)

Pages: 1 ... 63 64 [65] 66 67 68