How the capture of a specific CP(s) can 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
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

How the capture of a specific CP(s) can trigger an animation

Post by Ace_Azzameen_5 »

As the title states, I'm trying to get a cp capture to trigger an animation. I read through the just of the scripting.doc, but that thing left me confuse as to waht exactly the event or the funtion or the actor is and which one I'd used to specify the capture of a cp to cuase something. Is this possible or does the campaign just use the thing that cuases something to happen when the team captures any command post? It seems that in all the campaign maps, only one CP is captureable at the time of a trigger anyway . . .

Come to think of it, I might need the even to be triggered when a group of cp's are captured.


What I want exactly:
I want an animated turret Gunship to swoop in and land when all the cp's in a region belong to the Republic (I'll be doing the same for all other teams, but with a different object and animation etc) , then wait for troops to walk on or enter the turrets* (static time based pause or perhaps another trigger will be used to get it moving again) The gunship wil then ferry troopers to another isolated part of the map with enemy cp's remaining.

*Only the part before the first asterisk is really relative to this topic.
Last edited by Ace_Azzameen_5 on Tue Aug 01, 2006 8:21 pm, edited 1 time in total.
xwingguy

RE: How Can capture of a specific CP trigger an animation?

Post by xwingguy »

ok I admit that some of this code won't make any sense to you but just go with me on this...(NOTE: assumes that REP is the attacking team)

OnGunshipTime = OnFinishCapture(
function(post)
if GetObjectTeam(<nameOfCommandPostInQuotes>) == 1 then --repeat as necessary
ReleaseFinishCapture(OnGunshipTime)
OnGunshipTime = nil
PlayAnimation(<nameOfAnimationGroupInQuotes>)
end --every time you add a command post if statement you must add another end here
end --this end ends the function DON'T TOUCH IT!
)

The weird stuff I added in makes it so that the event callback doesn't play the animation a second time.
$iniSTar

RE: How Can capture of a specific CP trigger an animation?

Post by $iniSTar »

the fact that you have this knowledge XWINGUY , makes me very excited about Battle over ENdor.
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

RE: How Can capture of a specific CP trigger an animation?

Post by Ace_Azzameen_5 »

Thanks Alot Xwingguy. I'm looking forward to Endor too. I'm adding you too my credit list.
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

RE: How Can capture of a specific CP trigger an animation?

Post by Ace_Azzameen_5 »

I need more help. When I add other Cp if statements, it defualts to 'or' if without me writing anything. I want it to be and. Typing and in place of 'then' doesn't work, nor does adding 'then' to the new if statements.
xwingguy

RE: How Can capture of a specific CP trigger an animation?

Post by xwingguy »

This is why I use wordedit and notepad...it doesn't do that stupid stuff.
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

RE: How Can capture of a specific CP trigger an animation?

Post by Ace_Azzameen_5 »

No, Lua does.

How do I get it to wait for the republic to have a group of CP's before the animation initializes?
xwingguy

RE: How Can capture of a specific CP trigger an animation?

Post by xwingguy »

just right click the file and select the "open with" option. Choose a simpler wordprocessor that doesn't argue with what you tell it.
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

RE: How Can capture of a specific CP trigger an animation?

Post by Ace_Azzameen_5 »

I'm using notepad. It's not arguing with me. I'm just saying that lthis code
" OnGunshipTime = OnFinishCapture(
function(post)
if GetObjectTeam("cp2") == 1--sticking <and> here
if GetObjectTeam("cp3") == 1 --and <and> here doesn't work either
if GetObjectTeam("cp5") == 1 then
ReleaseFinishCapture(OnGunshipTime)
OnGunshipTime = nil
PlayAnimation("LAAT")
RespawnObject("cp1cam")
RespawnObject("cp4")
end --every time you add a command post if statement you must add another end here
end
end"

Will trigger the animation if any of these co's are captured. I want it to be so it (and the other events) are triggered when all the mentioned command posts are in republic control.

Thanks for the quick response and patience.
xwingguy

Re: RE: How Can capture of a specific CP trigger an animatio

Post by xwingguy »

Ace_Azzameen_5 wrote:if GetObjectTeam("cp2") == 1
if GetObjectTeam("cp3") == 1
if GetObjectTeam("cp5") == 1 then
needs to be:

if GetObjectTeam("cp2") == 1 then
if GetObjectTeam("cp3") == 1 then
if GetObjectTeam("cp5") == 1 then

You also need another end.

Ace_Azzameen_5 wrote: Will trigger the animation if any of these co's are captured. I want it to be so it (and the other events) are triggered when all the mentioned command posts are in republic control.
Yes, the callback will be triggered every time a cp is captured. BUT unless all 3 if statements are true, it falls through and the animation doesn't take place. only when all 3 cps are capped will the animation run.
Post Reply