Flag for ugrading buildings?

Everything about mods can be found here.

Moderator: Morax

Flag for ugrading buildings?

Postby Hascins » 09 Feb 2016, 17:53

Is an upgrading factory a descrete unit itself or is it just a fac with a "upgrade unit" building?
Does a factory that is in transition to t2/t3 have a kind of flag that can be triggered for a mod?
User avatar
Hascins
Contributor
 
Posts: 400
Joined: 28 Dec 2012, 23:07
Has liked: 66 times
Been liked: 24 times
FAF User Name: Hascins

Re: Flag for ugrading buildings?

Postby Sprouto » 09 Feb 2016, 19:01

When a factory is upgrading a couple of things happen;

- a new factory unit (the upgraded factory) is created at the same position as the existing factory
- the existing factory enters the 'upgrading' state which can be queried by the code - see function IsUnitState
Sprouto
Priest
 
Posts: 366
Joined: 08 Sep 2012, 05:40
Has liked: 54 times
Been liked: 74 times
FAF User Name: Sprouto

Re: Flag for ugrading buildings?

Postby Hascins » 10 Feb 2016, 12:36

Hey thx Sprouto!

So it should be possible to implement a line in an UI-Mod that would do something like:

If enemy building "unitstate"=upgrading then create "ping"

??
User avatar
Hascins
Contributor
 
Posts: 400
Joined: 28 Dec 2012, 23:07
Has liked: 66 times
Been liked: 24 times
FAF User Name: Hascins

Re: Flag for ugrading buildings?

Postby nine2 » 10 Feb 2016, 13:00

You can't get a list of enemy buildings in a ui mod. What you are trying to do is impossible, and should be impossible, otherwise it would enable cheating.

For example you could display a count of enemy tank numbers
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Flag for ugrading buildings?

Postby Hascins » 10 Feb 2016, 13:07

Makes sense....how about radar signatures? When they change colour...is this triggerable?
User avatar
Hascins
Contributor
 
Posts: 400
Joined: 28 Dec 2012, 23:07
Has liked: 66 times
Been liked: 24 times
FAF User Name: Hascins

Re: Flag for ugrading buildings?

Postby nine2 » 10 Feb 2016, 13:09

UnitState is only available in a sim mod, so it won't help you anyway.

The only way I have found in a UI Mod is to see if a unit is upgrading is this hack:
local focus = unit:GetFocus()
local isUpgrading = unit:IsInCategory("STRUCTURE") and focus:IsInCategory("STRUCTURE")

That doesn't work for ACU upgrades, which are really "enhancements", which require other tricks, which you can see in the Notify mod.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Flag for ugrading buildings?

Postby nine2 » 10 Feb 2016, 13:10

Re radar, I don't know but I think that stuff is all rendered in between SIM and UI by the actual c++ engine and you can't get to it. Maybe you could probably hack it in the sim side.
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Flag for ugrading buildings?

Postby nine2 » 10 Feb 2016, 13:10

Are you trying to cheat or what?
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Flag for ugrading buildings?

Postby nine2 » 10 Feb 2016, 13:22

What I mean is this: The whole UI layer is built around exposing data in a very specific way so that a ui-mod cannot get data that it shouldn't have - that a ui modder cannot introduce a cheat. That is a reason why the UI layer is restricted to only a few things from the sim layer. The questions you are asking (probably without realizing it) are basically how to get around the security to prevent cheaters. I'm guessing you didn't know that ... since it's unlikely you would ask how to cheat on a forum deliberately :)
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Flag for ugrading buildings?

Postby Hascins » 10 Feb 2016, 13:27

Of course i don't want to cheat. I'd like to find a way to make upgrading buildings more visible...cuz i often miss them.
User avatar
Hascins
Contributor
 
Posts: 400
Joined: 28 Dec 2012, 23:07
Has liked: 66 times
Been liked: 24 times
FAF User Name: Hascins

Next

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest