Posted by: klingondragon - Tuesday, November 8, 2016 2:28:33 PM
Recently I found that a couple of my mods (hosted on my site) aren't working. Some of these I will try to fix and some I will just remove (for someone who has no obligations it's amazing how little spare time I have).
Posted by: zero hour mad map maker - Tuesday, November 8, 2016 8:20:02 PM
The only thing I'd like to see is to enable nuke trucks to be built for China in their war factories xD. That would be helpful for a mission map I am making. The boss generals is the Nuke Master or something along those lines and it would be neat if the AI could be those destructive beasts!
Posted by: klingondragon - Wednesday, November 9, 2016 12:57:22 AM
I can do that as a map.ini or an actual mod.
It would take me about 10 minutes.
Posted by: AdrianeMapMaker - Wednesday, November 9, 2016 3:09:24 AM
Posted by: klingondragon - Wednesday, November 9, 2016 3:41:33 AM
I'll give it a go but I've found generals is a little temperamental whenever I try to mod it. That's one of the reasons I stick to modding ZH.
Also, I don't mod models so unless you can provide me with the models you get what comes with the game.
Posted by: zero hour mad map maker - Wednesday, November 9, 2016 12:17:25 PM
[quote=klingondragon;141582]I can do that as a map.ini or an actual mod.
It would take me about 10 minutes.[/quote]
Haha awesome! A map .ini would be great! Since I would like it for just a single map.
Posted by: klingondragon - Wednesday, November 9, 2016 4:07:29 PM
[code=plain]
Object ConvoyTruckArmedWithNuke
BuildCost = 2000
BuildTime = 15.0 ; in seconds
KindOf = PRELOAD SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE
End
CommandButton Command_ConstructChinaVehicleNukeTruck
Command = UNIT_BUILD
Object = ConvoyTruckArmedWithNuke
TextLabel = CONTROLBAR:ConstructChinaVehicleNukeLauncher
ButtonImage = SSConvoy_L
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipChinaBuildNukeLauncher
End
CommandSet ChinaWarFactoryCommandSet
1 = Command_ConstructChinaTankBattleMaster
2 = Command_ConstructChinaTankOverlord
3 = Command_ConstructChinaVehicleTroopCrawler
4 = Command_ConstructChinaVehicleListeningOutpost
5 = Command_ConstructChinaTankGattling
6 = Command_UpgradeChinaChainGuns
7 = Command_ConstructChinaTankDragon
8 = Command_UpgradeChinaBlackNapalm
9 = Command_ConstructChinaVehicleInfernoCannon
10 = Command_ConstructChinaVehicleNukeTruck
11 = Command_ConstructChinaTankECM
12 = Command_UpgradeChinaMines
13 = Command_SetRallyPoint
14 = Command_Sell
End
CommandSet ChinaWarFactoryCommandSetUpgrade
1 = Command_ConstructChinaTankBattleMaster
2 = Command_ConstructChinaTankOverlord
3 = Command_ConstructChinaVehicleTroopCrawler
4 = Command_ConstructChinaVehicleListeningOutpost
5 = Command_ConstructChinaTankGattling
6 = Command_UpgradeChinaChainGuns
7 = Command_ConstructChinaTankDragon
8 = Command_UpgradeChinaBlackNapalm
9 = Command_ConstructChinaVehicleInfernoCannon
10 = Command_ConstructChinaVehicleNukeTruck
11 = Command_ConstructChinaTankECM
12 = Command_UpgradeEMPMines
13 = Command_SetRallyPoint
14 = Command_Sell
End
[/code]
This should work, unfortunately I can't make it cost anything and build time is instant. (some sort of limit with map.inis)
Posted by: Annihilationzh - Wednesday, November 9, 2016 5:44:15 PM
[quote=klingondragon;141590]This should work, unfortunately I can't make it cost anything and build time is instant. (some sort of limit with map.inis)[/quote]
To change price you have to hijack another unit.
[code=plain]CommandButton Boss_Command_ConstructChinaTankOverlord
Command = UNIT_BUILD
Object = Boss_TankOverlord
TextLabel = CONTROLBAR:ConstructGLAVehicleBombTruck
ButtonImage = SSConvoy_L
ButtonBorderType = BUILD ; Identifier for the User as to what kind of button this is
DescriptLabel = CONTROLBAR:ToolTipGLABuildBombTruck
End
CommandSet ChinaWarFactoryCommandSet
13 = Boss_Command_ConstructChinaTankOverlord
End
CommandSet ChinaWarFactoryCommandSetUpgrade
13 = Boss_Command_ConstructChinaTankOverlord
End
Object Boss_TankOverlord
DisplayName = OBJECT:ConvoyTruck
EditorSorting = VEHICLE
ArmorSet
Armor = TruckArmor
DamageFX = CrushableCarDamageFX
End
WeaponSet
Conditions = None
Weapon = PRIMARY ConvoyTruckSuicideWeapon
End
VisionRange = 150
ShroudClearingRange = 350
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 = CivilianTransportWithNukeCommandSet
VoiceSelect = ConvoyTruckVoiceSelect
VoiceMove = ConvoyTruckVoiceMove
SoundMoveStart = ConvoyTruckMoveStart
UnitSpecificSounds
; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
VoiceCreate = NoSound
TurretMoveStart = NoSound
TurretMoveLoop = NoSound
VoiceCrush = NoSound
VoiceEnter = NoSound
VoiceUnload = NoSound
End
Prerequisites
End
RemoveModule ModuleTag_01
RemoveModule ModuleTag_03
RemoveModule ModuleTag_04
RemoveModule ModuleTag_05
RemoveModule ModuleTag_06
RemoveModule ModuleTag_07
RemoveModule ModuleTag_08
RemoveModule ModuleTag_09
RemoveModule ModuleTag_10
RemoveModule ModuleTag_11
RemoveModule ModuleTag_12
RemoveModule ModuleTag_13
RemoveModule ModuleTag_16
RemoveModule ModuleTag_17
AddModule
Draw = W3DTruckDraw ModuleTag_01
OkToChangeModelColor = Yes
ConditionState = NONE
Model = NVConvoy
End
ConditionState = LOADED
Model = NVConvoy
End
CabRotationMultiplier = 1.5
TrailerRotationMultiplier = 0.2
;CabBone = CAB
;TrailerBone = TRAILER
RotationDamping = 0.7
RightFrontTireBone = Tire01
LeftFrontTireBone = Tire02
;MidRightFrontTireBone = Tire03
;MidLeftFrontTireBone = Tire04
;MidRightMidTireBone = Tire05
;MidLeftMidTireBone = Tire06
MidRightRearTireBone = Tire07
MidLeftRearTireBone = Tire08
RightRearTireBone = Tire09
LeftRearTireBone = Tire10
TireRotationMultiplier = 0.2 ; this * speed = rotation.
TrackMarks = EXTireTrack.tga
Dust = RocketBuggyDust
DirtSpray = RocketBuggyDirtSpray
End
Behavior = AIUpdateInterface ModuleTag_06
End
Behavior = SlowDeathBehavior ModuleTag_09
DeathTypes = NONE +SUICIDED
DestructionDelay = 1500
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
Behavior = SlowDeathBehavior ModuleTag_10
DeathTypes = ALL -SUICIDED
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
End; of AddModule
Locomotor = SET_NORMAL SupplyTruckLocomotor
Locomotor = SET_WANDER WanderCarLocomotor
Locomotor = SET_PANIC PanicCarLocomotor
End[/code]
The button picture is an Overlord though.
Posted by: klingondragon - Wednesday, November 9, 2016 5:52:40 PM
I thought about it (especially since the war factory hasn't got enough space for another unit) but I decided against it.
If it'd be better like that I can probably work on it some more to work out the kinks.
Posted by: AdrianeMapMaker - Thursday, November 10, 2016 12:18:41 AM
If i Just Remove this two, This should Work [grin]
[code=cpp]
Command_ConstructChinaVehicleListeningOutpost
[/code]
[code=cpp]Command_ConstructChinaTankECM
[/code]
Posted by: Annihilationzh - Thursday, November 10, 2016 6:55:19 AM
[quote=klingondragon;141592]I thought about it (especially since the war factory hasn't got enough space for another unit) but I decided against it.
If it'd be better like that I can probably work on it some more to work out the kinks.[/quote]
My code above has none of these issues.
I replaced the rally point button. It's a pointless button since you can just right-click to place a rally point. Plus I converted the boss general's overlord into the nuke truck; which won't be a problem unless someone is trying to play as the boss general.
Posted by: klingondragon - Thursday, November 10, 2016 11:48:18 AM
I'm pretty sure I noticed something but I can't remember what and I'm not going to bother. This thread has gone off the track I originally intended.
Posted by: zero hour mad map maker - Thursday, November 10, 2016 4:26:20 PM
[quote=klingondragon;141598]I'm pretty sure I noticed something but I can't remember what and I'm not going to bother. This thread has gone off the track I originally intended.[/quote]
You are helping! So you're thread isn't off track [wink]. I haven't tried the nuke truck thing [i]yet[/i], but I will soon! I bet it will be awesome to do xD. Anyway, I have another question regarding putting code into a map.ini. In this particular map I am creating, is it possible to make certain structures stealth even though they're built without it. [open_mouth]
I want to make an EMP turret have the stealth ability; that's what I am asking [+1]
Posted by: klingondragon - Thursday, November 10, 2016 4:56:10 PM
Add a stealth module.
Copy the code from a stealthed unit and then use the addmodule code to add it to the unit in the map.ini
Posted by: zero hour mad map maker - Thursday, November 10, 2016 6:04:10 PM
[quote=klingondragon;141608]Add a stealth module.
Copy the code from a stealthed unit and then use the addmodule code to add it to the unit in the map.ini[/quote]
Does this look right?
[code=plain]
Object SupW_AmericaPatriotBattery
; *** ART Parameters ***
SelectPortrait = SAMicroPat_L
ButtonImage = SAMicroPat
Draw = W3DModelDraw ModuleTag_01
OkToChangeModelColor = Yes
DefaultConditionState
Model = ABPatriotSW
Turret = TURRET01
TurretPitch = TURRETEL
WeaponLaunchBone = PRIMARY WeaponA
WeaponLaunchBone = SECONDARY WeaponA
WeaponLaunchBone = TERTIARY WeaponA
WeaponFireFXBone = PRIMARY WeaponA
WeaponFireFXBone = SECONDARY WeaponA
WeaponFireFXBone = TERTIARY WeaponA
End
AliasConditionState = NIGHT
ConditionState = DAMAGED
Model = ABPatriotSW_D
End
AliasConditionState = DAMAGED NIGHT
ConditionState = REALLYDAMAGED RUBBLE
Model = ABPatriotSW_E
End
AliasConditionState = REALLYDAMAGED RUBBLE NIGHT
ConditionState = SNOW
Model = ABPatriotSW_S
End
AliasConditionState = SNOW NIGHT
ConditionState = DAMAGED SNOW
Model = ABPatriotSW_DS
End
AliasConditionState = SNOW NIGHT DAMAGED
ConditionState = REALLYDAMAGED RUBBLE SNOW
Model = ABPatriotSW_ES
End
AliasConditionState = SNOW NIGHT REALLYDAMAGED RUBBLE
;**************************************************************************************************************************
;This block handles every possible case with construction process, selling process, awaiting construction, and sold states
;for this draw module
ConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED
Model = ABPatriot
Flags = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
End
AliasConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED NIGHT
ConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED SNOW
Model = ABPatriot_S
Flags = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
End
AliasConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED NIGHT SNOW
ConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED DAMAGED
Model = ABPatriot_D
Flags = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
End
AliasConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED DAMAGED NIGHT
ConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED DAMAGED SNOW
Model = ABPatriot_DS
Flags = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
End
AliasConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED DAMAGED NIGHT SNOW
ConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED REALLYDAMAGED
Model = ABPatriot_E
Flags = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
End
AliasConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED REALLYDAMAGED NIGHT
ConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED REALLYDAMAGED SNOW
Model = ABPatriot_ES
Flags = ADJUST_HEIGHT_BY_CONSTRUCTION_PERCENT
End
AliasConditionState = AWAITING_CONSTRUCTION PARTIALLY_CONSTRUCTED ACTIVELY_BEING_CONSTRUCTED REALLYDAMAGED NIGHT SNOW
ConditionState = AWAITING_CONSTRUCTION
Model = NONE
End
AliasConditionState = AWAITING_CONSTRUCTION DAMAGED
AliasConditionState = AWAITING_CONSTRUCTION REALLYDAMAGED
AliasConditionState = AWAITING_CONSTRUCTION NIGHT
AliasConditionState = AWAITING_CONSTRUCTION NIGHT DAMAGED
AliasConditionState = AWAITING_CONSTRUCTION NIGHT REALLYDAMAGED
AliasConditionState = AWAITING_CONSTRUCTION SNOW
AliasConditionState = AWAITING_CONSTRUCTION SNOW DAMAGED
AliasConditionState = AWAITING_CONSTRUCTION SNOW REALLYDAMAGED
AliasConditionState = AWAITING_CONSTRUCTION NIGHT SNOW
AliasConditionState = AWAITING_CONSTRUCTION NIGHT SNOW DAMAGED
AliasConditionState = AWAITING_CONSTRUCTION NIGHT SNOW REALLYDAMAGED
AliasConditionState = SOLD DAMAGED
AliasConditionState = SOLD REALLYDAMAGED
AliasConditionState = SOLD NIGHT
AliasConditionState = SOLD NIGHT DAMAGED
AliasConditionState = SOLD NIGHT REALLYDAMAGED
AliasConditionState = SOLD SNOW
AliasConditionState = SOLD SNOW DAMAGED
AliasConditionState = SOLD SNOW REALLYDAMAGED
AliasConditionState = SOLD NIGHT SNOW
AliasConditionState = SOLD NIGHT SNOW DAMAGED
AliasConditionState = SOLD NIGHT SNOW REALLYDAMAGED
End
Behavior = StealthUpdate ModuleTag_07
StealthDelay = 2000 ; msec
StealthForbiddenConditions = FIRING_PRIMARY
HintDetectableConditions = IS_FIRING_WEAPON
FriendlyOpacityMin = 50.0%
FriendlyOpacityMax = 100.0%
InnateStealth = Yes
OrderIdleEnemiesToAttackMeUponReveal = Yes
End
;**************************************************************************************************************************
End
[/code]
Posted by: klingondragon - Thursday, November 10, 2016 6:12:05 PM
For a mod, yes. For a map.ini, no.
For the map.ini you should only use write the code you want to add/change. Take out everything but the stealth module, then add an extra line for adding it (check some of the tutorials around the forums for more help with modules).
Posted by: zero hour mad map maker - Thursday, November 10, 2016 6:25:38 PM
Ohhhhh! Sorry, you're going to have to be patient with me on modding Zh, I'm such a novice! Well, back to researching!
Posted by: klingondragon - Thursday, November 10, 2016 6:33:03 PM
I don't call map.inis modding, they share code but you could be a great modder but when it comes to a map.ini you wouldn't necessarily be able to make it work.
Same language, different code.
Posted by: zero hour mad map maker - Thursday, November 10, 2016 9:47:27 PM
Yep, but I don't feel comfortable changing the entire game for one small thing; that is only needed for a single purpose. Modding, to me, is anything that changes the original aspects of the game regardless of how extensive or small it may be. It's fun all the same though haha. Good thread idea btw.
Posted by: klingondragon - Thursday, November 10, 2016 9:51:51 PM
As far as I remember I've done this about 3 times plus when I first made the 'small changes mod' I asked what else I should add.
Posted by: zero hour mad map maker - Thursday, November 10, 2016 10:20:31 PM
Well after quite the bit of research, I am still having some troubles. Though I do believe I am getting a lot closer!! [smile]
[code=plain]
Object SupW_AmericaPatriotBattery
AddModule
Behavior = StealthUpdate ModuleTag_07
StealthDelay = 2000 ; msec
StealthForbiddenConditions = FIRING_PRIMARY
HintDetectableConditions = IS_FIRING_WEAPON
FriendlyOpacityMin = 50.0%
FriendlyOpacityMax = 100.0%
InnateStealth = Yes
OrderIdleEnemiesToAttackMeUponReveal = Yes
End
[/code]
Posted by: klingondragon - Thursday, November 10, 2016 11:39:26 PM
You need to end the object, the addmodule, and the module itself (that's 3 ends), it also helps if you indent your code so that lines which open and end are on the same level and everything inside is indented (usually by two presses of the spacebar).
Also (I'm not certain so let me check) I think your addmodule might need to specify a module tag (don't hold me to that, I don't usually deal with map.inis so add, modify, and remove module tags are still a bit new)
Posted by: zero hour mad map maker - Friday, November 11, 2016 1:00:26 AM
[quote=klingondragon;141620]You need to end the object, the addmodule, and the module itself (that's 3 ends), it also helps if you indent your code so that lines which open and end are on the same level and everything inside is indented (usually by two presses of the spacebar).
Also (I'm not certain so let me check) I think your addmodule might need to specify a module tag (don't hold me to that, I don't usually deal with map.inis so add, modify, and remove module tags are still a bit new)[/quote]
DANG! Now it crashes the game LOL! You did say to put an end after Addmodule and after the object right? [sleepy]
[code=plain]
Object SupW_AmericaPatriotBattery
End
AddModule
End
Behavior = StealthUpdate ModuleTag_07
StealthDelay = 2000 ; msec
StealthForbiddenConditions = FIRING_PRIMARY
HintDetectableConditions = IS_FIRING_WEAPON
FriendlyOpacityMin = 50.0%
FriendlyOpacityMax = 100.0%
InnateStealth = Yes
OrderIdleEnemiesToAttackMeUponReveal = Yes
End
[/code]
Posted by: Annihilationzh - Friday, November 11, 2016 6:43:02 AM
[quote=Zero Hour Mad Map Maker;141630]DANG! Now it crashes the game LOL! You did say to put an end after Addmodule and after the object right? [sleepy][/quote]
This code that tells the game you want to deal with the EMP Patriot, and then immediately stop doing so.
[code]Object SupW_AmericaPatriotBattery
End[/code]
This code tell the game to add modules, and then immediately stop adding modules.
[code]AddModule
End[/code]
And then when the game sees this line:
[code]Behavior = StealthUpdate ModuleTag_07[/code]
The game will crash. You're specifying a module, but you haven't told it which unit you're changing or what to do with the module.
Also, don't use tabs in code. It'll crash the game.
See this:
[code=plain]Object SupW_AmericaPatriotBattery
AddModule
Behavior = StealthUpdate ModuleTag_07
StealthDelay = 2000 ; msec
StealthForbiddenConditions = FIRING_PRIMARY
HintDetectableConditions = IS_FIRING_WEAPON
FriendlyOpacityMin = 50.0%
FriendlyOpacityMax = 100.0%
InnateStealth = Yes
OrderIdleEnemiesToAttackMeUponReveal = Yes
End
End
End[/code]
The first line tells the game to edit the EMP patriot, and the last line tells it to stop editing the EMP patriot. The second line adds modules, the second to last line tells the game to stop adding modules.
I made the code neater and easier to read by indenting each line to show where things start and finish. This is quite normal in programming.
Posted by: klingondragon - Friday, November 11, 2016 10:07:48 AM
Although, unlike most languages, you shouldn't use tab, use 2 spaces for the indentation.
Posted by: zero hour mad map maker - Friday, November 11, 2016 11:56:09 AM
Wow okay! Thank you both! Sorry for my novice skills! I'm slow at first to learn a new language, though once I do I'll surely become proficient at it! Like I said many times in the past, I know how to do XML, HTML, DAT, C#, BASIC, and some other crap! Just not Zh....... lol. Alright, well that's all I think I want to know how to do for now.
Do any other members have a request to Klingon Dragon?
Posted by: zero hour mad map maker - Friday, November 11, 2016 4:32:24 PM
Hey guys! A slight problem came up! I am super glad that the stealth actually works! YAY! Now the EMP turrets are stealthed. Though they do not become unstealthed and do not attack when any of my troops are near them? They are on the enemy team so that's fine. I even tried to correct it with this script, but nothing. Dumb thing....
*** IF ***
Unit 'EP3' sees a(n) Enemy unit belonging to Player 'ThePlayer'.
*** THEN ***
Set Unit 'EP3' stealth ability to FALSE.
Unit 'EP3' attacks Team 'teamThePlayer'
*** ELSE ***
Set Unit 'EP3' stealth ability to TRUE.
Posted by: zero hour mad map maker - Sunday, November 13, 2016 5:27:13 PM
Anyone know why?
Posted by: Annihilationzh - Sunday, November 13, 2016 5:44:00 PM
[quote=Zero Hour Mad Map Maker;141714]Anyone know why?[/quote]
The AI needs changing, so that it will attack whilst stealthed. I completely forgot about that earlier.
I wasn't sure what kind of stealth you wanted so I didn't mention that your choice of module was overpowered; it wouldn't have revealed itself even if you attack it.
Here's a fixed one (assuming I haven't forgotten anything else):
[code=plain]Object SupW_AmericaPatriotBattery
RemoveModule ModuleTag_07
AddModule
Behavior = StealthUpdate ModuleTag_17
StealthDelay = 2500 ; msec
StealthForbiddenConditions = ATTACKING USING_ABILITY TAKING_DAMAGE
InnateStealth = Yes ;Require the upgrade first
OrderIdleEnemiesToAttackMeUponReveal = Yes
End
Behavior = AIUpdateInterface ModuleTag_07
Turret
TurretTurnRate = 180 // turn rate, in degrees per sec
TurretPitchRate = 180
AllowsPitch = Yes
NaturalTurretPitch = 45
GroundUnitPitch = 40
MinPhysicalPitch = -20
ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
MinIdleScanInterval = 250 ; in milliseconds
MaxIdleScanInterval = 250 ; in milliseconds
MinIdleScanAngle = 0 ; in degrees off the natural turret angle
MaxIdleScanAngle = 360 ; in degrees off the natural turret angle
End
AutoAcquireEnemiesWhenIdle = Yes Stealthed ;ATTACK_BUILDINGS; defensive weapon
MoodAttackCheckRate = 250
End
End
End[/code]
Posted by: zero hour mad map maker - Sunday, November 13, 2016 5:49:15 PM
Annihilationzh you're a genius! Thank you very much!