In ota, I used detect scripts that would tell a script whether or not a certain unit was built or not. With this, I made an upgrade system where you build an upgrade, the lab loads this unit, and units built check to see if the upgrade has been built, and either upgrade or don't upgrade based on this. First off, i'm not sure if this detect system is supported by spring (it was fairly new in TA, and required Xon Dlls to work properly), or if there is simply an easier way by using lua. If it is, I need to basically learn how to use this effectively.
Additionally, I am wondering if by using lua I can customize build menus ingame. I think every way a workaround could be used, since lua apparently can take a unit and then make it into a different unit, the second unit having a different build menu. However, this would be a huge pain for factories with more than one upgrade, since a multitude of units would have to be created for the different combinations of researched upgrades. Anyway, the main use of this would allow me to use enhanced build pics when a unit is upgraded, or allow for new units to be built under certain circumstances, as well as making sure that some silly gamers do not research the same upgrade twice

I'm also wondering how lua can 'upgrade' a unit. Does this upgrading require that I make an entirely different unit that has different stats, including a new script, unit.fbi file... , or does upgrading work so that it can be the same unit, but there is i.e. MaxDamage2=XXXX;. The latter would be much easier, but could lead to some confusing fbi files for units that change dramatically (perhaps both ways can be used?).
Lastly, I am wondering if there is somewhere i can take lua codes from and use as examples, because I don't exactly know where to start with lua.
Thanks!