Knuckle Cracker

Particle Fleet => Map Makers, Ship Builders, and Coders => Topic started by: Nicant on December 16, 2016, 07:14:58 PM

Title: Quick Question -- (How do you use constants in PRPL?)
Post by: Nicant on December 16, 2016, 07:14:58 PM
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.
Title: Re: Quick Question -- (How do you use constants in PRPL?)
Post by: 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.)
Title: Re: Quick Question -- (How do you use constants in PRPL?)
Post by: Nicant on December 16, 2016, 07:36:24 PM
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! :)
Title: Re: Quick Question -- (How do you use constants in PRPL?)
Post by: GoodMorning on December 16, 2016, 08:26:28 PM
(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.)