Lengo
  • Lengo
  • 69.5% (Friendly)
  • Captain Topic Starter
14 years ago
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!
Sponsor
i^love^mixery
14 years ago
i dont quite unterstand what you are trying to do.

what sort of map are you trying to build? what is SkirmishChinaTankGeneral supposed to be? thats not the name of a normal skirmish player.

also Local Player will most likely cause a mismatch in multiplayer matches.

what exactly are you trying to do in what sort of map (skirmish/mission map? multiplayer or singleplayer?)?
Lengo
  • Lengo
  • 69.5% (Friendly)
  • Captain Topic Starter
14 years ago

i dont quite unterstand what you are trying to do.

.....

what exactly are you trying to do in what sort of map (skirmish/mission map? multiplayer or singleplayer?)?

i^love^mixery wrote:



Read carefully

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.



If you don't know about scripting, why do you ask?
i^love^mixery
14 years ago
firstly: you should be more grateful to people who are trying to help you.

secondly: this might sound cocky but i am most likely the most skilled zero hour scripter in the entire forum.

but lets put that aside:
are you trying to add aditional waves to the AI scripts or are you trying to script your own AI like thing in a skirmish map (like making an AOD, multiplayer mission)?
Lengo
  • Lengo
  • 69.5% (Friendly)
  • Captain Topic Starter
14 years ago
I've managed to get most of it to work, but it isn't going to work. You can't tell an AI player that a team at a specific starting point is an enemy or friend. You can only tell an ai player that another team is a friend or enemy, and you can't tell him that depending on his starting point. You can't tell an ai controlled player that a team at a specific starting starting point is an enemy or friend. You can, however, do it the other way around. You can tell a player at a starting point that another team is an enemy or friend, but you can't tell an ai controlled player that a team at a specific starting starting point is an enemy or friend.

Because you can put the same kind of skirmish team in at any spot and make one an ally and the other an enemy, he'll see both players, and both will either be allies or enemies to him. In other words, If Local Player has an ally of kind skirmishChinaTank and an enemy of kind skirmishChinaTank, then it doesn't work. You can only tell him that skirmishChina tank is enemy or friend, and can't do it depending on his starting point. So to hell with it. I want to be able to make teams of any sort, and that is done at the startup screen for skirmish games and can't be done at the scripting level. There is no code for that.
NewNightmare
14 years ago
hold on hold on... you did bring in a lot of details in, but my question is: what is the exact context of this map? It might not relate directly to your problem , but what is this map all about? because AFAIK a 'standard' skirmish map doesn't involve any specific scripting. just terrain/objects and polygon areas.
ATM, from what I can read youre trying to make a skirmish map which would have some task that a team has to accomplish to win. An AOD-like map that you have to destroy enemy before they get to an end of a path?
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.
Have you not considered, since it's a skirmish map, to base that off an AOD (Art of Defence) template? and make it e.g. a 4-player map, with 5th slot being the enemy team?
this way you solve the team issue (you set the teams before the map starts). Where the AI is usually a GLA faction (could be tank gen in your case).
Look up few AOD maps' scripting, they might prove helptful.


i^love^mixery
14 years ago
oh dear...

so you want to make a map with fixed teams? like startpoint 1/2 vs startpoint 3/4, no matter what the actual teams were?

i understood that you are trying to create scripted relationships between players. but what should the team depend on? startposition/army?

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.

Lengo wrote:



the skirmish players stop working once you put scripts into their folders because then the game thinks you want to script them entirely by yourself. the standard AI scripts will then be disabled. thats why i asked you the questions if its supposed to be a skirmish map with working AI or a skirmish mission map (like AOD).

if you want your scripts AND the AI scripts to work on the same map then the only way to do so is to import the entire standard AI scripts into your map, then add your scripts to that scripts. only then your skirmish scripts will run in addition to the standard AI scripts.
Kampy*
  • Kampy*
  • 57.5% (Neutral)
  • Private
14 years ago
Just use the script Team - Create - Spawn. The team must be set up in the team menu.
Drummin
14 years ago
You need to read i^love^mixery's posts carefully! You can't just add teams or players to a skirmish map. As he pointed out you would need to import the default scripts into your map and rewrite the code adding any changes. Plus active "players" are those in the game and you can't just add the player scripting and expect the player to work... they're not in the game.