
Posts
86
Respect
34Add +1
Forum Rank
Rotting Walker
Primary Group
Community Mapper
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
andrew = GetEnt("andrew","targetname");In the above example, I made a variable andrew (with some ent in radiant stored in it), and then gave it the property of "gender", which I defined as "male".
andrew.gender = "male";
andrew.clip = GetEnt("andrew_clip","targetname");We can do all the same things we can do with variables with properties. For example using in functions:
andrew.clip Delete();It's important to note if this code was executed, the entity in radiant with targetname: "andrew_clip" would be deleted, not the entity with targetname: "andrew", because the property is being sent to the Delete() function, not the actual andrew variable.
if(isdefined(andrew.gender) && andrew.gender == "male")Really the sky is limit. You can even make properties of properties:
{
IPrintLnBold("By golly, you're a man!");
}
andrew = GetEnt("andrew","targetname");It should be noted that passing a variable that has properties on it will retain all properties on it in the function it is being passed to.
andrew.clothing = "on";
andrew.clothing.top = "t_shirt";
andrew.clothing.top.color = "red";
andrew = GetEnt("andrew","targetname");
andrew.clothing = "on";
andrew.clothing.top = "t_shirt";
andrew.clothing.top.color = "red";
andrew thread clothing_appraisal();
}
function clothing_appraisal()
{
if(isdefined(self.clothing) && self.clothing == "on")
{
if(isdefined(self.clothing.top) && self.clothing.top == "t_shirt")
{
if(isdefined(self.clothing.top.color) && self.clothing.top.color == "red")
{
IPrintLnBold("I think red looks rather nice on you");
}
}
}
}