Chagrin
10-23-2010, 05:03 PM
Hello all -
I am attempting to create a weapon in unrealscript that creates a DynamicPhysicsVolume when the projectile hits an object.
I have the weapon script working fine (extending UTWeap_RocketLauncher), and ammo can be picked up with no problem (ammo extends UTProj_Grenade), and I am able to fire a custom mesh just dandy. The problem comes in when I try to create a new DynamicPhysicsVolume on impact.
I copied and used the function:
simulated event HitWall(vector HitNormal, Actor Wall, PrimitiveComponent WallComp) //taken from UTProj_Grenade and modified
which I hope is the proper place for the creation of the DynamicPhysicsVolume.
Currently, my main two problems are:
How do I tell the DynamicPhysicsVolume to be spherical? (I think DrawSphereComponent has something to do with it, but I can't figure out how to tell the DynamicPhysicsVolume what shape to use); and
How do I specify its location upon creation? As one solution, I've tried creating a separate class for the DynamicPhysicsVolume, but I cannot find a way to "feed in" a location parameter into the defaultproperties, or otherwise edit its location.
To get around the first problem, I have created a DynamicPhysicsVolume in the editor, then turned it into first a prefab, then later an archetype, and tried to use both in my code, but I cannot seem to access any properties of either prefab or archetype (I suppose I just don't know the syntax).
So, basically, there are a million ways to do this, but I can't get any of them to work.
Thanks for your help!
I am attempting to create a weapon in unrealscript that creates a DynamicPhysicsVolume when the projectile hits an object.
I have the weapon script working fine (extending UTWeap_RocketLauncher), and ammo can be picked up with no problem (ammo extends UTProj_Grenade), and I am able to fire a custom mesh just dandy. The problem comes in when I try to create a new DynamicPhysicsVolume on impact.
I copied and used the function:
simulated event HitWall(vector HitNormal, Actor Wall, PrimitiveComponent WallComp) //taken from UTProj_Grenade and modified
which I hope is the proper place for the creation of the DynamicPhysicsVolume.
Currently, my main two problems are:
How do I tell the DynamicPhysicsVolume to be spherical? (I think DrawSphereComponent has something to do with it, but I can't figure out how to tell the DynamicPhysicsVolume what shape to use); and
How do I specify its location upon creation? As one solution, I've tried creating a separate class for the DynamicPhysicsVolume, but I cannot find a way to "feed in" a location parameter into the defaultproperties, or otherwise edit its location.
To get around the first problem, I have created a DynamicPhysicsVolume in the editor, then turned it into first a prefab, then later an archetype, and tried to use both in my code, but I cannot seem to access any properties of either prefab or archetype (I suppose I just don't know the syntax).
So, basically, there are a million ways to do this, but I can't get any of them to work.
Thanks for your help!