Page 1 of 1

Triggering animation on entering region.

Posted: Mon Jul 16, 2007 9:44 pm
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

Re: Triggering animation on entering region.

Posted: Mon Jul 16, 2007 9:58 pm
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. ;)

Posted: Mon Jul 16, 2007 11:05 pm
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?

Posted: Tue Jul 17, 2007 12:28 am
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.

Posted: Tue Jul 17, 2007 12:37 am
by Maveritchell
Good call. My region was property-less. Thanks for the heads-up; that one really had me thrown for a loop.