Automatic Jet-Pack Thrust

Ask questions, discuss ideas, get answers
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Automatic Jet-Pack Thrust

Post by Swaffy »

I am trying to make the RocketPack [Jet Pack from Secret Weapons of WWII] have automatic thrust instead of the player having to hit the space button a thousand times to fly ten feet. Plus, hitting the spacebar that much can wear out the space button.

What do I do to make it have automatic thrust [Just hold the space bar and the thrust will stay on]?

I believe the scripting is edited here:

Code: Select all

ObjectTemplate.create ActiveKitPart GermanElite_RocketPack
ObjectTemplate.geometry GermanElite_rocketpack
ObjectTemplate.setBoneName backpack
ObjectTemplate.setCopyLinksCount 0
ObjectTemplate.setActiveAcceleration  0/72/0
ObjectTemplate.setPassiveAcceleration 0/7.7/0
ObjectTemplate.setInAirAnimOverride GrenadeAxisFire
ObjectTemplate.burstFrequency 30
ObjectTemplate.Damping 0.0
ObjectTemplate.setTrigger PIAction
ObjectTemplate.addToNegativeMask Climbing
ObjectTemplate.addToNegativeMask Crouching
ObjectTemplate.addToNegativeMask Swiming
ObjectTemplate.addToNegativeMask Lying
ObjectTemplate.addTemplate e_RocketPack
ObjectTemplate.addTemplate e_RocketPackDefault
ObjectTemplate.DefaultEffectTemplate e_RocketPackDefault
rem ObjectTemplate.startEffectTemplate e_MustangFire
ObjectTemplate.ActiveHeatIncrement 0.001
rem ** I think PassiveHeatIncrement should be kept to 0.0 **
ObjectTemplate.PassiveHeatIncrement 0.0
ObjectTemplate.CoolingFactor 1.0
ObjectTemplate.ActiveEffectPersistancePerFrame 0
ObjectTemplate.loadSoundScript Sounds/RocketPack.ssc
ObjectTemplate.setInAirAnims Lb_RocketeeringIdle Empty
ObjectTemplate.OverrideAirMovementInhibitations 1
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
tekk
Posts: 171
Joined: Fri Dec 11, 2009 6:12 pm

Re: Automatic Jet-Pack Thrust

Post by tekk »

If I was to try doing that I would try adding this line as a start

Code: Select all

ObjectTemplate.setAsynchronyFire 1
I grabbed that from the weapons.con of the hellfire as the apache you can either have a autofire with your hellfires or set it to 0 where you have to click it one at a time. I would also try rem out the

Code: Select all

ObjectTemplate.burstFrequency 30
with the above code. Dont know if this helps.
Nodbrother- "getting whiped every single game by some over-active 9 year old kid with too much spare time and a reaction time that is a third of yours."
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Automatic Jet-Pack Thrust

Post by Apache Thunder »

I looked and found this unused command that was made specifically for the ActiveKitPart class:

Code: Select all

ObjectTemplate.burstTime
It accepts a float value. (similer to timeToLive, timeToLiveAfterDeath, etc) Judging from the name of the command, this should make the jetpack thrust longer with fewer key presses.

In fact, I may try this on the jetpacks in my BFH conversion mod. Real BFH has their jetpacks do all of their thrust in one key press. :P

EDIT:

Ok after some tweaking, the "burstTime" seems to have no effect. However I achieved a similar effect by coding it like this:

Code: Select all

ObjectTemplate.create ActiveKitPart RippinRocket_RocketPack
ObjectTemplate.setNetworkableInfo RocketPackEngineInfo
ObjectTemplate.geometry InvisibleKit_m1
ObjectTemplate.setBoneName backpack
ObjectTemplate.setCopyLinksCount 0
ObjectTemplate.loadSoundScript ../../Common/Sounds/RocketPack.ssc
rem ---------------------------------------------
ObjectTemplate.addTemplate e_RippinRocketPack
ObjectTemplate.addTemplate e_RippinRocketPackDefault
rem ---------------------------------------------
ObjectTemplate.activeEffectPersistancePerFrame 0
ObjectTemplate.activeHeatIncrement 30
ObjectTemplate.addToNegativeMask Climbing
ObjectTemplate.addToNegativeMask Crouching
ObjectTemplate.addToNegativeMask Swiming
ObjectTemplate.addToNegativeMask Lying
ObjectTemplate.burstTime 2
ObjectTemplate.burstFrequency 0.07
ObjectTemplate.coolingFactor 0.07
ObjectTemplate.damping 0.0
ObjectTemplate.defaultEffectTemplate e_RocketPackDefault
ObjectTemplate.overrideAirMovementInhibitations 1
ObjectTemplate.passiveHeatIncrement 0.0
ObjectTemplate.setActiveAcceleration  0/500/0
ObjectTemplate.setInAirAnimOverride GrenadeAxisFire
ObjectTemplate.setInAirAnims Lb_RocketeeringIdle Empty
ObjectTemplate.setPassiveAcceleration 0/0/0
ObjectTemplate.setTrigger PIAction
I reduced the burstFrequency to match the cooling time (in this case 0.07) so that it would take 10 or more seconds before it will let you use it again. (during that time you have just the regular jump) I also increased the heat increment to 30 so it will use up all the fuel in one jump.

Since I increased the active acceleration setting, it will do all of the expected hieght from the jet pack in one go. However unlike what you want to do, it does not allow you to hold the key down to thrust and let go when your want it to stop. In my coding it will do all of it's acceleration at once so you don't really get to chose how high you go. It suits my mod, but may not work for what you want to do. Nonetheless, I posted it anyway incase any of it might help.
ImageImageImage
I have cameras in your head!
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

perhaps the "old" ObjectTemplate.autoFire 1 works in a ActiveKitPart?
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Automatic Jet-Pack Thrust

Post by Apache Thunder »

That one only works on FireArms and handFireArms unfortunately. :(

Found alternate command for the "trigger"

Code: Select all

ObjectTemplate.setActivater
Accepts same setting type as the "setTrigger" command. Perhaps it's as simple as using this instead of the trigger command? I will try this now.

EDIT:

Nope doesn't do what I thought. Infact this command seems to be able to turn off and on the jetpack. (as in completely off. One press, and even the heat increment icon disappears and I assume the passive acceleration would turn off if the jetpack is off)

BUT you can use the "PassiveHeatIncrement" instead and then the jetpack would have a toggle function. Press a key and it would stay on with continuous thrust (passive acceleration ignores the burst settings, so you don't need to define the setTrigger command and burstFrequency can be set to zero) then press it again and it would turn off.

Set activeAcceleration to zero along with activeHeatIncrement and such. Then configure the passive acceleration settings and related commands instead so that it will have limited fuel. If you configure the passive acceleration correctly, you can have a proper jetpack. Press key and it will thrust you up, press again to turn off and descend. Also, you might need to tweak the rocket effects afterwords as they were originally coded to activate when the the trigger key is used and won't be active during passive acceleration. Recode the effects to use these on the effect bundles instead:

Code: Select all

ObjectTemplate.setStartOnEffects 32
ObjectTemplate.setStopOnEffects 64
This is used on my engines on some vehicles for exhaust effects on the vehicle mufflers. That tells it to turn on the effect when the engine starts, and turn off when the engine turns off. I assume this to do the same when coded on the jetpack as it's a engine too and the setActivator seems to turn on and off the jetpack.

Code: Select all

ObjectTemplate.setActivater PIAction
You can use a key other then the space bar if you want.

Before that, you can try using this command:

Code: Select all

ObjectTemplate.setInputToRoll
This is what standard engines use and rotational bundles and such. It's not listed to work with specific object classes, so it might also work on jetpack engines. The Trigger command is a toggle command, thus it will probably never work as you want it to. Alternate thrust commands should be used in it's place.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Automatic Jet-Pack Thrust

Post by Swaffy »

Thank you, sir. It toggles off and on. But how do I fix the effects?

I already have this added:
ObjectTemplate.setStartOnEffects 32
ObjectTemplate.setStopOnEffects 64
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Automatic Jet-Pack Thrust

Post by Apache Thunder »

Did you add them to the effectBundles? (not the emitters or sprites/particles)

Be sure to remove the old code lines. (I believe the only ones present was the startOnEffects command)

Also, you may need to turn this off on all the emitters:

Code: Select all

ObjectTemplate.startAtCreation 0
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Automatic Jet-Pack Thrust

Post by Swaffy »

Still not working. Here, I'll show you what I have set up.

Objects\Effects\e_RocketPack\Effects.con

Code: Select all

rem *** e_RocketPack ***
ObjectTemplate.create EffectBundle e_RocketPack
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.timeToLive CRD_UNIFORM/-1/0/0
rem -------------------------------------
ObjectTemplate.addTemplate Em_RocketPack_mesh
ObjectTemplate.setPosition 0.115/0.1/-0.2
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate Em_RocketPack_Smoker
ObjectTemplate.setPosition 0.115/0.1/-0.2
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate Em_RocketPack_mesh
ObjectTemplate.setPosition 0.115/-0.1/-0.2
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate Em_RocketPack_Smoker
ObjectTemplate.setPosition 0.115/-0.1/-0.2
ObjectTemplate.setRotation 180/0/0
rem -------------------------------------
rem ObjectTemplate.setStartOnEffects 1
ObjectTemplate.setStartOnEffects 32
ObjectTemplate.setStopOnEffects 64

rem *** Em_RocketPack_mesh ***
ObjectTemplate.create Emitter Em_RocketPack_mesh
ObjectTemplate.template Fx_RocketPack_mesh
ObjectTemplate.lodDistance 500
ObjectTemplate.timeToLive CRD_NONE/1/0/0
ObjectTemplate.intensity CRD_NONE/11/0/0
ObjectTemplate.startRotation CRD_UNIFORM/0/180/1
ObjectTemplate.noPhysics 1
ObjectTemplate.addChild 1
ObjectTemplate.looping 1

rem *** Fx_RocketPack_mesh ***
ObjectTemplate.create Particle fx_RocketPack_mesh
ObjectTemplate.geometry e_jetfire_m1
ObjectTemplate.timeToLive CRD_NONE/10/0/0
ObjectTemplate.size CRD_NONE/1.8/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeModifier 0.15/0.15/0.18
ObjectTemplate.sizeOverTime 0/1|100/0.1
ObjectTemplate.alphaOverTime 0/0.1|100/0


rem *** Em_RocketPack_Smoker ***
ObjectTemplate.create Emitter Em_RocketPack_Smoker
ObjectTemplate.template Fx_RocketPack_Smoker
ObjectTemplate.looping 1
ObjectTemplate.startAtCreation 0
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.startProbability 1
ObjectTemplate.lodDistance 800
ObjectTemplate.timeToLive CRD_NONE/0.2/0/0
ObjectTemplate.intensity CRD_NONE/50/0/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/7/12/0

rem *** Fx_RocketPack_Smoker ***
ObjectTemplate.create SpriteParticle Fx_RocketPack_Smoker
ObjectTemplate.timeToLive CRD_UNIFORM/0.4/0.7/0
ObjectTemplate.size CRD_NONE/0.5/0/0
ObjectTemplate.gravityModifier CRD_NONE/1/0/0
ObjectTemplate.drag CRD_UNIFORM/0/5/0
ObjectTemplate.sizeOverTime 0/0.2|100/1.5
ObjectTemplate.texture e_muzs1_I
ObjectTemplate.useMipMaps 1
ObjectTemplate.initRotation CRD_UNIFORM/0/180/1
ObjectTemplate.XYSizeRatio CRD_NONE/1/0/0
ObjectTemplate.srcBlendMode BMone
ObjectTemplate.destBlendMode BMInvSourceAlpha
ObjectTemplate.rotationSpeed CRD_UNIFORM/50/100/1
ObjectTemplate.colorRGBAOverTime 0/200/200/200/50|10/155/155/150/250|40/102/102/102/195|60/34/34/34/253|100/0/0/0/0

rem *** e_RocketPackDefault ***
ObjectTemplate.create EffectBundle e_RocketPackDefault
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.timeToLive CRD_NONE/-1/0/0
rem -------------------------------------
ObjectTemplate.addTemplate Em_RocketPackDefault_mesh
ObjectTemplate.setPosition 0.115/0.1/-0.2
ObjectTemplate.setRotation 180/0/0
ObjectTemplate.addTemplate Em_RocketPackDefault_mesh
ObjectTemplate.setPosition 0.115/-0.1/-0.2
ObjectTemplate.setRotation 180/0/0
rem -------------------------------------
rem ObjectTemplate.setStartOnEffects 1
ObjectTemplate.setStartOnEffects 32
ObjectTemplate.setStopOnEffects 64

rem *** Em_RocketPackDefault_mesh ***
ObjectTemplate.create Emitter Em_RocketPackDefault_mesh
ObjectTemplate.template Fx_RocketPackDefault_mesh
ObjectTemplate.lodDistance 500
ObjectTemplate.timeToLive CRD_NONE/0.1/0/0
ObjectTemplate.intensity CRD_NONE/10/0/0
ObjectTemplate.startRotation CRD_UNIFORM/0/180/1
ObjectTemplate.noPhysics 1
ObjectTemplate.addChild 1
ObjectTemplate.looping 1

rem *** Fx_RocketPackDefault_mesh ***
ObjectTemplate.create Particle fx_RocketPackDefault_mesh
ObjectTemplate.geometry e_jetfire_m1
ObjectTemplate.timeToLive CRD_NONE/0.03/0/0
ObjectTemplate.size CRD_NONE/1.2/0/0
ObjectTemplate.gravityModifier CRD_NONE/0/0/0
ObjectTemplate.sizeModifier 0.15/0.15/0.05
ObjectTemplate.sizeOverTime 1
ObjectTemplate.alphaOverTime 1
Objects\Items\Common\Objects.con

Code: Select all

ObjectTemplate.create ActiveKitPart GermanElite_RocketPack
ObjectTemplate.geometry GermanElite_rocketpack
ObjectTemplate.setBoneName backpack
ObjectTemplate.setCopyLinksCount 0
rem ObjectTemplate.setActiveAcceleration  0/72/0
rem ObjectTemplate.setPassiveAcceleration 0/7.7/0
ObjectTemplate.setActiveAcceleration  0/0/0
ObjectTemplate.setPassiveAcceleration 0/20/0
ObjectTemplate.setInAirAnimOverride GrenadeAxisFire
ObjectTemplate.burstFrequency 30
ObjectTemplate.Damping 0.0
rem ObjectTemplate.setTrigger PIAction
ObjectTemplate.setActivater PIAction
ObjectTemplate.addToNegativeMask Climbing
ObjectTemplate.addToNegativeMask Crouching
ObjectTemplate.addToNegativeMask Swiming
ObjectTemplate.addToNegativeMask Lying
ObjectTemplate.addTemplate e_RocketPack
ObjectTemplate.addTemplate e_RocketPackDefault
ObjectTemplate.DefaultEffectTemplate e_RocketPackDefault
rem ObjectTemplate.startEffectTemplate e_RocketPackDefault
ObjectTemplate.ActiveHeatIncrement 0.00
rem ** I think PassiveHeatIncrement should be kept to 0.0 **
ObjectTemplate.PassiveHeatIncrement 0.0
ObjectTemplate.CoolingFactor 1.0
ObjectTemplate.ActiveEffectPersistancePerFrame 1
ObjectTemplate.loadSoundScript Sounds/RocketPack.ssc
ObjectTemplate.setInAirAnims Lb_RocketeeringIdle Empty
ObjectTemplate.OverrideAirMovementInhibitations 1
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Automatic Jet-Pack Thrust

Post by Apache Thunder »

At this point I'm out of ideas. :(

Here's the full code to one of my vehicle exhaust effects:

Code: Select all

rem
rem *** Vehicle Exhaust (Small) ***
rem

ObjectTemplate.create EffectBundle e_exhaust_small
ObjectTemplate.saveInSeparateFile 1
rem -------------------------------------
ObjectTemplate.addTemplate em_exhaust_small
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/-1/0/0
ObjectTemplate.setStartOnEffects 32
ObjectTemplate.setStopOnEffects 64

ObjectTemplate.create Emitter Em_exhaust_small
ObjectTemplate.template Fx_exhaust_small
ObjectTemplate.looping 1
ObjectTemplate.startAtCreation 0
ObjectTemplate.addEmitterSpeed 1
ObjectTemplate.emitterSpeedScale 1
ObjectTemplate.lodDistance 20
ObjectTemplate.timeToLive CRD_UNIFORM/1/2/0
ObjectTemplate.intensity CRD_UNIFORM/8/9/0
ObjectTemplate.positionalSpeedInDof CRD_UNIFORM/-0.6/-0.8/0
ObjectTemplate.positionalSpeedInUp CRD_UNIFORM/-0.1/0.1/0
ObjectTemplate.startRotation CRD_NONE/1/0/0

ObjectTemplate.create SpriteParticle Fx_exhaust_small
ObjectTemplate.texture Anim_smoke
ObjectTemplate.timeToLive CRD_UNIFORM/0.6/0.8/0
ObjectTemplate.size CRD_UNIFORM/0.35/0.7/0
ObjectTemplate.gravityModifierOverTime 0/0|35/0|50/-0.05|75/-0.1|100/-0.2
ObjectTemplate.sizeOverTime 0/0|50/0.5|75/0.65|85/0.75|100/1
ObjectTemplate.drag CRD_NONE/0.35/0/0
ObjectTemplate.initRotation CRD_UNIFORM/0/360/0
ObjectTemplate.rotationSpeed CRD_UNIFORM/0/15/0
ObjectTemplate.colorRGBAOverTime 0/100/100/100/0|50/80/80/80/200|75/100/100/100/128|100/128/128/128/0
ObjectTemplate.numAnimationFrames 4
ObjectTemplate.initAnimationFrame CRD_NONE/2/0/0
ObjectTemplate.animationSpeed CRD_NONE/2/0/0
Hope there is something in there that will give you an idea on the fix.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Automatic Jet-Pack Thrust

Post by Swaffy »

Alright. I have an idea. Be back soon.
[Edit] Nope. Doesn't work. Forget it. I give up.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Post Reply