Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3001 closed defect (fixed)

[PATCH] Game mode defaults to Conquest when Endless mode is selected

Reported by: Niek Owned by: Niek
Priority: Must Have Milestone: Alpha 18
Component: UI & Simulation Keywords:
Cc: Patch:

Description

When testing my trigger defeatconditions I noticed that the game itself handled them incorrectly (while Atlas did work as should). My research show that source:ps/trunk/binaries/data/mods/public/gui/gamesetup/gamesetup.js#1941 is the problem

Changing

r.scripts = [[]];

to

r.scripts = [[""]];

worked for me.

Attachments (1)

3001.1.diff (355 bytes ) - added by Stan 9 years ago.
Add the quotes. Patch by Niektb. Made by Ticketman.

Download all attachments as: .zip

Change History (8)

by Stan, 9 years ago

Attachment: 3001.1.diff added

Add the quotes. Patch by Niektb. Made by Ticketman.

comment:1 by Stan, 9 years ago

Keywords: review patch added
Owner: set to Niek
Summary: Game mode defaults to Conquest when Endless mode is selected[PATCH] Game mode defaults to Conquest when Endless mode is selected

comment:2 by fabio, 9 years ago

Resolution: fixed
Status: newclosed

In 16146:

Fixes game mode defaulting to Conquest when Endless mode is selected.

Patch by niektb, thanks!

Fixes #3001.

comment:3 by leper, 9 years ago

Keywords: simple review patch removed

comment:4 by leper, 9 years ago

In 16232:

Clear the victory conditions properly. Refs #3001.

comment:5 by leper, 9 years ago

In 16238:

Reset victory conditions on map change. Refs #3001.

comment:6 by elexis, 9 years ago

The last commit (r16238) was required as you get the following bug otherwise:

  1. Pick a skirmish map
  2. Set the victory condition to None
  3. Click on map type "scenario" (== selecting a scenario with a conquest condition)
  4. after loading the map, the game type is conquest, but the scripts are not loaded

Source:

< niektb> Pick a skirmish map, set the conditions to None and then change to a scenario that has a Conquest condition. You'll see that when you load the map no victory conditions are set. http://irclogs.wildfiregames.com/2015-01-27-QuakeNet-%230ad-dev.log

It only seems to occur when doing it exactly that way - doing a different maptype / map change seems to work.

Unfortunately #3209 (r16840) reverts the commit. An easy and correct way to handle both tickets is to reset the victory condition in case of non-random maps. When we will rewrite/clean the gamesetup code we might find a better solution.

You can check which victory scripts are loaded by printing them when starting the game:

Index: binaries/data/mods/public/gui/gamesetup/gamesetup.js
===================================================================
--- binaries/data/mods/public/gui/gamesetup/gamesetup.js	(revision 17021)
+++ binaries/data/mods/public/gui/gamesetup/gamesetup.js	(working copy)
@@ -1107,10 +1107,12 @@
 			else
 				g_GameAttributes.settings.PlayerData[i].Name = chosenName;
 		}
 	}
 
+	error(JSON.stringify(g_GameAttributes.settings.TriggerScripts));
+
 	// Copy playernames from initial player assignment to the settings
 	for (let guid in g_PlayerAssignments)
 	{
 		let player = g_PlayerAssignments[guid];
 		if (player.player > 0)	// not observer or GAIA
Last edited 9 years ago by elexis (previous) (diff)

comment:7 by mimo, 9 years ago

In 17026:

Move the victory conditions to the new simulation settings system. Patch by elexis. Refs #3355,#3001

Note: See TracTickets for help on using tickets.