Page 1 of 2

Studio Breakthrough

Posted: Sun Sep 29, 2019 8:40 am
by DavidTheTech
I have unlocked studio mode but all I need is help fixing brush configs

this is the error Image

and here is proof of studio

Image

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 8:47 am
by TommyCD1
It's the definition for the brush that is missing. In DR2 it's defined through the source code and in ARMTS it doesn't exist at all...

If we knew how the source code translated into ingame language we could maybe restore the brushes, but as it stands now we can't modify the game engine and so we cannot restore the studio to the ARMTS build. It's best to simply mod the DR2 studio and use that instead.

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 8:51 am
by DavidTheTech
I can modify the games code that's what I've been doing for some time now

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 8:52 am
by TommyCD1
If you can then can you reinstert the studio code from the DR2 source code? That should at least allow the studio to boot.

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 8:55 am
by DavidTheTech
DR2 Brush file
Image

AMRTS Brush
Image

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 8:58 am
by TommyCD1
So you can't? I know obviously one is formatted differently, but can you not change the parameters of the ARMTS code?
Why not look at the DR2 exe the same way you look at the amrts code?

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 9:01 am
by DavidTheTech
Its all there the entire studio code is in amrts i've checked i do look at dr2 exe as well but the error is something different which is confusing me and asking if anyone knows whats wrong

Re: Studio Breakthrough

Posted: Sun Sep 29, 2019 9:08 am
by TommyCD1
The error is that the brush is not defined.
Normally when writing a new brush it looks like this:

Code: Select all

CreateControl("Brush::Terrain", "Brush::Config")
{
  ReadTemplate("Brush::Common");
  Text("Terrain");

  // Invisible control to align to
  CreateControl("Align", "Static")
  {
    Style("Transparent");
    Geometry("HCentre", "ParentWidth");
    Size(-4, 0);
  }

  // Should the brush draw heights
  CreateControl("Deform", "Tool::ToggleAlignButton")
  {
    UseVar("$<.drawheight");
  }
Notice how the class of the module is "Brush::Config".
Now all classes are defined somewhere in the game. For example in the interface for the sound settings:

Code: Select all

    CreateControl("Notches", "Game::Notches")
    {
      Align("<VolumeMaster");
    }
The class is "Game::Notches" which is defined earlier in the ingame.x file.

Code: Select all

ConfigureInterface()
{
  DefineControlType("Game::Notches", "Static")
  {
    Geometry("Bottom", "HInternal");
    Style("Transparent");
    Pos(0, 1);
    Size(302, 12);

    CreateControl("LeftNotch", "Static")
    {
      ColorGroup("Sys::Texture");
      Image("if_interfacealpha_game.tga", 56, 14, 7, 11);
      Size(7, 11);
    }
    CreateControl("RightNotch", "Static")
    {
      Geometry("Right");
      ColorGroup("Sys::Texture");
      Image("if_interfacealpha_game.tga", 63, 14, 7, 11);
      Size(7, 11);
    }
    CreateControl("Notch1", "Static")
    {
      Pos(24, 0);
      ColorGroup("Sys::Texture");
      Image("if_interfacealpha_game.tga", 28, 10, 3, 5);
      Size(3, 5);
    }
    CreateControl("Notch2", "Static")
    {
      Pos(49, 0);
      ColorGroup("Sys::Texture");
      Image("if_interfacealpha_game.tga", 28, 10, 3, 5);
      Size(3, 5);
    }
The problem is that the class of "Brush::Config" is not defined anywhere in AMRTS. In DR2, it's defined through the source code itself, in the same way that basic classes like "Static" "Window" or "MultiPlayer::Players::Slot" are defined.

If we knew how the source code translated into ingame language, we could theoretically redefine the class in the same way that "Game::Notches" is defined.

Re: Studio Breakthrough

Posted: Mon Sep 30, 2019 10:48 am
by DavidTheTech
I give up

Re: Studio Breakthrough

Posted: Wed Oct 02, 2019 11:51 am
by DavidTheTech
I redact my claim of giving i was just tired

the brushes are defined in the source code

in studio_brush_terraintweak.cpp in dr2

Code: Select all

TerrainTweak::TerrainTweak(const char *name) : ApplyCell(name)
    {
      // Create interface vars
      varVertexColor1 = CreateInteger("vertexColor1", Color((S32)64, (S32)128, (S32)64));
      varVertexColor2 = CreateInteger("vertexColor2", Color((S32)255, (S32)255, (S32)255));
      varColorScale = CreateFloat("colorScale", 0.3f, 0.001f, 1.0f);
      varSmoothFloor = CreateInteger("smoothFloor", FALSE);
    }
in AMRTS

Code: Select all

int __thiscall sub_5D7050(int this, char *a2)
{
  int v2; // esi@1

  v2 = this;
  sub_5E56C0(this, a2);
  *(_DWORD *)v2 = &off_671008;
  *(_DWORD *)(v2 + 336) = sub_5BCF50((void *)v2, (int)aVertexcolor1, -12550080, 2147483648, 0x7FFFFFFF);
  *(_DWORD *)(v2 + 340) = sub_5BCF50((void *)v2, (int)aVertexcolor2, -1, 2147483648, 0x7FFFFFFF);
  *(_DWORD *)(v2 + 344) = sub_5BD020((void *)v2, (int)aColorscale, 1050253722, 981668463, 1065353216);
  *(_DWORD *)(v2 + 348) = sub_5BCF50((void *)v2, (int)aSmoothfloor, 0, 2147483648, 0x7FFFFFFF);
  return v2;
}