Jump to content

Making a Class only show in the GTS and not randomly.


shadowuk

Recommended Posts

 

Ok i opened the mod that DOES have the class only in the GTS and i opened my class UIchooseclass.uc and there is no difference.

 

Which mod are you referring to? Unless they've overridden UIChooseClass (which you'd probably have to do), they would be playing by the same rules as everyone else, where a positive numInForcedDeck is the only way for the class to be GTS trainable.

 

i got no idea how to do that you got a tutorial link?

Link to comment
Share on other sites

the mod Officer class, the guy says he has it working so that it only comes up in the GTS. i looked at his UIchooseClass.uc and there is no difference in the default one.

 

Look for a class which inherits from UIScreenListener. Most likely stuff will get done there.

Link to comment
Share on other sites

For what its worth, in testing the Specialist as a by-training only class, I had changed the Specialist from NumInForcedDeck=1 & NumInDeck=4 to =0, = 0

It DID still promote a specialist - on the first ( scripted ) mission ( which I believe to be part of the post-mission script ) - but none so far since, as expected. And to confirm, the Specialist is no longer, in this test mod, trainable from the GTS ( ie, GTS only trains positive NumIn(Forced)Deck classes).

Link to comment
Share on other sites

Just an idea, but if you want your mod to be less intrusive, you might get away without overriding UIChooseClass. You could register a screenlistener on it and add your Dude to m_arrClasses[] manually.

Yes, this idea of screen listeners appears to be the magic trick of xcom2 modding, at least so far. Often we can't affect the actual lists of objects or techs or soldier classes. So, whenever a picklist is about to be displayed, we hijack the screen and add just one more button. This approach works, and there doesn't seem to be any alternative, but I don't like it much. I'd rather affect lists persistently, instead of intercepting displays of one screen or another. Maybe we will learn more as we go along.

 

 

 

Getting 1 soldier of each vanilla class during Operation Gatecrasher is not scripted, as I've gotten squads entirely composed of mod-added classes

I bet that for gatecrasher, there is something scripted that ignores the deck, and ensures each promotion is to a different class. Anybody ever gotten two of the same class after the first mission? I haven't checked the code yet.

Edited by davidlallen
Link to comment
Share on other sites

 

Yes, this idea of screen listeners appears to be the magic trick of xcom2 modding, at least so far. [...] This approach works, and there doesn't seem to be any alternative, but I don't like it much. I'd rather affect lists persistently, instead of intercepting displays of one screen or another. Maybe we will learn more as we go along.

 

 

Yeah, I dont like it much either.

 

To modify templates, I managed to do so without a listener, during app start. But that will not help to modify UIs since they are not generated by templates. :(

Link to comment
Share on other sites

 

 

To modify templates, I managed to do so without a listener, during app start.

That sounds important. Most mods I have disassembled appear to add new projects or techs via a listener as I mentioned, that fires the first time the screen appears, and then remembers that it fired. For the method you mentioned, have you published a mod with that yet so we can see? If not can you post some code (maybe in a new thread)?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...