[mod][api][github]M.I.L.A. 1.3[mila]

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by azekill_DIABLO » Sun May 27, 2018 17:19

Stix wrote:I thought this might help?: https://github.com/PilzAdam/mobs/wiki/API

It was already one of my references. BTW, I think I know how to implement halos, it will be simple.

*EDIT: i think it would be cool if you merged burlis pathfinder with this mod, it would make mobs more dangerous as they can find paths to you: viewtopic.php?f=9&t=17406

I tried to use the minetest built-in pathfinder it didn't gave anything cuz' I really suck at that. I'm not sure about this one.
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
csirolli
Member
 
Posts: 128
Joined: Mon Jan 15, 2018 21:46
Location: Florida, USA
GitHub: ChristianSirolli
IRC: CSirolli
In-game: CSirolli

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by csirolli » Thu Jun 21, 2018 22:04

Are there any known mods that use this api?
Jesus is the only Way to heaven, the only saving Truth, and the only Life that is worth living.
 

User avatar
Stix
Member
 
Posts: 1113
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Stix » Thu Jun 21, 2018 22:08

csirolli wrote:Are there any known mods that use this api?

This one does: viewtopic.php?f=9&t=18200
Ignore this.
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by azekill_DIABLO » Fri Jul 06, 2018 13:54

M.I.L.A. upcoming functionnality : Auras
Image
Enjoy!
Attachments
screenshot_20180706_154928.jpeg
auras showcase
(60.81 KiB) Not downloaded yet
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
Stix
Member
 
Posts: 1113
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Stix » Fri Jul 06, 2018 19:25

azekill_DIABLO wrote:M.I.L.A. upcoming functionnality : Auras
Image
Enjoy!

Amazing, just what i always wanted <o/ !

Well that and animations.
Ignore this.
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
Andrey01
Member
 
Posts: 2060
Joined: Wed Oct 19, 2016 15:18
Location: Russia, Moscow
GitHub: Andrey2470T
In-game: Andrey01

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Andrey01 » Fri Jul 06, 2018 20:04

azekill_DIABLO, can you please add a chance mobs to turn their heads? For example, they would can turn the head if they have seen something and somebody. This would be very nice as this would be quite new feature in mobs mods!
DL9Eh7xVBw7DXwLAMX1lStE21bSD2XUQ
 

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by azekill_DIABLO » Sat Jul 07, 2018 12:07

I don't know how to use animations. And the models aren't capable of doing this. I'm as frustrated as you. But i'll see if I can do something.

@Stix: i'm glad you like them!
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
Stix
Member
 
Posts: 1113
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Stix » Wed Jul 11, 2018 18:04

So hows progress on the new particles? :3
Also what about spawning and de-spawning particles...
Ignore this.
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
Stix
Member
 
Posts: 1113
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: Stix + Stix_
In-game: Stix

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Stix » Wed Jul 11, 2018 23:32

Another user is making mobs that work with M.I.L.A.! viewtopic.php?f=9&p=325078#p325078
Ignore this.
Need to know something? "Google it" --GreenDimond
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by azekill_DIABLO » Sat Jul 14, 2018 10:51

Yay! I've checked it, it's a nice start!
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
Hamlet
Member
 
Posts: 422
Joined: Sat Jul 29, 2017 21:09
Location: Italia
IRC: H4mlet

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Hamlet » Sat Jul 14, 2018 20:02

I've tried to add animations' support to your API, eventually I've managed to make a working function. I've tried it with the wolves and it seems to work acceptably. \o/

First of all, to use an animation you must know which are its first and last frames. Quick method: fetch them from an existing mob's definition; Other method: open (import) the mob's model using Blender, at the window's bottom will be displayed a meter showing the animation frames, with markers named "walk start", "walk end", and alike - those markers will tell you the frame's number.

Secondarily, the animation function itself isn't very useful if the API does not specify when the function has to be called; e.g. you can call the function to load the "moving fast" animation when the mob is moving toward its targed, but it should also be called when the mob is standing still, or simply walking, or digging, etc.
Usage example: apply_animation(self, "moving")

Last but not least: this is my very first attempt to do such a thing, thus don't expect this code to be "bug-proof", elegant or performant; it's just a first step. :)

Now, the code.
The function must be added to your api.lua, while the animations definition must be added to the mob that you want to use it.

I'm releasing this code under the GPLv3 license, which basically means "credit me please, share alike (freely you have been given, freely you shall give), don't use it for closed source software (else your soul will be doomed to <insert unpleasant things here>)".

api.lua
Code: Select all
function apply_animation(self, action)
   if (self.animations ~= nil) then
   -- For backward compatibility: if the existing entities have been
   -- spawned without the "animations" specification in the entity
   -- definition, the game will not crash.
   -- If (self.animations == nil) then it will trigger line #78

      local animations_table = self.animations
      -- fetch the "animations" specification from the entity's definition

      local standing = animations_table["standing"]
      -- fetch the values for the "standing" animation
      -- i.e. the mob stands still

      local moving = animations_table["moving"]
      -- fetch the values for the "moving" animation
      -- i.e. the mob walks, swims or flies

      local moving_fast = animations_table["moving_fast"]
      -- fetch the values for the "moving_fast" animation
      -- same as the previous, but for running or similar

      local attacking = animations_table["attacking"]
      -- fetch the values for the "attacking" animation
      -- i.e. the mob bites, punches, digs, etc.

      if (action ~= nil) then
      -- When calling the function you must specify which action
      -- is being done, else the function will abort.
      -- It triggers line #80

         if (action == "standing") then
            self.object:set_animation(
               standing[1],
               -- i.e. {x = N1, y = N2}
               -- N1 = first animation's frame
               -- N2 = last animation's frame

               standing["frame_speed"],
               -- usually a number like 30, or 60, etc.

               standing["frame_blend"],
               -- a number, 0 to disable, I guess it makes animations smoother

               standing["frame_loop"]
               -- whether if the animation must be repeated when the last frame
               -- has been reached
            )

         elseif (action == "moving") then
            self.object:set_animation(
               moving[1],
               moving["frame_speed"],
               moving["frame_blend"],
               moving["frame_loop"]
            )

         elseif (action == "moving_fast") then
            self.object:set_animation(
               moving_fast[1],
               moving_fast["frame_speed"],
               moving_fast["frame_blend"],
               moving_fast["frame_loop"]
            )

         elseif (action == "attacking") then
            self.object:set_animation(
               attacking[1],
               attacking["frame_speed"],
               attacking["frame_blend"],
               attacking["frame_loop"]
            )

         else
            print("M.I.L.A " ..mila.version..": action \"" .. action ..
               "\" not supported or typed wrong.")
         end

      else
         print("M.I.L.A " ..mila.version..": action's value is nil.")
      end
   end
end


mob definition (frames' values are from the "Mobs Wolf" mob)
Code: Select all
animations = { -- ../minetest/doc/lua_api.txt at line 3278
   standing = { -- the mob stands still
      {x = 1, y = 60}, -- x: animation start, y: animation end
      frame_speed = 30, -- animation's speed
      frame_blend = 0, -- should make the animation smoother
      frame_loop = true -- if false then  the animation runs just once
   },

   moving = { -- the mob walks, swims or flies
      {x = 61, y = 120}, -- x: animation start, y: animation end
      frame_speed = 65, -- animation's speed
      frame_blend = 0, -- should make the animation smoother
      frame_loop = true -- if false then  the animation runs just once
   },

   moving_fast = { -- the mob runs, swims or flies faster
      {x = 61, y = 120}, -- x: animation start, y: animation end
      frame_speed = 70, -- animation's speed
      frame_blend = 0, -- should make the animation smoother
      frame_loop = true -- if false then  the animation runs just once
   },

   attacking = { -- the mob bites, punches, etc.
      {x = 1, y = 60}, -- x: animation start, y: animation end
      frame_speed = 60, -- animation's speed
      frame_blend = 0, -- should make the animation smoother
      frame_loop = true -- if false then  the animation runs just once
   },
}


EDIT--
Happy 14 July, froggy. ;)
 

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by azekill_DIABLO » Sun Jul 15, 2018 10:53

Wow, you deserve a price of kindness ;D
I must admit one thing: I'll probably don't work on minetest anymore. So feel free to fork my mod and make it live.

I love frogs btw.
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
Hamlet
Member
 
Posts: 422
Joined: Sat Jul 29, 2017 21:09
Location: Italia
IRC: H4mlet

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by Hamlet » Sun Jul 15, 2018 11:23

azekill_DIABLO wrote:I must admit one thing: I'll probably don't work on minetest anymore. So feel free to fork my mod and make it live.


Ah this is bad news, however if you decide so, then I wish you all the best for your current/future projects about real life and your other interests. :)

I will fork your mod and try my best to keep it alive.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7385
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [mod][api][github]M.I.L.A. 1.3[mila]

by azekill_DIABLO » Sun Jul 15, 2018 12:43

Thank you so much. PM me if you need help, I'll still be here from time to time.
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

Previous

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests