//============================================================================= // trigger that only works when using the "grab" key // also includes a feedback message //============================================================================= class InteractiveTrigger extends Trigger; //#exec texture import file=Textures\staticfield.pcx name=i_StaticField group=Icons mips=Off flags=2 //var() float sphereRadius; //The spherical radius of this actor. //var() bool gradualDistribution; //Whether or not the overlay opacity should adjust based on player distance. //var() Texture overlayTexture; //The texture to use for the overlay. //var() float alpha; //How opaque the overlay is, between 0.0 (invisible) and 1.0 (fully opaque). //var() localized editconst const string SRNote; //"Collision is auto-set from this value." var() Actor lookTarget; //The target actor for the player to be looking at. var() bool bUseTriggered; // Triggered by player grab var() bool enabled; //Whether or not this actor is enabled. var bool ready; var bool active; //borrowed from ebd's firetrucks function tick(Float f) { local PlayerPawn p; local bool b; if (!active) return; if (!enabled) return; if (!ready) return; if (lookTarget == none) return; b = angleBetween(lookTarget, p) < precision; foreach TouchingActors(class'PlayerPawn', p) { if (b) { // p.Instigator.ClientMessage( Message , 'Pickup'); triggerEvent(event, Self, Instigator); if (triggerOnceOnly) enabled = false; if (reTriggerDelay > 0) { ready = false; setTimer(retriggerDelay, false); } return; } } } function timer() { ready = true; } simulated function float angleBetween(Actor a, Pawn p) { local vector v, d; d = a.location - p.location; v = vector(p.viewRotation); return acos((d dot v) / (vSize(d) * vSize(v))); } // Called when something touches the trigger. function Touch( actor Other ) { Super.Touch(Other); /* if ( bUseTriggered ) { WaitingPawn = Other; Other.SpecialPause = 2.5; Trigger(Other, Other); return true; }*/ if ( Len(Message)>0 ) // Send a string message to the toucher. Other.Instigator.ClientMessage( Message , 'Pickup'); } defaultproperties { bCollideActors=True Message='test' }