Login

russian armor

Creating ungarrisonable cover-based trenches

16 May 2017, 15:26 PM
#1
avatar of Takahashi

Posts: 9

Is this possible? I'm trying to make constructable non garrison trenches like the ambient ones you can find.

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?
17 May 2017, 11:30 AM
#2
avatar of Planet Smasher
Senior Modmaker Badge

Posts: 632 | Subs: 1

You'd have to ask a moderator to change the title, but I think it's alright.

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.
17 May 2017, 14:49 PM
#3
avatar of Mr.Smith

Posts: 2636 | Subs: 17

What you want is:
- 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)".
17 May 2017, 19:49 PM
#4
avatar of ZombiFrancis

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.
18 May 2017, 12:03 PM
#5
avatar of Takahashi

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.
18 May 2017, 15:35 PM
#6
avatar of Mr.Smith

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!
19 May 2017, 08:01 AM
#7
avatar of Takahashi

Posts: 9

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.
19 May 2017, 09:45 AM
#8
avatar of Mr.Smith

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.
19 May 2017, 15:15 PM
#9
avatar of Takahashi

Posts: 9

Spawning them around a central item works. Need to find a way to rotate the front trench section 180 degrees and to find a deformation decal that works properly. Tried the soviet weapon support centre deformation decal but that only sinks the trench sections in halfway. Doubt I'll find anything but I'll keep looking though.

EDIT: Completely forgot that you can set the height of the spawned entities. I can sink them in properly.
22 May 2017, 12:45 PM
#10
avatar of Mr.Smith

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
22 Jul 2017, 15:24 PM
#11
avatar of Takahashi

Posts: 9

Update! I've gotten this working fairly well. Sandbags make for visually believable trench walls and provide cover at both the front and back of the trench.

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.
23 Jul 2017, 15:07 PM
#12
avatar of ZombiFrancis

Posts: 2742

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.
24 Jul 2017, 12:52 PM
#13
avatar of Takahashi

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.
31 Jul 2017, 19:43 PM
#14
avatar of Mr.Smith

Posts: 2636 | Subs: 17

This looks amazing. Good work!

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.
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

806 users are online: 806 guests
0 post in the last 24h
8 posts in the last week
37 posts in the last month
Registered members: 49090
Welcome our newest member, BrubeckDeclarkBurche
Most online: 2043 users on 29 Oct 2023, 01:04 AM