测试
This commit is contained in:
@@ -12,54 +12,65 @@
|
||||
# * * ************************************** * *
|
||||
|
||||
include_once weapons/sam/large_sam.txt
|
||||
include_once behavior/behavior_engage.txt
|
||||
|
||||
platform_type LARGE_SAM_LAUNCHER WSF_PLATFORM
|
||||
platform_type LARGE_SAM_LAUNCHER WSF_PLATFORM
|
||||
icon SA-10_Launcher
|
||||
radar_signature VEHICLE_RADAR_SIGNATURE
|
||||
|
||||
comm cmdr_net RED_DATALINK
|
||||
|
||||
mover WSF_GROUND_MOVER
|
||||
end_mover
|
||||
|
||||
comm cmdr_net RED_DATALINK
|
||||
network_name <local:slave>
|
||||
internal_link data_mgr
|
||||
internal_link task_mgr
|
||||
end_comm
|
||||
mover WSF_GROUND_MOVER
|
||||
end_mover
|
||||
|
||||
processor data_mgr WSF_TRACK_PROCESSOR
|
||||
purge_interval 60 sec
|
||||
end_processor
|
||||
|
||||
processor task_mgr WSF_TASK_PROCESSOR
|
||||
script void on_task_assign(WsfTask aTask, WsfTrack aTrack)
|
||||
|
||||
if (aTask.TaskType() == "ENGAGE")
|
||||
{
|
||||
WsfWeapon missile = PLATFORM.Weapon("sam");
|
||||
missile.Fire(aTrack);
|
||||
writeln("fire,remain weapon:", missile.QuantityRemaining());
|
||||
}
|
||||
if (aTask.TaskType() == "MOVE")
|
||||
{
|
||||
if(!aTrack.WithinZoneOf(PLATFORM,"battalion_sector"))
|
||||
{
|
||||
double relativeAzimuthOf=
|
||||
PLATFORM.RelativeAzimuthOf(aTrack.CurrentLocation());
|
||||
PLATFORM.TurnToRelativeHeading(relativeAzimuthOf);
|
||||
PLATFORM.GoToSpeed(16);#m/s
|
||||
|
||||
}
|
||||
}
|
||||
if (aTask.TaskType() == "WAIT")
|
||||
{
|
||||
PLATFORM.GoToSpeed(0);#m/s
|
||||
}
|
||||
|
||||
update_interval 5 sec
|
||||
advanced_behavior_tree
|
||||
selector
|
||||
behavior_node behavior_engage
|
||||
end_selector
|
||||
|
||||
end_advanced_behavior_tree
|
||||
|
||||
end_script
|
||||
# script void on_task_assign(WsfTask aTask, WsfTrack aTrack)
|
||||
#
|
||||
# if (aTask.TaskType() == "ENGAGE")
|
||||
# {
|
||||
# WsfWeapon missile = PLATFORM.Weapon("sam");
|
||||
# missile.Fire(aTrack);
|
||||
# writeln("fire,remain weapon:", missile.QuantityRemaining());
|
||||
# }
|
||||
# if (aTask.TaskType() == "MOVE")
|
||||
# {
|
||||
# if(!aTrack.WithinZoneOf(PLATFORM,"battalion_sector"))
|
||||
# {
|
||||
# double relativeAzimuthOf=
|
||||
# PLATFORM.RelativeAzimuthOf(aTrack.CurrentLocation());
|
||||
# PLATFORM.TurnToRelativeHeading(relativeAzimuthOf);
|
||||
# PLATFORM.GoToSpeed(16);#m/s
|
||||
#
|
||||
# }
|
||||
# }
|
||||
# if (aTask.TaskType() == "WAIT")
|
||||
# {
|
||||
# PLATFORM.GoToSpeed(0);#m/s
|
||||
# }
|
||||
#
|
||||
#
|
||||
# end_script
|
||||
|
||||
|
||||
end_processor
|
||||
|
||||
|
||||
|
||||
weapon sam LARGE_SAM
|
||||
quantity 10
|
||||
end_weapon
|
||||
|
||||
Reference in New Issue
Block a user