squirt
Member-
Content Count
5 -
Joined
-
Last visited
Never -
Medals
Community Reputation
0 NeutralAbout squirt
-
Rank
Rookie
-
problem solved! I found it explained in my old notes (Hey i already passed that test, so what do i still need to know this for ?! Â ) </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ; FATNINJAKID - no rights reserved whatsoever! ; _angel as seen from _a! _a= _this select 0 _b= _this select 1 _ax = (getpos _a select 0) _ay= (getpos _a select 1) _az= (getpos _a select 2) _bx= (getpos _b select 0) _by= (getpos _b select 1) _bz= (getpos _b select 2) ; relative position _abx = _bx -_ax _aby= _by-_ay _abz= _bz-_az ;vectors: ;_perpendicular = [0, 10]; 10 Â or whatever ;_connectionline = [_abx,_aby] ;Angel _up= ( _abx+ 100* _aby) _down =100* sqrt (_abx^2+_aby^2) _coAb =_up/_down _angel= acos _coAB ;-1<_coAB>1 Â ! ?(_abx<0): _angel = 360 - _angel <span id='postcolor'> Â Â Â Â
-
How do you get a soldier to stay in one place?
squirt replied to cms81586's topic in OFP : MISSION EDITING & SCRIPTING
to make it stay put enter in the initialization: UnitName SetCombatMode "Yellow" UnitName SetUnitPos "Up" UnitName AllowFleeing 0 Also avoid using groups. The Ai is just plain stupid when it comes to buildings. Try making a gamelogic unit and place it where you want the soldier to go to. Then create a trigger where the AI usually screws up. Enter in "On Activation" : UnitName Setpos [getpos gamelogicName select 0, getpos gamelogicName select 1,.5] try also : UnitName setdir (0-360) might help -
i want to go deer hunting with my kozlice, deep in the woods of Kolgujev
-
How do i get the direction in which UnitA has to turn to see UnitB? For the script line : soldierA setdir (angel to soldierB) much like CamSetTarget.. or generally speaking : How do i get the direction (0° - 360°) of any given unit as seen from another unit         360         |     Q   |         | 270<------X-------->90         |         |             |        180 Like in what direction does X have to look to see Q? Q is changing position constantly, so trail and error wont work. As i vaguely remember it may have to do with linear combination.. Thanks for reading anyhow
-
look what i did kind of works but doesn't look very professional. Â i've seen soldiers lie on their backs in Klink's medical Huey but i can't figure out how he did it. any suggestions on how to create such an effect? </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #start ?(GetDammage unitA > .2):goto "loop1" goto "start" #loop1 unitA switchmove "CombatRunBDyingVer2" ; makes unit fall over and lie on its back ~4 unitA groupchat "i'm hit! help me!" _dir =getdir unitA _pos = getpos unitA #loop2 unitA setdir _dir unitA setpos _pos ; stops unit rotating and bouncing unitA setdammage (getdammage unitA + .0002) ~.01 ;makes unit bleed to death :) ?(GetDammage unitA < .1):goto "end" ;does unit get help?? goto "loop2" #end unitA switchmove "LyingToTreatedLying" unitA groupchat "thanks man" goto "start" <span id='postcolor'>