Posted by: NOP - Saturday, July 16, 2011 3:15:20 AM
I have an object upgrade that adds a speaker tower to the supply truck much like the overlord upgrade... My towers show up in the right place, but kinda floating around, always horizontal no matter the terrain slope. I've been looking around the ini files for something to do with this, but cant find anything. Does anyone know how to properly attach a spawned object?
EDIT:
I'll bet it it's something in the model. Like the bone not being attached to the model or something.
EDIT:
I tried grouping the spawn bone to the main model, but that didn't help at all.
Posted by: Annihilationzh - Saturday, July 16, 2011 6:07:22 AM
Can I see the code? I've got too many questions to write down that would all be answered by the code.
Posted by: NOP - Saturday, July 16, 2011 9:46:07 AM
[code];China Supply Truck
Object Nuke_ChinaVehicleSupplyTruck
; *** ART Parameters ***
SelectPortrait = SNSupplyTruck_L
ButtonImage = SNSupplyTruck
;UpgradeCameo1 = NONE
;UpgradeCameo2 = NONE
;UpgradeCameo3 = NONE
UpgradeCameo1 = Upgrade_ArmTheTrucks
UpgradeCameo5 = Upgrade_ChinaSupplyTkTower
Draw = W3DTruckDraw ModuleTag_01
OkToChangeModelColor = Yes
DefaultConditionState
Model = NVSSUPPLYTK
HideSubObject = Cargo01
End
ConditionState = REALLYDAMAGED
Model = NVSSUPPLYTK_D
End
ConditionState = RUBBLE
Model = NVSSUPPLYTK_D
End
ConditionState = CARRYING
ShowSubObject = Cargo01
End
ConditionState = REALLYDAMAGED CARRYING
Model = NVSSUPPLYTK_D
ShowSubObject = Cargo01
End
ConditionState = RUBBLE CARRYING
Model = NVSSUPPLYTK_D
ShowSubObject = Cargo01
End
TrackMarks = EXTireTrack.tga
LeftFrontTireBone = Tire01
RightFrontTireBone = Tire02
MidLeftRearTireBone = Tire03
MidRightRearTireBone = Tire04
LeftRearTireBone = Tire05
RightRearTireBone = Tire06
TireRotationMultiplier = 0.2 ; this * speed = rotation.
PowerslideRotationAddition = 2.5 ; This speed is added to the rotation speed when powersliding.
Dust = RocketBuggyDust
DirtSpray = RocketBuggyDirtSpray
PowerslideSpray = RocketBuggyDirtPowerSlide
End
; ***DESIGN parameters ***
DisplayName = OBJECT:SupplyTruck
Side = ChinaNukeGeneral
EditorSorting = VEHICLE
TransportSlotCount = 2 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = NONE
Weapon = PRIMARY NONE
End
WeaponSet
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY ConvoyTruckSuicideWeapon
End
BuildCost = 600
BuildTime = 10.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 300
Prerequisites
Object = Nuke_ChinaSupplyCenter
End
ArmorSet
Conditions = None
Armor = TruckArmor
DamageFX = TankDamageFX
End
CrusherLevel = 2 ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
CrushableLevel = 2 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = NukeSupplyTruckCommandSetNEW
; *** AUDIO Parameters ***
VoiceSelect = SupplyTruckVoiceSelect
VoiceMove = SupplyTruckVoiceMove
VoiceAttack = NoSound
SoundMoveStart = SupplyTruckMoveStart
SoundMoveStartDamaged = SupplyTruckMoveStart
UnitSpecificSounds
VoiceCreate = SupplyTruckVoiceCreate
TruckLandingSound = NoSound
TruckPowerslideSound = NoSound
VoiceSupply = SupplyTruckVoiceSupply
VoiceCrush = SupplyTruckVoiceCrush
VoiceEnter = SupplyTruckVoiceMove
End
; *** ENGINEERING Parameters ***
RadarPriority = UNIT
;@todo lorenzen removed the CAN_ATTACK from the chinasupplytruck... ok?
KindOf = PRELOAD CAN_ATTACK SELECTABLE CAN_CAST_REFLECTIONS VEHICLE HARVESTER SCORE
Body = ActiveBody ModuleTag_02
MaxHealth = 300.0
InitialHealth = 300.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.
SubdualDamageCap = 600
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End
Behavior = SupplyTruckAIUpdate ModuleTag_03
MaxBoxes = 4
SupplyCenterActionDelay = 400 ; ms for whole thing (one transaction)
SupplyWarehouseActionDelay = 1000 ; ms per box (many small transactions)
SupplyWarehouseScanDistance = 700 ;350 ; Max distance to look for a warehouse, or we go home. (Direct dock command on warehouse overrides, and no max on Center Scan)
SuppliesDepletedVoice = SupplyTruckVoiceSuppliesDepleted
End
Locomotor = SET_NORMAL SupplyTruckLocomotor
Behavior = PhysicsBehavior ModuleTag_04
Mass = 5.0
End
ExperienceValue = 50 50 50 50 ;Experience point value at each level
Behavior = SlowDeathBehavior ModuleTag_05
DeathTypes = ALL -SUICIDED
DestructionDelay = 200
DestructionDelayVariance = 100
FX = FINAL FX_SupplyTruckExplosionOneFinal
OCL = FINAL OCL_ChinaSupplyTruckDeathEffect
; Weapon = FINAL DirtyNukeCreationWeapon
End
Behavior = SlowDeathBehavior ModuleTag_29
DeathTypes = NONE +SUICIDED
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
; Weapon = FINAL DirtyNukeCreationWeapon
End
Behavior = FireWeaponWhenDeadBehavior ModuleTag_40
DeathWeapon = ChinaSupplyTKDeathWeapon ;DirtyNukeCreationWeapon
StartsActive = No ; turned on by upgrade
TriggeredBy = Upgrade_ArmTheTrucks
End
Behavior = FXListDie ModuleTag_06
DeathTypes = NONE +CRUSHED +SPLATTED
DeathFX = FX_CarCrush
End
Behavior = CreateObjectDie ModuleTag_07
DeathTypes = NONE +CRUSHED +SPLATTED
CreationList = OCL_ChinaSupplyTruck_CrushEffect
End
Behavior = TransitionDamageFX ModuleTag_08
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_NukeCannonDamageTransition
End
Behavior = FlammableUpdate ModuleTag_10
AflameDuration = 5000 ; If I catch fire, I'll burn for this long...
AflameDamageAmount = 3 ; taking this much damage...
AflameDamageDelay = 500 ; this often.
End
; A crushing defeat
Behavior = DestroyDie ModuleTag_11
DeathTypes = NONE +CRUSHED +SPLATTED
End
Behavior = CreateCrateDie ModuleTag_12
CrateData = SalvageCrateData
End
Behavior = OverlordContain ModuleTag_16 ; Like Transport, but when full, passes transport queries along to first passenger (redirects like tunnel)
Slots = 1
DamagePercentToUnits = 100%
AllowInsideKindOf = PORTABLE_STRUCTURE
PassengersAllowedToFire = Yes
PassengersInTurret = No ; My passengers ride in my turret, that's where the Firepoint bones are
End
Behavior = WeaponSetUpgrade ModuleTag_18
TriggeredBy = Upgrade_ArmTheTrucks
End
Behavior = ProductionUpdate ModuleTag_19
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
End
Behavior = ObjectCreationUpgrade ModuleTag_17
UpgradeObject = OCL_SupplyTkPropagandaTower
TriggeredBy = Upgrade_ChinaSupplyTkTower
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
End
Behavior = ProductionUpdate ModuleTag_13
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
End
Behavior = CommandSetUpgrade ModuleTag_14
CommandSet = NukesupllytkWithTowerCommandset
TriggeredBy = Upgrade_ChinaSupplyTkTower
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
End
Geometry = BOX
GeometryMajorRadius = 17.0
GeometryMinorRadius = 7.0
GeometryHeight = 14.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length
End[/code]
[code]ObjectCreationList OCL_SupplyTkPropagandaTower
CreateObject
ObjectNames = SupplyTkPropTower
Count = 1
ContainInsideSourceObject = Yes
End
End[/code]
[code]Object SupplyTkPropTower
; *** ART Parameters ***
SelectPortrait = SNPropSpeaker_L
ButtonImage = SNPropSpeaker
;UpgradeCameo1 = Upgrade_Nationalism
; UpgradeCameo2 = Upgrade_ChinaUraniumShells
; UpgradeCameo3 = Upgrade_ChinaNuclearTanks
;UpgradeCameo4 = NONE
;UpgradeCameo5 = Upgrade_ChinaOverlordPropagandaTower
Draw = W3DDependencyModelDraw ModuleTag_01
OkToChangeModelColor = Yes
AttachToBoneInContainer = FIREPOINT01
ConditionState = NONE
Model = Speakers
; Animation = NVOvrlrd_S.NVOvrlrd_S
; AnimationMode = LOOP
End
ConditionState = REALLYDAMAGED
Model = Speakers
; ParticleSysBone = Smoke01 SmolderingSmoke
; ParticleSysBone = Smoke02 SmolderingSmoke
; ParticleSysBone = Flame01 SmolderingFire
; ParticleSysBone = Flame01 SmolderingFlameCore
; ParticleSysBone = Spark01 LiveWireSparks
End
; night
ConditionState = NIGHT
Model = Speakers
; Animation = NVOvrlrd_S.NVOvrlrd_S
; AnimationMode = LOOP
End
End
PlacementViewAngle = -45
; ***DESIGN parameters ***
Side = China
EditorSorting = SYSTEM
TransportSlotCount = 1
ArmorSet
Conditions = None
Armor = InvulnerableAllArmor ; We can't be hurt on the field. We share damage from the Overlord with his damage module
End
VisionRange = 200
; *** AUDIO Parameters ***
UnitSpecificSounds
TurretMoveStart = NoSound
TurretMoveLoop = NoSound ;TurretMoveLoop
End
; *** ENGINEERING Parameters ***
KindOf = PRELOAD PORTABLE_STRUCTURE CAN_ATTACK CLICK_THROUGH IGNORED_IN_GUI
Body = StructureBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End
Behavior = AIUpdateInterface ModuleTag_03
;
End
Behavior = PropagandaTowerBehavior ModuleTag_04
Radius = 150.0
DelayBetweenUpdates = 2000 ; in milliseconds
HealPercentEachSecond = 1% ; get this % of max health every second
PulseFX = FX_OverlordPropagandaTowerPropagandaPulse ;plays as often as DelayBetweenUpdates
UpgradeRequired = Upgrade_ChinaSubliminalMessaging
UpgradedHealPercentEachSecond = 2% ; get this % of max health every second
UpgradedPulseFX = FX_OverlordPropagandaTowerSubliminalPulse ;plays as often as DelayBetweenUpdates
End
Behavior = DestroyDie ModuleTag_05
;
End
Geometry = BOX
GeometryMajorRadius = 6.0
GeometryMinorRadius = 6.0
GeometryHeight = 10.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length
End[/code]
Posted by: Annihilationzh - Saturday, July 16, 2011 10:14:55 AM
[quote]W3DTruckDraw[/quote]
As I thought.
Only the overlord draw module supports addons. This will fix some bugs, I don't know if it'll fix this one in particular.
[quote] Model = Speakers[/quote]
Is this a custom model?
Is it supposed to be an overlord addon?
Posted by: NOP - Saturday, July 16, 2011 10:53:13 AM
If I replace the truck draw with overlord draw, the game crashes... The model speakers is a small speaker model which I made... It all works except that the tower sort of floats...
Its for my supply trucks, which get the object upgrade speaker tower, which adds a speaker tower to the supply truck... Actually exactly like the overlords propaganda tower add-on...
Posted by: Annihilationzh - Saturday, July 16, 2011 12:31:59 PM
[quote]If I replace the truck draw with overlord draw, the game crashes...[/quote]
Truckdraw has aspects that tankdraw can't process.
So try W3DOverlordTruckDraw.
[quote]The model speakers is a small speaker model which I made... It all works except that the tower sort of floats...[/quote]
Make sure it has the same bones as the normal overlord turrets.
Posted by: NOP - Saturday, July 16, 2011 4:30:58 PM
[quote]So try W3DOverlordTruckDraw[/quote]
Doesn't work...
[quote]Make sure it has the same bones as the normal overlord turrets.[/quote]
the EA add-ons have no bones that I can see... They just spawn on bones on the container model...
Is it something in the code?
Posted by: Annihilationzh - Sunday, July 17, 2011 4:36:34 AM
Both were guesses.
I don't know why W3DOverlordTruckDraw doesn't work. It's on my modulelist, which says it should. But if it's still crashing you may have to remove some of this section of the art code:
[code] LeftFrontTireBone = Tire01
RightFrontTireBone = Tire02
MidLeftRearTireBone = Tire03
MidRightRearTireBone = Tire04
LeftRearTireBone = Tire05
RightRearTireBone = Tire06
TireRotationMultiplier = 0.2 ; this * speed = rotation.
PowerslideRotationAddition = 2.5 ; This speed is added to the rotation speed when powersliding.
Dust = RocketBuggyDust
DirtSpray = RocketBuggyDirtSpray
PowerslideSpray = RocketBuggyDirtPowerSlide[/code]
As for the speakers, I have long assumed it must have unique bones, because only some models can be used as overlord addons without glitches occuring.
Posted by: NOP - Sunday, July 17, 2011 4:17:21 PM
Well it cant be the speaker model, because even if I spawn the overlord speaker model, the same problem occurs... The tower appears at the right bone, only not attached to the model, always vertical, no matter the terrain slope... Might actually be a cool effect for something gyro-stabilised... It should be mentioned that the towers spawn on their side, so I have to flip them on their sides in renx for them to appear vertical in-game... So for some reason, my truck unit code or tower object code or something just isn't spawning them correctly...
Posted by: BR-Alexandre - Monday, July 18, 2011 1:35:10 PM
if towers can't be attached to the truck then try make a new unit: suplly truck with speaker tower. instead add a tower to the unit make a new unit with a tower on it and add the propaganda effect (just like assault troop crawler). when the player upgrade the truck then just replace all suplly trucks (its just an idea, i don't even know anything about modding or making new units)
Posted by: NOP - Thursday, July 21, 2011 3:19:11 AM
[quote]if towers can't be attached to the truck then try make a new unit: suplly truck with speaker tower. [/quote]
That might actually be something of an idea... Last night I noticed this in the helix code:
[code] DefaultConditionState
Model = NVHELIX
Animation = NVHELIX.NVHELIX
AnimationMode = LOOP
WeaponFireFXBone = PRIMARY Muzzle03
WeaponMuzzleFlash = PRIMARY TurretFX03
HideSubObject = BombWing
End
[/code]
And:
[code] Behavior = SubObjectsUpgrade ModuleTag_39
TriggeredBy = Upgrade_HelixNapalmBomb
ShowSubObjects = BombWing
End[/code]
Before I get started, does anyone have any thoughts on why this shouldnt work?
EDIT: It works! I still spawn an overlord contain thingy to provide the speaker tower effects, but its invisible and the model itself is actually a part of the truck now...