第六章第八节Lua及C++函数
Posted iLoboke
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第六章第八节Lua及C++函数相关的知识,希望对你有一定的参考价值。
Lua及C++函数说明
附件一【task函数说明】
说明:
8.1.1-8.1.6函数为官方提供的自定义task函数,传入用户编写的dll技能,实现扩展
每个自定义task函数指定给对应的角色使用,如KickerTask对应Kicker(前锋)、ReceiverTask对应Receiver(中场)等。
使用方法示例:
Kicker = KickerTask(“dll名称”, pos_,dir_,kickflat_,kp_,cp_)
然后,我们需要明白,自定义skill技能函数的c++框架。
KickerTask
ReceiverTask

TierTask

DefenderTask

MiddleTask

GoalieTask

说明:
· 8.1.7-8.1.19函数为官方task函数,调用官方提供的技能函数;
· 每一个官方task函数完成一项技能,并且可以指派给所有的角色使用。
GetBall

Goalie

GoRecePos

RobotHalt

NormalDef

PassBall

ReceiveBall

Stop

Shoot

RefDef

GotoPos

PenaltyDef

PenaltyKick

附件二【基础函数说明】
以下函数为LUA层可以直接调用的函数
比赛信息:我方球员
COurRole_x

COurRole_y

COurRoleDir

CBall2RoleDist

CRole2BallDir

COurRole2RoleDist

CRole2TargetDist

COurRole2RoleDir

CRole2OppGoalDir

CIsBallKick

CIsGetBall

比赛信息:敌方球员
CGetOppNums

注:CGetOppNums返回的table存储格式是{[0]=”n1”, [1]=”n2”,[2]=”n3”},存储顺序是随机的;其中”n1”,”n2”,”n3”表示返回的车号,车号是string类型。在实际应用中,我们需要用for...in pairs(table)do...的方式遍历table并找到场上敌方车号。
COppNum_x

COppNum_y

COppNumDir

CBall2OppNumDist???????

COppNum2BallDir


COppIsBallKick

COppIsGetBall

比赛信息:球
CGetBallX

CGetBallY

CBall2PointDist

CBall2PointDist

CBall2RoleDist

CBall2PointDir

CBall2PointDir

比赛信息:比赛条件
CGameOn

CNormalStart

Cbuf_cnt

附件三【worldmodel lib库说明】
worldmodel_lib库定义了WorldModel类,并通过WorldModle类中的方法获得球场上vision信息。
get_ball_pos

get_our_player_pos

get_opp_player_pos

get_ball_vel

get_our_player_v

get_opp_player_dir

get_our_player_dir

get_our_goalie

get_opp_goalie

get_our_exist_id

get_opp_exist_id

附件四【utils工具包说明】
PlayerTask类成员变量说明
orientate

target_pos

needKick

isPass

needCb

isChipPass

kickPower
以上是关于第六章第八节Lua及C++函数的主要内容,如果未能解决你的问题,请参考以下文章