Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Suomaf  
#1 Posted : Sunday, July 11, 2010 2:56:03 PM(UTC)
Suomaf
Private
Joined: 7/11/2010(UTC)
Posts: 6
Location: Canada

Hello, I am currently working on a map trying to modify the Demolition Generals RPG Trooper (using a map.ini script file) to shoot a Scud Missile... I have been able to make him FIRE the Scud Missile, however it fires at a straight path, which ends up colliding very soon with the ground, not making it to the designated target. I am able to put a pitch on the firing of it, but then he is unable to move... what I want, is a RPG Trooper that can fire a scud missile with a pitch (so it doesn't hit the ground) and have him still be able to walk.

This is the Script I have:

Code:
Object Demo_GLAInfantryTunnelDefender

  WeaponSet
    Conditions = None 
    Weapon = PRIMARY DEMO_SCUDLauncherGunExplosivePlusTwo
    Weapon = SECONDARY DemoTunnelDefenderRocketWeapon
    Weapon = TERTIARY TerroristSuicideNotARealWeapon
    PreferredAgainst = PRIMARY   INFANTRY VEHICLE STRUCTURE
    PreferredAgainst = SECONDARY AIRCRAFT
    AutoChooseSources = SECONDARY NONE
    AutoChooseSources = TERTIARY NONE
  End

;  AddModule
;    Behavior = AIUpdateInterface ModuleTag_SA2
;      Turret
;        TurretTurnRate = 60   ; turn rate, in degrees per sec
;        TurretPitchRate = 60
;        FirePitch = 45 ; Instead of aiming pitchwise at the target, it will aim here
;        AllowsPitch = Yes
;        ControlledWeaponSlots = PRIMARY 
;      End
;    End
;  End

End


That makes him just shoot scuds on a straight path (colliding early into the ground), taking off the notes ';' makes him shoot at a 45 degree angle, hitting the designated zone... but for some reason also stops him from being able to walk... I believe it to be because of the "Turret" identifier, but I cannot remove that or the game crashes.

I have tried and tried and tried every which way I can think of to do something differently to make it work... if you know how I might be able to achieve this, or just have some ideas, I would greatly appreciate any help.
Sponsor
Offline Annihilationzh  
#2 Posted : Sunday, July 11, 2010 3:40:20 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Initially, I thought this was a really tough problem...

...then I remembered.

Try this (not tested):

Code:
Object Demo_GLAInfantryTunnelDefender

  WeaponSet
    Conditions = None
    Weapon = PRIMARY DEMO_SCUDLauncherGunExplosivePlusTwo
    Weapon = SECONDARY DemoTunnelDefenderRocketWeapon
    Weapon = TERTIARY TerroristSuicideNotARealWeapon
    PreferredAgainst = PRIMARY   INFANTRY VEHICLE STRUCTURE
    PreferredAgainst = SECONDARY AIRCRAFT
    AutoChooseSources = SECONDARY NONE
    AutoChooseSources = TERTIARY NONE
  End

  ReplaceModule ModuleTag_03
    Behavior = AIUpdateInterface ModuleTag_03_Override
      Turret
        TurretTurnRate = 60   ; turn rate, in degrees per sec
        TurretPitchRate = 60
        FirePitch = 45 ; Instead of aiming pitchwise at the target, it will aim here
        AllowsPitch = Yes
        ControlledWeaponSlots = PRIMARY
      End
    End
  End
  Locomotor = SET_NORMAL MissileDefenderLocomotor
End


First of all, it's not a good idea to have two AI modules, so replacing works better than adding. Secondly, the Locomotor is directly linked to the AI. If you change the AI in any way, you lose the locomotor. That would explain why he's not moving.

Then it's just a case of hoping that there isn't anything else wrong with it.

Edited by user Sunday, July 11, 2010 3:43:18 PM(UTC)  | Reason: Not specified

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.
Offline Suomaf  
#3 Posted : Sunday, July 11, 2010 4:56:23 PM(UTC)
Suomaf
Private
Joined: 7/11/2010(UTC)
Posts: 6
Location: Canada

It works! Thanks a lot, that problem had me stuck for quite a long time.
Offline Suomaf  
#4 Posted : Monday, July 12, 2010 7:43:07 PM(UTC)
Suomaf
Private
Joined: 7/11/2010(UTC)
Posts: 6
Location: Canada

If I may, I'd like to delve deeper into modifying units... I want to be able to 'edit' the weapons... but I cannot figure out how to achieve this. It seems as if it should be simple enough to do, however I keep coming up empty handed...

Lets work with the Scud Launching RPG Trooper... lets say I want to edit the 'weapon' he's shooting, in this case it being the "Demo_SCUDLauncherGunExplosivePlusTwo". So I look at the weapons scripts, find that weapon...

Code:
Weapon DEMO_SCUDLauncherGunExplosivePlusTwo
  PrimaryDamage               = 400.0            
  PrimaryDamageRadius         = 50.0      
  SecondaryDamage             = 75.0          
  SecondaryDamageRadius       = 100.0    
  ScatterRadiusVsInfantry     = 30.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange                 = 450.0
  MinimumAttackRange          = 200.0
  PreAttackDelay              = 500
  PreAttackType               = PER_SHOT ; Do the delay every single shot
  DamageType                  = EXPLOSION 
  DeathType                   = EXPLODED
  FireFX                      = FX_ScudLauncherIgnition
  ProjectileObject            = SCUDMissilePlusTwo
  ProjectileExhaust           = ScudMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicScudMissileExhaust
  ProjectileDetonationFX      = WeaponFX_DEMO_SCUDMissileDetonationExplosive
  RadiusDamageAffects         = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
  FireSound                   = ScudLauncherWeapon
  DelayBetweenShots           = 1
  ClipSize                    = 1                ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 10000            ; how long to reload a Clip, msec
  ; Uses a clip of one to get the Reloading modelcondition

  ; note, these only apply to units that aren't the explicit target 
  ; (ie, units that just happen to "get in the way"... projectiles
  ; always collide with the Designated Target, regardless of these flags
  ProjectileCollidesWith = STRUCTURES

  WeaponBonus = PLAYER_UPGRADE DAMAGE 125%  ; AP rockets upgrade for SCUD launcher
End


Now I would assume that I should be able to just write the following into my 'map.ini' file:
Code:
Weapon Demo_SCUDLauncherGunExplosivePlusTwo
  DelayBetweenShots           = 333
  ClipSize                    = 3
End

And it should work... well I guess I assume wrong, because this seems to make the unit "shoot blanks" you can see him try to shoot... it does the "launch" effect, three times, 333ms apart from eachother as it should, but he isn't actually launching a anything anymore. (I have tried to keep the rest of the weapon script with it, to see if that helps, it doesn't... and I didn't really expect it to since the map.ini only applies that which you have changed.)

Now I would preferrably be able to make my very own custom weapon so any other unit (ie: the real scud launcher) isn't sharing this special attack. So how would I go about getting the following script to work?

Code:
Weapon Custom_SCUDLauncherGunExplosivePlusTwo
  PrimaryDamage               = 400.0            
  PrimaryDamageRadius         = 50.0      
  SecondaryDamage             = 75.0          
  SecondaryDamageRadius       = 100.0    
  ScatterRadiusVsInfantry     = 30.0     ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
  AttackRange                 = 450.0
  MinimumAttackRange          = 200.0
  PreAttackDelay              = 500
  PreAttackType               = PER_SHOT ; Do the delay every single shot
  DamageType                  = EXPLOSION 
  DeathType                   = EXPLODED
  FireFX                      = FX_ScudLauncherIgnition
  ProjectileObject            = SCUDMissilePlusTwo
  ProjectileExhaust           = ScudMissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicScudMissileExhaust
  ProjectileDetonationFX      = WeaponFX_DEMO_SCUDMissileDetonationExplosive
  RadiusDamageAffects         = ALLIES ENEMIES NEUTRALS NOT_SIMILAR
  FireSound                   = ScudLauncherWeapon
  DelayBetweenShots           = 333
  ClipSize                    = 3                ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 10000            ; how long to reload a Clip, msec
  ; Uses a clip of one to get the Reloading modelcondition

  ; note, these only apply to units that aren't the explicit target 
  ; (ie, units that just happen to "get in the way"... projectiles
  ; always collide with the Designated Target, regardless of these flags
  ProjectileCollidesWith = STRUCTURES

  WeaponBonus = PLAYER_UPGRADE DAMAGE 125%  ; AP rockets upgrade for SCUD launcher
End

Object Demo_GLAInfantryTunnelDefender

  WeaponSet
    Conditions = None 
    Weapon = PRIMARY Custom_SCUDLauncherGunExplosivePlusTwo ;Demo_SCUDLauncherGunExplosivePlusTwo
    Weapon = SECONDARY DemoTunnelDefenderRocketWeapon
    Weapon = TERTIARY TerroristSuicideNotARealWeapon
    PreferredAgainst = PRIMARY   INFANTRY VEHICLE STRUCTURE
    PreferredAgainst = SECONDARY AIRCRAFT
    AutoChooseSources = SECONDARY NONE
    AutoChooseSources = TERTIARY NONE
  End

  ReplaceModule ModuleTag_03
    Behavior = AIUpdateInterface ModuleTag_03_Override
      Turret
        TurretTurnRate = 60   ; turn rate, in degrees per sec
        TurretPitchRate = 60
        FirePitch = 25 ; Instead of aiming pitchwise at the target, it will aim here
        AllowsPitch = Yes
        ControlledWeaponSlots = PRIMARY
      End
    End
  End
  Locomotor = SET_NORMAL MissileDefenderLocomotor
End


I have tried to add the code that the 'weapon' referrences for 'FX' and all, to see if keeping them relative to the same file might make it able to 'read' it, but that doesn't change anything, and I didn't expect it to... all I can really do is Trial and Error.

I hope this isn't too much to ask, if you do not have the time to explain this to me, but know somewhere that I can read up on the information I'd need to achieve my desired result I would indeed be greatful for that as well. I can't find any tutorials on this sort of scripting, the best I can do is dig through the game files and try to understand what they're doing, and look at mods other people have made to try to connect some dots.

Thank you for your time!
Offline Annihilationzh  
#5 Posted : Tuesday, July 13, 2010 3:09:16 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
I don't care how many things you ask me, I find these topics interesting.

Map.inis are beta. A large number of things do not work with them. It's a shame, but we're stuck with it.

A list of things I've discovered so far:
-You can't change weapons; projectiles dissappear, or the changes just don't work.
-You can't change the price of a unit; it'll change the displayed price, but it'll still charge the old price.
-You can't add a unit limit. As long as you haven't reached the limit, you can queue as many as you want. So if you gave the crusader a 1 limit, you could queue 9 per war factory until it is finished.

Edited by user Tuesday, July 13, 2010 3:50:54 AM(UTC)  | Reason: Not specified

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.
Offline Suomaf  
#6 Posted : Tuesday, July 13, 2010 6:39:39 PM(UTC)
Suomaf
Private
Joined: 7/11/2010(UTC)
Posts: 6
Location: Canada

Hmmm, it does suck that the map.ini isn't completely functional. I noticed not being able to change the cost of anything, and that you cannot change the time it takes to train a unit, yet you may change the time to construct a building... I also tried making my own "Locomotors" then realised that the game might be able to "Start" the match fine, however the moment that match ends, the game crashes... I guess if I really want to do any heavy modding I'm going to have to work with .big files.

Thank you for your help.
Offline Annihilationzh  
#7 Posted : Wednesday, July 14, 2010 4:50:37 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Feel free to come back again if you have further issues.
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.
Offline Suomaf  
#8 Posted : Wednesday, July 14, 2010 4:47:33 PM(UTC)
Suomaf
Private
Joined: 7/11/2010(UTC)
Posts: 6
Location: Canada

Question on making my own "Mod"... I just want to start off simple, modding the existing Generals, maybe make my own General once I have a better understanding...

How do I go about making changes to the game... As a simple test I have extracted the "Data/INI/Object/NukeGeneral.ini" & "Data/INI/Weapon.ini" files from the INIZH.big

in the NukeGeneral.ini I changed the TankHunters primary weapon to "SuomafMissileWeapon"

inside the Weapon.ini I added the following to the top.
Code:
Weapon SuomafMissileWeapon
  PrimaryDamage               = 300.0            
  PrimaryDamageRadius         = 75.0      
  DamageType                  = EXPLOSION
  DeathType                   = EXPLODED
  AttackRange                 = 320.0
  MinimumAttackRange          = 80.0 ; used to be 100.0, but that was too large for mig/missile speed
  ProjectileObject            = NapalmMissile
  ProjectileExhaust           = MissileExhaust
  VeterancyProjectileExhaust  = HEROIC HeroicMissileExhaust
  FireFX                      = WeaponFX_NapalmMissile
  FireSound                   = MigJetNapalmWeapon
  RadiusDamageAffects         = ALLIES ENEMIES NEUTRALS NOT_SIMILAR   
  AcceptableAimDelta          = 30 
  DelayBetweenShots           = 333             ; time between shots, msec
  ClipSize                    = 3                        ; how many shots in a Clip (0 == infinite)
  ClipReloadTime              = 5000               ; how long to reload a Clip, msec
  AutoReloadsClip             = Yes
  AntiGround                  = Yes
  ProjectileDetonationFX      = Nuke_WeaponFX_NukeCannon
  ProjectileDetonationOCL     = OCL_RadiationFieldSmall
  DamageDealtAtSelfPosition   = Yes
  ProjectileCollidesWith      = STRUCTURES
  AntiAirborneVehicle         = Yes
  AntiAirborneInfantry        = Yes
  ShowsAmmoPips               = Yes
  ShockWaveAmount   = 75.0 ; represents the shockwave amount. The larger the amount, the greater and more dramatic the shockwave effect    
  ShockWaveRadius     = 75.0 ; should be no more than the primary/secondary damage radius, whichever is larger.
  ShockWaveTaperOff  = 0.50    ; 0.33 means at the shockwave edge, the shockwave amount is 33%.

End


I package these two files into "Suomaf.big" and place it in my ZH Directory... play as Nuke General but the Tank Hunter isn't different... What am I not doing wrong? do I need to have other certain ini scripts in my .big?

I have this one mod called "Armageddon" I was able to apply my "SuomafMissileWeapon" to one of the units in that mod. so I know the 'script' is right. I just don't know what I have to do to have my moddified ini's override the games default ones.
Offline Annihilationzh  
#9 Posted : Thursday, July 15, 2010 2:17:40 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
You don't have to put them back into a .big file (it's a waste of time until you've finished the mod). You can put your INIs straight into their standard location. That is, create an INI folder inside the Data folder and put them in there. You can also extract all the INI files into your directory. See here:
http://www.cnclabs.com/f....aspx?g=posts&t=9305

I will answer your question anyway, it should work if you rename it 0Suomaf.big.
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.
Offline Suomaf  
#10 Posted : Thursday, July 15, 2010 3:52:48 PM(UTC)
Suomaf
Private
Joined: 7/11/2010(UTC)
Posts: 6
Location: Canada

Thanks for the advice. Renaming the file works, I'm assuming this is because the game loads in the files alphabetically.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.