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

Pages: [1] 2 3 ... 33
1
Bugs & Feature requests / Re: Universal Windows App
« on: May 22, 2017, 05:30:46 am »
I think this would be an interesting port. They say Xbox One will be compatible with Xbox Scorpio. My stance against it has lessened if that is really true because it has been looking like Microsoft wants to make all past hardware/operating systems obsolete after a new release. My sources above say that Universal Windows Platform (UWP) will not work on operating systems before Windows 10.
http://www.xbox.com/en-US/project-scorpio

2
General discussion / 19 transitions
« on: May 18, 2017, 10:37:10 am »
I made many transitions in Gimp from scratch. I still have some tweaking to do, but I plan to have these 320x240 transitions setup as animations. Of course, I plan to have these as CC0, so they will be free for any usage.

What does everyone think? Did I miss any basic transition?

Gimp Playback Previews:






































3
Your projects / Re: Allied AI Script Project Alpha
« on: May 16, 2017, 09:07:31 am »
These sprite draw functions that I made for this project can draw a sprite at:

1. The hero
2. An entity
3. A position

It can remove:

1. Any sprite index
2. All of them at once

By default it uses a death animation.

Code: Lua
  1. --create 4 sprites and draw on map
  2. entity:sprite_create(4, map)
  3.  
  4. --Draw at coordinates
  5. entity:sprite_draw(1,"main_heroes/eldran", 130,100, true)
  6.  
  7. --Draw at coordinates
  8. entity:sprite_draw(2,"main_heroes/eldran", 100,100, true)
  9.  
  10. --draw at hero
  11. entity:sprite_draw(3,"main_heroes/eldrina/eldrina", 0,0, true, start_anime, start_sound, end_anime, end_sound, true, hero_visable, false)
  12.  
  13. --draw at an entity named "old"
  14. entity:sprite_draw(4,"main_heroes/eldrina/eldrina", 0,0, true, start_anime, start_sound, end_anime, end_sound, hero_pos, hero_visable, false, direction, true,"old", entity_visable)
  15.  
  16. --remove sprite 1
  17. entity:sprite_undraw(1)
  18.  
  19. --remove all sprites if true
  20. entity:sprite_undraw(1,true)
  21. --or
  22. --remove all sprites if true
  23. entity:sprite_undraw(true)

They all fall down.

4
Development / [Solved]Screen vs entity position?
« on: May 15, 2017, 05:27:31 pm »
That was the first thing I tried because I saw it in the Children of Solarus game_over.lua script. It seems I forgot to repeat my timer when checking my script, so a mistake on my part. Thank you Christopho and Zutokaza for the assistance. My script works perfectly now.

5
Development / [Solved]Screen vs entity position?
« on: May 15, 2017, 01:51:17 pm »
Is there a formula I could use to calculate screen image x,y coordinates to the entity position? For example, drawing an image at the hero. I am not sure that entity:get_position() is related to this because is not that position different than image x,y coordinates?

6
Development / [Solved]Array in function?
« on: May 15, 2017, 06:20:41 am »
Solved it.

Code: Lua
  1.   local sprites = sprites[index]
  2.  
  3.   function sprites:on_animation_finished()
  4.     sprites:set_animation(end_anime)
  5.     sol.audio.play_sound(end_sound)
  6.   end

7
Development / [Solved]Array in function?
« on: May 15, 2017, 06:07:00 am »
I get the following error:
Code: [Select]
0] Error: Failed to load script 'scripts/lib/zefk_entity_lib.lua': [string "scripts/lib/zefk_entity_lib.lua"]:2093: '(' expected near '['
when trying this:

Code: Lua
  1.   function sprites[index]:on_animation_finished()
  2.     sprites[index]:set_animation(end_anime)
  3.     sol.audio.play_sound(end_sound)
  4.   end

The following function will only work if I convert my array to a normal variable.

Code: Lua
  1.     sprites2 = sprites[2]
  2.   function sprites2:on_animation_finished()
  3.     sprites[index]:set_animation(end_anime)
  4.     sol.audio.play_sound(end_sound)
  5.   end

Is there a way around this because I'd like to on_animation_finish() without having a limit set. I do not want to do something like this:

Code: Lua
  1.    
  2.  sprites2 = sprites[2]
  3.   function sprites2:on_animation_finished()
  4.     sprites[index]:set_animation(end_anime)
  5.     sol.audio.play_sound(end_sound)
  6.   end
  7.  
  8.  sprites1 = sprites[1]
  9.   function sprites1:on_animation_finished()
  10.     sprites[index]:set_animation(end_anime)
  11.     sol.audio.play_sound(end_sound)
  12.   end
  13.  
  14.  sprites3 = sprites[3]
  15.   function sprites3:on_animation_finished()
  16.     sprites[index]:set_animation(end_anime)
  17.     sol.audio.play_sound(end_sound)
  18.   end
  19.  
  20.  sprites4 = sprites[4]
  21.   function sprites4:on_animation_finished()
  22.     sprites[index]:set_animation(end_anime)
  23.     sol.audio.play_sound(end_sound)
  24.   end
  25.  
  26.  sprites5 = sprites[5]
  27.   function sprites5:on_animation_finished()
  28.     sprites[index]:set_animation(end_anime)
  29.     sol.audio.play_sound(end_sound)
  30.   end
  31.  

8
Development / Re: Jump movement direction4 error?
« on: May 14, 2017, 03:51:18 am »
For example, If I set the direction8 to 2 for sprite to jump up and I face him down from the custom entity, then the following script should make him face up.

Maybe a visual explanation will help.


I use this script to change his direction, but it does not work.
Code: Lua
  1.   function self:on_movement_changed()
  2.      self:set_direction(quick_movement:get_direction4())  
  3.   end


1.I set direction8 to 0 for the hero to jump to the right. From the entity I face the entity up. He will jump right while facing up.

Code: Lua
  1.   entity:jump(speed, traversable, ignore_obstacles, 0, jump_distance, start_animation, finish_animation, finish_jump_sound, start_jump_sound, sound_timer, dialog, dialog_activation_distance)

2.I set the direction8 to 2 for the hero to jump up. From the entity I face the entity right. He will jump up while facing right.

Code: Lua
  1.   entity:jump(speed, traversable, ignore_obstacles, 2, jump_distance, start_animation, finish_animation, finish_jump_sound, start_jump_sound, sound_timer, dialog, dialog_activation_distance)

My entity:jump_create() function works. It is 95% identical to entity:jump(). The major difference with entity:jump_create() is that it creates the sprite by script.  I believe that using a sprite from the custom entity with the jump movement causes a facing direction bug.

9
Development / Re: Jump movement direction4 error?
« on: May 14, 2017, 03:01:56 am »
What I see is, you try to get the direction4, which doesn't exist in the jump movement

You can only get direction8 from a jump movement, which is understandable

http://www.solarus-games.org/doc/latest/lua_api_jump_movement.html#lua_api_jump_movement_get_direction8

So then, to get a 4 direction way, simply divide by 2

I do not understand what you mean. Doesn't the following script make the hero turn depending on the direction the movement is moving? The hero should still face the jumping direction.

Code: Lua
  1.   function self:on_movement_changed()
  2.      self:set_direction(quick_movement:get_direction4())  
  3.   end

Jump movements are particular movement objects. Therefore, they inherit all methods from the type movement.
http://www.solarus-games.org/doc/latest/lua_api_movement.html#lua_api_movement_get_direction4

0 will make the hero jump to the right with the direction8 movement. If I face the hero up from the custom entity and jump, then the hero jumps to the right while facing up. It does this for everything else. I understand that the direction8 is different from the direction4.

Quote
Also in on_interaction, you can save a lot of space by doing

Code: Lua
  1. self:set_direction((2 + hero:get_direction()) % 4) -- Make the entity face the hero
  2. map:get_game():start_dialog(dialog) -- dialog

Thanks for the tip. I will try it out sometime.

Quote
And i maintain, i don't get the on_interaction issue you're facing, so it comes from your code

If this doesn't solve the issue then it have something to do with your code, i'll investigate it tomorrow.

Did you try letting the custom entity move away from the hero after interacting with it? If you move the hero one step, then the bug cancels. If the custom entity is standing still, then you will never get the bug because you will move the hero. Also, this does not happen with an NPC entity. This is kinda off topic.

10
Your projects / Re: Allied AI Script Project Alpha
« on: May 14, 2017, 02:13:09 am »
Here is a cool function I made for this project. The lib I am making has a bunch of other functions to make showing images easier. This was made to display stats, item amounts, etc.



It is declared like this.

Code: Lua
  1. game:set_value("money", 2)
  2. game:set_value("gem", 3)
  3. game:set_value("silver", 4)
  4.  
  5. entity:font_draw(1,"MONEY: ", 30, 50, "money")
  6.  
  7. entity:font_draw(2,"GEM: ", 30, 80, "gem")
  8.  
  9. entity:font_draw(3,"SILVER: ", 30, 110, "silver")
  10.  
  11. entity:font_create(3, font_name, text_size, render_mode, color_rgb, map)
  12.  
  13. --remove gem text
  14. entity:font_undraw(2)
  15.  
  16. --true remove all text
  17. entity:font_undraw(font_index, true)

11
Development / Re: Jump movement direction4 error?
« on: May 14, 2017, 01:19:00 am »
I attached the jump_lib.lua. Put it in the script directory.

From your main.lua put the following at the top.

Code: Lua
  1. require("scripts/jump_lib.lua")

Pick a sprite from the custom entity and paste the following into a custom entity script. The sprite will need a "jumping" and "stopped" animation. Also, a sound called "jump". Using the sample_quest and Eldran will work. Remember to change the direction of the custom entity. It jumps "right" by default.

Code: Lua
  1. -- Event called when the custom entity is initialized.
  2. function entity:on_created()
  3.   entity:jump()
  4. end

I have tested this outside of my project. I am pretty sure you will get the same result. That is why I reported it as a bug. This only happens with the jump movement.

https://github.com/solarus-games/solarus/issues/1057

For entity:jump_create() all you gotta do is paste it into a custom entity. This is the function that works. It uses Eldran as the default sprite. main_heroes/eldran

Code: Lua
  1. entity:jump_create()

You can change the directory.

Code: Lua
  1. entity:jump_create("main_heroes/eldran")

The jump_create function creates the sprite with script instead.

Code: Lua
  1. sprite = self:create_sprite(sprite_directory)

12
Development / Re: Stopping npcs
« on: May 13, 2017, 05:02:42 pm »
Quote
I'm trying to two npcs walk in a circle, but if one of the npcs is stopped the other one will just walk right through it.

I think you want the set_traversable function? Sets whether this NPC can be traversed by other entities.
http://www.solarus-games.org/doc/latest/lua_api_npc.html#lua_api_npc_set_traversable


Quote
Is there a way to make it so usual npcs stop when they collide with another usual npc the way that they stop when they collide with a generalized npc?

If you want them to stop when encountering another NPC, then use the on_obstacle_reached function.
http://www.solarus-games.org/doc/latest/lua_api_entity.html#lua_api_entity_on_obstacle_reached

13
Development / Re: Jump movement direction4 error?
« on: May 13, 2017, 03:18:28 am »
Quote
If it doesn't work, try
http://www.solarus-games.org/doc/latest/lua_api_movement.html#lua_api_movement_on_changed 

Does not work.

Quote
Also, you are overwriting the on_interaction function, all custom entities with undefined on_interaction will have this "default" code. This might be related to http://forum.solarus-games.org/index.php/topic,974.0.html

No matter how I test it. If the custom entity is able to wander off after an on_interaction, then I can activate it as long as the hero does not move. If the hero moves 1 step, then it cancels.  The fact that it cancels when the hero moves it super strange because my code has nothing to do with the hero movement.

14
Development / Re: How to add an "opening" animation for chests?
« on: May 11, 2017, 05:52:14 pm »
The switch I have already basically done, but only for stepping on. I do not plan to make all the entities except for when it is simple or when I need it for animation purposes. I probably will not have a second player feature because it is not something I want with my games, but in some cases simple second player features can be useful.  For example, when you want an entity to step on a switch or to move a block that can only be pushed from their side.

15
Development / Re: How to add an "opening" animation for chests?
« on: May 11, 2017, 08:16:23 am »
I am still debating on it though because first my main goal is to just get a fully function ally AI system working. A custom entity chest for the hero is far easier.

Pages: [1] 2 3 ... 33