DeinonSlayer
14 years ago
I've placed a bomb truck on the map and set it via scripting to disguise itself as a B52. The idea was to use map.ini to define the locomotor for this unit, so as to simulate a B52 speeding up as it moves down a runway. The truck only proceeds down the runway once a number of events have completed successfully, accelerating to in-flight speeds. Once the truck reaches the end of the waypoint path, it is supposed to be deleted and replaced in-place with a real B52, whose own locomotor would start it out at top speed, but climb at a slower rate (the whole idea is to avoid the harrier-jumpjet appearance of a spawning aircraft). My locomotors are causing the game to crash hard, and for the life of me I can't figure out why.

Locomotor MovingPlane
  Surfaces            = GROUND
  Speed               = 200   ; in dist/sec
  SpeedDamaged        = 125   ; in dist/sec
  TurnRate            = 90   ; in degrees/sec
  TurnRateDamaged     = 60   ; in degrees/sec
  Acceleration        = 10 ;400  ; in dist/(sec^2)
  AccelerationDamaged = 10 ;300  ; in dist/(sec^2)
  Braking             = 10 ;50   ; in dist/(sec^2)
  MinTurnSpeed        = 0    ; in dist/sec
  ZAxisBehavior       = NO_Z_MOTIVE_FORCE
  Appearance          = FOUR_WHEELS
  TurnPivotOffset     = -0.5    ; where to pivot when turning (-1.0 = rear, 0.0 = center, 1.0 = front)

  AccelerationPitchLimit = 2 ;5              ; Angle limit how far chassis will lift or roll from acceleration.
  DecelerationPitchLimit = 2 ;5              ; Angle limit how far chassis will dip from deceleration.
  PitchStiffness = 0.05                   ;  stiffness of the "springs" in the suspension forward & back.
  RollStiffness = 0.025                   ;  stiffness of the "springs" in the suspension side to side.
  PitchDamping = 0.8                      ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  RollDamping = 0.3                       ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  ForwardAccelerationPitchFactor = 0 ;0.5    ; How much acceleration will cause the front to lift, or dip for stops.
  LateralAccelerationRollFactor = 0.33    ;  How much cornering will cause the chassis to roll.

  HasSuspension                   = Yes           ; Calculate 4 wheel independent suspension info.
  MaximumWheelExtension           = 0  ; Maximum distance the wheels will drop on the model.
  MaximumWheelCompression         = 0 ; Maximum distance the wheel will move up into the chassis.
  FrontWheelTurnAngle             = 22      ; How many degrees the front wheels can turn.
End

Locomotor B52LocomotorInFlight
  Surfaces = AIR
  Speed = 200  ;100         ; in dist/sec
  SpeedDamaged = 75         ; in dist/sec
  MinSpeed = 60             ; in dist/sec
  TurnRate = 25             ; in degrees/sec
  TurnRateDamaged = 10      ; in degrees/sec
  Acceleration = 200         ; in dist/(sec^2)
  AccelerationDamaged = 30  ; in dist/(sec^2)
  Lift = 20                ; in dist/(sec^2)
  LiftDamaged = 20          ; in dist/(sec^2)
  Braking = 20              ; in dist/(sec^2)
  MinTurnSpeed = 10         ; in dist/sec
  PreferredHeight = 200
  AllowAirborneMotiveForce = Yes
  ZAxisBehavior = SURFACE_RELATIVE_HEIGHT
  Appearance = WINGS 

  PitchStiffness = 0.5                  ;  stiffness of the "springs" in the suspension forward & back.
  RollStiffness = 0.1                   ;  stiffness of the "springs" in the suspension side to side.
  PitchDamping = 0.9                    ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  RollDamping = 0.9                     ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  ForwardVelocityPitchFactor = 0        ;  How much velocity will cause the front to lift/dip
  LateralVelocityRollFactor = 0.2       ;  How much cornering will cause the chassis to roll.
  Apply2DFrictionWhenAirborne = Yes
  AirborneTargetingHeight = 30          ;  How high do I have to be before I get targeted as 'airborne'
  LocomotorWorksWhenDead = Yes          ;  for JetSlowDeathBehavior
End

Object Demo_GLAVehicleBombTruck
  Locomotor = SET_NORMAL MovingPlane
End

Object AmericaJetB52
Locomotor = SET_NORMAL B52LocomotorInFlight

I'm just getting started out editing .INI files, and it's proven more difficult than I had anticipated. I would really appreciate any advice on this.
Sponsor
DeinonSlayer
14 years ago
Should this topic go in the Generals: Modding forum? I've stuck away from it thus far, since all of the changes I intend to make are mission-specific. I have other questions besides this, but I'm not sure where they're appropriate.
Annihilationzh
14 years ago
Object AmericaJetB52
Locomotor = SET_NORMAL B52LocomotorInFlight
Where's the End?

Object Demo_GLAVehicleBombTruck
  Locomotor = SET_NORMAL MovingPlane
End
When setting a locomotor, you need to watch for the AIUpdate, as they're linked. Try using a ReplaceModule for the AI, and then add the locomotor afterwards.

World builder can't detect map.ini errors, so ReleaseCrashInfo.ini may be necessary. If you can't tell where the error is, you may need to comment out areas and see if it still crashes. Once you find the source of the crash, we can then fix it.

It may take a bit of time to get through these, as map.inis have some massive bugs.
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.
DeinonSlayer
14 years ago
Thanks for the suggestion. I've changed the objects to function like this:
Object Demo_GLAVehicleBombTruck
  ReplaceModule ModuleTag_04
    Behavior = AIUpdateInterface ModuleTag_04_Override
      AutoAcquireEnemiesWhenIdle = No ATTACK_BUILDINGS
    End
  End
  Locomotor = SET_NORMAL MovingPlane
End

Object AmericaJetB52
  ReplaceModule ModuleTag_08
    Behavior = DeliverPayloadAIUpdate ModuleTag_08_Override
      DoorDelay         = 500
      MaxAttempts       = 4
      DropOffset        = X:0 Y:0 Z:-10
      DropDelay         = 300     ; time in between each item dropped (if more than one)
      PutInContainer    = AmericaParachute
      DeliveryDistance  = 150
    End
  End
  Locomotor = SET_NORMAL B52LocomotorInFlight
End
I'm still crashing, though. How do I go about deploying this ReleaseCrashInfo.ini?
Annihilationzh
14 years ago
I typed ini XD. I meant to say txt.

In Documents\Command and Conquer Generals Zero Hour Data

There is a file called ReleaseCrashInfo.txt. Now if the game is picking up the error, it'll tell you which line is causing it.

Here's an example:

Release Crash at Mon Apr 04 16:45:02 2011
; Reason Error parsing INI file 'C:\Users\**\Documents\Command and Conquer Generals Zero Hour Data\Maps\GenericMap\Map.ini' (Line: 'Object CarAmbulance')


Last error:


Current stack:
If it can't detect the problem, it'll just give a load of nonsense.
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.
DeinonSlayer
14 years ago
Unfortunately, it looks to be the latter.
Release Crash at Sun May 29 23:30:07 2011
; Reason Uncaught Exception in GameEngine::update

Last error:
Exception is access violation
WinMain at 401720
Error code: EXCEPTION_ACCESS_VIOLATION
Description: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Access address:0000002C was read from.

Stack Dump:
  <Unknown>(-1) : <Unknown> 0x00413A5E

Details:
Register dump...
Eip:00413A5E	Esp:0018F850	Ebp:0350E664
Eax:067B3CC0	Ebx:00A27A68	Ecx:0688D480
Edx:000000B6	Esi:00000000	Edi:0688D48C
EFlags:00010202 
CS:0023  SS:002b  DS:002b  ES:002b  FS:0053  GS:002b
EIP bytes dump...

Bytes at CS:EIP (00413A5E)  : 8B 4E 2C 85 C9 75 03 89 46 2C 8B 4E 18 49 85 DB 89 4E 18 74 0A 83 C3 04 53 FF 15 00 92 93 00 5F 


Current stack:
Is it worth noting that the error only occurs when I try to restart or exit the mission?
Annihilationzh
14 years ago
Sounds like an undocumented bug. Sorry, but that's map.ini's for ya.
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.
DeinonSlayer
14 years ago
It was for a cinematic sequence anyway... I'm sure I can work around it with a few cuts. They made it work in the campaign somehow (USA mission 4 ZH), I suppose I can look at what they did there and take another crack at it. Thanks.

On another note, is it possible to change teams in the middle of a match, or to change time-of-day? What I'm working on is essentially four missions rolled into one map, with the player changing teams three times over the course of the "campaign." The idea is that the preparations you make for defending your base in mission 2 will be crucial to whether you can survive mission 4.
i^love^mixery
14 years ago

They made it work in the campaign somehow (USA mission 4 ZH)

DeinonSlayer wrote:


they most likely used some CINE_ object


On another note, is it possible to change teams

DeinonSlayer wrote:


you mean.. faction? i dont think so.. not without modding the game.


in the middle of a match, or to change time-of-day?

DeinonSlayer wrote:


well you can fake night mode with fading to black (scripting). it works well but the GUI is screwed up.. you dont see unit health bars for example, so i guess that will only work in cine sequences


What I'm working on is essentially four missions rolled into one map, with the player changing teams three times over the course of the "campaign." The idea is that the preparations you make for defending your base in mission 2 will be crucial to whether you can survive mission 4.

DeinonSlayer wrote:



interesting idea. so you have exactly the same stuff you built in the first mission, same base etc. so its basically one big mission. but changing the army is hardly possible i guess.. you can, of course, fake it by just spawning another command center and unlocking other special abilities
BR-Alexandre
14 years ago

They made it work in the campaign somehow (USA mission 4 ZH)

DeinonSlayer wrote:



trying to make a plane take off? probably they have one that fly and a different one to takeoff, because if i remember that mission, you don't see the plane land, it just move and next time you see it, he's on the ground and some missions like GLA 1 and GLA 4 (or 3 i don't know...) you only see the planes taking off. maybe the answer in on the airfiend...try find in raptor, mig or any other plane's codes for some kind of "takeoff" code then copy it to that B52 you're making
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
DeinonSlayer
14 years ago
That's a shame about time-of-day. I figure that I can use "Transfer control of a team to a player" to hand off the team you were using to an AI. I might even be able to change the EVA voice by using "Disable type/Enable type" for each event. The only issue I see there is that the team you control will always be the same color, and scoring may be a bit of a mess. I'll see if I can find the CINE object you were referring to.

The idea in the second mission is that you're in command of an undermanned American logistics base deep in enemy territory. In this mission, you don't face any huge opposition, but you still have to keep looters from pilfering supplies. You have a huge perimeter to defend, and the more they succeed in stealing from you, the stronger they'll be when they come back (upgraded technicals, snipers, hijackers, truck bombs etc). You have more vehicles than you have troops to man them (no training new troops, by the way. I'm working on a structure that lets them switch weapons, and vehicles they can abandon, though). While fending off looters, you have to search the mass of material in the base to find things to strengthen your defenses (chain-link fence, mines, infrared cameras (sees stealth), tank traps etc). At the same time, you're interacting with a refugee camp which has sprung up outside of your front gate. Ignore them for too long, and they'll start spawning Angry Mobs against you. Send food out to them, and they'll provide early warning of incoming enemies, but looters will attack more frequently, forcing you to defend both your base and the refugees. The mission ends whenever you take it upon yourself to destroy the looters' base of operations. However, in the fourth mission, a real army has amassed to overrun your base, and if you didn't built up your defenses enough, you have almost no chance of survival.