Jump to content

Recommended Posts

Hello guys,

 

thanks for taking the time.

I am working hard on an experience for some people that I am going to entertain as Zeus and mission maker, but gotten to a point where I have not manage to find any module, mod or other script that meet my specific needs.

 

My friends during their adventure through a map, will come and go to different locations, and return to the same ones again potentially. Each time they do, I want to be able to spawn in AI units, under specific classnames, in very specific location like a marker or trigger.

Maybe one AI of one type of classname stands at a gatehouse, and another AI of another type of classname is standing outside in the rain. But each time they go there, they will spawn in into the same spot or markers. And if they leave, they will despawn again, in order

to save on performance for the server. 

 

I have seen many population scripts out there, but they generally populate areas and houses, they do not place them into very specific manual locations, or i can choose which classname will be placed down to the detail.

I am also looking for the option that if I spawn a third guy by the guard house, he starts to patrol in a small radius when he has appeared.

I can easily create this by placing down NPCs, but it is going to tax the performance if I have so many different locations populated all at once. It would be better if they despawn on leaving, and respawn on approach.

 

It would also be useful if there are specific enemy classnames in an area they can attack, they will respawn later in case they want to go back and do the same attack over again.

 

Anyone has any ideas or suggestions? Much appreciated!

Share this post


Link to post
Share on other sites

It's too specific. Such topic could be in "find or offer" section.

Roughly, your demand is vague and implies a lot of work:

"I have seen many population scripts out there, but they generally populate areas and houses, they do not place them into very specific manual locations, or i can choose which classname will be placed down to the detail."

is already huge.
Here, just an example as I scripted guards on guard houses along the border on Gabreta map (CSLA Iron Curtain DLC)
 

Spoiler

 

Placed 4 game logics with this code :


if (isServer) then {
  private ["_fortress","_pos","_unit","_grp"];
  private _fortresses = nearestTerrainObjects [getpos this, ["fortress"],2000];
  {
    _fortress = _x;
    if (random 1 > 0.7 or _fortress isKindOf "Land_csla_Spak_High") then {
      _pos = (selectRandom (_fortress buildingPos -1));
      _unit = createGroup EAST createUnit  [selectRandom ["CSLA_mrOP63","CSLA_mrRF10","CSLA_mrSa58V","CSLA_mrSa58P","CSLA_mrRPG75","CSLA_mrUK59"],_pos,[],0,"can_collide"];
      _grp = group _unit; _grp enableDynamicSimulation TRUE;
      _grp deleteGroupwhenEmpty TRUE;
      _grp setBehaviour "SAFE";
      _unit setdir (120 + random 180)
    }
  } forEach _fortresses;
};


 

 

You can wait for 25th December or try another way:

place your specific units on your specific places on the map and randomize their presence and/or use the dynamic simulation

 

  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, pierremgi said:

 

You can wait for 25th December or try another way:

place your specific units on your specific places on the map and randomize their presence and/or use the dynamic simulation

 

 

So maybe an easier sample could be to populate the entire map with specific AI, but then have something like a trigger or script where, all units in a proximity of players gets Simulated or not?

Share this post


Link to post
Share on other sites
2 minutes ago, saddle said:

like a trigger or script

 

23 hours ago, pierremgi said:

 

He provided that link for a reason 😉

Share this post


Link to post
Share on other sites
1 minute ago, Harzach said:

 

 

He provided that link for a reason 😉

 

Thanks.


Will large amounts of AI across the map still affect performance? Even if they are all disabled in simulation?

Share this post


Link to post
Share on other sites

Well, it's not magic, but it helps with performance - that's the entire point of it. They are still rendered, though, so if you have 20 groups of 100 soldiers standing in formation on the salt flats of Altis, your framerate will tank when they are within visible range but still outside DS range.

 

Depending on your definition of "large amounts of AI," better solutions might include either spawning/despawning AI as needed, or a caching system like ALiVE.

Share this post


Link to post
Share on other sites
3 hours ago, Harzach said:

Well, it's not magic, but it helps with performance - that's the entire point of it. They are still rendered, though, so if you have 20 groups of 100 soldiers standing in formation on the salt flats of Altis, your framerate will tank when they are within visible range but still outside DS range.

 

Depending on your definition of "large amounts of AI," better solutions might include either spawning/despawning AI as needed, or a caching system like ALiVE.

 

Thanks a ton for the support so far guys.

I might try an option and make like a script/trigger/init line radius around all players on the map, that if any and all AI ends up outside the radius they will disable simulation, and then when they enter the radius the simulation is on again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×