Awarding upgrade unlocks for progress

Started by GoodMorning, January 07, 2017, 03:35:00 AM

Previous topic - Next topic

GoodMorning

Hello all,

Hereunder, there is a script to award a tech when a certain object is destroyed. Useful for allowing (say) additional mine production only after a certain milestone.


# --GiveTechOnDestroy-- 1/4/2017 4:43:12 PM
$DependsOnUnit:-1 #Set me to the UID of what must be destroyed
$Tech:0 #Tech number. 0 is the mine production tech.

once
<-DependsOnUnit -1 eq if
Self ->DependsOnUnit
endif
endonce

<-DependsOnUnit.UnitIsDestroyed if
Self 0 DestroyUnit
endif

:destroyed
<-Tech 1 SetTechAvailability
A narrative is a lightly-marked path to another reality.