Posted by: crashdodgers - Thursday, November 28, 2013 1:01:46 PM
Hi all, this request/problem has been giving my trouble best part of the week. All I want to do is make my infantry garrison a build just like the AI,now I know you need a script telling the to garrison and a subroutine to action it, but try as I might I am still unable to get my units to garrison the build. The close I got was a pathfinder to garrison a building, leaving 9 missile defenders out side. So how do you create a script with an attached subroutine or edit a team to use a subroutine instead of a script?

Posted by: bio138 - Thursday, November 28, 2013 2:57:50 PM
Hey, I am fairly new to scripting but I know what is going on somewhat. I solved your solution (I think the way you want it, I could be completely wrong) I created a team under an AI ie(SkirmishGLA) It has 3 Missile Defenders, *** IF *** Player 'SkirmishGLA' is Faction Name: GLA *** THEN *** Spawn an instance of Team 'team0001' at Waypoint 'Spawn1'. Team 'team0001' enters into building named Unit 'Test1' That's how I got it to work, I don't know if that's what you wanted, but they spawn, enter and shoot at anyone that passes by, this what you want?

Posted by: crashdodgers - Thursday, November 28, 2013 4:43:31 PM
Hi Bio138, thanks for that but all it dose is crash the game.

Posted by: bio138 - Thursday, November 28, 2013 6:25:55 PM
Hmmm that's odd, you had the other player set as GLA right? I'm on a mobile device right now so I can't do much testing, also you made a team, named it and named a building and changed the values I gave you? Not trying to tell you how to but I have made some stupid mistakes before. Running in comp mode? Are you using the built in script editor or are you using out game? Just trying to list things that I've screwed up causing the game to crash for me before. When I get home ill do futher testing but for now I can only give you tips of what I know

Posted by: crashdodgers - Friday, November 29, 2013 2:57:38 AM
Hi Bio138, well after a few hours of good sleep I final cracked it, found out what caused the crash and now it works fine. Listed below is how it was done. 1. Place a Barracks belonging to example “SkirmishAmerica” in side your base area. 2. In edit player list, add skirmish players and then remove the unwanted teams, then edit faction team, “SkirmishAmerica” so that they are allies and your enemy to their enemy. Make sure that this team is still an AI team. 3. In edit teams create new team/teams for the SkirmishAmerica. 4. Use script below to create an American guard team. 5. When creating script always remember that every additional unit, example “AmericaInfantryMissileDefender” is created as a new script and not a copy. 6. Copy and edit finished script to make additional teams. *** IF *** Player 'SkirmishAmerica' is Faction Name: America *** THEN *** Spawn unit of type 'AmericaInfantryPathfinder' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Spawn unit of type 'AmericaInfantryMissileDefender' on Team 'team0001' at waypoint Waypoint 'GuardTower1' Move Team 'team0001' to Waypoint 'GuardTower1A'. Team 'team0001' enters into building named Unit 'GuardTower_1'