I am now making a mission for my brother (Only intended for my brother, and he only got ofp v1.3)
(And I also have only v1.3)
As you can imagine,
you can't do much scripting things with that ....
but I finally managed to find the max buildingpos in a nearby building
(I think functions don't work in that version,because i can't use execVM command)here's the code :
_unit=_this select 0;
_h_building=_this select 1;
_bp=0;
_bpos=[];
#loop
_bpos=_h_building buildingpos _bp;
_bformat=format ["%1",_bpos];
;I think its converting _bpos to string
;in ofp v1.3 ,you can't compare something with arrays
;getpos player==[1,3,4] won't work.
~0.2
? (_bformat != format ["%1",[0,0,0]]) : _bp=_bp+1;goto "Loop"
;if buildingpos is not equal to [0,0,0] then continue looping
hint format ["Building : %1\nMax Positions : %2",_building,_bp];
;output the max buidingpos of the nearby building
exit
Can it be used with ofp resistance?
another problem :
i have the editorupdate102 addon installed.
so,i've got a snow dropping object (Burn...*Snow or something like that in empty>ammo)
(the object is fire type,so this inflame true is necessary to drop the snow
as well as a disturbing action menu entry showing "Put Out Fire", and "Light Fire" pop up where you are near it)
I wrote a script(
snow dropping script) so it keeps the snow object about 5 meters in the air and 6m infront of him all the time.
(So its snowing around the player all the time)
I want to setpos that snow to [0,0,0] when the player is inside a building...
So I
added the following things to the
snow dropping script and end up with failure.
_unit=_this select 0;
_snow=_this select 1;
_nb=nearestBuilding _unit;
#loop
? _unit distance _nb < 5 : _snow setpos [0,0,0];@ _unit distance _nb > 5
dropping stuffs
other things
goto "loop"
and when i hint formatted the two positions of the building and unit.
the position of the building is far too higher than the unit even though the unit is just standing out side the
building.
eg.
unit pos > [4321.5,3059.5,0]
building pos > [10035.6,18550.3,0.0023E]
(just my imagination of the positions ,not copied from the mission)
So is there any other way to setpos that snow to [0,0,0] when _units in a building?
and is there any other way to check the distance between the unit and the building?
Regards,
Haroon1992