Toggle vehicle engine on/off?

Ask questions, discuss ideas, get answers

Toggle vehicle engine on/off?

Postby Swaffy » Wed May 02, 2018 11:52 pm

I was messing with ObjectTemplate.setActivater today and I can't seem to get my engine to toggle on and off. It works with the jet pack but I am not sure how to get it working with vehicle engines. Is it possible?
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Image
User avatar
Swaffy
 
Posts: 1710
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Toggle vehicle engine on/off?

Postby russ » Thu May 03, 2018 10:56 am

setActivater only functions on ActiveKitPartTemplate. What template type are you attempting to use it on?
russ
 
Posts: 57
Joined: Sun Oct 29, 2017 8:12 am

Re: Toggle vehicle engine on/off?

Postby Swaffy » Thu May 03, 2018 11:46 am

russ wrote:setActivater only functions on ActiveKitPartTemplate. What template type are you attempting to use it on?


ObjectTemplate.create Engine WespeEngine
. . .
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Image
User avatar
Swaffy
 
Posts: 1710
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Toggle vehicle engine on/off?

Postby russ » Fri May 04, 2018 8:47 am

Yup, that won't have any effect on that template type. Here's a full catalog of things that you can do to an engine template:

Code: Select all
1[2/1] 0/1 int ObjectTemplate[Engine].engineType(int) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].torque(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].differential(float) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[Engine].numberOfGears(int) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].gearUp(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].gearDown(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].gearChangeTime(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].noPropellerEffectAtSpeed(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].heatIncrement(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Engine].coolingFactor(float) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[Engine].inverseHeatBar(bool) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[Engine].setHeatBarType(heatBarType) defaultDynamicObjectName
0[2/1] 0/0 int ObjectTemplate[Engine].getHeatBarType() defaultDynamicObjectName

And Engine is a RotationalBundle, so you get
Code: Select all
1[2/1] 0/1 Vec3 ObjectTemplate[RotationalBundle].minRotation(Vec3) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[RotationalBundle].maxRotation(Vec3) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[RotationalBundle].PivotPosition(Vec3) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[RotationalBundle].maxSpeed(Vec3) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[RotationalBundle].acceleration(Vec3) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[RotationalBundle].continousRotationSpeed(Vec3) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[RotationalBundle].inputToYaw(int) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[RotationalBundle].inputToPitch(int) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[RotationalBundle].inputToRoll(int) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[RotationalBundle].automaticReset(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[RotationalBundle].rememberExcessInput(bool) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[RotationalBundle].lesserYawAtSpeed(float) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[RotationalBundle].automaticYawStabilization(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[RotationalBundle].automaticPitchStabilization(bool) defaultDynamicObjectName

0[2/1] 0/0 string ObjectTemplate[Bundle].listTemplates() defaultDynamicObjectName
0[2/1] 0/0 void ObjectTemplate[Bundle].clearTemplateList() defaultDynamicObjectName
0[2/1] 0/1 string ObjectTemplate[Bundle].getTemplate(int) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[Bundle].addTemplate(string) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[Bundle].removeTemplate(int) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[Bundle].setActiveTemplate(int) defaultDynamicObjectName
0[2/1] 1/2 void ObjectTemplate[Bundle].setRandomGeometries(int, int) defaultDynamicObjectName
0[2/1] 1/2 void ObjectTemplate[Bundle].setPosition(Vec3, int) defaultDynamicObjectName
0[2/1] 1/2 void ObjectTemplate[Bundle].setRotation(Vec3, int) defaultDynamicObjectName
0[2/1] 0/1 Vec3 ObjectTemplate[Bundle].getPosition(int) defaultDynamicObjectName
0[2/1] 0/1 Vec3 ObjectTemplate[Bundle].getRotation(int) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[Bundle].setExplodePartAtDestroy(bool) defaultDynamicObjectName


1[2/1] 0/1 string ObjectTemplate[SimpleObject].mesh(string) defaultDynamicObjectName
1[2/1] 0/1 string ObjectTemplate[SimpleObject].networkableInfo(string) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasMobilePhysics(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasCollisionPhysics(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasPointPhysics(bool) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[SimpleObject].addToCollisionGroup(uint) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasResponsePhysics(bool) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[SimpleObject].physicsFrequency(int) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].isBundable(bool) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].drag(float) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[SimpleObject].dragOffset(Vec3) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].mass(float) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[SimpleObject].centerOfMassOffset(Vec3) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[SimpleObject].inertiaModifier(Vec3) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasDynamicShadow(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasDecalEmitter(bool) defaultDynamicObjectName
1[2/1] 0/1 string ObjectTemplate[SimpleObject].geometry(string) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[SimpleObject].grip(int) defaultDynamicObjectName
1[2/1] 0/1 string ObjectTemplate[SimpleObject].aiTemplate(string) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].hasArmor(bool) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[SimpleObject].material(int) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].hitPoints(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].maxHitPoints(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].damageMod(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].speedMod(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].angleMod(float) defaultDynamicObjectName
0[2/1] 3/3 void ObjectTemplate[SimpleObject].addArmorEffect(int, string, Vec3) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].timeToLiveAfterDeath(float) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].fadeAtTimeToLiveAfterDeath(bool) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].timeToStartFadeAfterDeath(float) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].resetWhenRemoved(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].damageFromWater(bool) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].waterDamageDelay(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].criticalDamage(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].explosionRadius(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].explosionDamage(float) defaultDynamicObjectName
1[2/1] 0/1 int ObjectTemplate[SimpleObject].explosionMaterial(int) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].explosionForce(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].explosionForceMod(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].explosionForceMax(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].sinkInToLandAfterDeathSpeed(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].hpLostWhileCriticalDamage(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].hpLostWhileUpSideDown(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].hpLostWhileDamageFromWater(float) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].destroyed(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].noCollisionAsDestroyed(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].canBeRepairedAndDestroyed(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].stayAsDestroyed(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].damageFromDeepWater(bool) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].deepWaterDamageDelay(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].deepWaterLevel(float) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[SimpleObject].hpLostWhileDamageFromDeepWater(float) defaultDynamicObjectName
0[2/1] 1/1 void ObjectTemplate[SimpleObject].loadSoundScript(string) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].attachToListener(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate[SimpleObject].isPortalPassing(bool) defaultDynamicObjectName
1[2/1] 0/1 Vec3 ObjectTemplate[SimpleObject].portalPassingPosition(Vec3) defaultDynamicObjectName

1[2/1] 0/1 string ObjectTemplate[Object].networkableInfo(string) defaultDynamicObjectName
1[2/1] 0/1 float ObjectTemplate[Object].cullRadiusScale(float) defaultDynamicObjectName

0[2/0] 2/2 void ObjectTemplate.setObjectiveCompletetionString1(string, int) defaultStaticObjectName
1[2/0] 0/1 IObjectTemplate ObjectTemplate.active(IObjectTemplate) defaultStaticObjectName
0[2/0] 0/1 string ObjectTemplate.info(IObjectTemplate) defaultStaticObjectName
0[2/0] 0/1 void ObjectTemplate.delete(IObjectTemplate) defaultStaticObjectName
0[2/0] 0/1 void ObjectTemplate.update(IObjectTemplate) defaultStaticObjectName
0[2/0] 0/0 void ObjectTemplate.updateAll() defaultStaticObjectName
0[2/0] 0/1 string ObjectTemplate.list(string) defaultStaticObjectName
0[2/0] 0/1 string ObjectTemplate.printScript(IObjectTemplate) defaultStaticObjectName
0[2/0] 0/0 bool ObjectTemplate.saveAll() defaultStaticObjectName
0[2/0] 0/1 bool ObjectTemplate.save(IObjectTemplate) defaultStaticObjectName
0[2/0] 0/0 bool ObjectTemplate.loadAll() defaultStaticObjectName
0[2/0] 0/1 string ObjectTemplate.type(IObjectTemplate) defaultStaticObjectName
1[2/0] 0/1 string ObjectTemplate.defaultSaveFile(string) defaultStaticObjectName
2[2/1] 0/0 string ObjectTemplate.name() defaultDynamicObjectName
0[2/0] 2/2 IObjectTemplate ObjectTemplate.create(string, string) defaultStaticObjectName
0[2/0] 0/0 string ObjectTemplate.listTemplateClasses() defaultStaticObjectName
1[2/1] 0/1 bool ObjectTemplate.saveInSeparateFile(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.createNotInGrid(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.createInvisible(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.createVisibleInEditor(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.isNotSaveable(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.templateHasBeenUsed(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.preCacheObject(bool) defaultDynamicObjectName
1[2/1] 0/1 bool ObjectTemplate.removeAtRestart(bool) defaultDynamicObjectName
russ
 
Posts: 57
Joined: Sun Oct 29, 2017 8:12 am

Re: Toggle vehicle engine on/off?

Postby freddy » Sun May 06, 2018 9:12 am

Swaffy wrote:I was messing with ObjectTemplate.setActivater today and I can't seem to get my engine to toggle on and off.

I dont really get what you want to accomplish, but if its just a question of making the engine to stay on/of without need to keep pressure on any button, it should work by setting the AutomaticReset to zero.

Code: Select all
ObjectTemplate.setAutomaticReset 0
User avatar
freddy
 
Posts: 1230
Joined: Sun Oct 18, 2009 4:58 pm


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 22 guests

cron