Page 1 of 1

Is there a trigger that locks a tech or unit? ANSWERED

Posted: Fri Apr 23, 2021 6:45 am
by Badnorth
Like the topic title, is there a trigger that locks a tech or unit?
Or disables them, removing them from production or research.

Re: Is there a trigger that locks a tech or unit?

Posted: Fri Apr 23, 2021 7:13 am
by Hyuhjhih
Cond: Any ; eff: remove Objtype from buildables for PlayerN

Re: Is there a trigger that locks a tech or unit?

Posted: Fri Apr 23, 2021 7:22 am
by Badnorth
That one? I see. Thanks!

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 5:00 am
by Badnorth
@Hyuhjhih Can you test the Remove Obj type from buildables of player nr?
It doesn't seem to work for me. Well, it works but when i use it all of my buildables goes null.

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 5:02 am
by Hyuhjhih
Did you used eff: clear all buildables ?

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 5:30 am
by Badnorth
I didn't.

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 5:57 am
by Hyuhjhih
I just checked. Wierd, the cond: remove objtype to buildables for PlayerN is acting like clear all buildables for PlayerN and is overriding add all default buildables for PlayerN. while add obj type to buildables is working fine.

A recent bug? @Endru1241

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 6:05 am
by Hyuhjhih
@Badnorth
A temp solution is
Cond: any
Eff: add all default buildables to PlayerN
Eff: remove objtype from buildables to PlayerN.

In the same order.

GLHF

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 6:40 am
by Badnorth
Hyuhjhih wrote: Sat Apr 24, 2021 6:05 am @Badnorth
A temp solution is
Cond: any
Eff: add all default buildables to PlayerN
Eff: remove objtype from buildables to PlayerN.

In the same order.

GLHF
Thanks :)

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 6:09 pm
by Endru1241
I noticed it few days ago, but I thought it was only in old tmx maps.

Nothing in assets affects trigger definition, so only stratego could check it in the code.

Edit: no reason to mention him - I asked through e-mail.

Re: Is there a trigger that locks a tech or unit? ANSWERED

Posted: Sat Apr 24, 2021 9:14 pm
by Endru1241
I got an explanation and I'll change help file to better fit how it really works.
This:
Hyuhjhih wrote: Sat Apr 24, 2021 6:05 am Cond: any
Eff: add all default buildables to PlayerN
Eff: remove objtype from buildables to PlayerN.

In the same order.

GLHF
Is not a temporary solution - it's how it really works.
Each map has list of permitted units parameter.
Normally it's null (list doesn't exist) and engine uses all (default) in that case.

If you try to remove objtype from null - it creates a list (to prevent nullException I assume) and tries to remove id of this unit - so empty list is left, ergo nothing to build/train.
Btw. Adding shouldn't work normally - it clears the list too, so only added units are buildable.