-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Removed the need to give NPCs fake objectives to properly end the game #7081
Conversation
@@ -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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
d08ae27
to
d319a8f
Compare
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). |
Removed the need to give NPCs fake objectives to properly end the game
👍 |
player.MarkCompletedObjective(SurviveObjective) | ||
ussr.MarkFailedObjective(DefendObjective) | ||
player.MarkCompletedObjective(EinsteinSurviveObjective) | ||
if not Tanya.IsDead then |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
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.