Creating ungarrisonable cover-based trenches
Posts: 9
EDIT: It occurs to me that I could better express what I am trying to do. Essentially, I am attempting to make trenches like in the CoH1 mod "The great war".
So, what I've been trying to do is having the engineers build the front trench wall, then having on constructed actions spawn a dummy building (to stamp down the earth) in the center, and the rear wall. But my game crashes every time I build the trench section now.
Is there any way to edit the thread title to fix my idiocy?
Posts: 632 | Subs: 1
Does your game crash if you remove everything from on_construction? Instead of spawning a dummy building, you might be able to use a deformation action - have a look Bulldozer's barricade abilities as for how that works.
Posts: 2636 | Subs: 17
- The trench graphics showing for your completed structure
- Units should only be able to traverse the trench horizontally (along the walkway), but not vertically (from front to back)
- When standing inside the trench, you want to have directional green cover (i.e., green cover that only affects people standing inside the trench, as opposed to standing outside it
I don't know if this is possible, however I would approach this as:
- Study Pak43, and how the build action also spawns sandbags
- Create a trench entity that is pass through (i.e., remove the extention that blocks pathing; look at for Major antenna for a similar entity)
- Once the trench entity completes building, spawn two sections of invisible, uncrushable, unvaultable sandbags to act as green cover
- To make green cover affect only one side, you probably need to affect cover_ext and define the size of the green cover area by hand
Otherwise, if it's possible to build world-builder objects, look for the vaultable wooden-trench green-cover sections that are present in Lienne forest in the forest section.
In that case:
- Your units start building a Brit trench
- Once the trench completes, the trench spawns two permanent wooden-wall sections with the right orientation
- Then, the trench self-destructs and only leaves the inanimate objects behind
If the second solution works, this means that you don't have to worry about editing green cover sections by hand.
In both cases, you might have to create a terrain deformation action to "dig" the ground downwards. For this, I would advise looking at Soviet T2 structure since it does something similar.
PS: I can edit the title of the thread as you please. Would you be OK with the following:
"Creating ungarrisonable cover-based field defences (trenches)".
Posts: 2742
Otherwise, if it's possible to build world-builder objects, look for the vaultable wooden-trench green-cover sections that are present in Lienne forest in the forest section.
You can. Opel blitz setup is a good reference. IIRC it spawns a few crates when it sets up.
Posts: 9
PS: I can edit the title of the thread as you please. Would you be OK with the following:
"Creating ungarrisonable cover-based field defences (trenches)".
Yes that would be quite suitable thank you.
Posts: 2636 | Subs: 17
Yes that would be quite suitable thank you.
Done! I had to prune the title a bit, since it was too long!
Posts: 9
Posts: 2636 | Subs: 17
The Pak43 and Opel Blitz both use SCAR Function calls to spawn their accessory buildings. Considering I don't know anything about Lua or SCAR in particular, and this whole Idea was on a whim, I'm going to shelve it for now.
Check the forward retreat ability on the major. The ability uses a spawn-entity call to create the antennas and the forward retreat point. I am not sure whether you can control rotation, though.
You should be able to bundle the spawn entity thing under the constructed_actions of your trench.
Posts: 9
EDIT: Completely forgot that you can set the height of the spawned entities. I can sink them in properly.
Posts: 2636 | Subs: 17
Spawning them around a central item works. Need to find a way to rotate the front trench section 180 degrees
I dont know the default rotation for spawning entities. However, if the facing seems to be fixed:
- Try to spawn an auxiliary entity that that will spawn the sandbags
- That way you can use the auxiliary entity to control the rotation of sandbags when that occurs
Posts: 9
Some issues.
1. Sandbags may spawn erratically, height may vary, some spawn diagonally despite the trench not being on an angle.
2. Sandbags provide cover to infantry standing at the parapet as well.
3. It is not possible to enter or exit the trench by vaulting the sandbags. I assume this is because they would be underground at the end of the animation.
4. Machine guns like to point at the sky when set up in the trench. Looks kind of weird but it's only a small graphical quibble.
The trench in question.
And an older version before I settled on sandbags. You can see it better here, but the problematic trench walls are in use here.
Posts: 2742
In short:
Have you tried using another trench wall? I am fairly certain there are vaultable ones and non-vaultable ones. Same with sandbags.
From what I remember from playing around with hulldowns, objects are spawned in this way in relation to the entity's facing. So if there's a squad of infantry, I think there's ample opportunity for some facing to get a little screwy as those entities maneuver around.
Posts: 9
OMFG this site sometimes... Wrote a response, timed out, everything gone.
In short:
Have you tried using another trench wall? I am fairly certain there are vaultable ones and non-vaultable ones. Same with sandbags.
From what I remember from playing around with hulldowns, objects are spawned in this way in relation to the entity's facing. So if there's a squad of infantry, I think there's ample opportunity for some facing to get a little screwy as those entities maneuver around.
The standard trench wall segments don't work for the rear wall. It's not possible to change the direction of a spawned object so you end up with a trench like the second image, with one wall facing the wrong way. I've made a new version that solves some of those problems.
The rear wall cannot be vaulted over. But the front wall can.
I want to make them removable with wire cutters, although it doesn't seem to want to work. They are currently unremovable by any means.
They Block line of sight now, as demonstrated by this conscript squad. The rear echelon cannot see the conscripts, nor can the conscripts see the rear echelons. Great for ambushes!
The trenches do not however, block rifle rounds. The conscripts were able to quickly shred the rear echelons when fog of war was turned off despite being prone.
Cover is inconstant within the trench. When running down it's length, the squad will repeatedly be in and out of cover. The whole cover system is utterly bewildering and I have no idea how to make the entire trench a directional cover zone. Making it omnidirectional would be easy, but undesirable.
Posts: 2636 | Subs: 17
With respect to cover, how about making spawning invisible entities along the trench wall and making them provide omni-directional cover? In any case cover will be ignored if enemy units run up close enough, due to the point blank mechanic behaviour.
Livestreams
13 | |||||
196 | |||||
44 | |||||
25 | |||||
2 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.34957.860+14
- 3.589215.733+4
- 4.1101614.642+2
- 5.305114.728+1
- 6.916405.693-2
- 7.272108.716+23
- 8.721440.621+3
- 9.1041674.607-2
- 10.17146.788+1
Replay highlight
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Board Info
8 posts in the last week
38 posts in the last month
Welcome our newest member, 23winlocker
Most online: 2043 users on 29 Oct 2023, 01:04 AM