/** * LBXenoCampusController * * Creation date: 27.06.2016 22:29 * Copyright 2016, Windows7 */ class LBXenoCampusController extends LBPawnInteractableController; var(MechanismInfo) editconst string InteractionInfo[4]; var(System) name InfoMechanism; var(System) name OtherActorsMechanism; var(System) name AreaCheckingMechanism; var(Animation) name BlendByActionNode; //A node in animtree, which blends through all head actions var(Animation) array ActionSequences; //An array of all sequences, which represent certain actions var AnimNodeBlendList blendbyaction; var array actionseqs; var int curinteraction; var int curaction; //действие пауна var actor otheractor; //актор, с которым предполаагется взаимодействие function FirstTickInit() { if (bfirsttick==false) return; if (bfirsttick==true) bfirsttick=false; InitAnimation(); } function InitAnimation() { local int i; local AnimNodeSequence anim; //Head animations init blendbyaction=AnimNodeBlendList(LBPawn(parent).Mesh.FindAnimNode(BlendByActionNode)); if (blendbyaction == none) { LogError("BlendByActionNode" @ BlendByActionNode @ "not found in" @ LBPawn(parent) @ " in " @ LBPawn(parent).Mesh); return; } LogInfo("Action animations blender found:" @ BlendByActionNode @ blendbyaction); blendbyaction.SetActiveChild(0, 0.5); //сброс на исходное состояние for (i=0; i"@v); SetTargetParamVector(actor(o), OtherActorsMechanism, 'TargetLocation', v); //SetTargetParam(actor(o), OtherActorsMechanism, 'OtherActor', parent); SetTargetParamInt(actor(o), OtherActorsMechanism, 'ActorState', 1); //SetTargetParamBool(actor(o), OtherActorsMechanism, 'bEnableMovement', true); } else if (value == 2) { //взять предмет //v=GetTargetParamVector(parent, InfoMechanism, 'Location'); //o=GetTargetParam(parent, TargetingMechanism, 'TargetedObject'); if (otheractor==none) { LogError("proc: PickUp interaction failed, targeted object is not an actor or none:"@o); return; } SetTargetParam(parent, InventoryMechanism, 'AddObject', otheractor); otheractor=none; //схватить - т.е. Attach } else if (value == 3) { //положить предмет //v=GetTargetParamVector(parent, InfoMechanism, 'Location'); //o=GetTargetParam(parent, TargetingMechanism, 'TargetedObject'); SetTargetParamBool(parent, InventoryMechanism, 'RemoveAllObjects', true); } } function DeactivateInteraction(int value) { //DeactivateInteractionId=value; //ActivateInteractionId=-1; } function SetParamInt(name param, int value, optional int priority=0) { super.SetParamInt(param, value); if (param=='ActivateInteraction') ActivateInteraction(value); } //событие для вызова из дерева анимаций //event OwnerAnimNotify(AnimNodeSequence notifynode, AnimNotifyTypes notifytype) //{ // local int i; // // for (i=0; i