Jump to content
Sign in to follow this  
Colossus

How to make verical angle?

Recommended Posts

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  biggrin_o.gif )

The problem is this:

problem.gif

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 biggrin_o.gif

Share this post


Link to post
Share on other sites
PS: Brandwith is limited on the picture  sad_o.gif

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

Ok now I know that, thx smile_o.gif

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

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

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

Thx, I'll try that biggrin_o.gif

If the Zsu-23 was empty, what kind of script could I use then?

Share this post


Link to post
Share on other sites

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   smile_o.gif

Share this post


Link to post
Share on other sites

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  biggrin_o.gif

<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
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

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
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:

problem.gif

to this:

problem1.gif

When it's empty

Share this post


Link to post
Share on other sites

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

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

<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
Quote[/b] ][mygun,180,100,30] exec "watch.sqs"

This time too?

lol biggrin_o.gif

Share this post


Link to post
Share on other sites

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  smile_o.gif

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

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... crazy_o.gif

Share this post


Link to post
Share on other sites

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
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  smile_o.gif  )

problem.gif

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 wink_o.gif

Share this post


Link to post
Share on other sites

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

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 smile_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×