加入火力打击无人机
This commit is contained in:
45
behavior/UCAV_fire.txt
Normal file
45
behavior/UCAV_fire.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
# File generated by Wizard 2.9.0 on Oct 9, 2025.
|
||||
advanced_behavior UCAV_fire
|
||||
|
||||
script_variables
|
||||
WsfWeapon missile;
|
||||
WsfControlMessage msg=WsfControlMessage();
|
||||
string str="";
|
||||
WsfTrack track=WsfTrack();
|
||||
end_script_variables
|
||||
|
||||
on_init
|
||||
missile = PLATFORM.Weapon("blue_gps_bomb_1");
|
||||
|
||||
end_on_init
|
||||
|
||||
on_message
|
||||
type WSF_CONTROL_MESSAGE
|
||||
script
|
||||
msg=(WsfControlMessage)MESSAGE;
|
||||
writeln("receive",msg.AuxDataString("task"));
|
||||
str=msg.AuxDataString("task");
|
||||
track=(WsfTrack)msg.AuxDataObject("track");
|
||||
#writeln(str);
|
||||
|
||||
end_script
|
||||
end_on_message
|
||||
|
||||
precondition
|
||||
|
||||
if( str=="FIRE")
|
||||
{
|
||||
writeln("UCAVE fire");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
end_precondition
|
||||
|
||||
execute
|
||||
missile.Fire(track);
|
||||
writeln("fire,remain weapon:", missile.QuantityRemaining());
|
||||
str="";
|
||||
return Success();
|
||||
end_execute
|
||||
|
||||
end_advanced_behavior
|
||||
46
behavior/UCAV_move.txt
Normal file
46
behavior/UCAV_move.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
# File generated by Wizard 2.9.0 on Oct 9, 2025.
|
||||
advanced_behavior UCAV_move
|
||||
|
||||
script_variables
|
||||
WsfControlMessage msg=WsfControlMessage();
|
||||
string str="";
|
||||
WsfTrack track=WsfTrack();
|
||||
end_script_variables
|
||||
|
||||
on_init
|
||||
|
||||
end_on_init
|
||||
|
||||
on_message
|
||||
type WSF_CONTROL_MESSAGE
|
||||
script
|
||||
WsfControlMessage msg=(WsfControlMessage)MESSAGE;
|
||||
writeln("receive",msg.AuxDataString("task"));
|
||||
str=msg.AuxDataString("task");
|
||||
track=(WsfTrack)msg.AuxDataObject("track");
|
||||
|
||||
end_script
|
||||
end_on_message
|
||||
|
||||
precondition
|
||||
if(str=="MOVE")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
end_precondition
|
||||
|
||||
execute
|
||||
if(!track.WithinZoneOf(PLATFORM,"battalion_sector"))
|
||||
{
|
||||
double relativeAzimuthOf=
|
||||
PLATFORM.RelativeAzimuthOf(track.CurrentLocation());
|
||||
PLATFORM.TurnToRelativeHeading(relativeAzimuthOf);
|
||||
PLATFORM.GoToSpeed(200);#m/s
|
||||
|
||||
}
|
||||
str="";
|
||||
return Success();
|
||||
end_execute
|
||||
|
||||
end_advanced_behavior
|
||||
36
behavior/UCAV_wait.txt
Normal file
36
behavior/UCAV_wait.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
# File generated by Wizard 2.9.0 on Oct 9, 2025.
|
||||
advanced_behavior UCAV_wait
|
||||
|
||||
script_variables
|
||||
WsfWeapon missile;
|
||||
WsfControlMessage msg=WsfControlMessage();
|
||||
string str="";
|
||||
end_script_variables
|
||||
|
||||
on_init
|
||||
|
||||
end_on_init
|
||||
|
||||
on_message
|
||||
type WSF_CONTROL_MESSAGE
|
||||
script
|
||||
WsfControlMessage msg=(WsfControlMessage)MESSAGE;
|
||||
writeln("receive",msg.AuxDataString("task"));
|
||||
str=msg.AuxDataString("task");
|
||||
end_script
|
||||
end_on_message
|
||||
|
||||
precondition
|
||||
if(str=="WAIT")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
end_precondition
|
||||
|
||||
execute
|
||||
PLATFORM.GoToSpeed(0);#m/s
|
||||
return Success();
|
||||
end_execute
|
||||
|
||||
end_advanced_behavior
|
||||
@@ -16,7 +16,7 @@ advanced_behavior behavior_wait
|
||||
script
|
||||
WsfControlMessage msg=(WsfControlMessage)MESSAGE;
|
||||
writeln("receive",msg.AuxDataString("task"));
|
||||
str=msg.AuxDataString("tsak");
|
||||
str=msg.AuxDataString("task");
|
||||
end_script
|
||||
end_on_message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user