Posted by: tomeister - Saturday, April 14, 2012 12:56:22 AM
I've looked over the codes, but can't quite work it out- how does the bomb truck disguise ability work, and what would I do to transfer that to a new unit?

Posted by: acidbrain - Saturday, April 14, 2012 7:05:18 AM
It needs a special ability, the StealthUpdate module and a DISGUISER KindOf defined. The StealthUpdate module: [code] StealthUpdate [This module allows the use of SoundStealthOn and SoundStealthOff parameters on the object and is hardcoded to display MESSAGE:StealthNeutralized when the object has been discovered] UseRiderStealth = [Yes/No] StealthDelay = [integer, milliseconds] MoveThresholdSpeed = [integer] StealthForbiddenConditions = [Status Bit types] HintDetectableConditions = [Status Bit types] FriendlyOpacityMin = [percentage] FriendlyOpacityMax = [percentage] PulseFrequency = [integer, milliseconds] RevealDistanceFromTarget = [real number] ForbiddenStatus = [Status Bit types] RequiredStatus = [Status Bit types] OrderIdleEnemiesToAttackMeUponReveal = [Yes/No] InnateStealth = [Yes/No] EnemyDetectionEvaEvent = [Entry from Eva.ini] OwnDetectionEvaEvent = [Entry from Eva.ini] GrantedBySpecialPower = [Yes/No] BlackMarketCheckDelay = [integer, milliseconds] [Note: This part needs the DISGUISER KindOf defined on the object and [allows the use of DisguiseStarted and DisguiseRevealedSuccess [and DisguiseRevealedFailure within UnitSpecificSounds section of the object] DisguisesAsTeam = [Yes/No] DisguiseFX = [entry from FXList.INI] DisguiseRevealFX = [entry from FXList.INI] DisguiseTransitionTime = [integer, milliseconds] DisguiseRevealTransitionTime = [integer, milliseconds] End [/code]

Posted by: tomeister - Saturday, April 14, 2012 8:42:30 AM
Thanks;) So what part of it makes the game recognise that's you can disguise as other vehicles, not just go stealth.

Posted by: acidbrain - Saturday, April 14, 2012 10:58:56 AM
It's not just go stealth...read..:P If you want to add it to your mod add this to your vehicle of choice: [code] Behavior = SpecialAbility ModuleTag_Dis01 SpecialPowerTemplate = SpecialAbilityDisguiseAsVehicle UpdateModuleStartsAttack = Yes InitiateSound = BombTruckVoiceDisguise End Behavior = SpecialAbilityUpdate ModuleTag_Dis02 SpecialPowerTemplate = SpecialAbilityDisguiseAsVehicle StartAbilityRange = 1000000.0 ApproachRequiresLOS = No End Behavior = StealthUpdate ModuleTag_Dis03 StealthDelay = 1 DisguisesAsTeam = Yes RevealDistanceFromTarget = 100.0f OrderIdleEnemiesToAttackMeUponReveal = Yes DisguiseFX = FX_BombTruckDisguise DisguiseRevealFX = FX_BombTruckDisguiseReveal InnateStealth = Yes DisguiseTransitionTime = 2000 DisguiseRevealTransitionTime = 1000 End [/code] Add this to the commandset of the vehicle you've chosen: [code] CommandSet BlaBlaBlaCommandSet ? = Command_DisguiseAsVehicle End [/code] If you want to use it for a single map add this to the map.ini: (I used the Lazr_AmericaVehicleTomahawk as an example) [code] Object Lazr_AmericaVehicleTomahawk KindOf = PRELOAD SELECTABLE DONT_AUTO_CRUSH_INFANTRY CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE DISGUISER AddModule Behavior = SpecialAbility ModuleTag_Dis01 SpecialPowerTemplate = SpecialAbilityDisguiseAsVehicle UpdateModuleStartsAttack = Yes InitiateSound = BombTruckVoiceDisguise End End AddModule Behavior = SpecialAbilityUpdate ModuleTag_Dis02 SpecialPowerTemplate = SpecialAbilityDisguiseAsVehicle StartAbilityRange = 1000000.0 ApproachRequiresLOS = No End End AddModule Behavior = StealthUpdate ModuleTag_Dis03 StealthDelay = 1 DisguisesAsTeam = Yes RevealDistanceFromTarget = 100.0f OrderIdleEnemiesToAttackMeUponReveal = Yes DisguiseFX = FX_BombTruckDisguise DisguiseRevealFX = FX_BombTruckDisguiseReveal InnateStealth = Yes DisguiseTransitionTime = 2000 DisguiseRevealTransitionTime = 1000 End End End CommandSet AmericaVehicleTomahawkCommandSet 1 = Command_ConstructAmericaVehicleBattleDrone 2 = Command_ConstructAmericaVehicleScoutDrone 3 = Command_ConstructAmericaVehicleHellfireDrone 4 = Command_DisguiseAsVehicle 11 = Command_AttackMove 13 = Command_Guard 14 = Command_Stop End [/code] Start up the game and see for yourself... Note: if you want to disguise your vehicle into an Avenger the turret doesnt show because the turret is a separate object, the same for all the tanks and vehicles with W3DOverlordTruckDraw which use W3DDependencyModelDraw to add a turret. Greetz, acidbrain

Posted by: tomeister - Saturday, April 14, 2012 12:03:48 PM
Thanks, that's really helpful;)

Posted by: tomeister - Sunday, April 15, 2012 6:11:10 AM
Could get it to disguise as buildings too?

Posted by: acidbrain - Sunday, April 15, 2012 12:03:38 PM
Check the GLA fake building stuff...

Posted by: tomeister - Friday, April 27, 2012 9:28:49 AM
But they don't disguise, they have the same model. I want it a bit like the disguise CAH from BFME2.

Posted by: acidbrain - Saturday, April 28, 2012 2:22:08 AM
I don't play BFME2 but maybe you can make an upgrade to disguise the building and use the "ReplaceObjectUpgrade" to switch from one building to another just like the GLA fakebuildings switch back to the real building. This method requires a lot of code because you have to make the switch for all the buildings you want the original building to turn in to, it works different than the disguise stuff. You could make a button in the buildingcommandset to switch to another commandset in wich you can choose the building you want to switch to. You have to make separate upgrades for every building you want to switch to and if you pick a building in the second commandset switch back to the default commandset of the building, use the "CommandSetUpgrade" module for that, triggered by the one of the disguiseupgrades. Maybe there's a better way to do it so give it a try and test some stuff...

Posted by: CommieDog - Saturday, April 28, 2012 11:13:33 PM
If I remember correctly, the code that determines whether or not an object is a suitable target for a special power checks the special power's Enum value. Try making a new special power that uses the Hacker's disable building special power enum and using that as the special power for your disguise ability.

Posted by: acidbrain - Sunday, April 29, 2012 6:18:14 AM
[quote=CommieDog;124189]If I remember correctly, the code that determines whether or not an object is a suitable target for a special power checks the special power's Enum value. Try making a new special power that uses the Hacker's disable building special power enum and using that as the special power for your disguise ability.[/quote] Well i tested some stuff and couldn't get it to work as the disguise stuff does, i think the disguise stuff is hardcoded or something or i'm just too stupid..:P @tomeister However you can use "DisguiseAsVehicle" for buildings if you add "VEHICLE" and "DISGUISER" to the KindOf and comment out "IMMOBILE", give the building an "AIUpdateInterface" module with a locomotor and a "PhysicsBehavior" module with a mass. You can give the locomotor a tiny speed so you can move the building a bit so it fits nicely and doesn't overlap other buildings. I don't know if you want to use it for your mod in which you use the moveable buildings, if so you already got a locomotor and mass i guess. What's important is that the building you want to disguise as also has "VEHICLE" as KindOf defined, an "AIUpdateInterface" module with a locomotor and a "PhysicsBehavior" module with a mass. Here's an example map.ini, took the Lazr_AmericaPowerPlant to test it. [code] Object Lazr_AmericaPowerPlant KindOf = PRELOAD STRUCTURE SELECTABLE SCORE CAPTURABLE FS_POWER MP_COUNT_FOR_VICTORY VEHICLE DISGUISER ;IMMOBILE AddModule Behavior = AIUpdateInterface ModuleTag_Loco End End Locomotor = SET_NORMAL NoMoveLocomotor ;made this for testing purposes, add locomotor of choice AddModule Behavior = PhysicsBehavior ModuleTag_Mass Mass = 50.0 End End AddModule Behavior = SpecialAbility ModuleTag_Dis01 SpecialPowerTemplate = SpecialAbilityDisguiseAsVehicle UpdateModuleStartsAttack = Yes ; InitiateSound = BombTruckVoiceDisguise End End AddModule Behavior = SpecialAbilityUpdate ModuleTag_Dis02 SpecialPowerTemplate = SpecialAbilityDisguiseAsVehicle StartAbilityRange = 1000000.0 ApproachRequiresLOS = No End End AddModule Behavior = StealthUpdate ModuleTag_Dis03 StealthDelay = 1 DisguisesAsTeam = Yes RevealDistanceFromTarget = 100.0f OrderIdleEnemiesToAttackMeUponReveal = Yes DisguiseFX = FX_BombTruckDisguise DisguiseRevealFX = FX_BombTruckDisguiseReveal InnateStealth = Yes DisguiseTransitionTime = 2000 DisguiseRevealTransitionTime = 1000 End End End CommandSet Lazr_AmericaPowerPlantCommandSet 1 = Command_UpgradeAmericaAdvancedControlRods 2 = Command_DisguiseAsVehicle 14 = Command_Sell End [/code] I tested it in game and it works, disguised a powerplant into a supplydropzone. Hope i was a bit of a help for you... Greetz, acidbrain

Posted by: tomeister - Sunday, April 29, 2012 5:13:32 PM
Thanks so much- this should fit in with my moveable buildings- your right. Thank you both for your help!;)