Posted by: shekdog - Sunday, May 3, 2009 11:24:01 AM
Hi, I had looked online and found out about the script on spawning unmanned units. So I looked and followed its procedure, as described here:http://au.gamespot.com/pc/strategy/candcgeneralszerohour/show_msgs.php?topic_id=m-1-42101782&pid=917865 I did exactly as it said, but the units which are placed under the team are still ungarrisonable. So what did I do wrong?

Posted by: Drummin - Sunday, May 3, 2009 10:12:06 PM
Hello, I did a little test of my own. I created a new player called "TankTeam". In the script writing area inside this new player's folder I made an [u]NonActive[/u] script called "MakeUnManned" and so the setting for this script is [ns na D] with the following script. [code]*** IF *** True. *** THEN *** Make Team 'teamTankTeams' unmanned.[/code] The condition for creating your units can be whatever you want but each time you create the unit, activate your "MakeUnManned" script. So at the very basic level you'd have this. [code]*** IF *** True. *** THEN *** Spawn unit of type 'AmericaTankCrusader' on Team 'teamTankTeams' at waypoint Waypoint 'SpawnPoint' Enable Script 'MakeUnmanned'.[/code] I also played around with adding counters and timers, first setting the counter to zero with a Separate script like this. [code]*** IF *** True. *** THEN *** Set 'LimitTeam1' to 0[/code] And a Timer script like this. [code]*** IF *** True. *** THEN *** Set timer 'Delay1' to expire in 8.00 seconds.[/code] And then adding timer condition check and an "Add To Counter" line to the spawn side of the script like this. [code]*** IF *** Timer 'Delay1' has expired. *** THEN *** Spawn unit of type 'AmericaTankCrusader' on Team 'teamTankTeams' at waypoint Waypoint 'SpawnPoint' Enable Script 'MakeUnmanned'. Add 1 to counter 'LimitTeam1' Enable Script 'MakeATankPing'.[/code] Notice I enabled a "Ping script". This is used to reset things and check the unit count. It goes like this. [code]*** IF *** Counter 'LimitTeam1' IS Less Than 2 *** THEN *** Enable Script 'DelayTime'. Enable Script 'MakeATank'.[/code] If you only wanted this script and timer activated after the unit is captured then I would make an Area around the spawn point and add a "unit check" line to the ping script like this. [code]*** IF *** Counter 'LimitTeam1' IS Less Than 2 *AND* Player 'TankTeams' has Less Than 1 unit or structure of type 'AmericaTankCrusader' in the area 'DetectionZone' *** THEN *** Enable Script 'DelayTime'. Enable Script 'MakeATank'.[/code] This would mean that after the unit is captured, player "TankTeams" no longer has a unit in this location and so the timer and spawn scripts are reactivated. Like I said, you can make the condition whatever you want. I'm throwing out some ideas. Hope this helps.

Posted by: shekdog - Monday, May 4, 2009 7:36:17 AM
Thanks for the help. I was actually looking for a script that's going to make units unmanned, but I did it by naming the units, then wrote a script to change the unit status to "unmanned". I figured out it wasn't working at first because I placed the script under the wrong player. But thanks for the tip. And by the way, do you have to place the script under "PlyCivilian" to make neutral units unmanned? I tried to put it under a newly created player like it said in that tutorial in the link, but it didn't work. Thanks again

Posted by: Drummin - Monday, May 4, 2009 7:44:23 AM
Well I was trying to avoid using named units. This is why I used team in the new player folder. If you use named units you should be able to do all scripting and spawning in the PlyrCivilian folder.

Posted by: shekdog - Tuesday, May 5, 2009 1:15:47 AM
I don't really understand. I tried to set the team status to unmanned like it said in that link, and placed the units under the new created player, but it didn't work however I tried it. I got really frustrated so looked at someone else's map, and found that they all used named units, so I copied. But it is quite time-consuming and repetitive, but I just can't do it the other way.

Posted by: Drummin - Tuesday, May 5, 2009 6:51:27 AM
From the title of your post I'm assuming you're spawning units at some point after the game starts. Correct? You really have two options: In PlyrCivilian folder Use named units and on each spawn script add the line to make that named unit unmanned. OR In Created player folder Use the first two examples above to make the team unmanned. In both cases the "Make Unmanned" script line is used after each spawn. I've attached the sample map, which shows three ways you could add unmanned units to the map. Spawn a named unit. Use a placed team. (Like your linked sample) Spawn unnamed unit to a team. (My sample above) The scripts on this sample map explain what's going on and how you could use it. Note: If using placed units you could also put a bunch of named units on the map and write a script to make each named unit unmanned. Seems like a waste of effort but also works. This is not shown in the sample map. [ATTACH]352[/Attach]

Posted by: shekdog - Tuesday, May 5, 2009 9:18:45 PM
Thanks for the map, that solved my problem. And sorry for not making my question clear. I was just trying to find out a way to make units unmanned, whether to spawn one or making an existing unit unmanned. So I tried the way in that link but didn't work, so looked at other people's map and did it the hard way. Thanks again for your help.

Posted by: towns1 - Sunday, May 17, 2009 10:36:02 PM
tanks for that but i need to play a saund everytime i haf been attacked how do i do that[i]???[/i]

Posted by: krit - Monday, May 18, 2009 3:35:44 AM
[quote=towns1]tanks for that but i need to play a saund everytime i haf been attacked how do i do that[i]???[/i][/quote] For the hundredth time; stop hijacking other people's topics...