Page 1 of 1

[LUA][Rulesets] Tile reval signal

Posted: Wed Nov 08, 2017 6:39 pm
by Lachu
I know, that making good Civilization scenario is hard and adding signals invoked once player reveal some tile/city/hero on map doesn't change this, but maybe this little change could be useful?
"Sir, We've discovered barbarian camp! Raze it!" ;-)

Re: [LUA][Rulesets] Tile reval signal

Posted: Mon Nov 13, 2017 11:07 am
by dunnoob
There is a unit_moved signal, and I never tested or used it so far. Allegedly a handler gets arguments (Unit unit, Tile src_tile, Tile dst_tile), and if that happens after the move all adjacent tiles for the destination including huts, enemies, etc. should be visible.

Out of curiosity I just tried to find it in the code, it's in server/unittools.c near line 3935 deep in function unit_move(). Near the end, vision already updated, after is applicable. IOW, what you want should be possible in Lua, it's just a special case of "unit_moved".

Edit: comment added on the Wiki.