Page 1 of 1
Extra vision for units in Watchtowers?
Posted: Thu Jan 08, 2015 11:23 am
by GottaLove88s
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
Re: Extra vision for units in Watchtowers?
Posted: Sun Jan 11, 2015 1:19 am
by jcb989
clever idea.
Re: Extra vision for units in Watchtowers?
Posted: Mon Jan 12, 2015 4:24 pm
by pipfromslitherine
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
Re: Extra vision for units in Watchtowers?
Posted: Tue Jan 13, 2015 7:36 am
by enric
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.
Re: Extra vision for units in Watchtowers?
Posted: Tue Jan 13, 2015 4:16 pm
by GottaLove88s
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!
Re: Extra vision for units in Watchtowers?
Posted: Tue Jan 13, 2015 4:26 pm
by Richcat
How about if infantry unit that enters Tower building triggers the normal scout command, or even elite scout command?
Re: Extra vision for units in Watchtowers?
Posted: Wed Jan 14, 2015 1:14 am
by jcb989
enric wrote:
- A Bunker, sand bags, already gives protection but, units inside can only fire in one direction or 180 degrees in front.
Does not this mean there is a script somewhere that is modifying unit stats based on what hex content they are in...?
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?
Posted: Wed Jan 14, 2015 7:10 am
by enric
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.
Re: Extra vision for units in Watchtowers?
Posted: Wed Jan 14, 2015 4:16 pm
by pipfromslitherine
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
Re: Extra vision for units in Watchtowers?
Posted: Wed Jan 14, 2015 7:44 pm
by GottaLove88s
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
Thanks Pip, that makes sense to me.
But what's the correct variable to check whether the unit is in a tile that also has a watchtower object?
Re: Extra vision for units in Watchtowers?
Posted: Wed Jan 14, 2015 8:05 pm
by pipfromslitherine
Check out GetObjectFromName and GetTileObject in the autodocs. They should do the job.
Cheers
Pip
Re: Extra vision for units in Watchtowers?
Posted: Thu Jan 15, 2015 9:38 pm
by GottaLove88s
Thanks Pip!