Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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


Sponsor
Annihilationzh
15 years ago
Change "NONE +SUICIDED" to "ALL" and it will explode regardless of how it dies.

I'd also recommend using this weaponset:
WeaponSet
Conditions = None
Weapon = PRIMARY SuicideCarBomb
End
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:
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

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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.
Annihilationzh
15 years ago
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.

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

I've checked this, and it exploded.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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
Annihilationzh
15 years ago

Not to bother you too much


I am a volunteer. If this bothered me, I wouldn't do it.

Besides, exploding ambulances are funny.

can you explain how I can select some of the ambulances to be boobytraps and others not?


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:

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.

You could also do this:
Object CarCamaro ; some generic civilian car that won't be used
  BuildVariations = CarAmbulance CarAmbulance Ambulance_02
End

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.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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.





Annihilationzh
15 years ago
BuildVariations means that it will become another unit.

E.G.
Object ChinaDozer
BuildVariations = ChinaTankOverlord ChinaTankBattlemaster
End
(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.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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.
Annihilationzh
15 years ago
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:
BuildVariations = CarAmbulance Ambulance_02
to the CarCamaro in civilianunit.ini
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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?

Annihilationzh
15 years ago
Yup. With the right code, anything can be made to look like anything else. I remember someone replacing a train with a plane.

Object CarAmbulance
 ReplaceModule ModuleTag_01_Override
  Draw = W3DModelDraw ModuleTag_01
    ConditionState = NONE
      Model = CVCamaro
    End
  End
 End
End

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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.
Annihilationzh
15 years ago
Loads of Ends in the wrong places.

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

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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?
Annihilationzh
15 years ago
No, I don't test them until troubleshooting.

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

Ironically, I missed an End too. I forgot about ConditionState.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
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?
Annihilationzh
15 years ago
I'm not seeing anything obviously wrong. I'm assuming Ambulance_03 is the same as CarAmbulance?
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Fonzaa
  • Fonzaa
  • 58.25% (Neutral)
  • Private Topic Starter
15 years ago
Ambulance_03 and Ambulance_02 are both CarAmbulance, named at object properties.

Object CarAmbulance Ambulance_02 ;doesn't work either
Annihilationzh
15 years ago

Ambulance_03 and Ambulance_02 are both CarAmbulance, named at object properties.


I'd like to see the INI code for the three of them.

Object CarAmbulance Ambulance_02 ;doesn't work either


What is this even supposed to do? I've never done it, and I've never seen it done either.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.