Triggering animation on entering region.

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

Triggering animation on entering region.

Post by Maveritchell »

What I've got is an animation I'd like to play on entering a specific region. A couple questions:

1) I am calling the specific animation, not the animation group, right?

2) Can the animation still be triggered if the region in question already has specific properties? (It's a damageregion)

3) Assuming my animation is called tankdoor and my region is named tank1, what's wrong with this coding? I ask because with this setup, I don't get the animation to trigger.

Code: Select all

--------------------------------------------------------

-------------------
-- ScriptPostLoad
--------------------------------------------------------

-------------------
function ScriptPostLoad()

	DisableAIAutoBalance()

	SetUberMode(1);

        SetAIDifficulty(10, -5)
	
	EnableSPHeroRules()
 	-- This is the actual objective setup
	TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, 
						

multiplayerScoreLimit = 100,
						textATT 

= "game.modes.tdm",
						textDEF 

= "game.modes.tdm2", multiplayerRules = true, 

isCelebrityDeathmatch = true}
	TDM:Start()

    AddAIGoal(1, "Deathmatch", 100)
    AddAIGoal(2, "Deathmatch", 100)

ActivateRegion("tank1")

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

PauseAnimation("tankdoor")
RewindAnimation("tankdoor")
PlayAnimation("tankdoor")
end
end,
"tank1"
)


end
Darth_Z13
Jedi High Council
Jedi High Council
Posts: 2275
Joined: Sat Jun 17, 2006 9:51 am
xbox live or psn: Xanthius Wylon
Location: Canada

Re: Triggering animation on entering region.

Post by Darth_Z13 »

Maveritchell wrote:What I've got is an animation I'd like to play on entering a specific region. A couple questions:

1) I am calling the specific animation, not the animation group, right?

2) Can the animation still be triggered if the region in question already has specific properties? (It's a damageregion)
1) I'm pretty sure you call the group.

2) No I don't think so. Just make a new region in the same spot. ;)
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

It would seem as though there's something wrong with my code, as I tried making a new region and tried calling both the anim group and animation itself. Any takers?
Ace_Azzameen_5
Jedi
Jedi
Posts: 1119
Joined: Sat Apr 23, 2005 8:52 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Ace_Azzameen_5 »

Typo?

Wait....this one got me a week back.

You have to call whatever is in the region's 'properties' box in the code, and not the name. Either that or both have to be the same. My trigger regions all have the same name/property so i can't tell.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

Good call. My region was property-less. Thanks for the heads-up; that one really had me thrown for a loop.
Post Reply