[Code] Fast Roping Workshop
Posted: 2010-02-16 22:57
I will edit this first post with info about the grapple code as we find more.
I give you the magical world of the grappling rope...
You hold the grapple handheld weapon and it all starts when you fire the projectile that throws it all into motion...
You would be able to fire this projectile from a vehicle afaik and by doing it in burst mode with two of these projectiles from two barrels on either side of the chopper you would be able to deploy fastropes with one click of a mouse button (whichever drop a crate isnt)
Now the basic idea I've considered is to fire implosive bullets on either side of the chopper even with the center of gravity so they cancel each other out. The button that deploys the rope projectile would be the same trigger that causes a second weapon to fire these somewhat weak implosive bullets at a high ROF on either side of the chopper. The key to making all this work is making the hook be highly affected by implosions and the ropes not at all...
The code that governs the grapple is as follows...
^^^
Governs the properties of the projectile that is released. Because it isn't actually one geometry but rather a large number of linked ones special code is required to govern the way they are all released and the physics of the movement. In addition this is what expresses the connection of all the pieces as it is defined in hardcode that we cant see. This is the most important piece of code and I will outline it more below...
^^^
AFAIK this just creates the ropelink geoms
Same as above except for the hook
This is the vehicle-esque portion of the code that allows players to enter the grappling hook and climb it like a ladder traveling across the ropelink geom's. The vehicle is always located at a specific location along the ropes length. A geometry can be added to this to observe the physics of the vehicle.
This is the code for the camera the players POV occupies while he is in the vehicle.
ObjectTemplate.create GrapplingHookRope grapplinghookrope
Creates all the projectiles (Custom code note it is not the normal "ObjectTemplate.projectileTemplate" but rather I believe it creates a number of projectiles at once as defined somewhere else...)
ObjectTemplate.networkableInfo BasicInfo
Defines the networkable properties of the object
ObjectTemplate.PreCacheObject 1
Unsure
ObjectTemplate.setMaxRopeLength 35.0
Used to set the distance between links
ObjectTemplate.setNumberOfLinks 26
# of ropelink connections
ObjectTemplate.Timeout 60.0
Amount of time before the object expires
ObjectTemplate.throwStrength 0.0012
ObjectTemplate.upThrowBoost 0.5
ObjectTemplate.degradeThrowStrength 0.8
ObjectTemplate.throwStrength2 0.0012
ObjectTemplate.upThrowBoost2 0.39
ObjectTemplate.degradeThrowStrength2 0.98
ObjectTemplate.dropStrength 0.3
ObjectTemplate.upDropBoost 0.6
ObjectTemplate.degradeDropStrength 0.99
All the above govern how the release velocity is degraded between all the separate parts to allow the rope to deploy as an actual rope instead of a giant clump of geom's... (Could be used to allow a proper deploying of the fastrope from the chopper)
ObjectTemplate.linkAttachMovement 0.00001
I believe a property of the connection between ropelinks but not entirely sure (ie used to mantain the integrity of the rope)
ObjectTemplate.linkAttachTime 0.5
ObjectTemplate.dismountCheckOffset 0.25
ObjectTemplate.minYNormal 0.5
Unsure
ObjectTemplate.attachClimberRadius 2.0
Pretty sure this is how easy it is to enter the rope
ObjectTemplate.climbingSpeed 2.3
Duh?
ObjectTemplate.elasticity 0.2
Can be increased to force the rope to stay awake longer
ObjectTemplate.airFriction 0.95
How the objects slow after release...
ObjectTemplate.climbableAngle 0.5
ObjectTemplate.dismountAngle 0.75
Have yet to test but I am fairly sure that by setting the top # to 0 you could make it so the person only can climb and by changing the bottom # you could make it so if the chopper accelerates too much horizontally while flying the person will be forced off the vehicle (That is hoping and I very much doubt this second part)
ObjectTemplate.ClimbersAttachForce 0.14
Not sure but also may possibly be used to fling a person off the rope if the chopper moves...
ObjectTemplate.AwakeTime 6
Time before rope locks up provided it has not made contact with a static mesh. Regardless it may still settle anyways but the time can be increased by tweaking the elasticity line.
These blocks of code do contain quite a bit of familiar code that bears a hybrid between a vehicle and a weapon, with quite a bit of custom code. I believe from what I've noticed is that the key to making anything even plausible is to try to add mobile physics to nearly every part (minus the camera) and add established ObjectTemplate code to trick the game into thinking the hook should be able to move, and ofcourse as AM mentioned to dramatically increase the awake time.
I was able to able to seperate the links and make the rope free form by added the mobile physics line to the "ObjectTemplate.create GrapplingHookRope grapplinghookrope" portion but still had to face the thing becoming frozen (attributed to AwakeTime). I will certainly be going back and testing this a lot more but alas I am an engineer at mid semester who has to deal with a lot of homework xD
ps. Still doesn't change the fact that this is a lot of complicated, weird work for a stupid little gimmick
I give you the magical world of the grappling rope...
You hold the grapple handheld weapon and it all starts when you fire the projectile that throws it all into motion...
Code: Select all
ObjectTemplate.projectileTemplate GrapplingHookRopeNow the basic idea I've considered is to fire implosive bullets on either side of the chopper even with the center of gravity so they cancel each other out. The button that deploys the rope projectile would be the same trigger that causes a second weapon to fire these somewhat weak implosive bullets at a high ROF on either side of the chopper. The key to making all this work is making the hook be highly affected by implosions and the ropes not at all...
The code that governs the grapple is as follows...
Code: Select all
ObjectTemplate.create GrapplingHookRope grapplinghookrope
ObjectTemplate.networkableInfo BasicInfo
ObjectTemplate.PreCacheObject 1
ObjectTemplate.setMaxRopeLength 35.0
ObjectTemplate.setNumberOfLinks 26
ObjectTemplate.Timeout 60.0
ObjectTemplate.throwStrength 0.0012
ObjectTemplate.upThrowBoost 0.5
ObjectTemplate.degradeThrowStrength 0.8
ObjectTemplate.throwStrength2 0.0012
ObjectTemplate.upThrowBoost2 0.39
ObjectTemplate.degradeThrowStrength2 0.98
ObjectTemplate.dropStrength 0.3
ObjectTemplate.upDropBoost 0.6
ObjectTemplate.degradeDropStrength 0.99
ObjectTemplate.linkAttachMovement 0.00001
ObjectTemplate.linkAttachTime 0.5
ObjectTemplate.dismountCheckOffset 0.25
ObjectTemplate.minYNormal 0.5
ObjectTemplate.attachClimberRadius 2.0
ObjectTemplate.climbingSpeed 2.3
ObjectTemplate.elasticity 0.2
ObjectTemplate.airFriction 0.95
ObjectTemplate.climbableAngle 0.5
ObjectTemplate.dismountAngle 0.75
ObjectTemplate.ClimbersAttachForce 0.14
ObjectTemplate.AwakeTime 6Governs the properties of the projectile that is released. Because it isn't actually one geometry but rather a large number of linked ones special code is required to govern the way they are all released and the physics of the movement. In addition this is what expresses the connection of all the pieces as it is defined in hardcode that we cant see. This is the most important piece of code and I will outline it more below...
Code: Select all
ObjectTemplate.create RopeLink ropelink
ObjectTemplate.PreCacheObject 1AFAIK this just creates the ropelink geoms
Code: Select all
ObjectTemplate.create HookLink xp1_grapplinghook
ObjectTemplate.PreCacheObject 1Code: Select all
ObjectTemplate.create GrapplingHookRopeContainer GrapplingHookRopeContainer
ObjectTemplate.PreCacheObject 1
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.networkableInfo BasicInfo
ObjectTemplate.seatAnimationSystem Objects/Vehicles/xpak_vehicles/xpak_grapplehook/animationSystem.inc
ObjectTemplate.seatInformation GrapplingHookRopeContainer 0.0796084/0.19108/0.0994398 0/0/0
ObjectTemplate.addTemplate GrappleContainerCamera
ObjectTemplate.setPosition 0/0.5/-0.5
ObjectTemplate.hasCollisionPhysics 0
ObjectTemplate.maintainCameraOnExit 1
ObjectTemplate.autoUseAbility 0
ObjectTemplate.isOpenVehicle 1
ObjectTemplate.createComponent VehicleHud
ObjectTemplate.vehicleHud.hudName "GrapplingHook"
ObjectTemplate.vehicleHud.showInfo 0
ObjectTemplate.vehicleHud.usePlayerIcon 1
ObjectTemplate.vehicleHud.useVehicleCommRose 0
rem ---EndComp ---Code: Select all
ObjectTemplate.create Camera GrappleContainerCamera
ObjectTemplate.setMinRotation -120/-60/0
ObjectTemplate.setMaxRotation 120/60/0
ObjectTemplate.setMaxSpeed 250/250/0
ObjectTemplate.setAcceleration 1000/1000/0.1
ObjectTemplate.setInputToYaw PIMouseLookX
ObjectTemplate.setInputToPitch PIMouseLookY
ObjectTemplate.CVMFlyBy 0
ObjectTemplate.CVMChase 0
ObjectTemplate.CVMFrontChase 0
ObjectTemplate.CVMNose 0
ObjectTemplate.CVMTrace 0
ObjectTemplate.CVMExternTrace 0ObjectTemplate.create GrapplingHookRope grapplinghookrope
Creates all the projectiles (Custom code note it is not the normal "ObjectTemplate.projectileTemplate" but rather I believe it creates a number of projectiles at once as defined somewhere else...)
ObjectTemplate.networkableInfo BasicInfo
Defines the networkable properties of the object
ObjectTemplate.PreCacheObject 1
Unsure
ObjectTemplate.setMaxRopeLength 35.0
Used to set the distance between links
ObjectTemplate.setNumberOfLinks 26
# of ropelink connections
ObjectTemplate.Timeout 60.0
Amount of time before the object expires
ObjectTemplate.throwStrength 0.0012
ObjectTemplate.upThrowBoost 0.5
ObjectTemplate.degradeThrowStrength 0.8
ObjectTemplate.throwStrength2 0.0012
ObjectTemplate.upThrowBoost2 0.39
ObjectTemplate.degradeThrowStrength2 0.98
ObjectTemplate.dropStrength 0.3
ObjectTemplate.upDropBoost 0.6
ObjectTemplate.degradeDropStrength 0.99
All the above govern how the release velocity is degraded between all the separate parts to allow the rope to deploy as an actual rope instead of a giant clump of geom's... (Could be used to allow a proper deploying of the fastrope from the chopper)
ObjectTemplate.linkAttachMovement 0.00001
I believe a property of the connection between ropelinks but not entirely sure (ie used to mantain the integrity of the rope)
ObjectTemplate.linkAttachTime 0.5
ObjectTemplate.dismountCheckOffset 0.25
ObjectTemplate.minYNormal 0.5
Unsure
ObjectTemplate.attachClimberRadius 2.0
Pretty sure this is how easy it is to enter the rope
ObjectTemplate.climbingSpeed 2.3
Duh?
ObjectTemplate.elasticity 0.2
Can be increased to force the rope to stay awake longer
ObjectTemplate.airFriction 0.95
How the objects slow after release...
ObjectTemplate.climbableAngle 0.5
ObjectTemplate.dismountAngle 0.75
Have yet to test but I am fairly sure that by setting the top # to 0 you could make it so the person only can climb and by changing the bottom # you could make it so if the chopper accelerates too much horizontally while flying the person will be forced off the vehicle (That is hoping and I very much doubt this second part)
ObjectTemplate.ClimbersAttachForce 0.14
Not sure but also may possibly be used to fling a person off the rope if the chopper moves...
ObjectTemplate.AwakeTime 6
Time before rope locks up provided it has not made contact with a static mesh. Regardless it may still settle anyways but the time can be increased by tweaking the elasticity line.
These blocks of code do contain quite a bit of familiar code that bears a hybrid between a vehicle and a weapon, with quite a bit of custom code. I believe from what I've noticed is that the key to making anything even plausible is to try to add mobile physics to nearly every part (minus the camera) and add established ObjectTemplate code to trick the game into thinking the hook should be able to move, and ofcourse as AM mentioned to dramatically increase the awake time.
I was able to able to seperate the links and make the rope free form by added the mobile physics line to the "ObjectTemplate.create GrapplingHookRope grapplinghookrope" portion but still had to face the thing becoming frozen (attributed to AwakeTime). I will certainly be going back and testing this a lot more but alas I am an engineer at mid semester who has to deal with a lot of homework xD
ps. Still doesn't change the fact that this is a lot of complicated, weird work for a stupid little gimmick