Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the need to give NPCs fake objectives to properly end the game #7081

Merged
merged 2 commits into from
Dec 8, 2014

Conversation

Mailaender
Copy link
Member

This simplifies setting up single-player objectives a lot. The behavior outlined in #6377 (comment) was pretty wonky. I noticed while trying to fix #7068. When Tanya gets killed, it would automatically mark Einstein as killed and vice versa.

@@ -37,6 +37,7 @@ public class Player : IScriptBindable, IScriptNotifyBind, ILuaTableBinding, ILu
public readonly bool NonCombatant = false;
public readonly bool Spectating = false;
public readonly bool Playable = true;
public readonly bool HasObjectives = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the MSDN, this shouldn't work. Why does it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know, but you are right. This should not be readonly.

- don't mark everything as failed just because one objective did
- remove fake objectives workarounds for non-playable factions
@obrakmann
Copy link
Contributor

The logic I was going for was that objectives that the player failed to complete in time before the game was over get marked as failed.

But this works for me, too. In more complicated maps, it will probably help the player figure out what went wrong when he loses. 👍

If we ever get replays for single-player missions back (with a limited viewport selector, perhaps), this will cause the 'outcome' filter to not work correctly in some cases, though (which was the main reason why I went for the existing logic).

chrisforbes added a commit that referenced this pull request Dec 8, 2014
Removed the need to give NPCs fake objectives to properly end the game
@chrisforbes chrisforbes merged commit 522c63f into OpenRA:bleed Dec 8, 2014
@chrisforbes
Copy link
Member

👍

@Mailaender Mailaender deleted the ignore-missing-npc-objectives branch December 8, 2014 19:19
player.MarkCompletedObjective(SurviveObjective)
ussr.MarkFailedObjective(DefendObjective)
player.MarkCompletedObjective(EinsteinSurviveObjective)
if not Tanya.IsDead then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should have been a lower-case tanya: Fatal Lua Error: [string "allies01.lua"]:133: attempt to index global 'Tanya' (a nil value)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eyeballs are no substitute for actually running the thing.

Will need a quick fix for this.

@obrakmann obrakmann mentioned this pull request Dec 9, 2014
@Mailaender
Copy link
Member Author

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allies01 - mission successful despite failed objectives
3 participants