Extra vision for units in Watchtowers?
Moderators: Slitherine Core, BA Moderators
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Extra vision for units in Watchtowers?
Guys,
Is there any code out there that extends LOS, say by +2 squares, for a unit that has climbed into something tall... say a Watchtower, or a tall building?
Thanks!
GL88
Is there any code out there that extends LOS, say by +2 squares, for a unit that has climbed into something tall... say a Watchtower, or a tall building?
Thanks!
GL88
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
-
jcb989
- Colonel - Fallschirmjäger

- Posts: 1423
- Joined: Fri Nov 05, 2010 12:02 am
- Location: Bradenton, Florida
Re: Extra vision for units in Watchtowers?
clever idea.
-
pipfromslitherine
- Site Admin

- Posts: 9883
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Extra vision for units in Watchtowers?
You would need to change (and keep updated) their LOS in the post start turn function I think (as well as changing it obviously when they climb in to, out of the tower).
Cheers
Pip
Cheers
Pip
follow me on Twitter here
Re: Extra vision for units in Watchtowers?
Probably all can be modded, but a step ahead in the core of BA would be that "objects" give several abilities to the unit in.
- A Watchtowers gives extra LOS
- A Bunker, sand bags, already gives protection but, units inside can only fire in one direction or 180 degrees in front.
- maybe units in hills have more LOS also
- etc.
- A Watchtowers gives extra LOS
- A Bunker, sand bags, already gives protection but, units inside can only fire in one direction or 180 degrees in front.
- maybe units in hills have more LOS also
- etc.
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Extra vision for units in Watchtowers?
Thanks Jcb, Pip & Enric,
So it's sounds like it's possible. If I understand correctly:
1. The best place to put this code is in the Post Start Turn function
2. I'd have to run through each of the units on the board and make a quick check of 'is this unit in a watchtower?' (for example)
3. If it is in a watchtower add +2 to the LOS from squads.csv (presumably there's an active LOS variable that is read directly from squads.csv?)
4. Redraw the screen with that new LOS
Questions:
5. Is there a variable that tells me what objects are in the same square as a specific unit?
6. Is there a variable that tells me the height (based on hill heights) of a specific unit? (Great idea Enric! At the moment, variable height hills look pretty, eg. Seelow Heights, but they don't change much vision for either side. It would be cool to advantage/handicap LOS based on unit height)
Thanks guys!
So it's sounds like it's possible. If I understand correctly:
1. The best place to put this code is in the Post Start Turn function
2. I'd have to run through each of the units on the board and make a quick check of 'is this unit in a watchtower?' (for example)
3. If it is in a watchtower add +2 to the LOS from squads.csv (presumably there's an active LOS variable that is read directly from squads.csv?)
4. Redraw the screen with that new LOS
Questions:
5. Is there a variable that tells me what objects are in the same square as a specific unit?
6. Is there a variable that tells me the height (based on hill heights) of a specific unit? (Great idea Enric! At the moment, variable height hills look pretty, eg. Seelow Heights, but they don't change much vision for either side. It would be cool to advantage/handicap LOS based on unit height)
Thanks guys!
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: Extra vision for units in Watchtowers?
How about if infantry unit that enters Tower building triggers the normal scout command, or even elite scout command?
Cheers
Richcat
Richcat
-
jcb989
- Colonel - Fallschirmjäger

- Posts: 1423
- Joined: Fri Nov 05, 2010 12:02 am
- Location: Bradenton, Florida
Re: Extra vision for units in Watchtowers?
Does not this mean there is a script somewhere that is modifying unit stats based on what hex content they are in...?enric wrote: - A Bunker, sand bags, already gives protection but, units inside can only fire in one direction or 180 degrees in front.
It seems that would be the place to add the "tell me if I'm in a watch tower" code...
I probably misunderstand Pip's suggestion.
Re: Extra vision for units in Watchtowers?
Probably the start point is the mine objects, they explode when a unit enter the tile, so a similar function may give some additional attribute the unit is in.
In Road to Wiltz (BA1), in OBJECTS.BSF there is a function that may help: FUNCTION enterMine(objectid, tilex, tiley, objectx, objecty, check, user, unit)
In BA2 I did not yet looked in the core, maybe there is something better.
In Road to Wiltz (BA1), in OBJECTS.BSF there is a function that may help: FUNCTION enterMine(objectid, tilex, tiley, objectx, objecty, check, user, unit)
In BA2 I did not yet looked in the core, maybe there is something better.
-
pipfromslitherine
- Site Admin

- Posts: 9883
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Extra vision for units in Watchtowers?
The protection from a given terrain type (such as sand bags) just comes from the cover value for the terrain. The watchtower code would best be probably need to be something that looked at every unit each tick and checked if the tile they were on had a watchtower in it.
Cheers
Pip
Cheers
Pip
follow me on Twitter here
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Extra vision for units in Watchtowers?
Thanks Pip, that makes sense to me.pipfromslitherine wrote:The protection from a given terrain type (such as sand bags) just comes from the cover value for the terrain. The watchtower code would best be probably need to be something that looked at every unit each tick and checked if the tile they were on had a watchtower in it.
Cheers
Pip
But what's the correct variable to check whether the unit is in a tile that also has a watchtower object?
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: 9883
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Extra vision for units in Watchtowers?
Check out GetObjectFromName and GetTileObject in the autodocs. They should do the job.
Cheers
Pip
Cheers
Pip
follow me on Twitter here
-
GottaLove88s
- Lieutenant-General - Do 217E

- Posts: 3151
- Joined: Fri Apr 06, 2012 6:18 pm
- Location: Palau
Re: Extra vision for units in Watchtowers?
Thanks 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

