Resource icon

Old Fortified Alert ---Newer one available 2016-11-13

gyogen2

Emperor
Joined
May 8, 2014
Messages
1,201

Attachments

  • ForifiedAlert.zip
    10.9 KB · Views: 85
Last edited:
Thanks for uploading this, I will have to try it out after i get done with my Gotm save.
 
Thanks, will give this a spin today.
 
This looks promising.

From the code it looks like you are trying to check two rings around a unit for other player units, and issue a wake command to the unit if you find one (at least in method OnLocalPlayerTurnBegin), but i think there are some bugs here.
1. You don't seem to be using the fortified unit's "sight" value. Some units see farther than others. Scouts vs Warriors for example, or scouts that have a +1 sight promotion.
2. I think, there are some errors in the code as you are walking around the ring. When you get to the 6 adjacent plot, the one that is NW from the original location, you go south east, to a plot you already checked. It is hard to tell from your code. Also on the 9th plot you move West when I think you need to move South West a 2nd time and then move west twice.

Maybe I am misunderstanding your code ?
 
Yeah, I was just testing this. First I tried using a formula that had worked in civ v to get the radius, but that didn't work here. I also attempted to do it based on when a unit moved, but w/o the mod tools, the method I had to use would cause lag once there were a lot of units.
It actually should check three rings, the first ring was easy just using the directions and adjacent plot (the for statement), the other two I did the long way just to get it done to see if the idea worked.

I had done the code a different way that worked much better as a game script, but that is mostly useless right now. I plan to redo once tools come out.
 
Thank you soooooooooo much for this. Every time I fortify I think to myself, oh I wish the 'A' button was still 'Sentry' mode. :deadhorse:
 
Top Bottom