Jump to content

GEORGE FLOROS GR

Member
  • Content Count

    4230
  • Joined

  • Last visited

  • Medals

Community Reputation

4149 Excellent

About GEORGE FLOROS GR

  • Rank
    Second Lieutenant

Profile Information

  • Gender
    Male
  • Location
    Greece / BI Forum Ravage Club Owner

Recent Profile Visitors

21188 profile views

Single Status Update

See all updates by GEORGE FLOROS GR

  1. George, I found you and David Doss having a discussion on this thread 

     

    I have tried the code below and nothing happens any ideas why?

    NOTES:

    I have tried: Full Bush Path:  a3\plants_f\Bush\b_ficusc2d_f.p3d and without full path  b_ficusc2d_f.p3d

    The bushes do not get replaced

    CODE SAMPLE BELOW 
     

    if (isServer) then {

    private _repleacearray = [

    ["a3\plants_f\Bush\b_ficusc2d_f.p3d", "a3\plants_f\Bush\b_ArundoD3s_F.p3d", 0],
    ["a3\plants_f\Bush\b_neriumo2d_f.p3d", "a3\plants_f\Bush\b_ArundoD3s_F.p3d", 0]
        
    ];


    {
        private _a = ((getModelInfo _x) select 0);
        private _c = _repleacearray select {_a == _x select 0};
        
        if !( _c isEqualTo []) then {
        
            private _b = ((getModelInfo _x) select 1);
            private _replacetree = ([(_c select 0) select 1] call BIS_fnc_simpleObjectData) select 1;
            private _directionOffset = (_c select 0) select 2;

            private _position = getPosWorld _x;
            private _vectorDirUp = [vectorDir _x, vectorUp _x];

            
             
            hideObjectGlobal  _x;
            private _simpletree = createSimpleObject [_replacetree, _position];
            _simpletree setVectorDirAndUp _vectorDirUp;
            _simpletree setDir (getdir _simpletree) + _directionOffset;
            _simpletree enableSimulationGlobal false;
            
            systemchat format["getModelInfo: %1     getPosWorld: %2     replacing tree ",getModelInfo _x, getPosWorld _x,  _x];    

        };

            
    } forEach nearestTerrainObjects 
        [
            [worldSize/2, worldSize/2], 
            ["Tree"], //["Tree","Bush"],
            worldSize, 
            false
        ];
    };

    hint "Replacing_trees_script done";

     

    Any help appreciated

     

    Ant

×