Page 1 of 1

How to reveal Fog on the entire map for a second?

Posted: Tue Dec 01, 2015 10:10 am
by noobmapmaker
Hey all,

So finally I managed to modd a map a little bit with the help of communitymembers. I've still got one question that I need help with and it's slightly more difficult.

First let me introduce the map: The City of Strubblesnuv (truly FIXED link: resource center)

It's a big deserted city that was once inhabited by retarded midgets and ruled by the infamous Glebvrumb. They where well known for their huge orgies, drenched in PCP, which where described in ancient writings as 'belligerent, paternalistic and decentralized'. According to witnesses they where like "a gathering of shaven boars fighting over invisible truffles". Anyway, this lifestyle turned out to be inefficient and their civilization crumbled over time.

This is where you step in: late for the party, but ready to capture! You start with a spy and an engineer in a corner and your goal is to capture the city of Strubblesnuv and destroy your opponents.

Image

The problem: the shroud is turned off for this map by default, but fog of war is on. Buildings (except for the hospitals, oil derricks and civilian buildings) don't show under fog when they are not discovered. This makes the map confusing.

What I want: to also show all the neutral buildings for the players, so they know what is where.

Possible solution: buildings do show under the fog once you have discovered them. So I thought it would be good to have a camera actor reveal the entire map for a fraction of time (1 tick) at the start of the game.

I've been looking into this, but my knowledge of actors and how to force this upon all players, and what details the actor needs (and in which format it has to written in the yaml) is to limited. So I hope someone knows and can tell me how to do it and where to put it. Thanks!!

Posted: Tue Dec 01, 2015 6:49 pm
by noobmapmaker
I tried this, but doesn't work:

Code: Select all

Rules:
	Camera:
		RevealsShroud:
			Range: 1000c100
			CameraRemoveDelay: 1
And that seems logical because I haven't specified when the camera should show (at the start of the game, but how do I mod that?).

Also I don't know how to set the range. When I look for "range" on the trait page I never find the range property for "camera" (in most yamls its written as "CAMERA", why?). What does # c # stand for? Why the c in between?

Posted: Tue Dec 01, 2015 7:11 pm
by abcdefg30
The proper way is probably to use "StartsRevealed: true" on the buildings "FrozenUnderFog:" trait (see https://github.com/OpenRA/OpenRA/wiki/T ... enunderfog ).

You should be fine by using

Code: Select all

Rules:
	^Building:
		FrozenUnderFog:
			StartsRevealed: true
Anyway, to answer your questions:

You can place the camera as you do for other actors in the map editor. You can even select in the dropdown which player this camera belongs to and then create one camera for each player. Then you'd need to remove them by using LUA or KillsSelf https://github.com/OpenRA/OpenRA/wiki/Traits#killsself .
On another thought, a range of "1000c100" won't work probably, as the game has some checks against that (don't know why though).
So you'll need to create a whole bunch of cameras in order to reveal the entire map.
The "c" means just that this is a cell-range. "1000c100" means just 1000 whole cells and a 100 "world units". (One cell = 1024 "world units".)

PS: The "range" field is here https://github.com/OpenRA/OpenRA/wiki/T ... ealsshroud .

Posted: Tue Dec 01, 2015 10:03 pm
by noobmapmaker
Thanks!! Works like a gem!

Well then the map is ready to test and play!

map:

Image

Posted: Wed Dec 02, 2015 12:52 pm
by noobmapmaker
By the way, is there a page where is explained what is what when it comes to yaml-code?

Example:

Yaml currently has a bunch of 'parentcategories' (or how do you call them?):
- Mapformat, Requiresmod, Title, Description, Author [...], Options, Players, Actors, Rules, [...], Translations.

- Mapformat = size of the map that is displayed (very small, small, etc)
- Requiresmod = the mod that is needed to play this map
- etc

A parentcategorie can have subcategories (often, or always(?) actors). An actor is [definition] and often you can specify traits of the actor. A trait is [definition] and can have several values, depending on the trait: a string (text), a number, etc.
Usually the format for an actor + trait + the value of a trait is written with this format:

Code: Select all

Actor
    Trait: value
If you don't put a value behind the trait, it does [don't know].

In the Rules-parentcategorie you can adjust the rules for this game, like example or example. The most used subcategories are "World" and "Camera". They allow you to bla bla.

There are several symbols that can be used together with a n actor or trait:

- (minus) = put this in front of the actor, like this "-actor". With a - the trait is exempted.
^ (accent circumflex) = put this in front of the actor (like this "^actor"). With a ^the actor bla bla.
The map consists of cells, each cell has 1024 worldunitcells. When a range has to be defined the format XcY is used, meaning X: number of cells and Y number of world units (max 1023)

Use tabs to indicate subcategories. Also an enter in between the code does nothing (or does it?). Make sure your code uses proper capitals als this, this and that is case-sensitive.

--------------------------------------------------------------------------

I probably wrote tons of nonse, but I hope you get the gist of what kind of information I'm looking for. The general information about how to format code, what the definition of an actors is, and a trait and and what format is needed to adjust them and with what you can combine them.

Posted: Wed Dec 02, 2015 8:13 pm
by Matt
https://github.com/OpenRA/OpenRA/wiki/C ... player-map is pretty outdated (still showing the legacy WinForms editor) and could need an overhaul.

Posted: Thu Dec 03, 2015 9:51 am
by noobmapmaker
That would be great!

The information that is given is good, but personally I'm looking for a broad beginners guide, instead of an example. I guess some learn best that way though.

Compare it to chess: you can explain the game by showing a game that has been played and explain the rules along the way. Or you can explain all the rules beforehand and then show an example game.

Chess has simple rules but the tactics and strategy can be extremely complex. When explaining the rules you can give the beginner a gist of the tactical abilities without having to explain them in detail.

E.g.: Rule: you are not allowed to move in check (illegal move). From this rule many tactics emerge. You can pin an opponents piece by attacking a piece with a king behind it. The opponent may not move the piece as it would uncover a check (illegal). You can now attack the piece with other pieces or prevent your opponent from using it in an attack. There are many more tactics using this rule, see here for details.

Translated: Rule: an actor can have a trait. You can set a trait by placing it directly under the actor with a tab-spacing so the actor becomes a parent. Traits exist in many variations and can be specified with values. For a full overview off the traits and their values see here.

Posted: Fri Dec 04, 2015 7:48 pm
by noobmapmaker
First testgame has been played with pretty good players. See here.

The game ends a bit premature, and the players start in a corner, but the camera may start in another, lol.. but it was quite fun to play actually!