[Setup] Product=BlackSway Unreal Script Version=100 Archive=BSCode.umod SrcPath=. MasterPath=.. Requires=UnrealRequirement Group=SetupGroup Group=umodINIGroup Group=Code ModuleGroup Group=umodIncludeFilesGroup [UnrealRequirement] Product=Unreal Version= [SetupGroup] Copy=(Src=System\Manifest.ini,Master=System\Manifest.ini,Size=524,Flags=3) Copy=(Src=System\Manifest.int,Master=System\Manifest.int,Size=528,Flags=3) [umodINIGroup] Ini=System\Unreal.ini,Editor.EditorEngine.EditPackages=BSCode [Code ModuleGroup] File=(Src=System\BSCode.u,Size=5578) [umodIncludeFilesGroup] File=(Src=BSCode\Classes\BSCode.txt,Size=907) [Setup] LocalProduct=BlackSway Unreal Script ReadMe=BSCode\Classes\BSCode.txt SetupWindowTitle=BlackSway Unreal Script AutoplayWindowTitle=BlackSway Unreal Script Options ProductURL=http://www.unreality.org/blacksway VersionURL=http://www.unreality.org/blacksway Developer=BlackSway DeveloperURL=http://www.unreality.org/blacksway [UnrealRequirement] LocalProduct=Unreal ProductURL=http://www.unreal.com/ VersionURL=http://unreal.epicgames.com/ Developer=Epic Games, Inc. DeveloperURL=http://www.epicgames.com/ Áƒ*žD6@ Q€ŒGóÉÓ˝č‹;ˇlU7 6NoneTickBSAttractTriggerTriggerAttractOtherTriggerTurnsOffAttractNormalTrigger AttractTypeCoreEngineAttractOtherTriggerTogglesGravityMultiplierBeginAttractOtherTriggerTurnsOn AT_Gravity bAttract AT_ConstantSystembInitiallyActiveTouchUnTouch AT_LinearPostBeginPlayCollisionRadiusBSCodeFloatPropertyClassPackage BoolProperty TextBufferStructActorPawn LocationEnumPEventInstigator DeltaTimeOther VelocityObject BytePropertyVector FunctionStateStructPropertyD bReverse numTouched EAttractType IntPropertyObjectPropertyV Triggers ScriptText ‘… Ž˙˙˙˙˙˙˙˙`˙˙˙˙˙˙˙˙˙˙ĆxԎŽšřPĆxԅҔőĆxԅҔő…Ň”őÓ $HBÓ$ČB  €ƒ€v iT.//============================================================================= // BlackSway - 13th January 2000 // Just a small trigger which can act as a gravity well, repellent // My first unreal script so I hope everyone likes it.. //============================================================================= class BSAttractTrigger extends Triggers; var() bool bAttract; // if true, attract, else repel var() float GravityMultiplier; var() bool bReverse; // attraction greatest at outer limit var() bool bInitiallyActive; //whether initially active var int numTouched; var() enum EAttractType { AT_Constant, // attracts the same within radious AT_Linear, // attract decreases linerly with distant: G * (1 - ( D / R ) ) AT_Gravity, // attract decreases like gravity: G * ( 1 - D / R ) ** 2 } AttractType; // Begin play disable tick and set number of touches to zero function PostBeginPlay() { Disable('Tick'); numTouched = 0; Super.PostBeginPlay(); } // Normal state. Set to intially active state() AttractNormalTrigger { Begin: bInitiallyActive = true; } // Other trigger toggles active state of this trigger state() AttractOtherTriggerToggles { function Trigger(actor Other, pawn EventInstigator) { bInitiallyActive = !bInitiallyActive; if( !bInitiallyActive ) { Disable( 'Tick' ); return; } if( numTouched > 0 ) Enable( 'Tick' ); } } // Other trigger turns this on state() AttractOtherTriggerTurnsOn { function Trigger(actor Other, pawn EventInstigator) { bInitiallyActive = true; if( numTouched > 0 ) Enable( 'Tick' ); } } // Other trigger turns this off state() AttractOtherTriggerTurnsOff { function Trigger(actor Other, pawn EventInstigator) { bInitiallyActive = false; Disable( 'Tick' ); } } // Touch by player. If active enable tick event function Touch(actor Other) { numTouched++; if( !bInitiallyActive ) return; Enable( 'Tick' ); } function UnTouch(actor Other) { numTouched--; if( numTouched <= 0 ) { numTouched = 0; Disable( 'Tick' ); } } function Tick(float DeltaTime) { local vector v; local float d; local pawn P; foreach TouchingActors(class 'Pawn', P) { v = Normal(self.Location - P.Location); // unit velocity vector d = VSize(self.Location - P.Location); // distance between trigger and player if( d == 0 ) { // log("zero distance"); return; } // because of height diffs d can be greater that CollisionRadius if( d > CollisionRadius ) d = CollisionRadius; if( bReverse ) d = CollisionRadius - d; if( !bAttract ) v = -v; switch( AttractType ) { case AT_Constant: v *= GravityMultiplier; break; case AT_Linear: v *= GravityMultiplier * (1 - ( d / CollisionRadius ) ); break; case AT_Gravity: v *= GravityMultiplier * ( (1 - ( d / CollisionRadius ) ) ** 2 ); } P.Velocity += v; } }  Ľv!% —MxĽ- u! – Tĺ"Ś ˜%%v! Œ;-'—%u! #3-' ˙˙˙˙˙˙˙˙˙˙ ™ b˜5/a3 …2âŘ ˆ ˆáŘ ˆ ˆc´?%0 }ą‡‡˜- ݇°-Ó Ë$Ý ń$ÝŤŻ?&ʇ $ÝŤŞŻ?&ʇ?, ˙˙ß š10  >b@˙˙˙˙˙˙˙˙˙˙€ƒ€ƒ€… 4’@˙˙˙˙˙˙˙˙˙˙Œ,ő7--#-v! 5—%u! €ƒ€…H!@˙˙˙˙˙˙˙˙˙˙ŒEě-(v!  €ƒ€…ţ˙˙˙˙˙˙˙2ţ˙˙˙˙˙˙˙*ý˙˙˙,ý˙˙˙ ˙˙˙˙+˙˙˙˙˙˙˙˙*ý˙˙˙*ý˙˙˙ţ˙˙˙4˙˙˙˙'˙˙˙˙ń˙˙˙)˙˙˙˙,˙˙˙˙!˙˙˙˙1˙˙˙˙(*ý˙˙˙*ý˙˙˙˙˙˙˙*ý˙˙˙,ý˙˙˙&Š- I”/ U’3 a‹ n„" zŠ  GŽ$WS‹ j‹. v“0B• I„% VŠ$ c˜54_.o†&NA†—-tA†–/aB†Œ,PC‰;|C†™bwD‰ )YH„% BI„% OI„# \I‰ )iI†Œ>RJ„% PK„# ]K‰)jK†Œ$SL„% wL„# DMBlackSway Unreal Script Readme http://www.unreality.org/blacksway blacksway@unreality.org -------------------------------------------------- -------------------------------------------------- BSAttractTrigger -------------------------------------------------- An attract trigger attract trigger. The following settings can be used... bool bAttract If true then the trigger will attract, else it will repel float GravityMultiplier The 'gravity' multiplier. Play around with this value to get the correct value for gravity I've tried about 30-40 for a constant gravity and higher for linear or gravity style wells bool bReverse If true then the attraction (or repellant) will be greatest at the outskirts, rather than the centre bool bInitiallyActive Whether the trigger is initially active. You also need to set the InitalState in Object to one of the usual values. System\Manifest.iniSystem\Manifest.intSystem\BSCode.uŸĘBSCode\Classes\BSCode.txti‹ŁĹăŸôá3ż°