Quick Question -- (How do you use constants in PRPL?)

Started by Nicant, December 16, 2016, 07:14:58 PM

Previous topic - Next topic

Nicant

I am familiar with the constants in CRPL, but how do i use them with PRPL? I tried using the Command SetUnitAttribute, but apparently it does not exist. So because of that, i come here to get an answer. So, how do i use it? I am using the constant, Const_IsEnemy BTW. If anyone knows this quick question then my first custom module will be complete! (Hopefully :P )

Edit: Anyone can just leave an example, i will just use the example as a future reference.
CW4 hype!!

planetfall

It's now just SetAttribute, but in most cases it isn't the best. Instead, use <-uid GetUnitIsEnemy or <-uid <-something SetUnitIsEnemy (there are now variations for all constants.) Or you can do <-uid.UnitIsEnemy and ->uid.UnitIsEnemy (again, equivalents exist for all constants.)
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Nicant

Quote from: planetfall on December 16, 2016, 07:25:17 PM
It's now just SetAttribute, but in most cases it isn't the best. Instead, use <-uid GetUnitIsEnemy or <-uid <-something SetUnitIsEnemy (there are now variations for all constants.) Or you can do <-uid.UnitIsEnemy and ->uid.UnitIsEnemy (again, equivalents exist for all constants.)

Ok, thank you for the clarification! :)
CW4 hype!!

GoodMorning

(Short note: There are some small, little-used areas where the .Attr, SetAttr and CONST_ATTR do not all exist, but this will hopefully change soon. I won't list those I have found in the hope that they will be fixed before anyone else misses them.)
A narrative is a lightly-marked path to another reality.