Author Topic: No Fade 4x4 Ice placeable (Need!)  (Read 622 times)

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #15 on: December 16, 2014, 05:58:15 pm »


               What I posted is a function, so to use it you need something like this:
 
void bhFillTiles(object oArea, int nGroundTileConst, int nStartColumn, int nStartRow, int nColumns, int nRows,
                 float fZOffset = -0.4f, int nColumnOffsetMetres = 0, int nRowOffsetMetres = 0, string sPlaceable = "");

void main()
{
  object oArea      = GetArea(GetFirstPC());  // or whatever

  bhFillTiles(oArea, 0, 10, 11, 6, 2, -0.98, 0, 5, "me_floor015");
}
adding the entire function at the end (or in a #include file).
               
               

               
            

Legacy_GIANTSWORD

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #16 on: December 16, 2014, 11:27:17 pm »


               
void bhFillTiles(object oArea, int nGroundTileConst, int nStartColumn, int nStartRow, int nColumns, int nRows,

                 float fZOffset = 6.51f, int nColumnOffsetMetres = 0, int nRowOffsetMetres = 0, string sPlaceable = "me_floor015")

 

 

{

    object oTile;

    vector vPos;

    vPos.x = 5.0 + 10.0 * IntToFloat(nStartColumn - 1) + IntToFloat(nColumnOffsetMetres);

    vPos.z = fZOffset;

 

    location lLoc;

    float fFace = 0.0;

 

    // * fill x axis

    int i, j;

    for (i=0 ; i < nColumns; i++)

    {

        vPos.y = 5.0 + 10.0 * IntToFloat(nStartRow    - 1) + IntToFloat(nRowOffsetMetres);

        // fill y

        for (j=0; j < nRows; j++)

        {

            lLoc = Location(oArea, vPos, fFace);

            oTile = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_invisobj", lLoc,FALSE, "x2_tmp_tile" + GetTag(oArea));

            SetPlotFlag(oTile,TRUE);

            if (sPlaceable != "me_floor015") CreateObject(OBJECT_TYPE_PLACEABLE, sPlaceable, lLoc);

 

            ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(nGroundTileConst), oTile);

            vPos.y = vPos.y + 10.0;

        }

        vPos.x = vPos.x + 10.0;

    }

 

}

 

void main()

{

  object oArea = GetArea(GetFirstPC());  // or whatever

 

  bhFillTiles(oArea, 0, 10, 13, 1, 1, 6.51, 0, 5, "me_floor015");

 


}

 

 

 

 

This compiles and I put it on enter of that area, not getting anything.  My area is 10 rows and 13 columns.  The ice will pretty much cover the whole area and what overlaps will be hidden by raised ground.

 

What am I doing wrong?


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #17 on: December 17, 2014, 12:08:13 am »


               Try

bhFillTiles(oArea, 0, 1, 1, 10, 13, 6.51, 0, 0, "me_floor015");

               
               

               
            

Legacy_GIANTSWORD

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #18 on: December 17, 2014, 02:14:18 am »


               

ok so.. I got it to work! unfortunately the 1x1 tiles fade just like all the other tiles that were giving me problems..


 


So I went back into the toolset and painted them down by hand as far as I could see out on the lake and when I load up the game they are solid as a rock (plot, static)..


 


keep in mind the 1x1's i'm spawning in are the same exact placeable set to plot/static.  Here is the final script I got to work to spawn them in via Proleric's advice (thank you!)


 


void bhFillTiles(object oArea, int nGroundTileConst, int nStartColumn, int nStartRow, int nColumns, int nRows,

                 float fZOffset = 6.52f, int nColumnOffsetMetres = 0, int nRowOffsetMetres = 0, string sPlaceable = "me_floor015")

 

 

{

    object oTile;

    vector vPos;

    vPos.x = 5.0 + 10.0 * IntToFloat(nStartColumn - 1) + IntToFloat(nColumnOffsetMetres);

    vPos.z = fZOffset;

 

    location lLoc;

    float fFace = 0.0;

 

    // * fill x axis

    int i, j;

    for (i=0 ; i < nColumns; i++)

    {

        vPos.y = 5.0 + 10.0 * IntToFloat(nStartRow    - 1) + IntToFloat(nRowOffsetMetres);

        // fill y

        for (j=0; j < nRows; j++)

        {

            lLoc = Location(oArea, vPos, fFace);

            oTile = CreateObject(OBJECT_TYPE_PLACEABLE, "me_floor015", lLoc,FALSE, "x2_tmp_tile" + GetTag(oArea));

            SetPlotFlag(oTile,TRUE);

            if (sPlaceable != "me_floor015") CreateObject(OBJECT_TYPE_PLACEABLE, sPlaceable, lLoc);

 

            //ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(nGroundTileConst), oTile);

            vPos.y = vPos.y + 10.0;

        }

        vPos.x = vPos.x + 10.0;

    }

 

}

 

void main()

{

  object oArea = GetArea(GetFirstPC());  // or whatever

 

    bhFillTiles(oArea, 0, 1, 1, 10, 13, 6.51, 0, 0, "me_floor015");

}


               
               

               
            

Legacy_GIANTSWORD

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #19 on: December 17, 2014, 06:14:11 pm »


               

*bump*


 


hoping anyone has a suggestion of how I can get the placeables spawned in via Prolerics method to stay put, no idea why they fade when spawned in via that script and do not fade when I place them down manually in the toolset and test in game.


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #20 on: December 17, 2014, 11:31:02 pm »


               Like I said, there's a well-known issue that vfx fade, and placeables fade unless they're static. Scripted placeables aren't static, by definition. So if the area needs to change dynamically, fog is your friend - or design the area so that lines of sight are fairly short.


If the appearance doesn't change over time, you could create an array of static placeables with a Moneo script, but you might find it easier to do it manually - Moneo is great, but there is a learning curve.
               
               

               
            

Legacy_GIANTSWORD

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
No Fade 4x4 Ice placeable (Need!)
« Reply #21 on: December 18, 2014, 01:18:37 am »


               

Good to know! thanks for the follow up.