darkwolf 0 Posted June 19, 2005 as title says ive looked on here and didnt find anything Share this post Link to post Share on other sites
bedges 0 Posted June 19, 2005 no script required - in the init field of the helo, type <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this flyinheight 200 note: 200 can be any height you wish. if you want the helo to start flying at a certain height at some other time than the beginning, put the code above into the 'on activation' field of the helo's waypoint where you want it to change height. Share this post Link to post Share on other sites
PhilippRauch 0 Posted August 12, 2006 Hi, i did a script checking if a OH-58 has a player as gunner and a AI as pilot and then adding a row of actions to the helo. If the pilot dies, becomes a player, if the player leaves the helo or if the helo becomes more than 0.85 dammaged the actions get removed. That works all fine... The problem though is, that my actions contain flyinheight commands, namely: Fly Treeline: _helo flyinheight 19 Fly 5m up: _helo flyinheight (_height+5) Fly 5m down: _helo flyinheight (_height-5) etc... Now, the Action "Fly Treeline" and "Fly 5m down" work. The others dont, interestingly the helo does all sinking commands, but no rising commands. It only goes lower with flyinheight command. NEVER higher. With the setvelocity it seems do go up, but i would rather not use this command, because the result isnt what i need... ...any idea why the flyinheight doesnt brings my helo up? Share this post Link to post Share on other sites
sanctuary 19 Posted August 12, 2006 The problem with a flyinheight telling an AI air vehicle to climb up is that the air vehicle must move , for the higher altitude flyinheight to be applied by the AI While the same air vehicle can be affected , and will apply immediately without needing to move at all a flyinheight telling it to fly lower. That's weird, but that's how BIS coded it, maybe they abused a bit vodka when they did it So for your problem to be solved, there is a simple solution : Fly Treeline: _helo flyinheight 19 Fly 5m up: _helo move [(getpos _helo select 0), (getpos _helo select 1)]; _helo flyinheight (_height+5) Fly 5m down: _helo flyinheight (_height-5) And when asked to fly 5 m up, the AI will first move on its exact current position (so visually it will not move), and thanks to doing that, the higher flyinheight will then be applied. Share this post Link to post Share on other sites
PhilippRauch 0 Posted August 12, 2006 thanks for the quick reply! i actually came across that domove command and it now works splendid, it uses something like you wrote sanctuary. thanks though I run out of time now and i have to go, so i will post the whole bunch of script when done 100%. Right now i work on turning the unit by 45deg.. (i will try 45deg. first) Any idea for that? I think i will end up using a function for that, i think it was called pos2dir.sqf or something like that. thanks and peace! Share this post Link to post Share on other sites