Activate Animations

Everything about mods can be found here.

Moderator: Morax

Activate Animations

Postby Dudekahedron » 17 Oct 2016, 02:53

Hi Guys,
I'm having issues with the scripting of an activation animation (.sca already made):

Spoiler: show
While being built:
Image

Then I want it to unfold to this:
Image


I'm trying to take from the megalith code, but no animation occurs, and I don't get an error ?
Code: Select all
    OnStartBeingBuilt = function(self, builder, layer)
        CStructureUnit.OnStartBeingBuilt(self, builder, layer)
        if not self.AnimationManipulator then
            self.AnimationManipulator = CreateAnimator(self)
            self.Trash:Add(self.AnimationManipulator)
        end
        self.AnimationManipulator:PlayAnim(self:GetBlueprint().Display.AnimationActivate, false):SetRate(0)
    end,
   
    OnStopBeingBuilt = function(self,builder,layer)
        CStructureUnit.OnStopBeingBuilt(self,builder,layer)
        if self.AnimationManipulator then
            self:SetUnSelectable(true)
            self.AnimationManipulator:SetRate(1)
           
            self:ForkThread(function()
                WaitSeconds(self.AnimationManipulator:GetAnimationDuration()*self.AnimationManipulator:GetRate())
                self:SetUnSelectable(false)
                self.AnimationManipulator:Destroy()
            end)
        end
    end,


Please help!
Check out my mod (in development): /viewtopic.php?f=41&t=13326
User avatar
Dudekahedron
Avatar-of-War
 
Posts: 118
Joined: 10 Apr 2016, 22:01
Has liked: 42 times
Been liked: 54 times
FAF User Name: Dudekahedron

Re: Activate Animations

Postby Uveso » 17 Oct 2016, 04:26

The script itself is correct.

Maybe a wrong entry inside the blueprint ?
You are calling the animation from "Display.AnimationActivate"

Is there a line like this inside the display array with full mod folder path ?

Code: Select all
AnimationActivate = '/mods/YOURMODNAME/units/xxx0000/xxx0000_AActivate.sca',
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Activate Animations

Postby Dudekahedron » 17 Oct 2016, 04:32

Hi Uveso,
I'm embarassed.
I forgot:
Code: Select all
'/mods/'

Thanks for your help :oops:
Check out my mod (in development): /viewtopic.php?f=41&t=13326
User avatar
Dudekahedron
Avatar-of-War
 
Posts: 118
Joined: 10 Apr 2016, 22:01
Has liked: 42 times
Been liked: 54 times
FAF User Name: Dudekahedron

Re: Activate Animations

Postby Uveso » 17 Oct 2016, 04:45

I hope it will work then :)

Btw, i like the unit. Looks great!
If you are building some Seraphim units like pointdefense or mobile units, tell me.
I could use some units for Total Mayhem, to make Seraphim more attractive :)
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Activate Animations

Postby Dudekahedron » 17 Oct 2016, 17:35

It does work! Yay! And thanks!

You made total mayhem :o :!:
I'd love to be a part of it, I do have ideas for seraphim stuff and I intend to start working on them once I get my scripting abilities up to par - and to do that, I'm right now making a mod pack to increase faction diversity. I'll post when I get a decent enough unit list :D
Check out my mod (in development): /viewtopic.php?f=41&t=13326
User avatar
Dudekahedron
Avatar-of-War
 
Posts: 118
Joined: 10 Apr 2016, 22:01
Has liked: 42 times
Been liked: 54 times
FAF User Name: Dudekahedron

Re: Activate Animations

Postby Uveso » 17 Oct 2016, 19:35

No, i did not make Total mayhem. ;)

These are the guys who made it:

Author: Burnie222
Models: OrangeKnight, Brandon
Sounds: adamstrange
Coding: Domino

I just asked Burnie222 for permission to update and maintenance the mod, and he agreed.
While reworking the mod i fixed many things. Changelog is over 1300 lines long :)

Can't wait to see your first seraphim units hehe
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Activate Animations

Postby Exotic_Retard » 17 Oct 2016, 21:00

you can also try to call it AnimationPermOpen since that is a special blueprint thing for animations after being built. (justgpgthings)
that way you dont need to have it in script to have it deploy.
you may need to have a specific unit class though, so theres a chance it wont work.

for an example we have the aeon sam bp, with an empty unit script:
AnimationPermOpen = '/units/UAB2304/UAB2304_Aopen.sca',
User avatar
Exotic_Retard
Contributor
 
Posts: 1470
Joined: 21 Mar 2013, 22:51
Has liked: 557 times
Been liked: 626 times
FAF User Name: Exotic_Retard

Re: Activate Animations

Postby Dudekahedron » 17 Oct 2016, 21:19

Once I realized I was missing some of the file path, a lot of different methods started working.
AnimationPermOpen is the effect I was going for, but I had no control over the animation speed (way too fast). Using the megalith method had it unfold nicely, but then fold back up (ugh)
I ended up using an altered version of the Aeon strat launcher and now it works beautifully :)
Check out my mod (in development): /viewtopic.php?f=41&t=13326
User avatar
Dudekahedron
Avatar-of-War
 
Posts: 118
Joined: 10 Apr 2016, 22:01
Has liked: 42 times
Been liked: 54 times
FAF User Name: Dudekahedron


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest