Spawn aggressive enemy platoon

Smellis

New member
Joined
May 22, 2011
Messages
22
Could someone demonstrate a simple add enemy platoon that attempts to capture only player city and stops to attack. i have a sandbox map that i would like large platoons to attack on beach/ coord. I will leave conditions for now and just use 30seconds. i can create the platoon but cannot make it attack anything.

Help would be greatly appreciated.
 
 
   It may be more helpful to point out the list of commands possible. From your script compiler directory, go back on folder, then go into the folder, "Script Language Documentation." Open the index.html file, go to section 3 (statements), then go to the table of contents section 3.18.

   There are several commands that may be useful that are described here:
[ add object to platoon object attack list ]
[ object attack object with severity expression ]
[ object attack buildings near coord_expression radius expression ]
[ set object attack everything near coord_expression radius expression ]
[ set platoon take over town ]

-ego533
 
 
thank you, i found the expressions but i just cant get it to work the way i want it to.

what is this missing?

Code:
define script enemyplatoon

begin script enemyplatoon

myCreature = player 0 creature
oPlatoon = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1250.197,30.1250} with 6 men and 6 women

start
	add myCreature to platoon oPlatoon attack list

end script enemyplatoon
 
try...

define script enemyplatoon

begin script enemyplatoon
myCreature = 0
oPlatoon = 0

start
                myCreature = player 0 creature
                create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1250.197,30.1250} with 6 men and 6 women
                set oPlatoon Player 1
add myCreature to platoon oPlatoon attack list

end script enemyplatoon
 
sorry left a bit out....

define script enemyplatoon

begin script enemyplatoon
myCreature = 0
oPlatoon = 0

start
          myCreature = player 0 creature
          oPlatoon = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1250.197,30.1250} with 6 men and 6 women
          set oPlatoon Player 1
          add myCreature to platoon oPlatoon attack list

end script enemyplatoon

 
 
   The "add to attack list" command never seems to work for me. It just crashes the game, in fact.. Does it do this for you also?

   I have this working to do something like what you're looking for, I think. Platoon actions are found in "PlatoonAgendaEnums.h":

Code:
run script MainScript

begin script MainScript

	playercreature[8]
	myCreature = 0
	myplatoon1 = 0
	myplatoon2 = 0
	thisplatoon1 = 0
	thisplatoon2 = 0
	thisplatoon3 = 0

start

	disable load screen
	set fade in time 3

	wait 3 seconds

	begin cinema
		set camera position to {1685,167,840}
		set camera focus to {1675,164,830}
	end cinema	


	playercreature[0] = create SCRIPT_OBJECT_TYPE_CREATURE CREATURE_TYPE_WOLF at {1600,163,828} using only alignment good neutral evil
	set player 0 creature to playercreature[0]
	myCreature = get player 0 creature
	set creature myCreature CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_FATNESS 0.4
	set creature myCreature CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_STRENGTH 1.0
	set creature myCreature CREATURE_SCRIPT_TRANSITIONAL_ATTRIBUTE_TYPE_SIZE 0.8

	wait 3 seconds

	myplatoon1 = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1620,163,835} with 6 men and 6 women
	set myplatoon1 player 0
	myplatoon2 = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1690,163,700} with 6 men and 6 women
	set myplatoon2 player 0
	disable platoon myplatoon2 respond to local platoon attack
	disable platoon myplatoon2 respond to player army


// Platoon1 - Will attack myplatoon1
// Platoon2 - Will attack myplayoon2, after 5 seconds, breaks off and attacks creature
// Platoon3 - Will attack myplayoon2, when the myplatoon2 is destroyed will attack creature


	thisplatoon1 = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1670,163,828} with 8 men and 8 women
	set thisplatoon1 player 1
	thisplatoon2 = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1720,163,700} with 8 men and 8 women
	set thisplatoon2 player 1
	disable platoon thisplatoon2 respond to local platoon attack
	disable platoon thisplatoon2 respond to player army
	thisplatoon3 = create platoon PLATOON_INFO_AZTEC_MELEE_10 at {1720,163,680} with 8 men and 8 women
	set thisplatoon3 player 1
	disable platoon thisplatoon3 respond to local platoon attack
	disable platoon thisplatoon3 respond to player army


	wait 3 seconds


	set thisplatoon1 attack myplatoon1 with severity 1
	add action PLATOON_AGENDA_ACTION_ATTACK using myplatoon2 to thisplatoon2 action queue
	add action PLATOON_AGENDA_ACTION_ATTACK using myplatoon2 to thisplatoon3 action queue

	wait 5 seconds
	add action PLATOON_AGENDA_ACTION_ATTACK using myCreature to front of thisplatoon2 action queue
	add action PLATOON_AGENDA_ACTION_ATTACK using myCreature to next in thisplatoon3 action queue



end script MainScript
 
messing around with it i noticed "get" was missing, and i also added a prism as a switch so they attacked on click, as you say it crashes my game so i have avoided and successfully got the troops to attempt to capture my town using the attack object. if anyone has got slightly more advanced scripts so the dummies dont attack without defending themselves. also i was wondering how to get a mobile static to move after it is created. Eventually i hope to have a defend city style map that has ships dropping off troops.

 
Back
Top