Colossus 2 Posted June 10, 2004 I already checked the rest of the forum for this kind of script and I can't find it (Maybe I'm a search noob  ) The problem is this: What I want is to make the turret have 45-60 degrees up from the ground instead of been straight forward. PS: Placebo must be happy now Share this post Link to post Share on other sites
Placebo 29 Posted June 10, 2004 PS: Brandwith is limited on the picture  1. Use jpeg for smaller file size, the pic could easily be 25% of the current 170kb, which would mean many more could view it before your bandwidth was used up. 2. Sign up to someone that doesn't limit bandwidth, read the first post of the combat photography thread in general for a list of free hosts. Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Ok now I know that, thx But that's not the point of this topic, I need to get the turret up from ground to 45-60 degrees. Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Do I need velocity or Getpos? I'm not a scripter so need a bit of help Share this post Link to post Share on other sites
Viriato 0 Posted June 10, 2004 Put a invisible object up in the sky with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Object setpos [(getpos this select 0), (getpos this select 1), 250] Put it at 250 m from the Zsu-23, and then, in the init of the Zsu type : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">This dotarget object The Zsu will be targeting the invisible object (a helipad maybe), but you will simply be looking at a zsu with a 45ÅŸ elevation cannon. Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Thx, I'll try that If the Zsu-23 was empty, what kind of script could I use then? Share this post Link to post Share on other sites
Blanco 0 Posted June 10, 2004 if the ZSU-23 is NOT empty, try this in a script: No targets needed. 4 params : [<name of gun>, <direction he should watch ( 0-360)>, <how far is the target from the gun in meters>,<How high he should watch in meters>] exec "watch.sqs" Example : [mygun,80,150,50] exec "watch.sqs" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;watch.sqs _gun = _this select 0 _dir = _this select 1 _dis = _this select 2 _howhigh = _this select 3 gunner _gun doWatch [(getpos _gun select 0) + ((sin _dir) * _dis),(getpos _gun select 1) + ((cos _dir) * _dis),_howhigh] Untested. If you want it empty you can try to moveingunner a gamelogic to man it, but I dont think a gamelogic can watch because it's a dumb, AI-less object  Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Ok I can try but I must warn you that I'm no good at scripts, so if it's fails it could be my foult  <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;watch.sqs _gun = _this select 0 _dir = _this select 1 _dis = _this select 2 _howhigh = _this select 3 gunner _gun doWatch [(getpos _gun select 0) + ((sin _dir) * _dis),(getpos _gun select 1) + ((cos _dir) * _dis),_howhigh] exit PS: should I put a ¨exit¨ at the end of the script maybe? Share this post Link to post Share on other sites
MrZig 0 Posted June 10, 2004 Quote[/b] ]PS: should I put a ¨exit¨ at the end of the script maybe? Yes. Share this post Link to post Share on other sites
Blanco 0 Posted June 10, 2004 yes you can put an exit at the end. Just place your gun (manned) on the map. Copy the code in a notepad and save it as watch.sqs Drag it in you users\username\missions\yourmissionname - folder And execute it in the initialitation field of your gun with the 4 parameters. Example : [mygun,180,100,30] exec "watch.sqs" The gunner will turn his turret south (180) looking at a ficticious target 30 meters high in the sky and 100m far from your gun "If" the code works, like I said it's untested. Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Quote[/b] ]If the zsu-23 was empty, what kind of script could I use then? I mean it can't be that hard to turn a turret from this: to this: When it's empty Share this post Link to post Share on other sites
Blanco 0 Posted June 10, 2004 So gamelogics are not as dumb as I thought? Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Script worked great on AI's but not on gamelogic or empty. I was just wondering if it was possible to start at 80,150,50 rater then move the turret to the point? Share this post Link to post Share on other sites
MrZig 0 Posted June 10, 2004 Could you make an AI move it, then after a lil wait (3 seconds or so) move the AI out of it/delete him? Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 But then again I need a delete script Share this post Link to post Share on other sites
MrZig 0 Posted June 10, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;watch.sqs ;exec via [Gun] exec "watch.sqs" (I edited it so you dont need so many params for what you want) _gun = _this select 0 _dir = getdir _gun _dis = 100 _howhigh = 30 gunner _gun doWatch [(getpos _gun select 0) + ((sin _dir) * _dis),(getpos _gun select 1) + ((cos _dir) * _dis),_howhigh] ~3 deletevehicle gunner _gun exit That should work? Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Quote[/b] ][mygun,180,100,30] exec "watch.sqs" This time too? lol Share this post Link to post Share on other sites
Blanco 0 Posted June 10, 2004 no [mygun] exec "watch.sqs" Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Arrgh...I still need a ai in it to make it work and the ai dosen't get deleted after a while, good work anyway guys  But still it needs to be empty and you can change the degree manualy AND you can ¨get in¨ when you want. Share this post Link to post Share on other sites
Blanco 0 Posted June 10, 2004 well, after you delete the gunner, create a gamelogic and move him in so nobody can board and move the turret. Is this for a camerascene? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;watch.sqs ;exec via [Gun] exec "watch.sqs" (I edited it so you dont need so many params for what you want) _gun = _this select 0 _dir = getdir _gun _dis = 100 _howhigh = 30 gunner _gun doWatch [(getpos _gun select 0) + ((sin _dir) * _dis),(getpos _gun select 1) + ((cos _dir) * _dis),_howhigh] ~3 deletevehicle gunner _gun @isnull gunner _gun _loggy = "logic" createvehicle [0,0,0] _loggy moveingunner _gun exit Something like that. it's still [mygun] exec "watch.sqs" This is getting bigger and bigger... Share this post Link to post Share on other sites
MrZig 0 Posted June 10, 2004 Better yet. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;watch.sqs ;exec via [Gun] exec "watch.sqs" (I edited it so you dont need so many params for what you want) _gun = _this select 0 _dir = getdir _gun _dis = 100 _howhigh = 30 gunner _gun doWatch [(getpos _gun select 0) + ((sin _dir) * _dis),(getpos _gun select 1) + ((cos _dir) * _dis),_howhigh] ~3 _gunner = gunner _gun _gunner action ["Eject",_gun] _gunner setpos [0,0,0] deletevehicle _gunner exit And I think you wanted it so you CAN get in? If not just add a simple _gun lock true to it Share this post Link to post Share on other sites
Colossus 2 Posted June 10, 2004 Is this for a camerascene? No, just make it more realistic. I have never seen a deployed AA gun with it's turret faced like this (except OFP Â Â ) It would be logical to have a AA gun faced the sky instead of faceing people on the ground, if you know what I mean. Damn you guys are really good at this, keep it up Share this post Link to post Share on other sites
Drakkhen 0 Posted June 21, 2004 Why not simply (in the class) set the gunner view to possible angles like Ymax 80, Ymin 10 and Ymed 30 (which would be used as default angle) instead of using scripting? Share this post Link to post Share on other sites
Junker 0 Posted June 21, 2004 i used this type of scripting for some AI mortars, but randomized the angles to make it more effective and realistic when the players on the recieving end triggered a trigger. :P OMG footie is on cmon ENGLAND Share this post Link to post Share on other sites