Scripts to trigger an animation

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
Predator_9094
Recruit Womprat Killer
Posts: 14
Joined: Fri Aug 22, 2008 12:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Scripts to trigger an animation

Post 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.
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: Scripts to trigger an animation

Post 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:
Predator_9094
Recruit Womprat Killer
Posts: 14
Joined: Fri Aug 22, 2008 12:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Re: Scripts to trigger an animation

Post 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?
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: Scripts to trigger an animation

Post 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
Predator_9094
Recruit Womprat Killer
Posts: 14
Joined: Fri Aug 22, 2008 12:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Re: Scripts to trigger an animation

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Scripts to trigger an animation

Post 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.
User avatar
wishihadaname
Captain
Captain
Posts: 493
Joined: Fri Dec 28, 2007 2:10 pm
Projects :: The Corellian Resistance
Games I'm Playing :: Halo Reach and LOTRO
Location: Look to your left.... no, your other left....

Re: Scripts to trigger an animation

Post 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.
Post Reply