Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: GoodMorning on January 07, 2017, 03:35:00 AM

Title: Awarding upgrade unlocks for progress
Post by: GoodMorning on January 07, 2017, 03:35:00 AM
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