So, I'm currently working on a game with some novel features, including "terrain based warfare" - modifiying the terrain to fit the features of your current army. Anyway, normally the area beyond your range of vision is darkened (can't see units) but you can still see the terrain. This means that certain events can be seen through the fog of war, such as rock mining (you can see the minerals disapear off the map) and terrain modification (i think). Also, I'm trying to make the map procedurally generated (like HexFarm).
Anyway, I wanted the area beyond units' vision to be completely black (can't see anything, not even the shape of the terrain). Is there a way to do this?
Can I make the area beyond unit's vision completely black?
Moderator: Moderators
Re: Can I make the area beyond unit's vision completely blac
afaik, there is no way to do this properly atm.
You may want to check this widget that does something similar, but it's not reliable, and it's slow.
You are supposed to place this widget in LuaUI/widgets, but note it can also be easily disabled.
You may want to check this widget that does something similar, but it's not reliable, and it's slow.
You are supposed to place this widget in LuaUI/widgets, but note it can also be easily disabled.
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Can I make the area beyond unit's vision completely blac
You'll have to find more examples to convince us that you need this feature.
The terrain is only updated when inside LOS.
Wrecks can be made only visible in LOS. Also I wrote a global LOS mineral system for knorke's game which has a good UI and does not give information away.
The terrain is only updated when inside LOS.
Wrecks can be made only visible in LOS. Also I wrote a global LOS mineral system for knorke's game which has a good UI and does not give information away.
Re: Can I make the area beyond unit's vision completely blac
that sounds like what I need! Where does the code for this live? on SVN somewhere?Google_Frog wrote: Also I wrote a global LOS mineral system for knorke's game which has a good UI and does not give information away.
Re: Can I make the area beyond unit's vision completely blac
for features:
http://springrts.com/wiki/Modrules.lua#featureLOS
googles code is in here:
http://pastebin.com/dtfsDFz7
It works by spawning multiple units and setting visibilty for teams accordingly.
Because script.HitByWeapon is called before UnitPreDamaged, there was problem that minerals would lose pieces (script thinks it is hit) but gadget said "no, you are not hit" but too late: pieces were already lost.
Kind of fuddled around that now but maybe something to watch out for.
If you want the units to move, you will have to add some SetUnitPosition stuff.
Or just make the rocks not be always visible?
Could also draw something like "ghosted building" widget does
In XTA see unit_ghostSite.lua and unit_ghostRadar.lua
http://springrts.com/wiki/Modrules.lua#featureLOS
googles code is in here:
http://pastebin.com/dtfsDFz7
It works by spawning multiple units and setting visibilty for teams accordingly.
Because script.HitByWeapon is called before UnitPreDamaged, there was problem that minerals would lose pieces (script thinks it is hit) but gadget said "no, you are not hit" but too late: pieces were already lost.
Kind of fuddled around that now but maybe something to watch out for.
If you want the units to move, you will have to add some SetUnitPosition stuff.
Or just make the rocks not be always visible?
Could also draw something like "ghosted building" widget does
In XTA see unit_ghostSite.lua and unit_ghostRadar.lua