Hello, its me again! For some reason, the AI that spawn in from the two ambush paths that I have set up as part of my WIP campaign mode keep respawning from the paths until I kill enough of them to complete the objective (which is to kill 4 of each type of unit spawning in). I have seperate, 4-node spawn paths for each of the two units set up in zeroeditor, and each unit type is on a seperate team with predefined unit quantities. Here is the significant portions of .LUA coding:
The actual objective:
Hidden/Spoiler:
--Objective 4, destroy the 8 mercenaries harrassing the farmers
The setup of the two teams that spawn the two different AI units:
Hidden/Spoiler:
AddUnitClass(3, "cis_inf_weequay", 6)(Note: this is "6", not "4", because I have two more of this type spawn in at an earlier objective)
SetUnitCount(3, 6)
SetTeamAsEnemy(3, ATT)
SetTeamAsEnemy(ATT, 3)
Is there a way to prevent the units from respawning when they are destroyed? I wouldn't complain about such a small thing, except for the fact that the constant respawning means that there is always at least two or three units left when the objective is completed (because I would have already taken out the 4 of each type). Is there another method of doing this objective altogether - perhaps combining the two units onto one team? The issue that I had with this was that it spawned in a random quantity of each, meaning that it was impossible to set up the TargetType lines with specific killLimit numbers; could I somehow leave out the class name and insert the team name, and set up a generic version like this?:
I know that the exact scripting might be different, but you get the idea.
Any suggestions?
Thanks!
Re: Ambush units keep respawning - why?
Posted: Wed Apr 29, 2009 4:57 pm
by Teancum
You still have a few more teams you can use. I believe someone (Squipple?) had like 7 or 8 teams in one of their maps. My suggestion: make each ambush a unique team. That way rather than trying to fix a bug you're going around it by making it impossible to have more reinforcements.
Re: Ambush units keep respawning - why?
Posted: Wed Apr 29, 2009 5:12 pm
by Superm9
Well, that's the thing... each ambush already is a seperate team... do you mean make each ambush a seperate objective? Because the ambushes are already seperate teams. In fact, the trandoshans (cis_inf_trando_militia) are respawning as well (I once sat on a hill with a sniper and noted every respawn, and some (most, even) were trandoshan). How is that even possible - the trandos respawning infinitely, despite having only 4 reinforcements?
Sorry, but can you explain your explaination to me?
Thanks!
Re: Ambush units keep respawning - why?
Posted: Wed Apr 29, 2009 6:01 pm
by Clone Captain
Sorry I can't help any, but it sounds like a Qiilura map right?
Re: Ambush units keep respawning - why?
Posted: Wed Apr 29, 2009 6:36 pm
by Teancum
Superm9 wrote:Well, that's the thing... each ambush already is a seperate team... do you mean make each ambush a seperate objective? Because the ambushes are already seperate teams. In fact, the trandoshans (cis_inf_trando_militia) are respawning as well (I once sat on a hill with a sniper and noted every respawn, and some (most, even) were trandoshan). How is that even possible - the trandos respawning infinitely, despite having only 4 reinforcements?
Sorry, but can you explain your explaination to me?
Thanks!
You mention that your weequay should only spawn 4 guys on one objective, and two on another (total of 6). Put 4 of them on one team, then the other 2 on a separate team for a separate objective.
But having misread your post it sounds like there's no limit to the number of respawns - they don't stop when the objective is completed.
@Teancum: I kind of misworled that post. What I meant to say was that both types of units, Weequay and Trandoshan, respawn until the objective is completed (kill 4 of each). THEN they stop respawning.
Oddly enough, the weequay unit really doesn't respawn nearly as often as the trandoshan... I wonder if setting the total unit count to 4 (equal to the size of the path that it is spawning on) for the trando is actually giving it the equivilent of setting the reinforcement count to -1 until that objective is complete for some wierd reason, because the weequay never respawns more that twice (coinciding with the 6 reinforcements) but the trando respawns infinitely....
Does that make sense?
Thanks!
Re: Ambush units keep respawning - why?
Posted: Thu Apr 30, 2009 8:56 am
by Teancum
Sortof, but I have a few questions:
1-So you have two teams for this objective it seems. What exactly needs to happen here? If I understand you're saying that both team 3 and team 4 should spawn, and you need to kill a total of four of them to complete the objective?
2-If that's the case, just put them both on one team and make the total reinforcements 4
On the other hand...
AddUnitClass(3, "cis_inf_weequay", 6)(Note: this is "6", not "4", because I have two more of this type spawn in at an earlier objective)
This is why I'm saying to split this team up. Have one team with two max weequay for your earlier objective, another team with four max weequay for your objective here. That way it will never be able to spawn more than you need for that objective.
Also, you're never setting a reinforcement count for either of those teams. Use SetReinforcementCount([team number], [amount])
Re: Ambush units keep respawning - why?
Posted: Tue May 05, 2009 3:33 pm
by Superm9
EDIT:
Ok, so this is what I have done in the last few days:
1. I set up the objective to work like the geonosis campaign objectives (e.g., "kill 3 droids w/ your sniper rifle"). This allows me to have a generic amount of mixed-unit enemies spawn in.
2. I have set up the enemy AI's objective as a defend objective instead of a deathmatch objective.
3. I have experimented with using the setReinforcementCount command to stop the AI from respawning once killed. When I use the SetReinforcementCount command to set the mercenary team (team 4 in this case) to any number of units, the game always instantly gives me the Victory screen when the mercenarys have 4 reinforcements left (reguardless of how many reinforcements I give them). When I don't use the SetReinforcementCount command, however, the AI constantly respawns until I complete the objective, at which point they stop respawning. I don't want either outcome to happen; what I want is for the AI to spawn in 8 units, and be able to kill all 8 of them (w/o any respawning) to complete the objective.
Why is the SetReinforcementCount command not working like it is supposed to?
Can someone please help me out?
Thanks!
EDIT: Oh. My. Gosh. I just realized that I had a local command post set to the ambush team... for some reason they were respawning once killed from THAT command post's spawn path (which is almost identical to theirs in terms of location)... I changed the team number, and PRESTO! No more respawning ambush...