Jump to content

Obstructions Hack


Recommended Posts

Hello fellow modder.

Tonight I mess around with obstruction, with gate obsyructions. I think to myself that there must be a way to use the gate obstruction code in the template to allow soldier to pass under the Triumphal Arch. It was confusing at first, but here it is. It works:

obstructions.jpg


  <Obstruction>
	<Static disable=""/>
	<Obstructions>
	  <Right width="6" depth="9" x="6" z="0"/>
	  <Left width="6" depth="9" x="-6" z="0"/>
	</Obstructions>
  </Obstruction>

 

Okay, so I have decided that X = the center of the obstruction along X axis (left and right when look at face of structure). Width is the width of the obstructuin centered on X. I had to disable Static obstruction because it is not overwritten by the <Obstructions>. If the Static obstruction is left in, there is a obvious conflict and it throw error. So, disable the Static obstruction and use <Obstructions> like I outline in this post to replace.

 

I think this only with with simple obstructions like the Triumphal Arch, but the game might be able to handle others more complex. Developer may be able to shed light. (y)

  • Like 1
Link to comment
Share on other sites

You can define as many rectangular obstructions as you want. It doesn't have to be named left, right or center, that's only a requirement for gates (where the center one is enabled and disabled to open and close the gate).

So in theory, you can make quite complex obstructions (f.e. on a market, give every stall its own obstruction, and let units walk through it). But in practice, this may be a lot of work.

Note that a more complex obstruction will also give a bit more work to the pathfinder. But if these are only used on buildings that don't appear so often (and not f.e. on trees), this shouldn't make a big difference.

A few days ago, I also wanted to make circular obstructions possible (f.e. usable on the Briton CC or for Stonehenge). It worked great for building placement, and for the long range pathfinder, but the short range pathfinder doesn't seem to like that yet.

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...