Setting ally count for a CP in lua?
Moderator: Moderators
-
- Lieutenant Colonel
- Posts: 545
- Joined: Mon Jul 04, 2016 10:56 pm
- Location: My other account
- Contact:
Setting ally count for a CP in lua?
I`m pretty sure "AllyCount" in the map editor is where I`d specify the number of units that spawn from a CP, however my map has a layer problem (which some may remember) and won`t update any of the layers except the Base layer, so this won`t work for me (I`ve tried cleaning, it just breaks the map), so as a work-around, is there a way I can set a limit to the number of units that can spawn from a CP..through the lua script?
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Setting ally count for a CP in lua?
Code: Select all
SetProperty(cpObjectName, "AllyCount", someValue)
-
- Lieutenant Colonel
- Posts: 545
- Joined: Mon Jul 04, 2016 10:56 pm
- Location: My other account
- Contact:
Re: Setting ally count for a CP in lua?
Marth8880 wrote:Code: Select all
SetProperty(cpObjectName, "AllyCount", someValue)
Code: Select all
function ScriptPostLoad()
SetProperty(cp3, "AllyCount", 20)
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Setting ally count for a CP in lua?
cp3 needs to be wrapped in quotation marks.SkinnyODST wrote:Code: Select all
SetProperty(cp3, "AllyCount", 20)
-
- Lieutenant Colonel
- Posts: 545
- Joined: Mon Jul 04, 2016 10:56 pm
- Location: My other account
- Contact:
Re: Setting ally count for a CP in lua?
Yayy it doesn`t mess up the map now
But (there`s always a but when it comes to me and .lua) it doesn`t seem to have any affect on how many units spawn from the cp. I even set it to 1 and it still spawns heaps of units like all the other cps. Am I misunderstanding what allycount does or is this just another common case of
But (there`s always a but when it comes to me and .lua) it doesn`t seem to have any affect on how many units spawn from the cp. I even set it to 1 and it still spawns heaps of units like all the other cps. Am I misunderstanding what allycount does or is this just another common case of
Hidden/Spoiler:
-
- Resistance Leader
- Posts: 5042
- Joined: Tue Feb 09, 2010 8:43 pm
- Projects :: DI2 + Psychosis
- xbox live or psn: Marth8880
- Location: Edinburgh, UK
- Contact:
Re: Setting ally count for a CP in lua?
I'm not entirely sure what AllyCount is for. Either way, AISpawnWeight is the parameter you're looking for, it has a default value of 10 for every CP.
-
- Lieutenant Colonel
- Posts: 545
- Joined: Mon Jul 04, 2016 10:56 pm
- Location: My other account
- Contact:
Re: Setting ally count for a CP in lua?
Omg it works YES THIS IS GREATMarth8880 wrote:I'm not entirely sure what AllyCount is for. Either way, AISpawnWeight is the parameter you're looking for, it has a default value of 10 for every CP.
ThAnk yoU MaRth