tomeister
  • tomeister
  • 100% (Exalted)
  • Major Topic Starter
13 years ago
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?
Sponsor
acidbrain
13 years ago
It needs a special ability, the StealthUpdate module and a DISGUISER KindOf defined.

The StealthUpdate module:

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

Panem et kirkinses
tomeister
  • tomeister
  • 100% (Exalted)
  • Major Topic Starter
13 years ago
Thanks;)

So what part of it makes the game recognise that's you can disguise as other vehicles, not just go stealth.
acidbrain
13 years ago
It's not just go stealth...read..:P

If you want to add it to your mod add this to your vehicle of choice:

  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
Add this to the commandset of the vehicle you've chosen:

CommandSet BlaBlaBlaCommandSet
  ? = Command_DisguiseAsVehicle
End

If you want to use it for a single map add this to the map.ini:
(I used the Lazr_AmericaVehicleTomahawk as an example)

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

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
Panem et kirkinses
tomeister
  • tomeister
  • 100% (Exalted)
  • Major Topic Starter
13 years ago
Thanks, that's really helpful;)
tomeister
  • tomeister
  • 100% (Exalted)
  • Major Topic Starter
13 years ago
Could get it to disguise as buildings too?
acidbrain
13 years ago
Check the GLA fake building stuff...
Panem et kirkinses
tomeister
  • tomeister
  • 100% (Exalted)
  • Major Topic Starter
13 years ago
But they don't disguise, they have the same model.
I want it a bit like the disguise CAH from BFME2.
acidbrain
13 years ago
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...
Panem et kirkinses
CommieDog
13 years ago
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.
UserPostedImage 
CommieDog: Because someone has to do your dirty work for you
acidbrain
13 years ago

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.

Originally Posted by: CommieDog 



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.

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

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
Panem et kirkinses
tomeister
  • tomeister
  • 100% (Exalted)
  • Major Topic Starter
13 years ago
Thanks so much- this should fit in with my moveable buildings- your right.
Thank you both for your help!;)