User Tools

Site Tools


crpl:docs:settechlimit

<- CRPL reference <- Utility Commands

SetTechLimit

ArgumentsResultNotation
Tech, Amount s1 i1 –

Description

Sets the research limit for the selected tech. -1 means unlimited

Tech names

Names are not case sensitive.

  • ENERGYSTORAGE
  • ACSTORAGE
  • PACKETSPEED
  • ENERGYEFFICIENCY
  • OREEFFICIENCY
  • BUILDSPEED
  • MOVESPEED
  • FIRERATE
  • FIRERANGE

Examples

SetTechLimit("MOVESPEED" 3)

This example creates a chargeable pickup that increases the fire range tech limit when collected.

#test ammo against maxammo
Self CONST_MAXAMMO GetUnitAttribute
    Self CONST_AMMO GetUnitAttribute eq if
  Self CONST_AMMO 0 SetUnitAttribute
  #ascend to orbit then destroy
  "Misc17" PlaySound
  AscendToOrbit
endif

:destroyed
  #increase the tech limit by one when destroyed
  "FIRERANGE" dup GetTechLimit 1 add SetTechLimit

:awake
  #these are all necessary core attributes for this kind of collectible.
  Self CONST_CONNECTABLE TRUE SetUnitAttribute
  Self CONST_REQUESTPACKETS TRUE SetUnitAttribute
  Self CONST_CANREQUESTAMMO TRUE SetUnitAttribute
  Self CONST_MAXAMMO 25 SetUnitAttribute
crpl/docs/settechlimit.txt · Last modified: 2021/02/05 11:44 by Karsten75