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
108 | |||||
32 | |||||
25 | |||||
9 | |||||
8 | |||||
180 | |||||
14 | |||||
9 | |||||
6 | |||||
2 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.653231.739+13
- 2.839223.790+2
- 3.35057.860+15
- 4.592234.717-1
- 5.278108.720+29
- 6.306114.729+2
- 7.645.928+5
- 8.922406.694+1
- 9.1122623.643+3
- 10.265138.658+2
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
10
Download
1245
Board Info
1034 users are online:
1034 guests
0 post in the last 24h
0 post in the last week
28 posts in the last month
0 post in the last week
28 posts in the last month
Registered members: 49427
Welcome our newest member, Baqis73421
Most online: 2043 users on 29 Oct 2023, 01:04 AM
Welcome our newest member, Baqis73421
Most online: 2043 users on 29 Oct 2023, 01:04 AM