Opened 4 years ago

Closed 6 weeks ago

#4881 closed defect (fixed)

Start Mods button only works as intended when saving the mods

Reported by: elexis Owned by: Angen
Priority: Should Have Milestone: Alpha 25
Component: Core engine Keywords:
Cc: Patch: Phab:D3592

Description

The mod selection screen has a button to save the mods and one to start the mods.

So the user might assume that the mods could be launched without saving the configuration too if theere is no dialog asking for the changes to be saved before 'starting' them.

The code also looks like it intends to launch the selected mods without saving:

function startMods()
{
	// always sort mods before starting
	sortMods();
	Engine.SetMods(["mod"].concat(g_modsEnabled));
	Engine.RestartEngine();
}

But it doesn't actually work, tested on svn, a22, a21 and a19 (while confirming that the mod attempted to start can be started after saving).

That RestartEngine call goes straight to restart_engine() of main.cpp. It sets quit to true which means the frame rendering infinite loop in the main thread is left. restart had been set to true which means that the same process is going to reinitialize everything. So it ought to be supported to restart without saving.

RunGameOrAtlas

Change History (11)

comment:1 by Imarok, 4 years ago

Hmm, works for me.

I just do (without mods enabled): click on a mod -> click on enable -> click start mods. Then the game restarts and the mod is enabled for this run.

comment:2 by elexis, 4 years ago

No matter which set of mods is enabled, no matter if there is a user.cfg entry for enabled mods, doesn't work for me on my unix machine. Even more wondering why then.

comment:3 by leper, 4 years ago

Milestone: Backlog
Resolution: worksforme
Status: newclosed

Just remove all currently enabled mods, then start mods, you should be greeted by the mod selection screen again (since that is what happens if you don't have any mods). If it doesn't check for local changes that could break this.

comment:4 by elexis, 4 years ago

Ive tested all sets of mods, including the empty set. Ive removed my user.cfg, tested with clean svn code, with a22, with a21, even with a19 code and always get the same result. I guess I can derive the origin through the c++ code.

comment:5 by Imarok, 4 years ago

But have you tried it in svn? (That is, what I tested...)

Edit: also worked in A22. Just to clarifiy: The way in comment:1 just enables the mod temporarily for the run after the restart.

Last edited 4 years ago by Imarok (previous) (diff)

in reply to:  description comment:6 by elexis, 4 years ago

I have stated that in the ticket description, repeated it in comment 4. I can upload a screencast if you guys don't believe me ._.

comment:7 by Imarok, 4 years ago

Ugh, I overlooked that you said svn

comment:8 by elexis, 3 years ago

Milestone: Backlog
Summary: Start Mods button only works when saving the modsStart Mods button only works as intended when saving the mods

The launching part works - but the list of enabled mods doesn't show the list of enabled mods, but only the list that is present in the config.

Confirm in alpha 22 for instance by disabling the public mod, clicking on launch mods, then seeing the public mod in the list of enabled mods again. Notice the public mod is not currently enabled by pressing F9 and typing warn(uneval(Engine.GetEngineInfo));.

comment:9 by elexis, 3 years ago

Resolution: worksforme
Status: closedreopened

comment:10 by Angen, 4 months ago

Milestone: BacklogAlpha 25
Owner: set to Angen
Patch: Phab:D3592
Status: reopenednew

comment:11 by Angen, 6 weeks ago

Resolution: fixed
Status: newclosed

In 25410:

Do not allow to start pyrogenesis with incompatible mods

Fixing following problems:
Issue number one:
Enable mod with a23 compatibility in a23b.
Save configuration.
Start a24.
Better result:
Mod will be enabled and invisible in mod selection screen producing various errors.
Worse result:
Game will crash and refuse to start.

Issue number two:
Mods can silently set loaded mods without restarting the engine, so mods can unlist themselves from compatibility detection.

Solution:
Enable necessary mods instead if running with gui and open mod page.
Open information window on top of mod page to infom why mod page is showing up.
On mod page show mods which failed in compatibility check and color the resposnible ones.
Disable start button without enabled mods.
Show non existed mods if they failed in compatibility check.

Else just log to mainlog and close.

Another fixes:
Display in enabled mods really enabled mods as current logic confuses players about which mods they have enabled and is not helpful (ref #4881)

Note:
this will not solve issue with mods claiming being compatible with engine version while in fact being incompatible.

Comments by: @vladislavbelov, @Stan, @Imarok
Tested by: @wraitii
Differential revision: D3592
Fixes: #6044 #4881

Note: See TracTickets for help on using tickets.