Skills on Map Tiles?

Hello all, I have a very idea man-y question today: is it possible to have certain tiles on maps temporarily give skills? For example, while standing on a Fort, a unit would get Vantage, but once they leave that fort, they lose that Vantage. Kind of like skills on weapons / items, where the skill is tied to an object, but affects the unit using it (or in this case, standing on it). My coding experience is… limited to say the least, so any sort of ideas on if this is even possible or just help in general would be greatly appreciated.

I can think of ways to do it but you would need to edit the skills’ ASM code for such (for example, one quick and dirty way would be to have the skill code check for terrain type ala skills like Forager instead of checking if the unit actually has the skill).

Editing the skill code is the safer way to do it, but if you want some :spaghetti:, you could silently give a skill and remove it again:

<- insert check matching terrain addevent here -> 
EventReader(0x203E894 + (0x10 * (unitID - 1)) + 1) 
SADD s9 s2 s0 // copy 1st learned skill to mem slot s9
SVAL s2 0x203E894 + (0x10 * (unitID - 1)) + 1
SVAL s1 SkillID 
SVAL s3 1 // byte size is 1? 
EventWriter (-1) // overwrite unitID's 1st learned skill 

you could do something like this as a “when unit has decided/moved to” event (and maybe even restore it after battle with a range event)

I think a spaghetti wizard could probably make something like this work.

Wait, so does that mean the skills would be on the units, and we just adjust the conditions to activate them based on map tiles? Or the skills exist somewhere in the coding ether, and activate with the map tiles? I’m a bit confused, sorry (well, more than usual).

The latter.