Jump to content
Sign in to follow this  
PicVert

Smoke deployed by vehicles...

Recommended Posts

Hello,

I have made a script with some help but we cannot make the right thing we would do... so I decided to post an image to help you to see what we wanna make :

smoke_deploy.jpg

So if you could help for making this script it would be great thx for help.

Think about a trick it deploy the smoke by use a weapon I just need the drop script or camcrate but I have tested the camcrate (like a the noob as I m) and it could not deploy it in alf of circle in front of the vehicle just in real direction Nort South etc.. but not of the vehicle dir drop it in the dir of Island ...

Share this post


Link to post
Share on other sites
Hello,

I have made a script with some help but we cannot make the right thing we would do... so I decided to post an image to help you to see what we wanna make :

(...)

So if you could help for making this script it would be great  thx for help.

Think about a trick it deploy the smoke by use a weapon I just need the drop script or camcrate but I have tested the camcrate (like a the noob as I m) and it could not deploy it in alf of circle in front of the vehicle just in real direction Nort South etc.. but not of the vehicle dir drop it in the dir of Island ...

Take a look into mine Tent Deploying script (it's in the mine VW Microbus pack) it's not working with a high precision, but it actually sets the object in front of another object. You can also refer to the similar script I included in this addon

this addon (bottom of the side). Anyways it seems the last value in the setPos array is totally ignored, and object is always set on the ground level.

Share this post


Link to post
Share on other sites

Ohhhhhh Airwolf.

If you only knew the problems the last value in Pos causes. It

can alternatively mean the height above ground, or the 'true'

height above OFP's zero altitude, depending on the situation.

If you use 0, it will be okay with objects that are meant to

be on the land surface.

PicVert

Basically, you want somthing like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; Get the direction of the tank/apc/vehicle

_origdir = getdir _tank

; Get the location

_basisx = (getpos _tank) select 0

_basisy = (getpos _tank) select 1

; And the distance from the tank to the spawn points

_distance = 10

; Start to the left of the tank

_dir = _origdir -90

#DeployLoop

; Move to a point (_distance) away in the right direction

_posx = _basisx + (_distance * sin(_dir)) + (_distance * cos(_dir))

_posy = _basisy + (_distance * cos(_dir)) - (_distance * sin(_dir))

; Create a smoke grenade at this location

_smoke = "SmokeGrenade" createvehicle[_posx, _posy, 0]

; Move 30 degrees to the right

_dir = _dir +30

; Keep going round the semicircle

?(_dir < _origdir +90): goto "DeployLoop"

exit

Untested - I may have got the sin and cos the wrong way

round. Also, you may have to insert code to make sure that

_dir is between 0 and 360.

Share this post


Link to post
Share on other sites

Hi thx.

Footmunch it's look like what I need thx but do you think it did work with creatvehicle insted of camcreate for a smoke grenade ? I will test it. ;) thx again if it should work I give you credits inside script as usual smile_o.gif thx.

Share this post


Link to post
Share on other sites

It's work great THX smile_o.gif

I have an other question is it possible to getdir but now from the aiming point of the turret ? not the target but just the dir of the turret ?

Share this post


Link to post
Share on other sites

PicVert

I'm not sure, but if you get the 'gunner' in the vehicle, you

may be able to 'getdir' him. This _may_ give you the

turret direction. If that doesn't work, there is another way,

but it's _very_ complicated: I'll have to copy and paste

the code, because I can't remember it well enough to post

it right now.

Createvehicle and camcreate are equivalent, AFAIK.

Share this post


Link to post
Share on other sites

Short notice, you can save some cpu power when you use a little trick (this will eliminate some unneeded sin/cos calculations):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_dir = (getdir _tank) - 90

_i = 0

#loop

_smoke = "SmokeGrenade" createvehicle [(getpos _tank select 0) + 10*cos(_dir), (getpos _tank select 1) + 10*sin(_dir), 0]

? _i < 7 : _i = _i + 1, _dir = _dir + 30, goto "loop"

exit

@Footmunch: "getdir gunner" will return the direction the gunner was facing when he get into the vehicle.

Share this post


Link to post
Share on other sites

Ok thanks Rastavovich, I'm not sure ? that is not possible to get dir of the direction of the turret ?

There is not a solution using the fired event then use the dir of the bullet insted of the vehcile ?

but anyway thx for code.

Share this post


Link to post
Share on other sites

It is absolutly possible to get the direction the turret is heading, all you need is to check for a certain ammo and which direction this ammo has (and that would be initialized over the "fired" eh).

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  

×