2 Question about pre-placing units on the map

Interesting mapping tools and mapping help.

Moderator: Morax

2 Question about pre-placing units on the map

Postby Vuud » 21 May 2020, 19:34

Hi!

Using the latest ozonex editor (as of now v0.606-Alpha WIP9) I have a problem and question:

When I place and assign a unit on the map to a player army the game ends as soon as it starts

For example, I have ARMY_1 and ARMY_2. I place a Soul Ripper near each base with the assignment to that army. As soon as the game starts it tells me the other player has been defeated. The ACU does not even deploy at that point... just the map, then the end. I did place a unit assigned to a non-player ARMY and did not have a problem. Once I removed the two units, the map worked fine again. Is there a way to do this?

Can I create a patrol for a non-player ARMY?

Here is a simple example: Let's say I wanted to have an experimental wandering around the middle of the map, just shooting up anyone that comes through. I get setting the players as the enemy, and I can deploys paths, but I cannot figure out how to make the NPC unit "wander". is this something that can be done via scripting if not the editor?

Thank you for any help!
Vuud
 
Posts: 4
Joined: 30 Mar 2014, 19:16
Has liked: 1 time
Been liked: 0 time
FAF User Name: Vuud

Re: 2 Question about pre-placing units on the map

Postby Jip » 19 Jul 2020, 00:39

On the first question, when an army has some units assigned as their initial units, then nothing else will spawn / trigger. More specifically: the commander will not spawn. The game probably ends because of the game mode you are running.

On the second question, yes! Yes you can. This is cannot be done in the editor but it can be done through scripting. This is a small example of how the file '<your-map-name>_script.lua' would look like:

Code: Select all
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')

function OnPopulate()
   ScenarioUtils.InitializeArmies()
end

function OnStart(self)

   -- spawn the units
   local army = "ARMY_1"
   local group = "GROUP_1"
   local wreckage = false
   local units = ScenarioUtils.CreateArmyGroup(army, group, wreckage);

   -- make them move along a path
   local chain = "c1"
   local path = ScenarioUtils.ChainToPositions(chain)

   for k, node in path do
      IssuePatrol(units, node)
      -- or:
      -- IssueMove(units, node)
   end

end


Another note: in comparison to the Discord channel on map making these forums aren't that alive anymore. You can find it here: https://discord.gg/gN4SdPb
Jip
Avatar-of-War
 
Posts: 51
Joined: 12 Jul 2015, 22:25
Has liked: 3 times
Been liked: 11 times
FAF User Name: Jip


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest