Fandom

武装突袭 Wiki

AttachTo

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

  Arguments of this scripting command don't have to be local to the client the command is executed onEffects of this scripting command are broadcasted over the network and happen on every computer in the network

点击图片可看到更多讯息

开始使用于

游戏:
Arma 2
版本:
1.00

描述

描述:
Attaches an object to another object. The offset is applied to the object center unless a memory point is provided. If no offset is specified, the offset used will be the current relative positioning of objects against each other.

基本句法

句法:
object1 attachTo [object2, offset, memPoint]
参数:
object1: Object - object to attach

[object2, offset, memPoint]: Array

object2: Object - object to attach to

offset: (optional): Array - format PositionRelative

memPoint: (optional): String - see ArmA: Selection Translations for czech selections names
返回值:
Nothing

范例

范例1:
player attachTo [car, [0, 0, 1] ];

范例2:
player attachTo [tank, [0, -1, 0], "Usti hlavne"];

范例3:
Automatic offset: ammoCrate attachTo [player];

范例4:

To set orientation of attached object use setVectorDirAndUp command:

_expl1 = "DemoCharge_Remote_Ammo" createVehicle position player; _expl1 attachTo [player, [-0.1, 0.1, 0.15], "Pelvis"]; _expl1 setVectorDirAndUp [ [0.5, 0.5, 0], [-0.5, 0.5, 0] ]; _expl2 = "DemoCharge_Remote_Ammo" createVehicle position player; _expl2 attachTo [player, [0, 0.15, 0.15], "Pelvis"]; _expl2 setVectorDirAndUp [ [1, 0, 0], [0, 1, 0] ]; _expl3 = "DemoCharge_Remote_Ammo" createVehicle position player; _expl3 attachTo [player, [0.1, 0.1, 0.15], "Pelvis"]; _expl3 setVectorDirAndUp [ [0.5, -0.5, 0], [0.5, 0.5, 0] ];

300px

额外资讯

多人游戏:
Only has to be executed on one client.
也可以看看:

attachObjectattachedObjectsattachedTowaypointAttachVehiclewaypointAttachedVehiclelightAttachObjecttriggerAttachVehicleattachedObjectdetachsetVectorDirsetVectorUpsetVectorDirAndUpmodelToWorld

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on June 6, 2009 - 13:47
IceShade
You can use setDir to change the direction of the attached object. The direction is relative to the object you attach it to, so setDir 180 won't point to the south but to the rear of the object you attach it to. Use setPos to synchronize the direction of the object in a network game. Example code: _obj setDir 180; _obj setPos getPos _obj;

Posted on September 17, 2011 - 19:20
teaCup
Some objects you cannot attach anything to. To be more precise, you can attach objects to them, but the behaviour is unexpected. For instance: SuitcaseObject attachTo [FoldingTableObject, [0,0,0]]; You would expect the suitcase to jump to the pivot point of the table, and stick to it. Instead, the suitcase will freeze in it's original position. Even if the table is moved, the suitcase will be unaffected: it will not follow the table, it will not even respond to actions it reacted to prior to being attached: pushing, being shot at, etc.. It's just an object frozen in space. In MP it's even weirder, the suitcase would turn invisible. Dodgy objects when it comes to attaching things to them: most in Objects(small), Objects(signs), all of Objects(helpers) categories, etc..

Posted on March 28, 2014 - 16:22
Pixinger77
If you attach an explosive charge to an object (e.g. ammobox), the charge will not detonate when you simply set the damage to 1. You must detach it before. private ["_target"]; _target = <<your_ammobox>>; // create and attach charge private ["_charge"]; _charge = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player; _charge attachTo [_target, [0,0,0.2]]; _charge setVectorDirAndUp [[0.5,0.5,0],[-0.5,0.5,0]]; // now detonate charge detach _charge; //Important! _charge setDamage 1;

Posted on 1 Jun, 2014 - 2300
ffur2007slx2_5
(ArmA3 ver 1.20) attachTo overwrites setVectorDirAndUp if attached obj was changed to attach another one. _obj attachTo [_logic,[0,0,0]]; _obj setVectorDirAndUp [[0,1,0],[0,0,-1]]; _obj attachTo [_logic,[0,0,2]]; //vector no changes _obj attachTo [_anotherOne,[0,0,0]]; //vector changes to default

Posted on September 25, 2014 - 10:00
ondrejkuzel
Attaching an object does not update the accessibility of a place for the AI. The command shouldn't be used for positioning large static objects - the AI will simply walk thru such objects.

Bottom Section

更多维基

随机维基