MapOptions. GameSpeed. In yaml file.

Dune2000, Dune 2000, d2k

Information and discussion for custom maps and mods.
Post Reply
Adrian
Posts: 39
Joined: Wed Feb 12, 2020 5:44 pm

MapOptions. GameSpeed. In yaml file.

Post by Adrian »

I read documentation here.
https://github.com/OpenRA/OpenRA/wiki/Map-Options

And I try to set GameSpeed (from the example below). But it does not work for some reason. Do I write something wrong?

* * *

Example from documentation.

AVAILABLE OPTIONS

Code: Select all

Rules: 
	World:
		MapOptions:
			TechLevelDropdownLocked: true
			TechLevel: unrestricted
			# other options are infonly, low, medium, nosuper (d2k also has: high)
			ShortGameCheckboxEnabled: true
			ShortGameCheckboxLocked: true
			GameSpeedDropdownLocked: true
			GameSpeed: default
			# other options are slower, fast, faster, fastest
My code from map.yaml file

Code: Select all

Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
	World:
		MapOptions:
			GameSpeed: slower
* * *

I also tried to write GameSpeed in the file rules.yaml. To add it in ready (existing) division "MapOptions". It does not work too.

Code: Select all

	MapOptions:
		TechLevel: medium
		GameSpeeds: slower
* * *

Button "Difficulty" works.

At the same time, I change easily default value of dropdown button "Difficulty". In the file rules.yaml.
From "Easy" to "Normal". The button appears in the menu "Missions".

Dropdown button "GameSpeed" is in the same menu "Missions" too.

Correct code for "Difficulty" :

Code: Select all

	ScriptLobbyDropdown@difficulty:
		ID: difficulty
		Label: Difficulty
		Values:
			easy: Easy
			normal: Normal
			hard: Hard
		Default: normal
In order of appearance. :-)

Actually I set default value for "Difficulty" first. For my map. It was not difficult :-)
Then, I supposed, it would be so easy for "GameSpeed" too. No... not for me.

abcdefg30
Posts: 424
Joined: Mon Aug 18, 2014 6:00 pm

Re: MapOptions. GameSpeed. In yaml file.

Post by abcdefg30 »

You wrote "GameSpeeds: slower" in your post once, should make sure it is just "GameSpeed: slower". I'd also add "GameSpeedDropdownLocked: true" which will lock the setting but show you if it worked at all, because sometimes non-locked map defaults are just overwritten by the game while changing the selected map.

Adrian
Posts: 39
Joined: Wed Feb 12, 2020 5:44 pm

Re: MapOptions. GameSpeed. In yaml file.

Post by Adrian »

Unfortunately nothing changes in (Singleplayer -> Missions) dropdown button "GameSpeed".
Default value is still "Normal".

I try to do:

1)
In the file map.yaml

Code: Select all

Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
	World:
		MapOptions:
			GameSpeedDropdownLocked: true
			GameSpeed: slower
2)
In the file rules.yaml

Code: Select all

MapOptions:
		TechLevel: low
		# added to existing code
		GameSpeedDropdownLocked: true
		GameSpeed: fast

Adrian
Posts: 39
Joined: Wed Feb 12, 2020 5:44 pm

Re: MapOptions. GameSpeed. In yaml file.

Post by Adrian »

I even try to make something similar to "Difficulty" dropdown button in the file rules.yaml.
Nothing changes.

Code: Select all

	ScriptLobbyDropdown@gamespeed:
		ID: gamespeed
		Label: Gamespeed
		Values:
			slower: Slower	
			normal: Normal
			fast: Fast
			faster: Faster
			fastest: Fastest
		Default: fast
Another question.
Is it possible, in general, in Dune2000 ? I mean, to create own dropdown menu and checkboxes, as documentation writes.
https://github.com/OpenRA/OpenRA/wiki/Map-Options
ScriptLobbyDropdown@Your_custom_dropdown:

LobbyPrerequisiteCheckbox@Your_custom_checkbox:

SirCake
Posts: 378
Joined: Thu Feb 04, 2016 5:40 pm

Re: MapOptions. GameSpeed. In yaml file.

Post by SirCake »

Adrian wrote:
Thu Aug 06, 2020 3:22 pm
Another question.
Is it possible, in general, in Dune2000 ? I mean, to create own dropdown menu and checkboxes, as documentation writes.
https://github.com/OpenRA/OpenRA/wiki/Map-Options
Yes. Just checked that it is working indeeed like shown in the documentation:
Attachments
CustomDropDown8bit.png
CustomDropDown8bit.png (134.69 KiB) Viewed 325 times

Adrian
Posts: 39
Joined: Wed Feb 12, 2020 5:44 pm

Re: MapOptions. GameSpeed. In yaml file.

Post by Adrian »

Thank you very much, SirCake!
(your answers are really very informative, and I can understand how exactly it works)
So, at least, it works in "Skirmish Game".

It's still interesting, how to reach default value (for own separate map) here:
Singleplayer -> Missions -> dropdown button "Speed".

It was so easy for dropdown button "Difficulty".

abcdefg30
Posts: 424
Joined: Mon Aug 18, 2014 6:00 pm

Re: MapOptions. GameSpeed. In yaml file.

Post by abcdefg30 »

The MapOptions thing is definitely a bug, I filed a bug report: OpenRA/OpenRA#18497

Post Reply