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

Notification

Icon
Error

Annihilationzh Offline
#1 Posted : Sunday, August 14, 2011 11:11:36 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,720
United Kingdom

Thanks: 26 times
Was thanked: 447 time(s) in 304 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.
 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
Annihilationzh Offline
#2 Posted : Sunday, July 22, 2012 5:49:57 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,720
United Kingdom

Thanks: 26 times
Was thanked: 447 time(s) in 304 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.
 1 user thanked Annihilationzh for this useful post.
Gameanater on 11/29/2014(UTC)
Gameanater Offline
#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,574
United States
Location: The Matrix

Thanks: 579 times
Was thanked: 171 time(s) in 147 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.
It is better to die standing up than to live life on your knees.
UTD^Force Offline
#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: 799
Jordan
Location: Middle east

Thanks: 443 times
Was thanked: 161 time(s) in 145 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

<3
The lilacs where the robin built,
And where my brother set
The laburnum on his birthday,
The tree is living yet!

"I rarely have many failures. If I'm baking a cake and it fails, it becomes pudding."

"Sometimes I sit and wonder, "why am I not in a mental asylum?" Then I take a good look at everyone around me and realize, maybe I am."

A flower does not think of competing to the flower next to it. It just blooms.
 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.

Powered by YAF 1.9.6.1 | YAF © 2003-2020, Yet Another Forum.NET
This page was generated in 1.097 seconds.