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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Annihilationzh  
#1 Posted : Sunday, August 14, 2011 11:11:36 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 am writing this assuming you have moderate experience with INI code.

Objects and Modules

There are three things you can do with Modules.

Add:
Code:
  AddModule ModuleTag_XX
   Behavior = YYY ModuleTag_XX
    [parameters]
   End
  [You can put other modules here]
  End


Remove:
Code:
  RemoveModule ModuleTag_XX

The easy one. It simply removes a module, so nothing else needs to be stated in the code.

There is also a replace module that should never be used:
Code:
  ReplaceModule ModuleTag_XX_Override
   Behavior = YYY ModuleTag_XX
    [parameters]
   End
  End

This module causes crashes with some modules. Just use Remove and Add if you want to replace a module.

Other code, such as ArmorSet, WeaponSet, and geometry do not need any extra code. They can be copied directly from normal INI code. There is an exception with locomotors, which require the AIUpdate to be replaced before the locomotor is specified. The same is true in reverse, if you replace an AIUpdate, you need to include the locomotor. Remember, locomotors always go AFTER the AIUpdate.

OCLs, CommandButtons, and more

Most other code (code not in the Object folder of the INI files), from OCLs to CommandButtons and CommandSets can be used the same way they would be in the INI files. For example:

Code:
ObjectCreationList SUPERWEAPON_AnthraxBombGamma
  DeliverPayload
    Transport = GLAJetCargoPlane
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed = Yes
    MaxAttempts = 1
    DropOffset = X:0 Y:0 Z:-10
    Payload = AnthraxBombGamma
    DeliveryDistance = 140
    DeliveryDecalRadius = 200
    DeliveryDecal
      Texture           = SCCAnthraxBomb_GLA
      Style             = SHADOW_ALPHA_DECAL
      OpacityMin        = 25%
      OpacityMax        = 50%
      OpacityThrobTime  = 500
      Color             = R:33 G:255 B:67 A:255 
      OnlyVisibleToOwningPlayer = Yes
    End
  End
  DeliverPayload
    Transport               = AmericaJetB3
    StartAtPreferredHeight  = Yes
    StartAtMaxSpeed         = Yes
    MaxAttempts             = 1
    DropOffset              = X:0 Y:0 Z:-10
    Payload                 = MOAB
    DeliveryDistance        = 160
    PreOpenDistance         = 160
    DeliveryDecalRadius     = 170
    DeliveryDecal
      Texture           = SCCFuelAirBomb_USA
      Style             = SHADOW_ALPHA_DECAL
      OpacityMin        = 25%
      OpacityMax        = 50%
      OpacityThrobTime  = 500
      Color             = R:255 G:0 B:0 A:255 
      OnlyVisibleToOwningPlayer = Yes
    End
  End
  DeliverPayload
    Transport = ChinaJetCargoPlane
    StartAtPreferredHeight = Yes
    StartAtMaxSpeed = Yes
    MaxAttempts = 4
    DropOffset = X:0 Y:0 Z:-2
    DropVariance = X:20 Y:20 Z:0
    Payload = EMPPulseBomb 1
    DeliveryDistance = 150
    DeliveryDecalRadius = 200
    DeliveryDecal
      Texture           = SCCEMPPulse_China
      Style             = SHADOW_ALPHA_DECAL
      OpacityMin        = 25%
      OpacityMax        = 50%
      OpacityThrobTime  = 500
      Color             = R:40 G:110 B:210 A:255 
      OnlyVisibleToOwningPlayer = Yes
    End
  End
End

This will replace the anthrax bomb with three planes, one drops the anthrax bomb, another drops a MOAB, and the final one drops an EMP bomb.

Examples and applicable topics


For a great example of map.ini code to learn from, I suggest Beng's Bushehr: Operation Partisans' Challenge, which you can download here:
http://www.cnclabs.com/d...oads/details.aspx?id=274

Here's an in-depth explanation thread with examples:
http://www.cnclabs.com/f...help-with-a-map-ini.aspx

Glitches

Map.inis are prone to glitches. Some bugs include:

Unit costs and build times cannot be altered. They will display a new price in game, but not change anything.

Unit limits also have a glitch. They will allow you to queue as many as you want to until you have actually reached the limit on the map. For example, if you add a limit of 1 to rangers, you will be able to queue 9 rangers per barracks until the first one is finished.

Questions and closing statements

Please do not ask for help in this topic. Please start your own topic in the Mapping or modding forum sections.

I hope to update this as I remember other things you can do with a Map.ini. Please, if you're reading this and know of anything I've missed out, do not be reluctant to comment.

Edited by user Tuesday, November 29, 2016 6:02:21 PM(UTC)  | Reason: New code tags. STICKED

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.
thanks 5 users thanked Annihilationzh for this useful post.
Gameanater on 6/6/2013(UTC), UTD^Force on 8/3/2014(UTC), SkyMix_RMT on 4/29/2016(UTC), AdrianeMapMaker on 10/11/2019(UTC), Commander Newgate on 10/15/2019(UTC)
Sponsor
Offline Annihilationzh  
#2 Posted : Sunday, July 22, 2012 5:49:57 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)
Here's some sample Map.ini code that I made a few years ago. I always find examples are the best way to learn.

Outline:

-Airforce general has only airfield and supply center.
-Assault Helix is available with a health boost. The bunker upgrade also provides a gattling cannon and speaker tower.
-Minigunner and pathfinder available for the helix bunker.
-Alpha aurora is available. PDL.
-Nuclear MiG available. PDL.
-Dozer has air resistance.
-Oil Derrick is exceedingly durable and has autorepair.
-Airfield is more durable, provides radar and free capture building.

Also note, Command_ConstructGLAVehicleCombatBikeRocket, Nuke_Upgrade_ChinaAircraftArmor and Infa_Upgrade_Fanaticism do not exist. I use them to remove buttons and Cameos.

Edited by user Friday, June 7, 2013 9:05:06 AM(UTC)  | Reason: New code tags

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.
thanks 1 user thanked Annihilationzh for this useful post.
Gameanater on 11/29/2014(UTC)
Offline Gameanater  
#3 Posted : Saturday, November 29, 2014 8:53:40 PM(UTC)
Gameanater
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 5/13/2013(UTC)
Posts: 1,537
United States
Location: Right Behind You

Thanks: 574 times
Was thanked: 166 time(s) in 144 post(s)
Sorry to reply to an ancient topic, but I don't know what you mean by "PDL" in your sample Map.ini code.
Any old friends still on here can add me on discord @jcdenton2187. I'm far more likely to respond there.
Offline UTD^Force  
#4 Posted : Sunday, November 30, 2014 8:01:31 AM(UTC)
UTD^Force
Colonel
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 8/13/2013(UTC)
Posts: 817
Jordan
Location: Middle east

Thanks: 430 times
Was thanked: 184 time(s) in 168 post(s)
PointDefenseLaserUpdate behaviour :)

Edited by user Sunday, November 30, 2014 9:28:23 AM(UTC)  | Reason: Changed the word behavior to behaviour & added the word Update

Proud Muslim

UTD^Force

Moderator and former map reviewer
CnC Labs
thanks 1 user thanked UTD^Force for this useful post.
Gameanater on 11/30/2014(UTC)
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.