Final Choice?

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
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Final Choice?

Post by jedimaster745 »

For those who have played(and completed) the force unleashed, you probably remember the end of the game, where your character must choose whether to attack darth vader or the emporer. and the choice decides the ending of the game.

For those who are experienced scripters, how would i integrate such a choice into a campaign mission? where at the end, the character is given a choice between two targets, and the one who is attacked becomes hostile, and the one who wasnt attacked either just stands there or becomes friendly, and either choice results in victory?

Thanks in advance!
User avatar
Dom380
Rebel Sergeant
Rebel Sergeant
Posts: 205
Joined: Wed Apr 08, 2009 12:19 pm

Re: Final Choice?

Post by Dom380 »

from my limited know how I would have to say no you could have two different versions of the map or campaign with a different ending

but you should ask someone who knows abit more than me about scripting
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Final Choice?

Post by [RDH]Zerted »

jedimaster745 wrote:...the character is given a choice between two targets, and the one who is attacked becomes hostile, and the one who wasnt attacked either just stands there or becomes friendly, and either choice results in victory?...
There are a few ways you can do it. One way is to use event callbacks and see which is damaged first by the human player. If the two targets are initially standing still, another way would be to surround them with regions and whoever the player walks up to first is the enemy.
User avatar
jedimaster745
First Lance Corporal
First Lance Corporal
Posts: 136
Joined: Sun Sep 07, 2008 5:05 pm

Re: Final Choice?

Post by jedimaster745 »

[RDH]Zerted wrote:
jedimaster745 wrote:...the character is given a choice between two targets, and the one who is attacked becomes hostile, and the one who wasnt attacked either just stands there or becomes friendly, and either choice results in victory?...
There are a few ways you can do it. One way is to use event callbacks and see which is damaged first by the human player. If the two targets are initially standing still, another way would be to surround them with regions and whoever the player walks up to first is the enemy.
How would i make the campaign so that the first one attacked becomes hostile?
User avatar
jangoisbaddest
Lieutenant General
Lieutenant General
Posts: 661
Joined: Mon Feb 27, 2006 12:10 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: All Along The Watchtower

Re: Final Choice?

Post by jangoisbaddest »

jedimaster745 wrote:
[RDH]Zerted wrote:
jedimaster745 wrote:...the character is given a choice between two targets, and the one who is attacked becomes hostile, and the one who wasnt attacked either just stands there or becomes friendly, and either choice results in victory?...
There are a few ways you can do it. One way is to use event callbacks and see which is damaged first by the human player. If the two targets are initially standing still, another way would be to surround them with regions and whoever the player walks up to first is the enemy.
How would i make the campaign so that the first one attacked becomes hostile?
You would have Vader and the Emperor on separate teams. These teams would be friendly to everyone at first. When your callback happens to check and see which path the player has chosen, you use SetTeamAsFriend/Enemy functions as appropriate.

The one thing I don't know how to do in this situation is create a branch in the objective structure - that is, how to create two different sequences of objectives based on this choice. However, most things (dialogue, etc) can be controlled by a simple boolean variable (true/false). For example, if you want to create dialogue that says "How dare you choose vader!", make the callback check the variable "IsVaderChosen" (or whatever you want to name it). If true, display the dialogue. If false, display alternate dialogue from vader (ex. "Soon you will perish", or w/e). But regarding the objectives, idk if that's a real hardcode issue or not. Someone with more coding experience should be able to (hopefully) shed some light on that.
Post Reply