Actually, topic.
Managed to make the MGs, obtained by Grenadiers and Panzergrenadiers via respective upgrades, random - either MG-34 or MG-42 with 50/50 probability (using the add_slot_item as action_choice in random_action).
But my attempt to do the same trick with HMG teams (i.e. to make them having the MG-34 or MG-42 HMG randomly) using the add_to_squad_loadout as action_choice part of random_action failed - the team merely appeared on the battlefield without any HMG, with just their MP-40. Have already tried playing around with .abp files - still nothing.
Any ideas? Have anybody done this successfully?
Random MGs for German factions
14 Nov 2016, 20:28 PM
#1
Posts: 31
15 Nov 2016, 10:07 AM
#2
Posts: 2636 | Subs: 17
I have no idea about this. However, I think that the MG team needs to "attach" themselves to the MG the moment they spawn. Thus I don't think you can give them a randomized MG that way.
The easy way to fix this is replace the unit-building option with an upgrade. For this, you can draw on the way the Captain is fielded for inspiration: When the captain upgrade finishes, the captain appears on the battlefield.
In your case, you can make it that your upgrade has a 50% chance of spawning an MG-34 team or a 50% chance of spawning an MG-42 team.
A downside of going for the upgrade-only route is that the player cannot see the progress bar of the MG being made (on the top right). However, this is way easier to implement, and it should always work.
Otherwise (and if you have the time to spare), your solution could look like this:
- Create a dummy squad with the MG icon and everything, that the player has to build to get access to MGs
- The moment the dummy squad spawns, you execute an action that spawns your real squad and deletes the dummy squad
To make the real squad spawn from the production building, you need to make it into a filter action (for hq_mp)
- For an example of how to implement a filter action look for the OKW Medic upgrade. Just make sure you remove the "apply to future units" flag
- Inside the filter action, you will have your 50/50 chance thing, and you can spawn your real MG in the same way that the Captain spawns
Note that I am not sure whether the spawned MG squad will respect the rally point set by the production building.
I hope that works!
The easy way to fix this is replace the unit-building option with an upgrade. For this, you can draw on the way the Captain is fielded for inspiration: When the captain upgrade finishes, the captain appears on the battlefield.
In your case, you can make it that your upgrade has a 50% chance of spawning an MG-34 team or a 50% chance of spawning an MG-42 team.
A downside of going for the upgrade-only route is that the player cannot see the progress bar of the MG being made (on the top right). However, this is way easier to implement, and it should always work.
Otherwise (and if you have the time to spare), your solution could look like this:
- Create a dummy squad with the MG icon and everything, that the player has to build to get access to MGs
- The moment the dummy squad spawns, you execute an action that spawns your real squad and deletes the dummy squad
To make the real squad spawn from the production building, you need to make it into a filter action (for hq_mp)
- For an example of how to implement a filter action look for the OKW Medic upgrade. Just make sure you remove the "apply to future units" flag
- Inside the filter action, you will have your 50/50 chance thing, and you can spawn your real MG in the same way that the Captain spawns
Note that I am not sure whether the spawned MG squad will respect the rally point set by the production building.
I hope that works!
21 Nov 2016, 18:43 PM
#3
Posts: 60
One workaround maybe is to have two different types of squads and make it a call in ability randomizing which of the two come out.
21 Nov 2016, 18:59 PM
#4
Posts: 3103 | Subs: 1
One workaround maybe is to have two different types of squads and make it a call in ability randomizing which of the two come out.
That's a great idea which should work. Instead of making it a spawner item, make it a call-in ability within the building.
21 Nov 2016, 19:10 PM
#5
Posts: 31
That's a great idea which should work. Instead of making it a spawner item, make it a call-in ability within the building.
Hmmm ... really, it could work. Just let me itemize - "call-in ability inside the building" is like one for dispatching the Captain or Major for USF?
21 Nov 2016, 19:19 PM
#6
Posts: 3103 | Subs: 1
Hmmm ... really, it could work. Just let me itemize - "call-in ability inside the building" is like one for dispatching the Captain or Major for USF?
I haven't tried it myself, but I suppose you should be able to adapt the method for it from that by removing the parts that relate giving you an upgrade that makes you able to access the Platoon/Company/Battalion Company Posts and, of course, changing the LT/Capt/Major to the HMG teams. Take a look at the Mobile Defense Doctrine's Osttruppen call-in ability to see if that'll help you implement in the randomization you want - or it just might be easier to start from that ability and add the random HMG ability to the building you want to build random HMGs out of.
22 Nov 2016, 16:25 PM
#7
Posts: 87
"Mobile Defense Doctrine's Osttruppen call-in ability"
But that's just doctrine ability, so OP can do it only in one doctrine - from what I understand, he wants to have it with every doctrine, in the building.
BTW did anyone try to add USF's-officer-like units? I mean, for example I build OKW's Flaktrack building and the moment it builds, Sturm offizier is dispatched. How to do it?
But that's just doctrine ability, so OP can do it only in one doctrine - from what I understand, he wants to have it with every doctrine, in the building.
BTW did anyone try to add USF's-officer-like units? I mean, for example I build OKW's Flaktrack building and the moment it builds, Sturm offizier is dispatched. How to do it?
22 Nov 2016, 20:04 PM
#8
Posts: 632 | Subs: 1
"Mobile Defense Doctrine's Osttruppen call-in ability"
But that's just doctrine ability, so OP can do it only in one doctrine - from what I understand, he wants to have it with every doctrine, in the building.
It's an ability, so it doesn't matter if the button appears in a building or the command bar. It's only a commander ability because of its requirements.
BTW did anyone try to add USF's-officer-like units? I mean, for example I build OKW's Flaktrack building and the moment it builds, Sturm offizier is dispatched. How to do it?
Unlocking USF tiers works via abilities as well - have a look at how they work. Or you could just add a reinforcements_action to the Flak HQ's on_construction_actions (in construction_ext).
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
6 | |||||
810 | |||||
16 | |||||
6 | |||||
5 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.595215.735+10
- 3.34957.860+14
- 4.1101614.642+2
- 5.305114.728+1
- 6.916405.693-2
- 7.273108.717+24
- 8.721440.621+3
- 9.1041674.607-2
- 10.17146.788+1
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1233
Board Info
375 users are online:
375 guests
0 post in the last 24h
8 posts in the last week
37 posts in the last month
8 posts in the last week
37 posts in the last month
Registered members: 49092
Welcome our newest member, dreilandechode
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, dreilandechode
Most online: 2043 users on 29 Oct 2023, 01:04 AM