Jump to content

AngelCaptain

Member
  • Content Count

    16
  • Joined

  • Last visited

  • Medals

Posts posted by AngelCaptain


  1. Thanks alot people now all its working with spawning a empty helipad but now another problem was found 

    if ((_tree getVariable ["PommesDispo",0]) == 0) then
    {
    	diag_log "La variable es introuvable et va maintenant etre créer.";
       _tree setVariable ["PommesDispo",_RealAvailable,true];
        diag_log format["Nombre de pommes: %1.",(_tree getVariable "PommesDispo")];
    } else {
        _tree getVariable "PommesDispo";
       diag_log format ["Pommes: %1",_tree getVariable ["PommesDispo",0]];
    };

    always i resend the script the variable was not found because the script always go to the _tree setVariable ["PommesDispo",_RealAvailable,true]; @pierremgi


  2. Just now, pierremgi said:

    Arf! trying to place apples in olive tree, That's hard!

    so funny xD.

    1 minute ago, Beldum said:

    Or he could try this

     

    _trees = nearestObjects [player,["Trees"],15];

    {

        _class = typeof _x;

        _pos = getpos _x;

        _dir = getdir _x;

        hideObject _x;

        _fakeTree = "Land_HelipadEmpty_F" createVehicle _pos;

        _fakeTree setVariable ["appletogetit",_RealAvailable,true];

    }forEach _trees;

    i'll try this and see maybe thats will be working


  3. Just now, das attorney said:

    It's not a proper object.

     

    Try it:

     

    
    _tree = (nearestTerrainObjects [player, ["TREE", "SMALL TREE", "BUSH"], 200]) select 0;
    _tree setVariable ["apple",true];
    diag_log format ["apple: %1",_tree getVariable ["apple",false]];

     

    Will return "apple: false" 

     

     

    True but i dont have any other solution for making a virtual inventory directly into the tree ?


  4. Hey good evening guys, i got a problem when i'm trying to find the solution.

     

    Sorry for my english i'm french :)

     

    i'll explain exactly what i'm trying to do.

     

    Firstable i make a scan of all p3d in a range 15m around the player, when its done i asking for find the p3d i want to use.

     

    Exemple: 

    _terrainObjects = nearestTerrainObjects [player, ["TREE", "SMALL TREE", "BUSH"], 15];
    _object = [];
    _DestructionP3D = "t_oleae1s_f.p3d";
    {
    	_counterDestructionP3D = count _DestructionP3D;
    	for "_i" from 0 to (_counterDestructionP3D-1) do
    	{
    		_find = str _x find (_DestructionP3D select _i);
    		if (_find > 0) then
    		{
    			if(damage _x < 1) then 
    				{
    					_object pushBack _x;
    				};
    		};
    	};
    } forEach _terrainObjects;
    _objects = count _object;
    if (_objects < 1) exitWith
    {
    	Hint "Impossible to get the tree";
    };

    after that i select the closer of the player:

    _tree = _object select 0;
    _RealAvailable = 16;

    after that when the tree is select and all is good i want to put on it a specific variable to give it to him a virtual inventory of apple at this moment all is good but when its time to give to him the variable its look like not working.

    if (isNil {_tree getVariable "appletogetit"}) then
    {
    	diag_log "The variable is not create we will create it.";
       _tree setVariable ["appletogetit",_RealAvailable,true];
        diag_log format["Number of apple's into the tree: %1.",(_tree getVariable "appletogetit")];
    } else {
        _tree getVariable "appletogetit";
        diag_log "Retreive the apple into the tree";
    };

    into the dialog for fetch the number of the appl was a add i got Null into the RPT:

    23:16:14 "Number of apple's into the tree: <null>."

    so its someone can find the solution of that problem thats will be magic.

     

     

    Thanks for help. 

     

    Best regards

×