武装突袭 Wiki
探索
首页
讨论板
所有页面
社区页
交互式地图
最新博文
页面
最新页面
Contact Reports
Hotshot's Sandbox
DIK KeyCodes
Curator
武装突袭 Wiki
Product.cpp/bin File Format
Oxygen Light
最新博客
分类
Uploaded with UploadWizard
Face A2 Face101.jpg
Face A2 Face102.jpg
Face A2 Face103.jpg
Face A2 Face104.jpg
Face A2 Face105.jpg
Face A2 Face106.jpg
Face A2 Face107.jpg
含有损坏文件链接的页面
Eden Editor: Introduction
Eden Editor: Switching from 2D Editor
Eden Editor: Menu Bar
Eden Editor: Asset Browser
Eden Editor: Toolbar
Eden Editor: Status Bar
Eden Editor: Entity Attributes
社区
社区首页
社区中心
帮助中心
FANDOM
游戏
电影
电视
wiki
探索wiki
社区中心
创建wiki
尚未注册?
注册
登录
登录
注册
武装突袭 Wiki
4,828
个页面
探索
首页
讨论板
所有页面
社区页
交互式地图
最新博文
页面
最新页面
Contact Reports
Hotshot's Sandbox
DIK KeyCodes
Curator
武装突袭 Wiki
Product.cpp/bin File Format
Oxygen Light
最新博客
分类
Uploaded with UploadWizard
Face A2 Face101.jpg
Face A2 Face102.jpg
Face A2 Face103.jpg
Face A2 Face104.jpg
Face A2 Face105.jpg
Face A2 Face106.jpg
Face A2 Face107.jpg
含有损坏文件链接的页面
Eden Editor: Introduction
Eden Editor: Switching from 2D Editor
Eden Editor: Menu Bar
Eden Editor: Asset Browser
Eden Editor: Toolbar
Eden Editor: Status Bar
Eden Editor: Entity Attributes
社区
社区首页
社区中心
帮助中心
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
编辑“
Arma 3 Animals: Override Default Animal Behaviour Via Script
”
返回页面
编辑
可视化编辑器
查看历史
讨论 (0)
正在编辑
Arma 3 Animals: Override Default Animal Behaviour Via Script
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
[[Category:Arma 3: Editing]] [[Category:Arma 3: Tutorials]] {{note|'''Please note, this feature works only in Development Build 1.55.133793 and later!'''}} ---- == Introduction == Current system of animal behaviour is that animals are randomly idling / moving around when spawned. This is caused by changes on engine side to save some performance. However, many people from community want to be able to control animals via script in some reasonable manner. So I started to work on some tweaks of animal animation configs which will offer this possibility to them. This page is overview of this feature and tutorial, how this behaviour can be achieved. At the moment, the tweaks are made for dog animation config only, because dog has the most variable movement possibilities and is mostly requested by community. Don't worry, other animals will be tweaked as well. == Basics == Animals can be spawned via multiple ways. Here I will explain you which ways will work with my recent tweaks, which partly and which not. === Module Animals from Sites category === Probably the easiest way how to spawn animals. Just insert the module in editor, set the desired parameters and you have animals in your mission. Unfortunately, animals spawned this way '''can't be controlled via script''' in any way and will only randomly move around depending on the area you set. === Spawn via [[createAgent|createAgent]] command === Spawning animals via scripting command [[createAgent|createAgent]] is another way how to have animals in your mission. And yes, animals created this way can be controled! As the animal AI is controlled by AIAgent, it won't be able to be controlled via commands such as [[doMove|doMove]] and [[doStop|doStop]] and will roam randomly around. '''But agents can be controlled via [[moveTo|moveTo]] command'''. And you can also determine, in which state (like run, sprint, etc.) the animal will move. '''Example:''' <syntaxhighlight lang="cpp">_dog = createAgent ["Fin_random_F", getPos player, [], 5, "CAN_COLLIDE"];</syntaxhighlight> === Spawn via [[createUnit|createUnit]] command === {{note|'''WARNING: If you will group animal created this way with another unit such as soldier, the animal will also be able to communicate via radio messages (eg. "Cease fire" etc.). Do not use unless you know, what you are doing!'''}} Another way to spawn animal is using [[createUnit|createUnit]] command. In this mode the AI is handled differently than agent so the animal won't randomly change directions and will face same direction in which it has been spawned. '''You can command the animal via [[doMove|doMove]] and [[doStop|doStop]] commands''', so you will be able to control it in its movement, but still, be aware of the warning above. Best way to spawn script controllable animals is [[createAgent|createAgent]] command. '''Example''': <syntaxhighlight lang="cpp">_grp = createGroup CIVILIAN; _dog = _grp createUnit ["Fin_random_F", getPos player, [], 5, "CAN_COLLIDE"];</syntaxhighlight> Additionaly the animal can be groupped with player and thus will be able to obey some basic commands like Move via command menu. '''Example:''' <syntaxhighlight lang="cpp">_dog = group player createUnit ["Fin_random_F", getPos player, [], 5, "CAN_COLLIDE"];</syntaxhighlight> == Usage == It is very simple. All you need is playMove or switchMove commands and knowledge of available animation states, which override the default animal behaviour (see [[#Currently available animals|list of currently available animals]]). When you will do that, remember, the animal will remain in that state until you change it via script. And also keep in mind, that the animal '''agent''' (spawned via createAgent command) will be affected by FSM if you won't disbale it via [[BIS_fnc_animalBehaviour|BIS_fnc_animalBehaviour_disable]] variable! === Example mission for dog === You can try following mission, just '''[https://mega.nz/#!4otnwA7T!R4HL77l_9Qwc_-3EgXZ95LqtV9g-W3ALXwru3JjQ6NQ simply download ZIP archive with mission here]'''. All dog actions are controllable via action menu. See [https://www.youtube.com/watch?v=0X8oumNj9kc this video] captured from this example mission. === Example script for dog following player === <syntaxhighlight lang="cpp">// Spawn dog _dog = createAgent ["Fin_random_F", getPos player, [], 5, "CAN_COLLIDE"]; // Disable animal behaviour _dog setVariable ["BIS_fnc_animalBehaviour_disable", true]; // Following loop 0 = [_dog] spawn { params ["_dog"]; // Force dog to sprint _dog playMove "Dog_Sprint"; while {alive _dog} do { _dog moveTo getPos player; sleep 0.5; }; };</syntaxhighlight> == Currently available animals == === Dog === '''Stop:''' <syntaxhighlight lang="cpp">_dog playMove "Dog_Stop";</syntaxhighlight> '''Sit:''' <syntaxhighlight lang="cpp">_dog playMove "Dog_Sit";</syntaxhighlight> '''Walk:''' <syntaxhighlight lang="cpp">_dog playMove "Dog_Walk";</syntaxhighlight> '''Run:''' <syntaxhighlight lang="cpp">_dog playMove "Dog_Run";</syntaxhighlight> '''Sprint:''' <syntaxhighlight lang="cpp">_dog playMove "Dog_Sprint";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_dog playMove "Dog_Idle_Stop";</syntaxhighlight> === Sheep === '''Stop:''' <syntaxhighlight lang="cpp">_sheep playMove "Sheep_Stop";</syntaxhighlight> '''Walk:''' <syntaxhighlight lang="cpp">_sheep playMove "Sheep_Walk";</syntaxhighlight> '''Run:''' <syntaxhighlight lang="cpp">_sheep playMove "Sheep_Run";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_sheep playMove "Sheep_Idle_Stop";</syntaxhighlight> === Goat === '''Stop:''' <syntaxhighlight lang="cpp">_goat playMove "Goat_Stop";</syntaxhighlight> '''Walk:''' <syntaxhighlight lang="cpp">_goat playMove "Goat_Walk";</syntaxhighlight> '''Run:''' <syntaxhighlight lang="cpp">_goat playMove "Goat_Run";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_goat playMove "Goat_Idle_Stop";</syntaxhighlight> === Rabbit === '''Stop:''' <syntaxhighlight lang="cpp">_rabbit playMove "Rabbit_Stop";</syntaxhighlight> '''Hop:''' <syntaxhighlight lang="cpp">_rabbit playMove "Rabbit_Hop";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_rabbit playMove "Rabbit_Idle_Stop";</syntaxhighlight> === Cockerel === '''Stop:''' <syntaxhighlight lang="cpp">_cock playMove "Cock_Stop";</syntaxhighlight> '''Walk:''' <syntaxhighlight lang="cpp">_cock playMove "Cock_Walk";</syntaxhighlight> '''Run:''' <syntaxhighlight lang="cpp">_cock playMove "Cock_Run";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_cock playMove "Cock_Idle_Stop";</syntaxhighlight> === Hen === '''Stop:''' <syntaxhighlight lang="cpp">_hen playMove "Hen_Stop";</syntaxhighlight> '''Walk:''' <syntaxhighlight lang="cpp">_hen playMove "Hen_Walk";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_hen playMove "Hen_Idle_Stop";</syntaxhighlight> === Snake === '''Stop:''' <syntaxhighlight lang="cpp">_snake playMove "Snakes_Stop";</syntaxhighlight> '''Move:''' <syntaxhighlight lang="cpp">_snake playMove "Snakes_Move";</syntaxhighlight> '''Back to default behaviour:''' <syntaxhighlight lang="cpp">_snake playMove "Snakes_Idle_Stop";</syntaxhighlight>
摘要:
请注意在武装突袭 Wiki上的所有贡献都将依据CC-BY-SA进行发布。
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Template:Note
(
查看源代码
)
Follow on IG
TikTok
Join Fan Lab