Help with your scripting

the current animation

the current animation

Postby ant0N » 06 Aug 2015, 11:50

Hi!! :)
is there a way to get the current animation of the entity?
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: the current animation

Postby SolarPortal » 06 Aug 2015, 12:10

i am a bit surprised, but it seems there is not a function for this.
The best thing to do for now is too store the current animation when changing animations in script.

I can see if i can add one though.
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: the current animation

Postby ant0N » 06 Aug 2015, 12:27

SolarPortal wrote:The best thing to do for now is too store the current animation when changing animations in script.

Yes, I'm doing it now. :)

SolarPortal wrote:I can see if i can add one though.

thanks, I think it will not be superfluous. :D
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: the current animation

Postby SolarPortal » 06 Aug 2015, 13:16

i have added a function used as:

Code: Select all
animsTable = anim.getCurrentAnims( eID );

for key,value in pairs(animsTable) do
    sky.print("Key: "..key.."  anim name: "..value);
end


The reason this is a table is due to the fact that a character can have more than 1 animation enabled at one time as characters can have animations applied by weights on the bones. For example, you could program a character to use the run animation on the legs down over, and then use the shooting animation on the top half of the body, which could then be idle, running, etc...

I just need to test the function now :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer

Re: the current animation

Postby ant0N » 06 Aug 2015, 13:46

thanks, this is what I need! :D
Sorry for my English. :)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: the current animation

Postby SolarPortal » 06 Aug 2015, 13:50

just tested and this is working :)
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 10 guests

cron