Page 1 of 1

Scripts to trigger an animation

Posted: Wed Mar 17, 2010 9:04 am
by Predator_9094
I have an animation that I want triggered when I enter the Mos Eisley arena on my map. What exactly would be the best way to go about doing that? I'm thinking an invisible cp with a capture zone, and when the capturing starts, start the animation. How would I do that exactly?

Should I use an invisible cp? or an uncaptureable one?
If this way I'm thinking of can work, where to I put the script to activate the animation?

PlayAnimation(“MyGroup”)
That's what I would type?

And also if this can work, I would need to make events in an lua to make it start when I enter the arena, but also when I exit, so I would need to pause the animation as well. I'm not very good at this script thing, so anyone know how to do what I'm talking about?

Thanks.

Re: Scripts to trigger an animation

Posted: Wed Mar 17, 2010 10:17 am
by Executer94
ActivateRegion("Enterregion")

region1 = OnEnterRegion(
function(region, player)
if IsCharacterHuman(player) then

PauseAnimation("animation")
RewindAnimation("animation")
PlayAnimation("animation")
end
end,
"Enterregion"
)


That should it be
add this to your lua under function ScriptPostLoad()
:thumbs:

Re: Scripts to trigger an animation

Posted: Wed Mar 17, 2010 3:51 pm
by Predator_9094
Thanks! It worked.

I added another function to pause it when I left!

I under stand the stop part a bit, but what does the end, end, "" mean? What am I ending?



Is there a way to make it so that anyone on the rotating object goes with it, so that they don't fall off?

Re: Scripts to trigger an animation

Posted: Wed Mar 17, 2010 5:08 pm
by Executer94
Predator_9094 wrote:Thanks! It worked.

I under stand the stop part a bit, but what does the end, end, "" mean? What am I ending?
Nice to hear.

It shows the function that it ends there. Without it you would get an error.
Predator_9094 wrote: Is there a way to make it so that anyone on the rotating object goes with it, so that they don't fall off?
Want do you mean exactly? :D

Re: Scripts to trigger an animation

Posted: Wed Mar 17, 2010 5:31 pm
by Predator_9094
Ok, so I'm rotating the arena when I enter it, but when I'm on top of it, it rotates and I don't move with it. I want to move with it. I want to move with the building.

I'm also using the cantina as a transporter around the map, so when I enter it, it moves to, let say the very corner of the map. When it moves, it disappears right under me when if moves fast enough. How do I make it so that the building takes me with it?

I don't want it to go slow, because it's like its teleporting.

Re: Scripts to trigger an animation

Posted: Wed Mar 17, 2010 5:37 pm
by Maveritchell
Predator_9094 wrote:Ok, so I'm rotating the arena when I enter it, but when I'm on top of it, it rotates and I don't move with it. I want to move with it. I want to move with the building.

I'm also using the cantina as a transporter around the map, so when I enter it, it moves to, let say the very corner of the map. When it moves, it disappears right under me when if moves fast enough. How do I make it so that the building takes me with it?
Welcome to "Star Wars Battlefront II doesn't have physics" 101. Non-fixable.

Re: Scripts to trigger an animation

Posted: Wed Mar 17, 2010 11:06 pm
by wishihadaname
If you want to do that with other objects you can, as in having frigates move their turrets with only one anim, just read up on hierarchies in the animation guide in the shipped docs, but ya like Michevall said there is no physics engine in BFII, probably the greatest shortfall this game has other than 1d planning and a hardcoded (and tiny) FX memory pool.