Ref_BIGPenaltyKick_11vs11
约 792 字
前言
Ref_BIGPenaltyKick_11vs11.lua 是为 11 辆车设计的,我方 Penalty (点球)阶段的跑位脚本。此脚本用于让全体车辆就位,然后 Goalie 开始点球
此脚本会在裁判盒发出我方的 PENTLAY_KICK 指令后,自动切换到该脚本,直到收到裁判盒的指令后,点球阶段结束。
当裁判盒发出对方的 PENALTY_KICK 指令,即对方进行点球时,跳转的是 Ref_PenaltyDef_11vs11 ,请注意不要混淆。
提示
你可以在这一位置找到文件: ZBin/lua_scripts/play/Ref/PenaltyKick/Ref_BIGPenaltyKick_11vs11.lua
--9*6
-- local our_player_stand_pos = {
-- CGeoPoint:new_local(-4000, 1100),
-- CGeoPoint:new_local(-4000,-1100),
-- CGeoPoint:new_local(-3400, 0),
-- CGeoPoint:new_local(-3400,-500),
-- CGeoPoint:new_local(-3400, 500),
-- }
--6*4
local our_player_stand_pos = {
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500, 1350),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500,-1350),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500, 0),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500,-1000),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500, 1000),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500,-1700),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500, 1700),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500, 2100),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500,-2100),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500, 2500),
CGeoPoint:new_local(-param.pitchLength/2 + param.penaltyDepth + 500,-2500),
}
local DSS_FLAG = flag.allow_dss + flag.dodge_ball --+ flag.our_ball_placement
local f = flag.dribbling --+ flag.our_ball_placement
local catchf = flag.dribbling + flag.our_ball_placement
local kickpos = {
CGeoPoint:new_local(param.pitchLength/2,-param.goalWidth/2+150),
CGeoPoint:new_local(param.pitchLength/2,param.goalWidth/2-150)
}
local willshootPos = function()
local ballPos = ball.pos()
local idir = (ballPos - pos.theirGoal()):dir()
local pos = ballPos + Utils.Polar2Vector(350+param.playerFrontToCenter,idir)
return pos
end
gPlayTable.CreatePlay{
firstState = "WaitStart",
["WaitStart"] = {
switch = function()
if cond.isNormalStart() then
return "PenaltyKick"
end
-- if cond.isGameOn() then
-- return "exit"
-- end
end,
Assister = task.goCmuRush(our_player_stand_pos[1],0,_,DSS_FLAG),
Special = task.goCmuRush(our_player_stand_pos[2],0,_,DSS_FLAG),
Defender = task.goCmuRush(our_player_stand_pos[4],0,_,DSS_FLAG),
Middle = task.goCmuRush(our_player_stand_pos[5],0,_,DSS_FLAG),
Breaker = task.goCmuRush(our_player_stand_pos[6],0,_,DSS_FLAG),
Receiver = task.goCmuRush(our_player_stand_pos[7],0,_,DSS_FLAG),
Kicker = task.goCmuRush(our_player_stand_pos[8],0,_,DSS_FLAG),
Fronter = task.goCmuRush(our_player_stand_pos[9],0,_,DSS_FLAG),
Center = task.goCmuRush(our_player_stand_pos[10],0,_,DSS_FLAG),
Leader = task.goCmuRush(our_player_stand_pos[11],0,_,DSS_FLAG),
Goalie = task.goCmuRush(willshootPos,dir.playerToBall,_,DSS_FLAG),
match = "{ASMDBRKFCL}"
},
["PenaltyKick"] = {
switch = function()
-- if cond.isGameOn() then
-- -- return "exit"
-- end
-- if bufcnt( player.kickBall("Leader"), "", 750) then
-- return "exit"
-- end
end,
Assister = task.goCmuRush(our_player_stand_pos[1],0,_,DSS_FLAG),
Special = task.goCmuRush(our_player_stand_pos[2],0,_,DSS_FLAG),
Defender = task.goCmuRush(our_player_stand_pos[4],0,_,DSS_FLAG),
Middle = task.goCmuRush(our_player_stand_pos[5],0,_,DSS_FLAG),
Breaker = task.goCmuRush(our_player_stand_pos[6],0,_,DSS_FLAG),
Receiver = task.goCmuRush(our_player_stand_pos[7],0,_,DSS_FLAG),
Kicker = task.goCmuRush(our_player_stand_pos[8],0,_,DSS_FLAG),
Fronter = task.goCmuRush(our_player_stand_pos[9],0,_,DSS_FLAG),
Center = task.goCmuRush(our_player_stand_pos[10],0,_,DSS_FLAG),
Leader = task.goCmuRush(our_player_stand_pos[11],0,_,DSS_FLAG),
Goalie = task.bigpenaltykick(),
match = "{ASMDBRKFCL}"
},
name = "Ref_BIGPenaltyKick_11vs11",
applicable ={
exp = "a",
a = true
},
attribute = "attack",
timeout = 99999
}这个脚本的难度相比与任意球,NormalPlayMessi 等脚本,难度下降很多,点球阶段我方真正工作的只有 Goalie ,其余车只需要站着就行了,而且点球的实现都在 C++ 层,Lua 层只需要把接口接上就行了。
和其他脚本相同,这个脚本有两个状态。
WaitStart
这个状态是点球还没有开始前,裁判盒发出 Penalty 指令,告诉大家准备点球,让大家就位。
按照规则,在点球阶段,除了点球车,其他所有车辆需要保持在球后方一米的位置以保证不会影响整个点球流程。
因此,我们的车都在禁区前面站着,站成一排,只需要跑 goCmuRush 就可以了。大家的位置可以保证不会接近球
我们的 Goalie 作为点球车,需要跑到点球点前等候,裁判会把球放到点球点的。
PenaltyKick
这个状态是从 WaitStart 阶段跳转过来的,当收到 Normal Start 指令,我们的车可以开始点球了,这时候其他车辆保持原状态, Goalie 跑 task.bigpenaltykick() ,踢着球往前跑,伺机射门
贡献者
更新日志
2026/2/16 22:23
查看所有更新日志
bc21e-init于