Posted by: Fonzaa - Wednesday, February 2, 2011 12:14:26 PM
As a beginner I have a lot of problems with the script of generals Zero:Hour.
For instance, I construct a map with a village and like to boobytrap a civilian car with a Nuke. Like a ConvoyTruckArmedWithNuke, but in a normal car. In Edit Script under Unit --> Status is a script named = Make boobytrapped.
The Script is Add boobytrap of type '???' to Unit '???'
In Type I search for ConvoyTruckArmedWithNuke and add it.
In Unit I can add the name of the object, a CarAmbulance which I called Ambulance_01.
Add boobytrap of type 'ConvoyTruckArmedWithNuke' to Unit 'Ambulance_01'
No error, game starts, I shoot the ambulance and no mushroomcloud.
Drive over it, no mushroomcloud, no boom, nothing. Why does it not work.
I tried to enter a script in map.ini, but without succes.
I tried to modify the script of the unit from the INI.BIG file with FinalBIG, but no result.
This is what I thought that could be it:
-------------------------------------------------------
Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY ConvoyTruckSuicideWeapon
End
Behavior = SlowDeathBehavior ModuleTag_09
DeathTypes = NONE +SUICIDED
DestructionDelay = 1500
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
End
------------------------------------------------------------
Can anyone advise?
Much Appriciated
Posted by: Annihilationzh - Wednesday, February 2, 2011 4:00:03 PM
Change "NONE +SUICIDED" to "ALL" and it will explode regardless of how it dies.
I'd also recommend using this weaponset:
[code]WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End[/code]
This will make it able to suicide the way a terrorist does. The one you have at the moment will only detonate if you push a command button.
A map.ini example:
[code]Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 1500
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
End
End[/code]
Posted by: Fonzaa - Thursday, February 3, 2011 5:09:36 AM
Thank you for the info, but with your map.ini example I still don't get anything from the ambulance. I can kill it, drive over it and it does nothing.
I changed then to CarAmbulance for the name I gave to the Ambulance, Ambulance_02, still no result.
Posted by: Annihilationzh - Thursday, February 3, 2011 6:00:46 AM
Ok, found the issue. I should have checked this before my last post. Basically, it had other modules that were destroying it before it could explode.
[code]Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
End
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End[/code]
I've checked this, and it exploded.
Posted by: Fonzaa - Thursday, February 3, 2011 6:10:32 AM
Nice, very nice
Not to bother you too much, but can you explain how I can select some of the ambulances to be boobytraps and others not?
I don't mind if every car explodes, but it is more fun if it is a surprise which one is rigged to blow and which is not.
I tried to set CarAmbulance to the name of it Ambulance_02, but then the game crashes if I start the game
Posted by: Annihilationzh - Thursday, February 3, 2011 7:56:14 AM
[quote]Not to bother you too much[/quote]
I am a volunteer. If this bothered me, I wouldn't do it.
Besides, exploding ambulances are funny.
[quote]can you explain how I can select some of the ambulances to be boobytraps and others not?[/quote]
There must be 10+ ways of doing this (which was also true of your first question). Now I've got to think of the most reasonable one.
Ok, this is how I'd do it:
[code]Object CarCamaro ; some generic civilian car that isn't used in the map
BuildVariations = CarAmbulance Ambulance_02
End[/code]
So you place the CarCamaro, and it will randomly become a CarAmbulance or Ambulance_02. One of these ambulances explodes, and the other doesn't.
You could also do this:
[code]Object CarCamaro ; some generic civilian car that won't be used
BuildVariations = CarAmbulance CarAmbulance Ambulance_02
End[/code]
To make one of them more common than the other.
The advantage to this method is that the same car won't always be a bomb. Every time you start the map, different ambulances will be rigged to explode.
Posted by: Fonzaa - Thursday, February 3, 2011 12:51:47 PM
Object CarCamaro ; some generic civilian car that isn't used in the map
BuildVariations = CarAmbulance Ambulance_02
End
So you place the CarCamaro, and it will randomly become a CarAmbulance or Ambulance_02. One of these ambulances explodes, and the other doesn't.
-----------------------------------------------------------------------------------------
After adding the script above I add a CarCamaro object somewhere on the map which will have the same Die trigger as an ambulance and ambulance_02 might not?
I don't quite understand what you mean.
If I add the following script and add a CarCamaro, the CarCamaro doesn't explode and the ambulance_02 does and looks like an ambulance.
If I don't add a CarCamaro the ambulance_02 still explodes and looks like an ambulance.
What I had in mind was the following:
the following object have the nukedestruct ability:
CarAmbulance
CarLimo1
CarCamaro
CarCompact
CarSUV01Nuke
CarSwatchEuro
CarTaxiCab02
AircraftCropDuster
And from those object I like to select which one is active and which is not.
The 2 Ambulances I named Ambulance_01 and Ambulance_02.
The script to give the ambulance the nuke ability, but if I use the same script on the CarCompact it doesn't work, the game crashes. My guess is that some lines are not compitable to the CarCompact, but are to the ambulance, but I have no idea which and how to see/change it.
Posted by: Annihilationzh - Friday, February 4, 2011 10:18:35 AM
BuildVariations means that it will become another unit.
E.G.
[code]Object ChinaDozer
BuildVariations = ChinaTankOverlord ChinaTankBattlemaster
End[/code]
(this was typed for an example, it's not likely accurate)
Would result in an overlord or battlemaster being created every time China tries to build a dozer.
However, if this doesn't work, I think we may have discovered another map.ini limitation.
Posted by: Fonzaa - Friday, February 4, 2011 12:19:16 PM
Object CarAmbulance Ambulance_02 ; some generic civilian car that isn't used in the map
BuildVariations = CarCamaro
End
Ambulance_02 is now disguised as a CarCamaro
good, but the nuketrigger is gone.
Posted by: Annihilationzh - Saturday, February 5, 2011 1:51:07 PM
Ok, that code just doesn't work properly in a map.ini.
Map.inis are notoriously glitchy. So it might be a better idea just to add the line: [code]BuildVariations = CarAmbulance Ambulance_02[/code]
to the CarCamaro in civilianunit.ini
Posted by: Fonzaa - Sunday, February 6, 2011 6:07:46 AM
Instead of editing in the INIZH, it is possible to give the CarAmbulance a disguise?
Like a bombtruck, but now an ambulance that is disguised as a CarCamaro.
Or is that the same as the BuildVariantions?
Posted by: Annihilationzh - Sunday, February 6, 2011 8:42:54 AM
Yup. With the right code, anything can be made to look like anything else. I remember someone replacing a train with a plane.
[code]Object CarAmbulance
ReplaceModule ModuleTag_01_Override
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = CVCamaro
End
End
End
End[/code]
Posted by: Fonzaa - Sunday, February 6, 2011 10:04:36 AM
Nice, but the game crashes when I start a game.
What is wrong with this script?
Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
ReplaceModule ModuleTag_01_Override
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = CVCamaro
End
End
End
End
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End
this doesn't work,
Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
End
End
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End
Object CarAmbulance
ReplaceModule ModuleTag_01_Override
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = CVCamaro
End
End
End
End
this doesn't work either.
Posted by: Annihilationzh - Sunday, February 6, 2011 11:36:01 AM
Loads of Ends in the wrong places.
[code]Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End ;close weaponset
AddModule ModuleTag_BOOM
Behavior = SlowDeathBehavior ModuleTag_BOOM_Override
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End ;close behaviour
End ; close addmodule
ReplaceModule ModuleTag_01_Override
Draw = W3DModelDraw ModuleTag_01
ConditionState = NONE
Model = CVCamaro
End ;close behaviour
End ; close replacemodule
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End ; close object[/code]
Posted by: Fonzaa - Sunday, February 6, 2011 11:50:38 AM
Your code results too in failure as it crashes the game every time.
You don't have that problem, it start without problem on your system?
Posted by: Annihilationzh - Sunday, February 6, 2011 12:02:21 PM
No, I don't test them until troubleshooting.
[code]Object CarAmbulance
ReplaceModule ModuleTag_01
Draw = W3DModelDraw ModuleTag_01_Override
ConditionState = NONE
Model = CVCamaro
End ; close conditionstate. I missed this first time.
End ;close behaviour
End ; close replacemodule
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End ;close weaponset
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End ;close behaviour
End ; close addmodule
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End ; close object[/code]
Ironically, I missed an End too. I forgot about ConditionState.
Posted by: Fonzaa - Sunday, February 6, 2011 12:36:30 PM
Nice it works,
last step is to control which ambulance is disguised as what vehicle.
I'll try to figure out what to edit to get this working.
Object CarAmbulance
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End
End
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End
Object Ambulance_02
ReplaceModule ModuleTag_01
Draw = W3DModelDraw ModuleTag_01_Override
ConditionState = NONE
Model = CVCamaro
End
End
End
End
; After that I could add other cars like a CarCompact
Object Ambulance_03
ReplaceModule ModuleTag_01
Draw = W3DModelDraw ModuleTag_01_Override
ConditionState = NONE
Model = CVCmpCar
End
End
End
End
What is wrong with the script, the ends are good.
Is the object line wrong?
How can I select only 1 of the objects?
Posted by: Annihilationzh - Sunday, February 6, 2011 1:34:16 PM
I'm not seeing anything obviously wrong. I'm assuming Ambulance_03 is the same as CarAmbulance?
Posted by: Fonzaa - Sunday, February 6, 2011 11:05:37 PM
Ambulance_03 and Ambulance_02 are both CarAmbulance, named at object properties.
Object CarAmbulance Ambulance_02 ;doesn't work either
Posted by: Annihilationzh - Monday, February 7, 2011 5:50:19 AM
[quote]Ambulance_03 and Ambulance_02 are both CarAmbulance, named at object properties.[/quote]
I'd like to see the INI code for the three of them.
[quote]Object CarAmbulance Ambulance_02 ;doesn't work either[/quote]
What is this even supposed to do? I've never done it, and I've never seen it done either.
Posted by: Fonzaa - Monday, February 7, 2011 6:16:46 AM
no ini code. In the worldbuilder I give every Item a name.
The ambulances I added to the map have names.
Ambulance_01
Ambulance_02
Ambulance_03
Object CarAmbulance Ambulance_02 ;was just an idea, maybe first the object name then the name I gave it in worldbuilder
If it doesn't work, too bad. Another problem is that I tried to play the game in LAN, but with the following map.ini the game dismatched every time within a second, while singleplayer is works great. Without the map.ini it works well in single and multiplayer.
[code]
Object CarAmbulance
ReplaceModule ModuleTag_01
Draw = W3DModelDraw ModuleTag_01_Override
ConditionState = NONE
Model = CVCamaro
End ; close conditionstate. I missed this first time.
End ;close behaviour
End ; close replacemodule
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End ;close weaponset
AddModule ModuleTag_BOOM_Override
Behavior = SlowDeathBehavior ModuleTag_BOOM
DeathTypes = ALL
DestructionDelay = 0
OCL = FINAL OCL_GenericCarExplode
Weapon = FINAL DirtyNukeCreationWeapon
End ;close behaviour
End ; close addmodule
RemoveModule ModuleTag_DeathTag03
RemoveModule ModuleTag_DeathTag04
RemoveModule ModuleTag_DeathTag05
End ; close object
[/code]