OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Harnu on 30 Oct 2002, 03:09:26

Title: Can someone explain this thing to me?
Post by: Harnu on 30 Oct 2002, 03:09:26
boom = "flarered" camcreate [getpos z select 0, getpos z select 1, getpos z select 2]

  Okay, I somewhat know how this crap works.  in this instance I have a red flare being created at z (A cessna).  Now,  what do I add or change to make something be created to the left or right or somewhere other than the the plane.  And I don't mean removing "getpost z select 2", I need that for it still being around the plane.  I just want to offset it a bit to the left or to the right.

  Hope someone can help ;) I have some ideas in mind that I wan't to put into action, but I can't get it right!
Title: Re:Can someone explain this thing to me?
Post by: 14th_Hoot on 30 Oct 2002, 03:49:40
Methinks you can play with it a bit. For instance, try the following:

boom = "flarered" camcreate [getpos z select 0, getpos z select 1, 20]

Simply inserting a number instead of the direct height SHOULD put the flare 20 meters directly overtop of the plane. Get it?
Also, I think you can do the following:

boom = "flarered" camcreate [getpos z select 0, getpos z select 1+10, getpos z select 2]

Which should move it on the second axis.

Not sure, but give her a shot! ;)

Hoot out!
Title: Re:Can someone explain this thing to me?
Post by: MI_Fred on 30 Oct 2002, 05:20:13
14th_Hoot almost got it, just forgot to add brackets...

boom = "flarered" camcreate [getpos z select 0, (getpos z select 1) + 10, 20]

which will create the flare 10 meter to the northern side of the plane and 20 meters above it. The setpos works in relation to the map. And in order for the flare to get lit, it needs 2 seconds of un-obstructed free fall time, which is about 12-20 meters. So if u have a flying plane, no prob. But if it isn't going north and u wan't it 10 meters ahead of the plane, hmm. And if you wan't it to stay there... bigger hmm. Ah well, tell us and we'll give u more answers  ;)
Title: Re:Can someone explain this thing to me?
Post by: Bremmer on 30 Oct 2002, 10:40:54
MI_Fred almost got it, just forgot to correct the z position...  ;)

Quote
boom = "flarered" camcreate [getpos z select 0, (getpos z select 1) + 10, 20]

which will create the flare 10 meter to the northern side of the plane and 20 meters above it.

This code in fact creates the flare at 20m above ground level. In order to create the flare above the object (z) you need to get the actual height of z then add the 20m on top of that. eg.

boom = "flarered" camcreate [getpos z select 0, (getpos z select 1) + 10, (getpos z select 2) + 20]