I've already spent hours on this. I can't get it to work. I want to
1. Make a team, spawned, or already on the map. This is a skirmish map.
2. Make that team an enemy of Local Player and if he has one, an enemy of his skirmish team mate. It should look like a unit from player2_startPosition or unit of player3_startposition
3. Have the team follow a path.
4. When it gets in sight of a named civilian building or to the end of the path, it attacks the building.
Local player's units must consider it an enemy. The team must consider local player an enemy. The team must consider this building (a civilian structure) an enemy, and must attack it!
What I've tried:
I created a team in the Teams window. I made a script to create the team in the skirmishChinaTank folder (these are skirmishChinaTank units). The team's 'Executed associated actions' box is checked. Here is the code:
[S A] subCreateStationAttackTeam
*** IF ***
Player 'SkirmishChinaTankGeneral' starting position is 2 .
*** OR ***
Player 'SkirmishChinaTankGeneral' starting position is 3 .
*** THEN ***
Spawn an instance of Team 'attackStation' at Waypoint 'Waypoint NearCenter1'.
Have Team 'wackos' EXACTLY follow Waypoint Path 'enemyAttackSt1' , as a team is TRUE
Team 'wackos' attacks Unit 'StationSouth'
The code is linked to the team in the Production:Condition box.
If I put this code in the SkirmishChinaTankGeneral folder, the script will execute, but the skirmish player will do nothing else but this. It won't make buildings. It won't create other units. Player at position 2 or 3, if he is SkirmishChinaTankGeneral, does nothing else.
If I put this code in the PlyrCivilian folder, the script will not execute. The SkirmishChinaTankGeneral does what it is suppose to do: fight me! It never sees this script, or refuses to execute it. It is a subroutine. I call the subroutine with a regular executing script (a ns script), but the script doesn't work. Either the skirmish player won't execute it, or it never get's run, but the script that calls this subroutine has the condition, IF TRUE, to keep it as simple as possible just to get the team to spawn. It does not spawn!
I have also placed units on the map, made them enabled, powered, and targetable, then got them to follow a path, but they won't attack the building or my (Local Player's) units, and my units won't attack them. They do nothing when they either get to the end of the path or come within sight of my units, and my units do nothing when they come in sight of them.
HOW do I do this? I want to make a team that
1. Is enemy of mine (and it will attack my units and my units will attack it).
2. Follows a path
3. Attacks a civilian building when it gets to the end of the path or close enough to fire at it.
The team can actually be created by SkirmishChinaTankGeneral or it can be simulated. I don't care how, but IT CAN BE DONE!
How do I do it? Where do I put the script?
If you have already done this and have a map that does this, put the link to it here. That way, I can see the code. Or copy the code (you can copy it from the script's top window where you can read it all), then paste it and tell me what folder it is in. But please don't give me pseudo-code. I don't know how to translate pseudo-code into real code.
This has made me nuts! I was already nuts before I started this! I have spent HOURS trying this and that. I can't get it to work, and this is the last thing I need this skirmish map to do. Please help!
(edit) Please don't tell what to try. I've already tried it, I'm sure! I'm tired of trying. I want to get it done!
Edited by user
14 years ago |
Reason: Not specified