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!
Final Choice?
Moderator: Moderators
- jedimaster745
- First Lance Corporal

- Posts: 136
- Joined: Sun Sep 07, 2008 5:05 pm
- Dom380
- Rebel Sergeant

- Posts: 205
- Joined: Wed Apr 08, 2009 12:19 pm
Re: Final Choice?
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
but you should ask someone who knows abit more than me about scripting
- [RDH]Zerted
- Gametoast Staff

- Posts: 2982
- Joined: Sun Feb 26, 2006 7:36 am
- Projects :: Bos Wars AI - a RTS game
- xbox live or psn: No gamertag set
- Location: USA
- Contact:
Re: Final Choice?
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.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?...
- jedimaster745
- First Lance Corporal

- Posts: 136
- Joined: Sun Sep 07, 2008 5:05 pm
Re: Final Choice?
How would i make the campaign so that the first one attacked becomes hostile?[RDH]Zerted wrote: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.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?...
- jangoisbaddest
- Lieutenant General

- Posts: 661
- Joined: Mon Feb 27, 2006 12:10 am
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: All Along The Watchtower
Re: Final Choice?
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.jedimaster745 wrote:How would i make the campaign so that the first one attacked becomes hostile?[RDH]Zerted wrote: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.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?...
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.
