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

Yeah, it seems impossible. Just switch factions and hide them behind offsite buildings you spawn for prereqs.

Information and discussion for custom maps and mods.
Post Reply
xX_Pokeman2003_Xx
Posts: 6
Joined: Sun Mar 20, 2022 11:25 pm

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

Post 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.
Last edited by xX_Pokeman2003_Xx on Wed Mar 23, 2022 4:29 pm, edited 1 time in total.

User avatar
Punsho
Posts: 113
Joined: Wed Jul 18, 2018 2:56 pm
Location: Lithuania

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

Post by Punsho »

You could use an invisible actor as a prerequisite for E2 and E3, then spawn it in lua whenever you please

xX_Pokeman2003_Xx
Posts: 6
Joined: Sun Mar 20, 2022 11:25 pm

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

Post by xX_Pokeman2003_Xx »

Is this really the only way? Oh well... I guess I could do that.

Pinkthoth
Posts: 13
Joined: Mon Apr 13, 2020 4:54 pm

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

Post 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.

Post Reply