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.
Scripts to trigger an animation
Moderator: Moderators
-
Predator_9094
- Recruit Womprat Killer
- Posts: 14
- Joined: Fri Aug 22, 2008 12:22 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Contact:
-
Executer94
- Major

- Posts: 504
- Joined: Fri May 01, 2009 7:45 am
- Location: Chalmuns Cantina
Re: Scripts to trigger an animation
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()

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()
-
Predator_9094
- Recruit Womprat Killer
- Posts: 14
- Joined: Fri Aug 22, 2008 12:22 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Contact:
Re: Scripts to trigger an animation
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?
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

- Posts: 504
- Joined: Fri May 01, 2009 7:45 am
- Location: Chalmuns Cantina
Re: Scripts to trigger an animation
Nice to hear.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?
It shows the function that it ends there. Without it you would get an error.
Want do you mean exactly?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?
-
Predator_9094
- Recruit Womprat Killer
- Posts: 14
- Joined: Fri Aug 22, 2008 12:22 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Contact:
Re: Scripts to trigger an animation
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.
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.
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: Scripts to trigger an animation
Welcome to "Star Wars Battlefront II doesn't have physics" 101. Non-fixable.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?
- wishihadaname
- Captain

- Posts: 493
- Joined: Fri Dec 28, 2007 2:10 pm
- Projects :: The Corellian Resistance
- Location: Look to your left.... no, your other left....
Re: Scripts to trigger an animation
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.
