Andrettin / Wyrmsun

Strategy game based on history, mythology and fiction
http://andrettin.github.io/
GNU General Public License v2.0
301 stars 47 forks source link

Hello, a question about building control groups #126

Closed Erenussocrates closed 7 years ago

Erenussocrates commented 7 years ago

Hello, this isn't about Wyrmsun but this is about another game made with stratagus engine. I'm asking here because I heard that you are a very knowledgable person in the matter and there were nowhere else that I could receive help :(

It's about wargus. It's also bugging my friends who play wargus as well. You know you can assign units and buildings to control groups by control + number. But for some reason in wargus, the buildings don't get selected when you press the number, you have to press alt + number in order to select the buildings, and pressing the number only makes you select the most recently trained units from the said building. Do you know what I must do / which file I must edit to swap this control and make it so that building is chosen with just pressing the number, and recently trained units chosen with alt + number? Please help me about this. Btw, I would much appreciate it if you could give me your contact email sir, I'm modding wargus and I might need some more help :(

Andrettin commented 7 years ago

This isn't really the right place to ask about Wargus stuff =/

Control groups don't work very well with buildings in mainline Stratagus (this has been changed in Wyrmgus). You could try adding "SelectableByRectangle = true" to the buildings, maybe that will work better. For help with modding Wargus, it would be better to ask the Wargus team; DinkyDyeAussie still seems to be active: https://github.com/DinkyDyeAussie

Erenussocrates commented 7 years ago

But how did you change it in wyrmgus? Please tell me how to do so

Andrettin commented 7 years ago

If I remember correctly, you need to add "SelectableByRectangle = true" to the building unit type definitions, and then comment out the following code in action_train.cpp:

        if (!unit.Player->AiEnabled && unit.GroupId) {
            int num = 0;
            while (!(unit.GroupId & (1 << num))) {
                ++num;
            }
            AddToGroup(&newUnit, 1, num);
        }
Erenussocrates commented 7 years ago

Do you know where I could find the action_train.cpp ? I'm sorry for asking things here, I know :( I could continue this there if you've provided me your contact email, sir

Andrettin commented 7 years ago

Hey, you can contact me at wyrmsun@stratagus.com