Skip to content

Modding Movement through units

Robosturm edited this page May 3, 2021 · 5 revisions

This is something a lot of people have asked or requested. After some thinking through. I came up with a solution that is possible since several releases.

Step by steup walk through:

  1. Give a unit the ability to ignore unit collision. See oozium-code for an example.
  2. Go to the movement table used by the given unit and add the following code: var currentUnit = terrain.getUnit(); if ((currentUnit !== null) && (unit.getOwner().isAlly(currentUnit .getOwner()))) { if (unit should not cross this currentUnit condition) { return -1; } }
  1. Replace the pseudo code for when a unit should not cross through the other unit. E.g. an air unit should cross another air unit or a sea unit another sea unit etc. Be creative.
Clone this wiki locally