I dont understand the parameters of a script...

Have modding questions or discovered something new? Post here.
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: I dont understand the parameters of a script...

Post by {RaheeXF} »

Thanks.......
*RaheeXF*
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: I dont understand the parameters of a script...

Post by {RaheeXF} »

I want to import the prop "Bat" from yard.x. But it seems I have to include the attic props, plastic and electric resources, physics and all army types in the "types.cfg". Is there any other way to just import one prop (Bat, Ball) to my map from another mission type (yard.x or kitchen.x)? I don't think anybody would like to include the things one-by-one.......
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Importing props from other world archives

Post by TommyCD1 »

The types.cfg file is used to include base requirements from the base.x archive. Things such as unit definitions, or resources, or other universal things. There is a secondary file you can use instead that will also be automatically read by the game. This file is types_mission.cfg. You can use this file to include and .cfg files that won't be normally included otherwise, such as custom objective code.

When it comes to including props, the reason each map has a "world" is because these worlds not only contain the data used to texture the ground, but also contain all necessary assets for props. This means each world has unique prop .cfg files, .god models, .tga textures, and so on. If you wanted to include a prop from another world, you would have to do the following.
  1. #include the .cfg file from types.cfg, types_mission.cfg, or some other file.
  2. Copy the included prop .cfg from the world you are borrowing it from into your mission directory.
  3. Open the .cfg file and see which model or models it desires. Models are .GOD files in both code and Windows Explorer.
  4. Copy the desired .GOD file into your mission directory.
  5. Now you'll have to copy the model's textures. There are two ways to find out which textures the model wants:
    1. Open the model file in a text or hex editor and locate the texture filenames manually. Textures will always end in .TGA
    2. Place the prop into your map and play it without any textures. This will output the missing textures to your amrts.log file.

      Code: Select all

      !|bitmap_manager      :129  |18:00:53|Can't load texture barbie_body.tga.
      !|bitmap_manager      :129  |18:00:53|Can't load texture barbie_face.tga.
  6. If your prop zips to the terrain, it most likely also has a footprint. The footprint is located in the 'footprints' folder in the world .x archive. Footprints are named according to their type definition with the .fpd filename. For example, the Barracks' footprint file would be:
    • army.building.barracks1.fpd
This process must be repeated for ALL custom props you want to include into your map. Even assuming there was a way to include them in bulk, they would still depend upon their assets such as models and textures, so you'd have to include entire asset packs into your map.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: I dont understand the parameters of a script...

Post by {RaheeXF} »

How did you color the map in AMRTS Stuido? It doesn't work for me even if I press the render button... As far as I remember, you told me to use the DR2 Studio for coloring maps but in your stream I can see you used AMRTS Studio. How is it working?
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: I dont understand the parameters of a script...

Post by TommyCD1 »

I'm not sure what you're referring to. If you're talking about the mini-map, I have not yet modified it. It is simply the default texture exported by studio when saving the map. If you're talking about painting the actual geography, then I am simply using the Terrain Tweak brush. You can select it by pressing 3 on your keyboard in the studio.

If you're talking about the large image that is exported when you press the 'Render' button on said brush, then yes. That is currently broken in the Army Men RTS studio and is only accessible using the Dark Reign 2 studio. What the render button does exactly, it is the same as generating a texture for your mini-map when saving. However the render button renders a texture which resolution is based on your game's current resolution, I believe up to a maximum of 2048x2048. It also renders terrain vertex colors too, which the mini-map does not.
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: I dont understand the parameters of a script...

Post by {RaheeXF} »

I am talking about coloring the terrain/geography in the AMRTS studio. In the live stream, you colored the edges of the map black.... Why did you do it? For the mini-map or actual mission? Also, when I make a image small in paint.net the image becomes pixelated, I am suffering to create a good mini-map. Please give me some suggestions...

:COFE:
*RaheeXF*
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: I dont understand the parameters of a script...

Post by {RaheeXF} »

--- Question ---

I want the AI to defend a specific position or region by recruiting a dumdum and sending it to the region. I do not want the AI to do it after a specific amount of time like 60 seconds or 120 seconds... I want the AI to only recruit and send the dumdum when the previous dumdum is dead which was defending the region or position... What type of Condition should I use for this? Please explain... Thank you...

--- More Explanation ---

At first, there is no one in the specific region/position, alright? That means the AI will think that the DumDum is dead. So it will recruit the first one. After recruiting the DumDum, the AI will send it to the specific region/position. Then the AI will wait until the sent DumDum dies. If it dies, it will do the whole process again. That's what I want. (I Want To Also Use A Group of Units Instead of DumDum)

Recruit DumDum ---> Send The Specific DumDum To A Specific Position/Region ---> Idle Mode ---> If The Previous DumDum Is Dead ---> Start Again
*RaheeXF*
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: I dont understand the parameters of a script...

Post by TommyCD1 »

{RaheeXF} wrote: Fri Mar 17, 2023 6:52 pmI am talking about coloring the terrain/geography in the AMRTS studio. In the live stream, you colored the edges of the map black.... Why did you do it? For the mini-map or actual mission? Also, when I make a image small in paint.net the image becomes pixelated, I am suffering to create a good mini-map. Please give me some suggestions...
The reason I painted the edges of the map black is both for gameplay and for the mini-map. For gameplay, it is generally a good rule of thumb to never let the player see the edges of the world, although there are several official maps which break this rule, so it's not a big deal. If they can see the edge, then they will notice that the cells at the edges of the map will harshly transition to black regardless of the lighting. This means by painting the edges black, you can soften this gradient to be more appealing. Also, if you cannot see the world's edge, painting the edges black will give the illusion of more terrain lying beyond the playing field underneath the fog of war.
As for mini-map purposes, it is generally a good idea to at the least have a border around your mini-map to help guide players focus to the more key areas of the map, as well as the same reason mentioned above about the illusion of continuous terrain.
{RaheeXF} wrote: Sat Mar 18, 2023 9:28 amI want the AI to defend a specific position or region by recruiting a dumdum and sending it to the region. I do not want the AI to do it after a specific amount of time like 60 seconds or 120 seconds... I want the AI to only recruit and send the dumdum when the previous dumdum is dead which was defending the region or position... What type of Condition should I use for this? Please explain... Thank you...
The best solution for this I believe would be to create a custom script that recruits from a base, but instead of assigning units to a trail, it assigns them to a region and also tags them... Again though, such a script does not exist, so you'd have to piece it together from parts of existing vanilla scripts or create it yourself.
:W

An easier solution I believe which only uses vanilla assets:
Spoiler
  1. Create a new orderer for your base which you want to build the DumDum(s).
  2. Remove all DumDums from every other orderer this base uses.
  3. Place all DumDums into the new orderer.
  4. Set the orderer's manifest to "Level".
  5. Assign the desired amount DumDums to the orderer + how ever many DumDums are preplaced in the map for that team.
    So for example, if you had three regions you wanted guarded, and in studio you already placed down 4 DumDums for the team, then the orderer would need 7 DumDums.
  6. Next, create an initial objective that will watch the region for your DumDum.

    Code: Select all

    Condition("InRegion")
    {
      Region("GUARD_REGION");
      Type("army.unit.dumdum")
      {
        Amount(1);
        Operator("<");
      }
    }
    As you can see, this objective will watch your desired region and become TRUE when there are no DumDums within it.
  7. For this objective's action, make it execute the following script. The script you will use is squad_move_typetoregion.cfg, so include that through strategic.cfg.
  8. Use the following block of code as your script:

    Code: Select all

    ExecuteScript("dumdum*", "squad.move.typetoregion")
    {
      Op("%.types", "=", "RECRUIT_TYPE");
      Op("%.range", "=", 4992);
      Op("%.region.src", "=", "BASE_REGION");
      Op("%.region.dst", "=", "GUARD_REGION");
      Op("%.attack", "=", 1);
    }
  9. Now modify the parameters to your desires values.
    • "%.types" = The recruitment type to use. Should be a simple one that only requests a single DumDum.
    • "%.range" = The search radius to find a DumDum. 4992 should encompass the entire map regardless of its size, although a smaller number like 100 can work just fine.
    • "%.region.src" = The region from which the search begins. This should be the region that is closest to where your DumDum exits the Garage from. If this region doesn't exist, or isn't close enough, you can simply make a dedicated one instead.
    • "%.region.dst" = The region the DumDum will walk to and guard.
    • "%.attack" = If set to 1, then the DumDum will stop to attack enemies it encounters on its way to its destination. If set to 0, it will ignore all enemies until it reaches the destination, after which I will resume attacking enemies.
  10. Now, once the script has been coded, add one final action to your initial objective which will call upon a new secondary objective.
  11. Make this secondary objective have the opposite condition of the initial one.

    Code: Select all

    Condition("InRegion")
    {
      Region("GUARD_REGION");
      Type("army.unit.dumdum")
      {
        Amount(0);
        Operator(">");
      }
    }
    This condition will become TRUE once any DumDum arrives at the destination. When it does, you'll want to then recall upon the initial objective once again. This will mean that the first condition will now watch the region for when your DumDum leaves it.
Keep in mind that the DumDum will obviously need to move in order to engage targets. If your destination region is too small, it may trigger the secondary objective prematurely. To compensate, make your region have a very large size, which the center point being the spot you wish the DumDum to stand.
I've attached an example of what I've described as well, in case this helps to look at.
Attachments
example.zip
(516 Bytes) Downloaded 130 times
example.zip
(516 Bytes) Downloaded 130 times
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
{RaheeXF}
Map Maker
Map Maker
Posts: 169
Joined: Tue Jun 15, 2021 6:45 am
Virgin Islands (USA)

Re: I dont understand the parameters of a script...

Post by {RaheeXF} »

Thanks a lot mate..... I will try it....
*RaheeXF*
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests