View Full Version : Need help ! script not working
0 hour
12-14-2007, 08:58 AM
i made two scripts
1:
*** IF ***
Unit 'Crusader1' enters area 'Crusader Danger'
*** THEN ***
Spawn an instance of Team 'terrorbike' at Waypoint 'Waypoint 1'.
2:
*** IF ***
Team 'terrorbike' has been created.
*** THEN ***
Team 'terrorbike' attacks Unit 'Crusader1'
Result: when crusader1 tank enters trigger area "crusader danger" , a unit terrorist bike creates at waypoint, but it doesn't attacks the unit "crusader1"
it means that there is some problem in the second script. plz help :redface:
Me Myself & Pi
12-14-2007, 10:33 AM
I'm not entirely sure why that doesn't work. Maybe the condition in the second script is only applies for teams that the AI builds, not when their spawned. So just put the action of the second script into the first script. (Make sure the attacking action is after the spawning action. You can tell the team to spawn first, then attack. But you can't tell the team to attack first, then spawn.) This should work & should look like this:
*** IF ***
Unit 'Crusader1' enters area 'Crusader Danger'
*** THEN ***
Spawn an instance of Team 'terrorbike' at Waypoint 'Waypoint 1'.
Team 'terrorbike' attacks Unit 'Crusader1'
0 hour
12-15-2007, 11:37 PM
Thanks for the reply , ur trick really works ! :)
Need one more help !
What kind of script is required , so that AI starts building a particular team ?
I have tried many scripts but did not succeed.
I think it also requires some settings with "teams" and "subroutine script" ..
plz help!
Me Myself & Pi
12-17-2007, 12:58 AM
It's accually two scripts.
1) Create a script & choose the action, "Player\Set a player to be able to build units." (There unable to build them at game start.)
2) Create a new script with the condition you want the team to start building by. Just leave the action as Null Operation.
3) In the script properties of this script, check, Script is Subroutine.
4) Go to the team window you want to be built.
5) In the Condition drop down menu, select the script you checked as a subroutine. (Scripts that are only checked as subroutines will appear here.)
6) In the "Build for" text box, just put "1" for the frame count. (This is the number EA made maps have for most of their Build for frame count.)
That should do it! The team should build as soon as the condition for the script is meat.
Tips:
If you do want to have actions for that script, go to the team window & check, Execute associated actions. The actions will then be carried out when the condition is met
If you want the script to be activated every time the action is met, uncheck, Deactivate upon success in the script properties.
You can run this script, there-by, the team building again, from another script using the action, "Scripting\Script\Run subroutine script."
If the script is repeated so the teams are built multiple times, you can set a limit to how many of the team can be on the map by the number that is in the Maximum Quantity:
If you want a script to be activated based on something the team has done (been built, sees an enemy, a unit in the team is destroyed, etc...) then create a new script as a subroutine. Leave the condition as True. For the action, choose whatever you want to happen. In the Behavior tap of the team window, choose the subroutine script in behavior condition of your choice.
If the action in the script has to do with the team, you can use <This Team>. (The <This Team> only refers to a team that the subroutine script is run by.)
There are other feature in the team window & it's tab, go ahead & explore them!
0 hour
12-17-2007, 04:44 AM
Thank you once again . All of ur replies are very useful . So now , i am also able to build teams. i don't know how u guys discovered that AI is not allowed to build any units and teams (by default) :) .
One more problem now!
Is it possible to make team to patrol at waypoints (by patrol i mean that they continuously move along a waypoint path but stop and fight if they see any enemy just like in redalert 2)
I made a script but the only problem is that the team dont stop to fight and continue to move along the waypoint path . Can u plz help !
Me Myself & Pi
12-18-2007, 10:38 AM
Try adding a script as a subroutine without it deactivating upon success (You'll want this script to repeat.) & have True as the condition. For the action, have <This Team> follow the path. Now create another script just like & use the hunting action. Then in the behavior tab, in the On Enemy Sighted drop down menu, select the script that tells <This Team> to hunt. For the On All Clear one, select the the script that tells it to move.
Be sure to still include the script that starts them moving in the first place.
That should do it!
0 hour
12-18-2007, 08:49 PM
ok i'll try this team patrol later!
right now i have one more question :)
i want the AI bomb truck to disguise as enemy vehicle. For this i placed a bomb truck on the map and named it "bomb boy" , i also made two scripts
1.
*** IF ***
True.
*** THEN ***
Set timer 'timer2' to expire in 10.00 seconds.
2.
*** IF ***
Timer 'timer2' has expired.
*** THEN ***
Unit 'bomb boy' use Ability 'Command_DisguiseAsVehicle' on Unit 'Crusader2'.
but it didnt work. Have any better idea Me Myself and Pi ?
Me Myself & Pi
12-19-2007, 08:58 AM
I've also had trouble using that action for certain units too. Try using using the bomb trucks from the other GLA factions & see if that works. If that doesn't work, try using the the bomb truck with CINE_ infront of them. If that doesn't work, I don't know what will.
P.S.
Thanks for all your posts. It's been dull in this section of the forums.
0 hour
12-19-2007, 10:37 AM
i have one more question for u.
i made a team of 3 GLA workers .The AI builds these workers but these workers remains idle and do nothing.I want these workers to collect supply.Is there any script for it ?
0 hour
12-22-2007, 11:22 PM
looks like Me Myself and Pi is tired up from my silly questions.
I'm sorry !
Me Myself & Pi
12-23-2007, 02:15 PM
Nah, I'm not tired. I enjoy answering you questions. It's just that I'm at my Grandparents house for Christmas. I'd rather not get into details so I'll just say that I really only check this forum once a day. For some reason, I wasn't able to get on this forum site yesterday.
Usually, the workers will start collecting the supplies as soon as their built. Are the supplies close enough? If so, upload the map in a ZIP folder so I can check it out.
0 hour
12-23-2007, 07:58 PM
Oh that's great !
i found an another way. Instead of the previous scripts i used "use command ability button of supply to build the workers" , and it worked ! now the workers also collect supply by themselves :)
vBulletin® v3.8.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.