Apocalypse232
7 years ago
Hi guys, this is my first post. I have a question and I need help from a pro. I want to make an upgrade for Dr. Thrax that makes his buggies fire toxin missiles and leave toxin residue and the rocket color same as toxin RPG trooper and toxin stinger site AFTER buying the upgrade. I want this upgrade to be just for Dr Thrax buggies. I attempted to do so but could not figure it out. When I command the buggy to fire, the game crashes and gives technical difficulties error. Also i want to add saboteur for demo general that can plant charges like demo Jarmen Kell. Please guide me! I'm new to modding. I know a few things but this matter is a bit complicated for a person like me.
Sponsor
UTD^Force
7 years ago
This is the code you need in a map.ini for the rocket buggy:
Object RocketBuggyMissile
 AddModule
  Behavior = FireWeaponWhenDeadBehavior ModuleTag_135125
    DeathWeapon   = ToxinShellWeaponUpgraded
    StartsActive  = No                      ; turned on by upgrade
    TriggeredBy   = Upgrade_GLABuggyAmmo
  End
 End
End
As for the saboteur (I've been practicing for half an hour on spelling that), there was a bug that the saboteur gets inside the building instead of planting the bomb, so I changed this line:
StartAbilityRange = 10.0
And now it works just fine.
Here is the code, I just copy-pasted the original jarmen kell modules.

Object Demo_GLAInfantrySaboteur

CommandSet = Demo_GLAInfantryJarmenKellCommandSet

AddModule
Behavior = SpecialAbility ModuleTag_1898
SpecialPowerTemplate = Demo_SpecialAbilityKellRemoteCharges
UpdateModuleStartsAttack = Yes
InitiateSound = DemoKellVoiceAttackDemo
End
End
AddModule
Behavior = SpecialAbilityUpdate ModuleTag_192
SpecialPowerTemplate = Demo_SpecialAbilityKellRemoteCharges
StartAbilityRange = 10.0 ;changed so the saboteur doesnt get inside the building
PreparationTime = 0
SpecialObject = RemoteC4Charge
MaxSpecialObjects = 8
SpecialObjectsPersistWhenOwnerDies = No ;Charges are removed instantly when owner dies (nobody can detonate).
AlwaysValidateSpecialObjects = Yes ;Coupled with the above setting, this one is necessary for code optimization.
SpecialObjectsPersistent = Yes ;Charges are persistent till lifetime expires or owner detonates them.
UniqueSpecialObjectTargets = Yes ;This prevents multiple charges placed on the same object.
UnpackTime = 5500 ;NOTE: Modifying this value will require modifying the delay for ColonelBurtonPlantCharge
PackTime = 0
SkipPackingWithNoTarget = Yes ;When yes, the packing/unpacking will be ignored when detonating charges.
FlipOwnerAfterUnpacking = Yes
FleeRangeAfterCompletion = 100.0 ;Runs away after finishing ability
UnpackSound = ColonelBurtonPlantCharge
LoseStealthOnTrigger = Yes
PreTriggerUnstealthTime = 5000 ; in milliseconds
End
End
AddModule
Behavior = SpecialAbility ModuleTag_204
SpecialPowerTemplate = Demo_SpecialAbilityDemoKellTimedCharges
UpdateModuleStartsAttack = Yes
InitiateSound = DemoKellVoiceAttackDemo
End
End
AddModule
Behavior = SpecialAbilityUpdate ModuleTag_112
SpecialPowerTemplate = Demo_SpecialAbilityDemoKellTimedCharges
StartAbilityRange = 10.0 ;changed so the saboteur doesnt get inside the building
PreparationTime = 0
SpecialObject = TimedC4Charge
MaxSpecialObjects = 10
SpecialObjectsPersistWhenOwnerDies = Yes
SpecialObjectsPersistent = Yes ;Charges are persistent till lifetime expires or owner detonates them.
UniqueSpecialObjectTargets = Yes ;This prevents multiple charges placed on the same object.
UnpackTime = 5500 ;NOTE: Modifying this value will require modifying the delay for ColonelBurtonPlantCharge
FlipOwnerAfterUnpacking = Yes
FleeRangeAfterCompletion = 100.0 ;Runs away after finishing ability
UnpackSound = DemoKellVoiceAttackDemo
LoseStealthOnTrigger = Yes
PreTriggerUnstealthTime = 5000 ; in milliseconds
End
End
End


EDIT: I deleted your other topic.
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
Apocalypse232
7 years ago
Hi, thank you for your reply...
What is map.ini and why do i need it?
Can't i just put this text in INI\Object\chemical General?
i find it confusing (the map.ini stuff)
as for the Saboteur i will test it with this configuration.
Apocalypse232
7 years ago

Hello again. So i tested out the Saboteur and it is working but i have a a little problem with the suicide button.
After Buying the upgrade "demo_suicide", a button appears that can give you the choice to detonate and kill your unit, but it appears gray when i select the saboteur and I'm unable to use that ability.

What should i edit?

This is in my INI Object folder for demoGeneral:

;----------Suicide Stuff-------

Behavior = FXListDie ModuleTag_Death15
DeathTypes = NONE +SUICIDED
DeathFX = Demo_FX_SuicideAbilityExplode
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag998
DeathWeapon = Demo_SuicideDynamitePackPlusFire
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
DeathTypes = NONE +SUICIDED
End;

Behavior = FireWeaponWhenDeadBehavior ModuleTag999
DeathWeapon = Demo_DestroyedWeapon
StartsActive = No
TriggeredBy = Demo_Upgrade_SuicideBomb
DeathTypes = ALL -SUICIDED
End

Behavior = CommandSetUpgrade ModuleTag_25
CommandSet = Demo_GLAInfantrySaboteurCommandSetUpgrade
TriggeredBy = Demo_Upgrade_SuicideBomb
End
UTD^Force
7 years ago
The map.ini file is a file you put inside the map's directory in Documents folder. It is used to change behaviors just for one map.
You are modding the game and not one map, so you don't need a map.ini file. All you need to do is to find the codes for the objects, RocketBuggyMissile (in weaponobjects.ini) and Demo_GLAInfantrySaboteur (in demogeneral.ini) and add the behaviors to their codes. Without using the removemodulle, addmodule or replacemodule.
Example, this is how the Object RocketBuggyMissile code looks like.


;------------------------------------------------------------------------------
Object RocketBuggyMissile

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
OkToChangeModelColor = Yes
DefaultConditionState
Model = UVRockBug_m
End
ConditionState = JAMMED
ParticleSysBone = None SparksMedium
End
End

; ***DESIGN parameters ***
EditorSorting = SYSTEM
VisionRange = 0.0
ArmorSet
Conditions = None
Armor = ProjectileArmor
DamageFX = None
End

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE SMALL_MISSILE
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0

; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
; A projectile is not disabled, but instead loses target and scatters
SubdualDamageCap = 200
SubdualDamageHealRate = 100000
SubdualDamageHealAmount = 50
End


; ---- begin Projectile death behaviors
Behavior = FireWeaponWhenDeadBehavior ModuleTag_04 ;;==UP HERE
DeathWeapon = ToxinShellWeapon
StartsActive = No ; turned on by upgrade
TriggeredBy = RocketBuggyToxinUpgrade
ConflictsWith = Upgrade_GLAAnthraxBeta Chem_Upgrade_GLAAnthraxGamma
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag_05 ;;==UP HERE
DeathWeapon = ToxinShellWeaponUpgraded
StartsActive = No ; turned on by upgrade
TriggeredBy = Upgrade_GLAAnthraxBeta RocketBuggyToxinUpgrade
RequiresAllTriggers = Yes ;TriggeredBy is an AND, not an OR like it normally is
ConflictsWith = Chem_Upgrade_GLAAnthraxGamma
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag99 ;;==UP HERE
DeathWeapon = Chem_ToxinShellWeaponGamma
StartsActive = No
TriggeredBy = Chem_Upgrade_GLAAnthraxGamma RocketBuggyToxinUpgrade
RequiresAllTriggers = Yes;
End;

Behavior = InstantDeathBehavior DeathModuleTag_01
DeathTypes = NONE +DETONATED
; we detonated normally.
; no FX, just quiet destroy ourselves
End
Behavior = InstantDeathBehavior DeathModuleTag_02
DeathTypes = NONE +LASERED
; shot down by laser.
FX = FX_GenericMissileDisintegrate
OCL = OCL_GenericMissileDisintegrate
End
Behavior = InstantDeathBehavior DeathModuleTag_03
DeathTypes = ALL -LASERED -DETONATED
; shot down by nonlaser.
FX = FX_GenericMissileDeath
End


; ---- end Projectile death behaviors

Behavior = PhysicsBehavior ModuleTag_06
Mass = 1
End
Behavior = MissileAIUpdate ModuleTag_07
TryToFollowTarget = Yes
FuelLifetime = 1800
InitialVelocity = 150 ; in dist/sec
IgnitionDelay = 0
DistanceToTravelBeforeTurning = 3
IgnitionFX = FX_BuggyMissileIgnition
DistanceScatterWhenJammed = 100
End
Locomotor = SET_NORMAL RocketBuggyMissileLocomotor

Behavior = WeaponBonusUpgrade ModuleTag_08
TriggeredBy = Upgrade_GLAAPRockets
End

Behavior = FireWeaponWhenDeadBehavior ModuleTag_09 ;;==== THIS IS OUR NEW BEHAVIOR
DeathWeapon = ToxinShellWeaponUpgraded ;;==== you can either add it here
StartsActive = No ; turned on by upgrade ;;or replace one of the FireWeaponWhenDeadBehavior behaviors up there ^^
TriggeredBy = Upgrade_GLABuggyAmmo
End

Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 2.0
End


To mod the game you need to check the object which you want their behaviour in another object. Example, adding the small toxin field for the rocket buggy missiles that we did.
This is the behavior that does this, I looked for it in the marauder's shell code. This is how modding works, and how you find solutions to problems yourself and ask about things you don't know how to do.

Behavior = FireWeaponWhenDeadBehavior ModuleTag_135125
DeathWeapon = ToxinShellWeaponUpgraded
StartsActive = No ; turned on by upgrade
TriggeredBy = Upgrade_GLABuggyAmmo
End


And doing that, you can find these in demo jarmen kell code. Which probably have something to do with the thing you want.
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY GLAJarmenKellRifle
    Weapon = SECONDARY GLAJarmenKellVehiclePilotSniperRifle
    Weapon = TERTIARY TerroristSuicideNotARealWeapon ;;====THIS LINE
    AutoChooseSources = TERTIARY NONE
    AutoChooseSources = SECONDARY NONE
  End
  Behavior = SlowDeathBehavior ModuleTag_Death15
    DeathTypes          = NONE +SUICIDED +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_TerroristExplode
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = FireWeaponWhenDeadBehavior ModuleTag998 
    DeathWeapon   = Demo_SuicideDynamitePackPlusFire
    StartsActive  = No
    TriggeredBy   = Demo_Upgrade_SuicideBomb
    DeathTypes = NONE +SUICIDED 
  End;

  Behavior = FireWeaponWhenDeadBehavior ModuleTag999
    DeathWeapon   = Demo_DestroyedWeapon
    StartsActive  = No
    TriggeredBy   = Demo_Upgrade_SuicideBomb
    DeathTypes = ALL -SUICIDED
  End


  Behavior = CommandSetUpgrade ModuleTag_17
    CommandSet = Demo_GLAInfantryJarmenKellCommandSetUpgrade
    TriggeredBy = Demo_Upgrade_SuicideBomb
  End

A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs