Posted by: josh3d2004 - Sunday, March 4, 2007 8:53:21 PM
What I want to do is make a map with a base in the center that attacks any unit(s) from any team that come within it's viewing distance/weapon range. I know this has to be possible considering I have played maps back when this game first came out that were unofficial and worked that way. I'm new to map making but I understand the basics and have made 6 fully functional working skirmish maps but this map idea is for an online game with a few friends and I can't seem to figure it out. Everything I try tends to not work correctly. I can make a team with the name like "USA" and get it to a specific color (blue instead of grey, civilian) and the team has sufficient power and money as well as tech but they don't attack anything, nor build units or fire superweapon when timer runs out. Any help would be greatly appreciated and I would like to apologize if this issue has been posted before as I could not find it. [smile]

Posted by: fleetatks - Monday, March 5, 2007 6:37:39 AM
I suggest placing a player starting position in the middle of the base and script it that so when USA (Or other general of your choosing) is in there it transfers the buildings to that player. the way you can do that is to make an area around the middle player starting position and name it "Check For AI" or anything of your choosing. Then name each unit/building you want to be transfered ex: Unit001. Note that each unit has to have it's own unique name. Then go into scripts (edit->scripts) and do the following. To make A unit Transfered to a player in the begginning of the game or for a different reason (ex: enter area, time expired...) First start by placing the units/buildings you want on the map and give them a name (ex: Unit001.) Give each of the units/building their own unique name and then go into scripts. For the condition you can do what you want, but for this I'll put it if you wanted it at the begginning of the game. IF 'True' THEN (Player->Transfer->Transfer Unit to player) 'Unit "Unit001" is transfered to the control of player "(LocalPlayer for Player1/host, Teamplayerskirmish____ for that specific AI)"' Note that having 2 or more of the same skirmish player will result in a crash, and also Note that you can't give units in the form of player1, player2, ect... Edit: To check for The AI make a script and have it say IF (Player->Area) "Player '____' exists inside of Area '_____' " Then (Script->Flag [if not that check for something similar]) "Set Flag 'AIPresent' to 'TRUE'" Else (If false) "Set Flag 'AIPresent' to 'FALSE'" Then you can have The transfer unit scripts have IF "Flag 'AIPresent' = 'TRUE'" instead of just "True" You can also use this method to destroy the buildings if it the AI isn't the correct general and/or isn't in the correct spot.

Posted by: josh3d2004 - Monday, March 5, 2007 6:19:19 PM
[quote=Fleetatks] I suggest placing a player starting position in the middle of the base and script it that so when USA (Or other general of your choosing) is in there it transfers the buildings to that player. the way you can do that is to make an area around the middle player starting position and name it "Check For AI" or anything of your choosing. Then name each unit/building you want to be transfered ex: Unit001. Note that each unit has to have it's own unique name. Then go into scripts (edit->scripts) and do the following. To make A unit Transfered to a player in the begginning of the game or for a different reason (ex: enter area, time expired...) First start by placing the units/buildings you want on the map and give them a name (ex: Unit001.) Give each of the units/building their own unique name and then go into scripts. For the condition you can do what you want, but for this I'll put it if you wanted it at the begginning of the game. IF 'True' THEN (Player->Transfer->Transfer Unit to player) 'Unit "Unit001" is transfered to the control of player "(LocalPlayer for Player1/host, Teamplayerskirmish____ for that specific AI)"' Note that having 2 or more of the same skirmish player will result in a crash, and also Note that you can't give units in the form of player1, player2, ect... Edit: To check for The AI make a script and have it say IF (Player->Area) "Player '____' exists inside of Area '_____' " Then (Script->Flag [if not that check for something similar]) "Set Flag 'AIPresent' to 'TRUE'" Else (If false) "Set Flag 'AIPresent' to 'FALSE'" Then you can have The transfer unit scripts have IF "Flag 'AIPresent' = 'TRUE'" instead of just "True" You can also use this method to destroy the buildings if it the AI isn't the correct general and/or isn't in the correct spot. [/quote] Thank you so much for answering my question. I really appreciate it. I was doing it exactly like that! The thing was, i left the originally created faction "plyrchina" (was placing chinese buildings and such on the map before adding skirmish teams and it was created) and I forgot to delete it. So I just loaded up World Builder and followed exactly as you put and it still wouldn't work and the units and buildings would still be civilian so I was beginning to be more stressed out so I was messing around with the teams and saved it before messing with it and deleted the plyrchina and saved it as test2 as a new map just in case it messed up or something. So I just went in to play and the tanks stay but they sell the buildings. I didn't place the waypoints, perimeters, combatzone, etc. so I'm guessing that's why. If not, please let me know how to make it so they wont sell them. My, hopefully, final question is, where does the combatzone go? Just around the middle team or what? and after that, what about the waypoints for the left center and right paths? Just set them for team 1 and team 3 (not the team which is team 2 in the middle - in my example) right? like from the combatzone into each team1 and team3 from combatzone correct? I would love to add this to some of my maps to add in a kind of "no rush" type thing but I don't want them to disappear after a certain time or spawn or anything else, just basically sit there until something messes with them or enters their area. I would once again like to thank you for responding so fast with the correct answer to solve my main problem. I hope to hear from you or someone else about my remaining problem and hopefully get this fixed and let me gain a little bit of knowledge while in the process [grin] Edit: Added the waypoints, combatzone, etc. and they still sell and ai on both teams wont move. Middle base and other base. I've double checked all waypoints and areas and I don't get what the problem could be. [skull]

Posted by: fleetatks - Monday, March 5, 2007 8:18:20 PM
I'm not exactly sure why they would sell them, maybe the AI sees that it has low money or think that it is defeated and sells it. Upload your map and I'll take a look at it.

Posted by: josh3d2004 - Monday, March 5, 2007 8:56:00 PM
[quote=Fleetatks] I'm not exactly sure why they would sell them, maybe the AI sees that it has low money or think that it is defeated and sells it. Upload your map and I'll take a look at it. [/quote] I just made it to test this so it's nothing that great. I've been messing around with some things and I can't figure it out. It's giving me a headache [skull] But I appreciate all the help [smile] /public/files/josh3d2004/test map.zip <

Posted by: fleetatks - Monday, March 5, 2007 10:45:52 PM
After a long time of being puzzled I finnally found something that might work. [img]http://i39.photobucket.com/albums/e163/Fleetatks/untitled-12.jpg[/img] Try it and see if it works.

Posted by: josh3d2004 - Monday, March 5, 2007 11:00:48 PM
[quote=Fleetatks] After a long time of being puzzled I finnally found something that might work. [img]http://i39.photobucket.com/albums/e163/Fleetatks/untitled-12.jpg[/img] Try it and see if it works. [/quote] That's the first thing I did as soon as I started the game and saw the rafters go up and them sell the buildings. I went in and tried it but with no effect. Just tried it again and they still sell them. I have no idea why this isn't working, it seems like everything is in place [img]https://www.cnclabs.com/forums/images/emoticons/gwicon_banghead.gif[/img]

Posted by: fleetatks - Tuesday, March 6, 2007 5:55:55 PM
Try going into scripts and manually putting the flag for unsellable on the buildings. If that doesn't work I see two ways of fixing this. 1. Remove the command button for the sell command from the chinese buildings. 2. Place waypoints where you want to put units/buildings and use the (Team->Spawn->Spawn an instance of a team at a waypoint) to spawn the buildings so they won't sell them (I've noticed that some people do this with AOD's and that might be why.)

Posted by: josh3d2004 - Tuesday, March 6, 2007 6:35:26 PM
[quote=Fleetatks] Try going into scripts and manually putting the flag for unsellable on the buildings. If that doesn't work I see two ways of fixing this. 1. Remove the command button for the sell command from the chinese buildings. 2. Place waypoints where you want to put units/buildings and use the (Team->Spawn->Spawn an instance of a team at a waypoint) to spawn the buildings so they won't sell them (I've noticed that some people do this with AOD's and that might be why.) [/quote] Thank you so much man, that takes a load off my mind. The spawn trick worked perfectly, but one more question. How do you add vehicles and units to the build que? Like the war factories and barrack's as well as airfields. Through the edit teams menu right? I believe that is right, set like the min and max to like 3 and it builds 3 of whatever unit specified correct? And how do you let them continue building them when destroyed? Just make scripts that check if the units are destroyed and then to remake them or something right? Then for building more buildings use the build list tool and set the team to whatever team the spawned units are right? I believe I have everything figured out now. Thank you so much man I really appreciate it, this will really add an extra bonus to my maps. Thanks [grin]

Posted by: fleetatks - Wednesday, March 7, 2007 2:19:15 PM
Having the AI Make teams of units is a very complicated proccess in scripts that takes hours, days, or even weeks. For now I suggest just having the AI have a lot of his own units and buildings then have units spawn in his base and have them follow a waypoint path to get to the players.

Posted by: josh3d2004 - Thursday, March 8, 2007 12:42:19 PM
[quote=Fleetatks] Having the AI Make teams of units is a very complicated proccess in scripts that takes hours, days, or even weeks. For now I suggest just having the AI have a lot of his own units and buildings then have units spawn in his base and have them follow a waypoint path to get to the players. [/quote] Ahh, thanks man. I appreciate all the help and I'll try it a little later (hopefully) when I get some more freetime. I appreciate all the responses and answers to my questions. [grin]