Placing damaged units on maps?
Moderators: Slitherine Core, BA Moderators
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Placing damaged units on maps?
Is there a way to place a unit, eg. a Sherman tank, on a user gen map... and then damage it... so that it's just interesting mapwork and doesn't count/work as an active unit?
I thought I'd seen this somewhere, but I can't find it now...
I thought I'd seen this somewhere, but I can't find it now...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
pipfromslitherine
- Site Admin

- Posts: 9929
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Placing damaged units on maps?
It's a feature that has been asked for, but it's not quite as simple to implement as I had hoped. It's on the wishlist, but not done as yet. You can do it via scripting, but adding a unit then killing it, but that can mess up the kill tallies.
Cheers
Pip
Cheers
Pip
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
Aw that's too bad... thanks anyhow Pip 
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Re: Placing damaged units on maps?
GL88 As Pip said it can be done - Have a look here viewtopic.php?f=104&t=18658- about placing destroyed objects- Thanks again to Merr & J2d
Cheers
Richcat
Richcat
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
WOW, thanks Richcat. That's a clever way to do it. If I understand correctly, using Merr's technique we can place damaged objects directly from within the editor, without any scripting and it won't affect the KIAs (We need accurate KIAs for a campaign we're running). Nice! Will try out later today...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Re: Placing damaged units on maps?
But if you place damaged tanks on the map, they should be removable by players in order to clear a path, just as 'regular' tanks are when destroyed.
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
I think Merr/Richcat's code includes a FADE command, which makes the Sherman automatically disappear once a unit moves into it...
Am not sure, but if we delete the FADE command, I assume another unit could be ordered to remove the damaged Sherman, as normal?
Am not sure, but if we delete the FADE command, I assume another unit could be ordered to remove the damaged Sherman, as normal?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
Guys, I'm using Merr's technique to add destroyed objects to a battle map.
See Merr's explanation of "how to", posted 30 Aug 2010 14:56, here -> viewtopic.php?f=104&t=18658
This works to add destroyed unit objects to a map. But it seems to add simple static 3d graphics. These don't interact with live units.
I can place damaged Shermans, Marders, pretty much anything solid (ie. not dead infantry).
My Objects.txt file has:
[SHERMAN_0]
BLOCKING
FADE
repeated for each of the destroyed unit objects that I want to include.
But when vehicles/infantry move into the space of a destroyed unit they just merge with its destroyed image, rather than fading it.
There is no extra cover, and no option to "remove" the destroyed unit... and if the unit moves out of that space, the destroyed unit image remains.
Any ideas anyone?


See Merr's explanation of "how to", posted 30 Aug 2010 14:56, here -> viewtopic.php?f=104&t=18658
This works to add destroyed unit objects to a map. But it seems to add simple static 3d graphics. These don't interact with live units.
I can place damaged Shermans, Marders, pretty much anything solid (ie. not dead infantry).
My Objects.txt file has:
[SHERMAN_0]
BLOCKING
FADE
repeated for each of the destroyed unit objects that I want to include.
But when vehicles/infantry move into the space of a destroyed unit they just merge with its destroyed image, rather than fading it.
There is no extra cover, and no option to "remove" the destroyed unit... and if the unit moves out of that space, the destroyed unit image remains.
Any ideas anyone?

SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
Amaris
- Captain - Heavy Cruiser

- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: Placing damaged units on maps?
For this you need to put a valid (and living) unit to your map.
And kill it with script into FUNCTION PreBattleSetup().
the easiest way is to retrieve the coordinates of the tile:
And kill it with script into FUNCTION PreBattleSetup().
the easiest way is to retrieve the coordinates of the tile:
Code: Select all
FUNCTION PreBattleSetup()
{
...
int id;
id = GetUnitOnTile(TILEX, TILEY); //Remplace Tilex and Tiley by the coordinates of the tile.
if (id != -11)
{
DestroyUnit(kill, 255) ;
}
}
“Take care, my friend; watch your six, and do one more roll… just for me.”
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
Thanks Amaris, that looks a slick way to do what I want.
Is the condition always set to look for if (id != -11)? Does the -11 signify anything I need to be aware of?
Will this code add that killed unit to the Killed in Action (KIA) summary? If yes, is there a way to reset the KIAs back to zero for both sides, so this unit won't show there?
Merci encore
Is the condition always set to look for if (id != -11)? Does the -11 signify anything I need to be aware of?
Will this code add that killed unit to the Killed in Action (KIA) summary? If yes, is there a way to reset the KIAs back to zero for both sides, so this unit won't show there?
Merci encore
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
Amaris
- Captain - Heavy Cruiser

- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: Placing damaged units on maps?
-11 is wrong
Remplace it with only -1
because the function GetUnitOnTile() work as :
//return an id for the unit on a tile, -1 for none
Remplace it with only -1
because the function GetUnitOnTile() work as :
//return an id for the unit on a tile, -1 for none
“Take care, my friend; watch your six, and do one more roll… just for me.”
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
Thanks again Amaris...
Do you know if the code will add that killed unit to the Killed in Action (KIA) summary?
If yes, is there a way to reset the KIAs back to zero for both sides, so this unit won't show there?
Sorry to ask many foolish questions...
Do you know if the code will add that killed unit to the Killed in Action (KIA) summary?
If yes, is there a way to reset the KIAs back to zero for both sides, so this unit won't show there?
Sorry to ask many foolish questions...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
-
Amaris
- Captain - Heavy Cruiser

- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: Placing damaged units on maps?
I don't known but there is a good chance that yes it is counted...
And I don't have any idea how to reset the KIAs back to zero.
Beware, there's another error in the script:
And I don't have any idea how to reset the KIAs back to zero.
Beware, there's another error in the script:
Code: Select all
FUNCTION PreBattleSetup()
{
...
int id;
id = GetUnitOnTile(TILEX, TILEY); //Remplace Tilex and Tiley by the coordinates of the tile.
if (id != -1)
{
DestroyUnit(id, 255) ;
}
}
“Take care, my friend; watch your six, and do one more roll… just for me.”
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Placing damaged units on maps?
Merci Amaris, that's perfect! I'll ask about resetting KIAs on another post... to see if anyone knows how... 
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Re: Placing damaged units on maps?
You can also add Terrain types to your damaged unit such as Wreak, LighFortifications, HeaveyFortifications, RoughGround, Water etc etc to get different types of cover . This overides the underlying tile type
Just add TERRAIN Wreak or whatever you choose could be HighVegetation from the Terrain.txt file to the Object Text file
The Terrain.TXT file types can be found in the most of the main campaign folders. Here's an example of a part of the Terrain.txt file with options that can be adjusted. I believe you can create your own, when you get the hang of it - haven't done it my self yet.
Just add TERRAIN Wreak or whatever you choose could be HighVegetation from the Terrain.txt file to the Object Text file
The Terrain.TXT file types can be found in the most of the main campaign folders. Here's an example of a part of the Terrain.txt file with options that can be adjusted. I believe you can create your own, when you get the hang of it - haven't done it my self yet.
// if covervalue0 is greater than 40 it means you cannot inflitrate. Roads & tracks should be less than 40.[LightFortifications]
INFANTRY 4
TRACKED 100
HALFTRACK 100
ARTILLERY 4
WHEELED 100
BOAT 100
AMPHIBIOUS 100
COVERFLAGS 1 // can infantry hide in this terrain
COVERVALUE0 25 // % damage inflicted if target is stationary
COVERVALUE1 40 // % damage inflicted if target is moving
COVERVALUE2 50 // % chance of getting bogged down when starting turn in this terrain * % chance of bogging so this /5 /10 is about the right amount.
COVERVALUE3 1 // is this a fortification?
Cheers
Richcat
Richcat

