Author Topic: Mapper2.exe Question  (Read 3820 times)

Fire Plague

  • Guest
Mapper2.exe Question
« on: August 20, 2008, 03:56:22 PM »
a quote from Hooman in a post called multiple questoins:

"...You just need an easy way to set the lava possible bit for the tiles you want. There's] no real reason to do it like it's currently being done. You could even do this in a map editor ..."

So, my questions is, wouldn't it be simplier in the end to add a Lava/blight possile button to the mapper. We have a speed of travel/impassible button and a place buildings button already...
« Last Edit: August 20, 2008, 03:56:46 PM by Fire Plague »

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Mapper2.exe Question
« Reply #1 on: August 20, 2008, 05:52:19 PM »
There is no blight possible. the blight goes everywhere, except on lava.

Adding a 3rd layer of tile info to the mapper containing a lava possible indicator could help making static lava expansions.

I say 3rd layer, as I think of a tile with no unit on it.  
"Nothing from nowhere, I'm no one at all"

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Mapper2.exe Question
« Reply #2 on: August 20, 2008, 10:16:32 PM »
Oh, sure, that's all well and good to say, but lava-possible is not set in the map. It's set by the DLL.  So the only thing the mapper could do is generate code to set lava-possible tiles that you then copy/paste into your mission project.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Mapper2.exe Question
« Reply #3 on: August 20, 2008, 10:23:17 PM »
Lava possible can be stored in the map file, actually. Dynamix just never used that feature for some reason, and neither does the mapper (yet).

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Mapper2.exe Question
« Reply #4 on: August 20, 2008, 11:32:23 PM »
Really? Now that is interesting. But can OP2 use that data?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Mapper2.exe Question
« Reply #5 on: August 21, 2008, 03:35:16 AM »
If it doesn't work by storing the lava-possible in the .map, then just add it as a code generation. And maybe, just maybe, not as a line for each lava-possible tile.
"Nothing from nowhere, I'm no one at all"

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
Mapper2.exe Question
« Reply #6 on: August 21, 2008, 08:02:22 AM »
You can already do this (in a very strange way).

Unfortunately I've forgotten how to do it exactly. Anyway, there is a file in the mapper directory that tells the mapper what to code to produce when it is asked to generate code (for units, mines, etc.) Simply make a backup of this and edit the original such that something (for example mines) produces code equal to a set lava possible call. Then you just have to place that unit on each tile you want possible, generate the code, and copy it into your mission code.

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Mapper2.exe Question
« Reply #7 on: August 21, 2008, 11:32:14 AM »
It is possible to store LavaPossible information within the map file. However, this was never implemented in the mapper's UI.

As far as using (abusing :P) the code generator to produce code for setting lava possible, you can make a copy of one of the .tpl files in the Mapper directory. (The .ctl files are information the mapper uses to display units, buildings, etc and to know how to generate code for them, so they can be safely ignored).

Make a copy of default.tpl. The file is split into different sections, which are identified by empty lines with "$$section". (With the exception of $$rem lines which are simply ignored and used for comments within the tpl file).

You could change the wreck section to be used to set lava possible characteristics instead. (Since wrecks are rarely used in a map).

Code: [Select]
$$wreck
GameMap::SetLavaPossible(LOCATION($x+31, $y-1), true);

If you wanted a special tpl file that would not generate anything else (just used for lava possible), remove / empty the sections such as $$player, $$endplayer, $$unit, $$beacon, $$wall. (I don't remember if you can completely remove the section tags without causing an error, if not just leave the sections empty).

The mapper scans for tpl files in its directory, so any new tpl files you save should appear in the code generation dropdown.

If you wanted to use walls instead of wrecks, just modify the $$wall section. It would be best to use walls, beacons, or wrecks however (units are player specific and this means that lava possible code would not get generated if a certain player doesn't exist).
This is kind of a sick hack, but it works for now.

Fire Plague

  • Guest
Mapper2.exe Question
« Reply #8 on: August 23, 2008, 12:29:21 PM »
So now that we have the ability to create the lava, what code is needed to get the thing to actually fill in the map?  I've seen it in the tethysgame class, but haven't got that far yet.

btw, is this the correct land rush function?
CODE:
void CreateLandRushVictoryCondition();
void CreateNoCommandCenterFailureCondition();

it's a modification to the OP2helper.h version:
CODE:
void CreateLastOneStandingVictoryCondition();
void CreateNoCommandCenterFailureCondition();

I know you need to set the map to be a land rush as well, but I can't rememer where i saw that in the SDK.

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
Mapper2.exe Question
« Reply #9 on: August 23, 2008, 01:26:18 PM »
No, there is no land rush victory function. Those two in op2helper are it. You'll need to come up with your own victory conditions (see functions.h i think).

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Mapper2.exe Question
« Reply #10 on: August 23, 2008, 04:53:00 PM »
Yeah, check Functions.h. You'll need to setup the Victory/Failure conditions using the trigger system. Those two helper functions just use the triggers from Functions.h to do it. They were mostly just to save a tiny little bit of typing. Particularly since those conditions were so common.


Land Rush maps usually setup a trigger for when the CC is placed, and once that happens, it creates the Last One Standing victory conditions. There needs to be some extra checking for failure as well. They might starve, or lose all their units before placing the CC.

Oh, the you'll need to change the DLL name prefix, and the DescBlock missionType field. You can check RequiredExports.h for details.