User Tools

Site Tools


crpl:docs:settechlimit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
crpl:docs:settechlimit [2015/03/10 21:08] – added names warrencrpl:docs:settechlimit [2021/02/05 11:44] (current) – Rmoved discussion tag Karsten75
Line 1: Line 1:
-~~DISCUSSION~~+
 <- [[crpl:crplreference|CRPL reference]] <- [[crpl:crplreference#utility_commands|Utility Commands]] <- [[crpl:crplreference|CRPL reference]] <- [[crpl:crplreference#utility_commands|Utility Commands]]
 =====  SetTechLimit  ===== =====  SetTechLimit  =====
Line 25: Line 25:
 === Examples === === Examples ===
 <code>SetTechLimit("MOVESPEED" 3)</code> <code>SetTechLimit("MOVESPEED" 3)</code>
 +
 +This example creates a chargeable pickup that increases the fire range tech limit when collected.
 +<code>
 +#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
 +</code>
  
crpl/docs/settechlimit.1426036130.txt.gz · Last modified: 2015/03/10 21:08 by warren