Home   Help Search Login Register  

Author Topic: AI waypoints after using Createunit command  (Read 773 times)

0 Members and 1 Guest are viewing this topic.

solo1zone

  • Guest
AI waypoints after using Createunit command
« on: 25 Feb 2003, 09:01:28 »
Created a map that has a trigger calling a script SQS file to create enemyunits on the map. I would like to assign waypoints or markers so they can move around in a patrolling fashion. The script is very simple and contains the following below. Can I add to my SQS script the waypoint actions or do i put it in the activiation line of the trigger? Either way the code and help and would be appreciated. :D

;F6R1=marker on map
;gair=group name

; Spawn Resistance in Area Airport
"SoldierGB" createUnit [getMarkerPos "F6R1", gair]
"SoldierGAA" createUnit [getMarkerPos "F6R1", gair]
"SoldierGAA" createUnit [getMarkerPos "F6R1", gair]
"SoldierGLAW" createUnit [getMarkerPos "F6R1", gair]
"SoldierGMG" createUnit [getMarkerPos "F6R1", gair]
"SoldierGB" createUnit [getMarkerPos "F6R1", gair]
"SoldierGB" createUnit [getMarkerPos "F6R1", gair]
exit

CrashnBurn

  • Guest
Re:AI waypoints after using Createunit command
« Reply #1 on: 25 Feb 2003, 10:59:01 »
Heres an easy way. Place 1 soldier in the editor, same side as your group you're creating. Give it the waypoints you want the created units to use. In the ini of the soldier give it the groupname and delete it:

gair = group this; deletevehicle this

Now when you load the mission, the soldier will be gone, but the units created with its groupname will use the waypoints. simple eh ?

solo1zone

  • Guest
Re:AI waypoints after using Createunit command
« Reply #2 on: 25 Feb 2003, 15:40:15 »
Thats funny u mentioned create a lead first. I had to do that for the createunit command to actually work. So I stuck that guy on a island on the map so the group will not respond to him, that controls them from roaming outside the trigger zone. Thus my wanting the waypoints...

I will take your input and put it to a test....good thinking. will let you know if it works.... Thanks...

new post: 2/25/03-10am
Well it worked. for the one time. they followed the waypoints and the man was deleted. This is where my next problem arose. My trigger was a repeat trigger, it will keep creating AI as long as knowone was in the trigger zone. If I take out all the resistance, and leave the trigger, it will respawn a patrol back (who just sit there, no more waypoints on the second go around, then third...etc)

Example: I have it in a C&H mission, if the East or West take the town away from resistance, they really should leave a player there to defend, else once they leave the trigger zone it will create resistance AI to patrol. This makes the C&H harder for both teams, the owning team will maintain ownership but will have to fight if they want to go back,and the other team will have to fight the resistance just to capture the zone if the opposing left it.

I took out the deletevehicle and moved the lead to the island. This made the team run a muck and not follow the waypoints....???
« Last Edit: 25 Feb 2003, 16:36:34 by solo1zone »

solo1zone

  • Guest
Re:AI waypoints after using Createunit command
« Reply #3 on: 26 Feb 2003, 03:55:45 »
I figured it out 1) u have to have a soldier on a seperate island with the gair = group this: then made a trigger that uses Anybody , repeatedly not present. On the activiation line called the below script. (this exec "air.sqs). On the map put a small 5:5 trigger around marker ma1(first move point), that says when Res present send to another point (using the commandmove). Then you can string the markers all over the area and cover them with 5:5 triggers.....

<air.sqs>
; Spawn Resistance in Area Airport
"SoldierGB" createUnit [getMarkerPos "F6R1", gair,"gairlead = this", 0.9, "Captain"]
"SoldierGAA" createUnit [getMarkerPos "F6R1", gair, "gairp1 = this"]
"SoldierGAA" createUnit [getMarkerPos "F6R1", gair, "gairp2 = this"]
"SoldierGLAW" createUnit [getMarkerPos "F6R1", gair, "gairp3 = this"]
"SoldierGMG" createUnit [getMarkerPos "F6R1", gair, "gairp4 = this"]
"SoldierGB" createUnit [getMarkerPos "F6R1", gair, "gairp5 = this"]
"SoldierGB" createUnit [getMarkerPos "F6R1", gair, "gairp6 = this"]
leader gairlead
gair setbehaviour "COMBAT"
[gairlead,gairp1,gairp2,gairp3,gairp4,gairp5,gairp6] commandmove getmarkerpos "ma1"

exit