Page 1 of 1

Is there a way to modify traits with Lua? [Impossible]

Posted: Mon Mar 21, 2022 11:30 pm
by xX_Pokeman2003_Xx
I couldn't find a way in the documentation, but there ARE 107 mentions of "trait" in the document alone so maybe I just missed it.
Basically, I'd like to prevent the construction of grenadiers and rocket infantry until later, and the player isn't allowed to construct a base, so they can't unlock it by themselves. I'd rather have the option invisible until a certain time period, so I've disabled E2 and E3 for now.
On a similar note that I'm not sure belongs here, I also want Nod to only open fire on civilians in their final wave.

Re: Is there a way to modify traits with Lua?

Posted: Tue Mar 22, 2022 6:05 am
by Punsho
You could use an invisible actor as a prerequisite for E2 and E3, then spawn it in lua whenever you please

Re: Is there a way to modify traits with Lua?

Posted: Wed Mar 23, 2022 4:15 pm
by xX_Pokeman2003_Xx
Is this really the only way? Oh well... I guess I could do that.

Re: Is there a way to modify traits with Lua? [Impossible]

Posted: Tue Apr 12, 2022 4:04 am
by Pinkthoth
If it's purely time based, you could have an untargetable invisible actor off map that slowly trickles down in health, and when it dies, it removes the prerequisite. I think you can require negations of prerequisites. If not, just make that first invisible actor spawn an actor upon death that provides the desired prerequisite.