Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: CO-exclusive units #9

Open
GuardianTempest opened this issue Jul 29, 2019 · 19 comments
Open

Suggestion: CO-exclusive units #9

GuardianTempest opened this issue Jul 29, 2019 · 19 comments
Assignees
Labels
enhancement New feature or request

Comments

@GuardianTempest
Copy link

Inspired by Sebastien Vakerics' fan designs for different units, I think there should be support for units that are exclusive to one or more COs. Maybe a variable that restricts a unit to being built by only specified COs, which could also be used to prohibit COs from building them.

@Robosturm
Copy link
Owner

i already thought about that idea. The only reason i didn't implemented it yet is the lack of units.
I will contact Sebastien if i'm allowed to use his sprites. -> none the less i'll add an option to add custom specific units.

@Robosturm
Copy link
Owner

Okay added the option a CO can now say if a unit can be build in addition to the normal units of a building. See the new callback getCOUnits(co, building), where you can return the ID's of additional units. I tested it by allowing infantries to be build from any building. :D A CO can also make multiple units buildable.

Robosturm pushed a commit that referenced this issue Jul 29, 2019
@Robosturm Robosturm self-assigned this Jul 29, 2019
@Robosturm Robosturm added the enhancement New feature or request label Jul 29, 2019
@Robosturm Robosturm added this to To Do in Commander Wars via automation Jul 29, 2019
@Robosturm
Copy link
Owner

Robosturm commented Jul 29, 2019

Next step add CO specific units

And again thx for the idea. Makes it one more person who likes to have something like that

@Robosturm Robosturm moved this from To Do to In Progress in Commander Wars Jul 29, 2019
@GuardianTempest
Copy link
Author

o7

@Robosturm
Copy link
Owner

Robosturm commented Jul 30, 2019

Let that issue open. Pls. ;) Since the actual units are missing.
Helps me to remember that it's not completed.
Though i i apprieciate your efford.

@GuardianTempest
Copy link
Author

Flak could finally have his Indirect Bombers.

Later on there could be a modding tutorial for adding new units/COs/gameplay adjustment patches.

@Robosturm
Copy link
Owner

As for modding take a look here:
https://github.com/Robosturm/Commander_Wars/wiki/Commander-Wars-Modding-Tutorial
If something is missing unclear give feedback and i'll try to adjust the wiki page.

@GuardianTempest
Copy link
Author

I don't know where to ask this but I want to know: How do I update my build of the game? I want to try using this new feature you've implemented and try giving Flak his indirect bombers.

@Robosturm
Copy link
Owner

Robosturm commented Aug 3, 2019 via email

@GuardianTempest
Copy link
Author

GuardianTempest commented Aug 3, 2019

Huh, well I didn't actually. I was wondering if it's possible to update the already-built using the updated files on Git, the resources to compile the app seemed pretty out of reach of my comprehension although I appreciate the tutorial (thanks for that).

EDIT: Wait, the current release is also updated? Huh, that's neat. I thought the changes would be ported to the next Beta...or perhaps I'm wrong?

EDIT2: Ah, there's a new Beta release, thanks!

@GuardianTempest
Copy link
Author

GuardianTempest commented Aug 12, 2019

flak_bombers v1.zip
Thank you for waiting, here's my attempt at giving Indirect Bombers to Flak. I can't seem to make 'em exclusive to Airports and there's some bugginess with them as well (such as the battlefield not updating unless you press B/check the range of a unit). On the other hand, the easiest fix would be to change a parameter in the unit's file...

Constructor.prototype = UNIT;
var FLAKBOMBER = new Constructor();

to

Constructor.prototype = UNIT;
var BOMBER = new Constructor();

However it replaces Flak's default bombers as a consequence (I want both bombers available to him).

@Robosturm
Copy link
Owner

Hi i fixed the problem with the bombers not beeing only buildable with airports.
Take a look at the flak script for that.
Not sure what you mean with bugginess but i found a bug in the bomber script.
I assume you don't have a sprite for the indirect bombers, but during a movement you wrote down to use those sprites i changed it to bombers, which should fix the bugginess.
Here the changes:
flak_bombers.v1.zip

Note: i found a bug which makes co-specific units not resupplyable. Fixed for the next release.

@GuardianTempest
Copy link
Author

Thank you very much for the fixes as well as the helpful comments to let me understand what's going on. I wanted this to be part of the sample mods added in the release as a cheeky add-on (and also for for any other novice modders looking for examples).

There's still a few more adjustments to be done, though it's just increasing ammo to 9 and maybe i increasing max range to 4.

@Robosturm
Copy link
Owner

if you are done tell me or if you need some more infos I'll try to give you the information you need.

@GuardianTempest
Copy link
Author

Right. It's functionally complete and ready for adding, but the only bug remaining is that the main unit portrait doesn't display. As far as the code goes, it should use the bomber's close-up image but in-game it doesn't. Maybe it's just me, or it's already fixed in the next build.

@Robosturm
Copy link
Owner

I guess you missed the close up scripts.
Create a Folder script/battleanimations/ in the mod and copy the BATTLEANIMATION_BOMBER Script from the main files and change it like you changed the bomber unit script.

The game seperates the close up or battleanimation sprites and the unit scripts.

@Robosturm
Copy link
Owner

Take a look here for some details about Battleanimations. Note this is the documentation for the upcoming Beta 6. ;)
https://github.com/Robosturm/Commander_Wars/wiki/Commander-Wars-Battleanimation-System

@GuardianTempest
Copy link
Author

Thank you, the fix works. Interesting documentation, complicated but it seems pretty neat so far. The bottom two sections might confuse new readers for being giant blocks of text and the code comments aren't parsed (and would seem like random asterisks).

@Robosturm
Copy link
Owner

Well i tried to reduce the battleanimations to an as simple as possible approach.
And i tried to write down the sequence in which the animations are played forming an actual animation.
Fixed the wrongly parsed comments. -> github showed it correctly in the preview....

@Robosturm Robosturm moved this from In Progress to To Do in Commander Wars Aug 31, 2019
@Robosturm Robosturm moved this from To Do to In Progress in Commander Wars Mar 23, 2020
@Robosturm Robosturm moved this from In Progress to To Do in Commander Wars Dec 26, 2020
Robosturm pushed a commit that referenced this issue Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Commander Wars
  
To Do
Development

No branches or pull requests

2 participants