Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

attraction to a single point?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • attraction to a single point?

    i have seen many weapons that attract pawns to a single point. i am assuming that there is an actor that does this but what actor is it?
    help is really appreciated!

    thanx in advance :up:

  • #2
    There's no point gravity actor in UT2004. You will have to write it yourself using the Tick() event.

    Comment


    • #3
      Oh ok.


      How?

      Comment


      • #4
        Write an actor that pulls stuff around it in, and make the weapon spawn the actor at the target location.

        Comment


        • #5
          i suggest a tick with a AddVelocity(); towards its location

          Comment


          • #6
            thanx. but u'll notice im a no0b so a little clarification is needed :noob:

            Comment


            • #7
              Get any version of Chaos UT and export the source code of the Gravity Vortex.

              Actually, since I don't know its current state, here's the original code I still have from way back when I coded the UT2003 version:
              Code:
              //=============================================================================
              // VortexProj
              // $Id: VortexProj.uc,v 1.36 2003/07/08 12:45:29 gasman Exp $
              // Our favorite little sucker. Completely rewritten from scratch.
              //=============================================================================
              class VortexProj extends Projectile;
              
              #exec OBJ LOAD file=..\Sounds\ChaosEsounds1.uax PACKAGE=ChaosEsounds1
              #exec OBJ LOAD File=..\Animations\Chaos_Extras1.ukx Package=Chaos_Extras1
              
              //=============================================================================
              // properties
              //=============================================================================
              
              var(Vortex) float VortexGravity, VortexRange;
              //var(Vortex) float VortexGravCompensation;              // scale gravity affecting the vortex projectile
              var(Vortex) float GravBeltScale;                       // scaling values for vortex gravity
              var(Vortex) float InitialDelay, BuildUpTime, EffectsSpawnTime, ActiveTime, CalmDownTime;
              var(Vortex) float InitialRisingRate;                   // upward acceleration when starting to suck things in
              var(Vortex) float MinSpeed;                            // minimum speed for secondary firing mode
              var(Vortex) float MaxRisingSpeed;                      // maximum speed when starting to suck things in
              var(Vortex) float SlowDownRate, WaterSlowDownRate;     // vortex constantly slows down at this rate
              var(Vortex) float DampenFactor, DampenFactorParallel;  // dampening when hitting objects
              var(Vortex) float KickUpSpeed;                         // for actors with PHYS_None or PHYS_Rotating
              var(Vortex) float KillRadius;                          // objects withing this radius are killed/destroyed
              
              // sounds
              var(VortexSounds) Sound VortexStartSound;
              var(VortexSounds) array<Sound> VortexFlash;
              var(VortexSounds) Sound VortexAmbientSound;
              var(VortexSounds) array<Sound> SlurpSound;
              var(VortexSounds) array<Sound> ImpactSounds;
              
              // display
              var(Display) Material ActiveMaterial;
              var(Display) Mesh ActiveMesh;
              
              // internal variables
              var protected float StartTimeIndex;                    // Level.TimeSeconds when this vortex was spawned
              var protected float StrengthFadeTimeIndex;             // Level.TimeSecunds when this vortext starts/stops sucking
              var protected float DamageTime;                        // time since last damaging
              var protected Emitter VortexEmitter, VortexMainLightning, VortexLightning;
              var protected array<ChaosVortexSphere> VortexSpheres;
              var protected VortexWatcher VortexWatcher;             // for checking vortex limit
              
              // Fearspot/Avoid Marker
              var AvoidMarker Fear;                                  // use to warn the bots not to walk through this
              
              //=============================================================================
              // replication
              //=============================================================================
              
              replication
              {
              	// variables initially replicated to clients
              	reliable if ( Role == ROLE_Authority && bNetInitial )
              		InitialDelay;
              }
              
              
              //=============================================================================
              // PostBeginPlay
              //=============================================================================
              
              simulated function PostBeginPlay()
              {
              	StartTimeIndex = Level.TimeSeconds;
              
              	Velocity = Speed * vector(Rotation);
              	RandSpin(100000);
              	//log("PostBeginPlay at"@Level.TimeSeconds, Name);
              
              	if ( Instigator != None )
              		InstigatorController = Instigator.Controller;
              
              	if ( Role == ROLE_Authority )
                  {
                      // Check to see if we need a VortexWatcher, if limit is 0, then it makes no sense
                      // to spawn the VortexWatcher
              		If (class'ChaosUT'.default.VortexLimit != 0)
                      {
                          ForEach DynamicActors(class'VortexWatcher', VortexWatcher)
                             break;
              		    if ( VortexWatcher == None )
              			     VortexWatcher = Spawn(class'VortexWatcher');
              		    VortexWatcher.AddVortex(Instigator.PlayerReplicationInfo);
              		}
                      if ( Fear == None )  // run away...run away....
                      {
                          Fear = Spawn(class'AvoidMarker',self);
                          Fear.SetPhysics(PHYS_Trailer);
                          Fear.SetCollisionSize(1500,1500);
                          Fear.StartleBots();
                      }
              	}
              }
              
              
              //=============================================================================
              // FellOutOfWorld
              //=============================================================================
              // The vortex should stay active even when dropping out of the world
              
              simulated event FellOutOfWorld(eKillZType KillType);
              
              
              //=============================================================================
              // Destroyed
              //=============================================================================
              
              simulated function Destroyed()
              {
              	if ( VortexWatcher != None )
              		VortexWatcher.RemoveVortex();
              
                  if (Fear != None )
                      Fear.Destroy();
              	//log("Destroyed at"@Level.TimeSeconds, Name);
              }
              
              
              //=============================================================================
              // ProcessTouch
              //=============================================================================
              // Do nothing, especially not go away when touched.
              
              function ProcessTouch(Actor Other, Vector HitLocation);
              
              
              //=============================================================================
              // Landed
              //=============================================================================
              // Same as HitWall().
              
              simulated function Landed(vector HitNormal)
              {
              	HitWall(HitNormal, None);
              }
              
              
              //=============================================================================
              // HitWall
              //=============================================================================
              // Bounce off walls with dampening.
              
              simulated function HitWall(vector HitNormal, Actor Wall)
              {
              	Velocity -= (Velocity dot HitNormal) * HitNormal * (1 + DampenFactorParallel);
              	Velocity *= DampenFactor;
              }
              
              
              
              //=============================================================================
              // state Flying
              //=============================================================================
              // initial state after the vortex has been launched
              
              auto simulated state Flying
              {
              	simulated function ProcessTouch(Actor Other, Vector HitLocation)
              	{
              		if ( Other != Instigator )
              			HitWall(Normal(Other.Location - Location), Other);
              	}
              
              	simulated function HitWall(vector HitNormal, Actor Wall)
              	{
              		Global.HitWall(HitNormal, Wall);
              		if ( VSize(Velocity) > 80 )
              			PlaySound(ImpactSounds[Rand(ImpactSounds.Length)], SLOT_Misc,,,,1.5);
              	}
              
              	simulated function BeginState()
              	{
              		//log("Flying BeginState at"@Level.TimeSeconds, Name);
              	}
              Begin:
              	Sleep(InitialDelay);
              	GotoState('StartSucking');
              }
              
              
              //=============================================================================
              // SpawnVisualEffects
              //=============================================================================
              // Spawns some spheres and an emitter.
              
              simulated function SpawnVisualEffects()
              {
              	local float TimeRemaining;
              
              	//AmbientSound = VortexAmbientSound;	// doesn't work? (works with bFullVolume) - Wormbo
                  PlaySound(VortexAmbientSound, SLOT_Interact, 255.0,, 6000.0);
              	if ( Level.NetMode == NM_DedicatedServer )
              		return;
              
              	TimeRemaining = (BuildUpTime - EffectsSpawnTime) + ActiveTime;
              
              	VortexSpheres[0] = Spawn(class'ChaosVortexSphere', self);
              	VortexSpheres[0].LifeSpan = TimeRemaining;
              	VortexSpheres[1] = Spawn(class'ChaosVortexSphereB', self);
              	VortexSpheres[1].LifeSpan = TimeRemaining;
              	VortexLightning = Spawn(class'VortexMainLightning',Self);
                  //VortexSpheres[2] = Spawn(class'ChaosVortexSphereC', self);
              	//VortexSpheres[2].LifeSpan = TimeRemaining;
              }
              
              
              //=============================================================================
              // ReleaseVortex
              //=============================================================================
              // Visual effect for opening the golden sphere and releasing the actual gravity
              // vortex.
              
              simulated function ReleaseVortex()
              {
              	local vector RandDir;
              	local VortexShell ShellPart;
              
              	RandDir = VRand();
              
              	// spawn two half spheres
              	ShellPart = Spawn(class'VortexShell',,, Location + 2 * RandDir, rotator(RandDir));
              	if ( ShellPart != None)
              		ShellPart.Velocity = 200 * RandDir;
              
              	ShellPart = Spawn(class'VortexShell',,, Location - 2 * RandDir, rotator(-RandDir));
              	if ( ShellPart != None)
              		ShellPart.Velocity = -200 * RandDir;
              
              	if ( Role == ROLE_Authority ) {
              		bUpdateSimulatedPosition = False;
              		//bTearOff = True;
              	}
              
              	// Change the mesh
              	LinkMesh(ActiveMesh);
              	SetDrawScale(1.2);
              	Skins[0] = ActiveMaterial;
              	RepSkin = ActiveMaterial;
              	LoopAnim('flying', 1.0);
              	bUnlit = True;
              }
              
              
              
              //=============================================================================
              // state StartSucking
              //=============================================================================
              // Vortex builds up its power.
              
              simulated state StartSucking
              {
              	simulated function BeginState()
              	{
              		StrengthFadeTimeIndex = Level.TimeSeconds;
              		//log("StartSucking BeginState at"@Level.TimeSeconds, Name);
              		SetPhysics(PHYS_Projectile);	// no longer affected by gravity
              		Acceleration = vect(0,0,1) * InitialRisingRate;
              		MaxSpeed = MaxRisingSpeed;
              
              		//SpawnVisualEffects();
              		ReleaseVortex();
              		bProjTarget = False;
              		SetCollision(False, False, False);
              		SetTimer(EffectsSpawnTime, False);
              
              		LightType = LT_Flicker;
              		LightRadius = 1.0;
              	}
              
              	simulated function Timer()
              	{
              		SpawnVisualEffects();
              	}
              
              	simulated function Tick(float DeltaTime)
              	{
              		local float StrengthScale;
              
              		// starts with lower radius
              		StrengthScale = (Level.TimeSeconds - StrengthFadeTimeIndex) / BuildUpTime;
              		SuckInActors(VortexGravity * StrengthScale, VortexRange * StrengthScale, DeltaTime);
              
              		LightRadius = Default.LightRadius * (BuildUpTime - LatentFloat) / BuildUpTime;
              	}
              
              	simulated function EndState()
              	{
              		Acceleration = vect(0,0,0);
              		//log("StartSucking EndState at"@Level.TimeSeconds, Name);
              	}
              
              Begin:
              	VortexEmitter = Spawn(class'VortexEmitter', self);
              	VortexEmitter.LifeSpan = BuildUpTime + ActiveTime + CalmDownTime;
              	PlaySound(VortexStartSound, SLOT_Misc, 255.0,, 6000.0);	// plays fine - Wormbo
              	Sleep(BuildUpTime);
              	GotoState('Sucking');
              }
              
              
              
              //=============================================================================
              // state Sucking
              //=============================================================================
              // Active state of the vortex.
              
              simulated state Sucking
              {
              	simulated function Tick(float DeltaTime)
              	{
              		SuckInActors(VortexGravity, VortexRange, DeltaTime);
              		if ( Physics != PHYS_Rotating ) SlowDown(DeltaTime);
              	}
              
              	simulated function BeginState()
              	{
              		VortexMainLightning = Spawn(class'VortexFX', self);
              		Timer();
              	}
              
              	simulated function Timer()
              	{
              		local Sound S;
              
              		S = VortexFlash[Rand(VortexFlash.Length)];
              		PlaySound(S, SLOT_Misc, 255.0,, 6000.0);
              
              		// play next sound when this one is finished and there's enough time left
              		// (LatentFloat is the remaining time of the Sleep() function)
              		if ( LatentFloat > GetSoundDuration(S) )
              			SetTimer(GetSoundDuration(S) + FRand(), False);
              	}
              
              	simulated function EndState()
              	{
              		SetTimer(0.0, False);
              	}
              
              Begin:
              	Sleep(ActiveTime);
              	GotoState('Collapsing');
              }
              
              
              
              //=============================================================================
              // state Collapsing
              //=============================================================================
              // Vortex gets weaker and collapses.
              
              simulated state Collapsing
              {
              	simulated function BeginState()
              	{
              		if ( VortexEmitter != None )
              			VortexEmitter.Kill();	// shut down emitter
              		if ( VortexLightning != None )
              			VortexLightning.Kill();	// should be killed already
              		if ( VortexMainLightning != None )
              			VortexMainLightning.Kill();
              		StrengthFadeTimeIndex = Level.TimeSeconds;
              		//log("Collapsing BeginState at"@Level.TimeSeconds, Name);
              	}
              
              	simulated function Tick(float DeltaTime)
              	{
              		local float StrengthScale;
              
              		StrengthScale = 1 - (Level.TimeSeconds - StrengthFadeTimeIndex) / CalmDownTime;
              		SuckInActors(VortexGravity * StrengthScale, VortexRange * StrengthScale, DeltaTime);
              		if ( Physics != PHYS_Rotating ) SlowDown(DeltaTime);
              
              		LightRadius = Default.LightRadius * LatentFloat / CalmDownTime;
              	}
              
              Begin:
              	Sleep(CalmDownTime);
              	Destroy();
              }
              
              
              //=============================================================================
              // SuckInActors
              //=============================================================================
              // Used during StartSucking, Sucking and Dying states to suck in actors.
              
              simulated function SuckInActors(float Gravity, float Range, float DeltaTime)
              {
              	local Actor thisActor;
              	local Pawn thisPawn;
              	local vector dir, ActorLocation;
              	local float dist, strength, ActorSize;
              
              	DamageTime += DeltaTime;
              
              	if ( Instigator == None && InstigatorController != None )
              		Instigator = InstigatorController.Pawn;
              
              	ForEach CollidingActors(class'Actor', thisActor, Range, Location)
                  {
              		// only affect visible actors that can actually be sucked in
              		if ( thisActor.IsA('VortexProj') || !IsMovable(thisActor) || !IsVisible(thisActor)
              				|| !FastTrace(thisActor.Location, Location) )
              			continue;
              
              		thisPawn = Pawn(thisActor);
              
              		// find this actor's location
              		if ( thisActor.Physics == PHYS_Karma ) {
              			// use center of mass as karma actor location
              			thisActor.KGetCOMPosition(ActorLocation);
              			ActorSize = thisActor.GetRenderBoundingSphere().W * thisActor.DrawScale;
              		}
              		else {
              			ActorLocation = thisActor.Location;
              			ActorSize = 0;
              		}
              
              		dir = Normal(Location - ActorLocation);	// pointing towards center of vortex
              		dist = VSize(Location - ActorLocation);
              		strength = Gravity * DeltaTime * (2.1 - 2 * Square(dist / Range));
              
              		//log("Sucking in"@thisActor@"Velocity:"@VSize(thisActor.Velocity));
              
              		if ( thisActor.Physics == PHYS_Karma || thisActor.Physics == PHYS_KarmaRagdoll ) {
              			// experimental karma stuff
              			if ( !thisActor.KIsAwake() )
              				thisActor.KWake();
              			thisActor.KAddImpulse(dir * strength * thisActor.Mass * thisActor.KGetMass(), ActorLocation, 'bip01 Spine');
              		}
              		else if ( thisPawn != None ) {
              			if ( HasGravbelt(thisPawn) )
              				strength *= GravBeltScale;	// scale force applied to players with activated gravbelt
              			if ( thisPawn.Physics == PHYS_Walking && dir.Z < 0 )
              				dir.Z = KickUpSpeed / strength;	// make sure player doesn't get crushed when getting stuck
              			thisPawn.AddVelocity(dir * strength);	// automatically sets physics, etc.
              			thisPawn.DelayedDamageInstigatorController = InstigatorController;
              		}
              		else {
              			if ( thisActor.Physics == PHYS_None || thisActor.Physics == PHYS_Rotating ) {
              				if ( thisActor.IsA('GameObject') && thisActor.IsInState('Home') )
              					thisActor.GotoState('Dropped');
              				thisActor.SetPhysics(PHYS_Falling);
              				thisActor.Velocity = vect(0,0,1) * KickUpSpeed;
              			}
              
              			// this changes the rotation based on the change of the object's direction of movement
              			if ( thisActor.Physics == PHYS_Projectile  || thisActor.IsA('RipperBlade') )
              				thisActor.SetRotation(thisActor.Rotation - rotator(thisActor.Velocity));
              			thisActor.Velocity += dir * strength;
              			if ( thisActor.Physics == PHYS_Projectile )
              				thisActor.SetRotation(thisActor.Rotation + rotator(thisActor.Velocity));
              		}
              
                      // Check for a proxy if it has a proxy set a flag
                      if ( thisActor.IsA('P_Proxymine')  &&  !P_Proxymine(thisActor).bInVortex )
                      {
              				P_Proxymine(thisActor).bInVortex=true;
              				P_Proxymine(thisActor).PlayVortex();
                      }
              		// damage/kill objects
              		if ( dist < KillRadius && IsInState('Sucking') && !thisActor.IsA('VortexShell') )
              			KillObject(thisActor, dist);
              		else if ( dist < DamageRadius && DamageTime > 0.2 )
              			DamageObject(thisActor, dist);
              	}
              
              	if ( DamageTime > 0.2 )
              		DamageTime -= 0.2;
              }
              
              
              //=============================================================================
              // SlowDown
              //=============================================================================
              // Permanently slows down the vortex until it stops.
              
              simulated function SlowDown(float DeltaTime)
              {
              	if ( VSize(Velocity) > MaxSpeed )
              		DeltaTime *= 2;
              	if ( !PhysicsVolume.bWaterVolume )
              		speed = FMax(VSize(Velocity) - SlowDownRate * DeltaTime, 0);
              	else
              		speed = FMax(VSize(Velocity) - WaterSlowDownRate * DeltaTime, 0);
              	if ( speed > 0 )
              		Velocity = Normal(Velocity) * speed;
              	else {
              		Velocity = vect(0,0,0);
              		Speed = 0;
              		SetPhysics(PHYS_Rotating);
              		SetCollision(False, False, False);
              	}
              }
              
              
              //=============================================================================
              // KillObject
              //=============================================================================
              // Kills or destroys the specified actor.
              
              simulated function KillObject(Actor Other, float DistToCenter)
              {
              	if ( Pawn(Other) != None && Other.Role == ROLE_Authority && Pawn(Other).Health > 0
              			&& !Pawn(Other).InGodMode() && !HasRespawnProtection(Pawn(Other)) )
              	{
              		Other.TakeDamage(1000, Instigator, Other.Location, vect(0,0,0), MyDamageType);
              		if ( Pawn(Other).Health > 0 )
              			Pawn(Other).Died(InstigatorController, MyDamageType, Other.Location);
              		PlaySound(SlurpSound[Rand(SlurpSound.Length)], SLOT_Misc, 255.0,, 6000.0);
              	}
              	else if ( Pickup(Other) != None )
                  {
              		Other.Destroy();	// was dropped anyways, so it can be destroyed
              	}
              	else {
              		Other.Touch(Self);
              		DamageObject(Other, DistToCenter);
              	}
              }
              
              
              //=============================================================================
              // DamageObject
              //=============================================================================
              // Damages the specified actor based on its distance to the center of the
              // vortex.
              
              simulated function DamageObject(Actor Other, float DistToCenter)
              {
              	if ( Other == None || Other.IsA('Pawn') && Other.Role < ROLE_Authority )
              		return;
              
              	if ( !Other.IsA('Pawn')
              			|| Pawn(Other).Health > 0 && !Pawn(Other).InGodMode() && !HasRespawnProtection(Pawn(Other)) )
              	{
              		Other.TakeDamage(Damage * (1 - DistToCenter / DamageRadius), Instigator,
              				Other.Location, vect(0,0,0), MyDamageType);
              	}
              }
              
              
              //=============================================================================
              // IsVisible
              //=============================================================================
              // Returns whether an actor is visible to the vortex. Brushes, terrain,
              // fluid surfaces, etc. are not concidered visible vor the vortex.
              
              simulated function bool IsVisible(Actor Other)
              {
              	return !Other.bHidden && (Other.DrawType == DT_Mesh || Other.DrawType == DT_StaticMesh
              			|| Other.DrawType == DT_Sprite || Other.DrawType == DT_SpriteAnimOnce
              			|| Other.DrawType == DT_RopeSprite || Other.DrawType == DT_VerticalSprite);
              }
              
              
              //=============================================================================
              // IsMovable
              //=============================================================================
              // Returns whether the vortex may apply momentum to this actor.
              
              simulated function bool IsMovable(Actor Other)
              {
              	if ( Other.bStatic || Other.bNoDelete )
              		return false;
              
              	// game objects
              	if ( Other.IsA('GameObject') && (Other.Physics == PHYS_None || Other.Physics == PHYS_Rotating) )
              		return Other.IsInState('Dropped') || Other.IsInState('Home');
              
              	// players (I'm not sure about flying players)
              	if ( Other.IsA('UnrealPawn') && (Other.Physics == PHYS_Walking
              			|| Other.Physics == PHYS_Falling || Other.Physics == PHYS_Swimming
              			|| /*Other.Physics == PHYS_Flying ||*/ Other.Physics == PHYS_Spider
              			|| Other.Physics == PHYS_Ladder || Other.Physics == PHYS_KarmaRagDoll) )
              		return true;
              
              	if ( Other.IsA('Pickup') && Pickup(Other).bDropped )
              		return true;
              
              	// other stuff
              	return Other.Physics == PHYS_Projectile || Other.Physics == PHYS_Falling || Other.Physics == PHYS_Karma;
              }
              
              
              //=============================================================================
              // HasGravbelt
              //=============================================================================
              // Returns whether this pawn has an activated GravBelt.
              
              simulated function bool HasGravbelt(Pawn Other)
              {
              	local Inventory Inv;
              
              	// search for GravBelt in Other's inventory
              	Inv = Other.FindInventoryType(class'GravBelt');
              	if ( Inv == None )
              		Inv = Other.FindInventoryType(class'GravBeltRecharging');
              
              	// check whether it's activated
              	return GravBelt(Inv) != None && GravBelt(Inv).bActive;
              }
              
              
              //=============================================================================
              // HasRespawnProtection
              //=============================================================================
              // Returns whether this pawn is under the effect of respawn protection.
              
              simulated function bool HasRespawnProtection(Pawn Other)
              {
              	// only works in DeathMatch games
              	if ( DeathMatch(Level.Game) == None )
              		return false;
              
              	// check for Epic's respawn protection
              	if ( Level.TimeSeconds - Other.SpawnTime < DeathMatch(Level.Game).SpawnProtectionTime )
              		return true;
              
              	return false;
              
              }
              
              
              //=============================================================================
              // GetVortexDuration
              //=============================================================================
              // Returns whether this pawn is under the effect of respawn protection.
              
              simulated static function float GetVortexDuration()
              {
              	return default.InitialDelay + default.BuildUpTime + default.ActiveTime + default.CalmDownTime;
              }
              
              //=============================================================================
              // default properties
              //=============================================================================
              
              defaultproperties
              {
              	// this sucks, literally ;)
              	VortexGravity=2000.0
              	VortexRange=2500.0
              	GravBeltScale=0.3
              	KickUpSpeed=80.0
              
              	// damage
              	Damage=10.0
              	DamageRadius=300.0
              	KillRadius=150.0
              	MyDamageType=class'DamTypeVortex'
              	MomentumTransfer=0.0
              
              	// movement
              	Speed=600.0
              	MaxSpeed=1200.0
              	MinSpeed=300.0
              //	VortexGravCompensation=0.0	// scale gravity that actually affects the vortex
              	InitialRisingRate=50.0
              	MaxRisingSpeed=200.0
              	SlowDownRate=100.0	// in UU/s²
              	WaterSlowDownRate=150.0
              	DampenFactor=0.5
              	DampenFactorParallel=0.75
              
              	// timing
              	InitialDelay=2.0
              	BuildUpTime=2.0
              	EffectsSpawnTime=1.0
              	ActiveTime=9.7
              	CalmDownTime=0.8
              
              	// display
              	Mesh=Mesh'Chaos_Extras1.Chaos_VXsphere'
              	ActiveMesh=Mesh'XWeapons_rc.GoopMesh'	// REPLACEME
              	ActiveMaterial=TexEnvMap'AWGlobal.Cubes.BriteEnv1'
              	AmbientGlow=80
              	DrawType=DT_Mesh
              	DrawScale=1.2
              	bDynamicLight=true
              	LightType=LT_None
              	LightEffect=LE_QuadraticNonIncidence
              	LightBrightness=150
              	LightHue=140
              	LightSaturation=20
              	LightRadius=75.0
              
              	// sounds
              	VortexStartSound=Sound'ChaosEsounds1.Vortex.vortex_start'
              	VortexAmbientSound=Sound'ChaosEsounds1.Vortex.vortex_run'
              	VortexFlash(0)=Sound'ChaosEsounds1.Vortex.vortex_flash1'
              	VortexFlash(1)=Sound'ChaosEsounds1.Vortex.vortex_flash2'
              	VortexFlash(2)=Sound'ChaosEsounds1.Vortex.vortex_flash3'
              	VortexFlash(3)=Sound'ChaosEsounds1.Vortex.vortex_flash4'
              	VortexFlash(4)=Sound'ChaosEsounds1.Vortex.vortex_flash5'
              	VortexFlash(5)=Sound'ChaosEsounds1.Vortex.vortex_flash6'
              	VortexFlash(6)=Sound'ChaosEsounds1.Vortex.vortex_flash7'
              	SlurpSound(0)=Sound'ChaosEsounds1.Vortex.vortex_slurp'
              	SlurpSound(1)=Sound'ChaosEsounds1.Vortex.vortex_slurp1'
              	SlurpSound(2)=Sound'ChaosEsounds1.Vortex.vortex_slurp2'
              	SlurpSound(3)=Sound'ChaosEsounds1.Vortex.vortex_slurp3'
              	SlurpSound(4)=Sound'ChaosEsounds1.Vortex.vortex_slurp4'
              	ImpactSounds(0)=Sound'ChaosEsounds3.Vortex.vortexshellbounce1'
                  ImpactSounds(1)=Sound'ChaosEsounds3.Vortex.vortexshellbounce2'
                  ImpactSounds(2)=Sound'ChaosEsounds3.Vortex.vortexshellbounce3'
              
              	SoundVolume=255
              	SoundRadius=6000
              
              	TransientSoundVolume=255
              	TransientSoundRadius=6000
              
              	// replication (make it kickable)
              	bNetTemporary=False
              	bUpdateSimulatedPosition=True
              
              	// physics
              	bBounce=True
              	Physics=PHYS_Falling
              	CollisionRadius=10.0
              	CollisionHeight=10.0
              	bProjTarget=true	// only until vortex starts sucking
              	LifeSpan=0
              }
              Keep in mind that this is UT2003 code and some things have changed in UT2004. I strongly recomment NOT copy/pasting the code, but instead try to understand what it does and how it works.

              Your main attention should be focused on the SuckInActors() function, how it is called and what it does. The vortex is also a good example for using states and for snycronizing serverside and clientside behavoir via replication and simulation. (Hmm, maybe I should try writing a tutorial for the UnrealWiki based on the vortex...)

              Comment


              • #8
                thanx 4 that. :up:

                i get hte general gist of the thing but i think i was being a bit ambitious...

                Still...maybe when im a better coder

                Comment


                • #9
                  This approach works well for the most part - however I can't get it to pull the pawns off the ground - they have to voluntarily jump. I want when it's above the pawns, to pull them up off the ground.

                  I can probably mess with setting the pawn to Falling state for that, and disengage him from his base/floor.

                  More pressing is the problem where we're trying to make it so the player can resist the pull of the vortex, but this results in jerky motion where the player lurches in the desired direction almost rhythmically. How can we get smoother motion with the player resisting the pull, like one would get in a PhysicsVolume's ZoneVelocity? Of course preserving the distance-proportional force effect.

                  Comment


                  • #10
                    I'm almost tempted to try to spawn a PhysicsVolume and attach it to the player, so I can get the desired motion. anyone know why it's so jerky when teh player resists? In addition the weapon bob effect jerks around like crazy as if it doesn't know which velocity to listen to - the player's or the gravity well's.

                    Comment


                    • #11
                      I use this little bit to similate the player being atached by a chain to something, the biggest difference between this and simulated gravity is that unlike my code gravity "gets weaker" the further away from something it is.
                      Code:
                      		
                      function Chainforce()
                      {
                      	Chainvec = Normal(Stake.Location - OwnerPawn.Location);
                      	Ownerpawn.Velocity += Chainvec * (Chainpull * VSize( Stake.Location-OwnerPawn.Location));
                      	Ownerpawn.SetPhysics( PHYS_Falling );
                      }
                      The first line gets the direction you want the player to be sucked towards (ie the OwnerPawn gets sucked in the direction of the Stake).
                      The second line modifies the players velocity so that they get sucked towards the stake. Chainvec being the direction, and Chainpull being an arbitrary amount of strength multiplied by the players distance from the stake.
                      I set the pawns physics to falling because as you have noticed they can otherwise easily escape/resist the force of the pull.
                      I call this function every tick (when it meets certain other conditions). Ive not noticed any jerkiness with the players camera/weapon bob.
                      Without seeing any of your code I cannot tell why it would work rhythmically, perhaps you are applying the force in a timer?

                      Comment


                      • #12
                        Thank you very much Vaporlynx. I should have tried setting physics to PHYS_FALLING - I was just afraid that the player would keep "landing" every tick.
                        My function is getting called every tick, but it sure looks like it's on a timer.
                        I AM having trouble with the walking physics being far too resistant to the pull, and then when airborne not resistant enough.
                        Perhaps this one thing will fix it all. I should just try it. No sense in being afraid. If it doesn't work that gives me more information.

                        Comment


                        • #13
                          K that is much smoother resisting translation motion! Now I just have to figure out how to keep it from landing every other tick when near the edges (the vortex is above the floor). It's jarring to see the weapon bob jerk around and hear the jump landing noise rapid fire like that.

                          Comment


                          • #14
                            Darn... I also can't jump while inside the max range of the force field. Makes sense - can't jump while falling. Back to the drawing board...

                            Comment


                            • #15
                              There are many options with unreal, its been a whyle since I was tweaking the collar force, but I had tried it without changing the player's physics. the result was that the player would feel a little force, but when they got knocked into the air, or jumped they would feel a lot of force. I assume that the players physics has some sort of attraction or stickiness when on the ground, perhaps some form of friction.
                              You could try increasing the magnitude of the force only when the player is on the ground, then decreasing the magnitude when the player is in the air.
                              You could also try changing the players physics in a timer.
                              You might could also force the player to fly (ie the "fly" console command) when they are in range of your force field.
                              There are many options. What are you trying to accomplish?

                              Comment

                              Working...
                              X