Hi
Could someone help me with that script? It is my 2nd script and i dunno what's wrong :/
once Self CONST_REQUESTPACKETS SetUnitAttribute endonce
once Self CONST_ISBUILDING SetUnitAttribute endonce
once Self CONST_BUILDCOST 20 SetUnitAttribute endonce
if "CONST_BUILDCOST" eq0
SetTechLimit("FIRERANGE" 5)
endif
I can connect crpl core to CN but it don't recive packets.
Try this.
once
Self CONST_CONNECTABLE true SetUnitAttribute
Self CONST_REQUESTPACKETS true SetUnitAttribute
Self CONST_ISBUILDING true SetUnitAttribute
Self CONST_BUILDCOST 20 SetUnitAttribute
endonce
Self CONST_BUILDCOST GetUnitAttribute eq0 if
SetTechLimit("FIRERANGE" 5)
endif
edit: whoops, I'm losing my touch :/
If that doesn't work try changing the second CONST_BUILDCOST to CONST_ISBUILDING.
First off, you only need one once block to set the attributes. Second, you give no value to the REQUESTPACKETS and ISBUILDING constants. For those constants, 1 is true and 0 is false.
Your if statement doesn't work because the BUILDCOST constant will never equal 0. Try checking against the ISBUILDING constant instead.
Try this:
once
Self CONST_REQUESTPACKETS 1 SetUnitAttribute
Self CONST_ISBUILDING 1 SetUnitAttribute
Self CONST_BUILDCOST 20 SetUnitAttribute
endonce
Self CONST_ISBUILDING ->test
if <-test eq0
SetTechLimit("FIRERANGE" 5)
endif
Quote from: Crimson King on June 30, 2014, 02:11:06 PM
Self CONST_ISBUILDING ->test
if <-test eq0
SetTechLimit("FIRERANGE" 5)
endif
it should be
<-test eq0 if
OR
if(<-test eq0)
Also you're missing a GetUnitAttribute.
Oops about missing the GetUnitAttribute. The syntax is wonky in my code because I used the code provided by the OP and only made the necessary changes to get it to work.
Thx for help guys! You are the best!