Jump to content

Snake1999

Member
  • Content Count

    298
  • Joined

  • Last visited

  • Medals

Posts posted by Snake1999


  1. Well,, the shortest possible I can think of is the following:

    ;Snake1999 | artillery

    ;[centre,area,NrOfRounds,frequency] exec "*.sqs"

    _centre = _this select 0

    _area = _this select 1

    _rounds = _this select 2

    _freq = _this select 3

    _bombArea = getPos _centre

    _baX = _bombArea select 0

    _baY = _bombArea select 1

    _areaX2 = _area * 2

    #Update

    _rounds = _rounds - 1

    Explosion = "shell125" camcreate [_baX + Random(_areaX2) - _area,_baY + Random(_areaX2) - _area, 30]

    ~_freq

    ? (_rounds > 0) : goto "Update"

    exit

    if you want something like atillery, mortar or similar. To Get it to work in OFP, do the following:

    Go to your mission's folder, and create a new notepad document.

    Paste the lines from above, and save the file as "mortar.sqs" (with quotes).

    Then in OFP, place a trigger (name it "mCentre" (without quotes)), and in the onActivation field, type:

    [mCentre,100,10,10] exec "mortar.sqs"

    This will fire 10 rounds at the location of mCentre, with a variation up to 100m, with 10sec between each round.

    (Edited by Snake1999 at 6:21 am on Dec. 31, 2001)

    (Edited by Snake1999 at 6:31 am on Dec. 31, 2001)


  2. The sensor/trigger waits until the condition/s is/are meet, and then they're triggered.

    If you have a variable in the trigger's condition field, in something like the example above;

    myCondition

    (this means myCondition == true)

    and you've set the variable as true, the trigger will get triggered smile.gif And you should alwayes give these kind of variables a start value, so that OFP doesn't assume the variable to have a value.

    The triggers are accurate, it's just that you have to be sure that you've set everything up right wink.gif


  3. Well,, you use scripting for everything wink.gif

    Nah,, really. Basicly everything you can do in the editor, and allot more, can be done with external script files. You can move around units, you can simulate mortar/artillery, making cutscenes and so much much more. There's no limit for what you can do really.

    Go to OFP editing center, and check out their "code snipet" area. There you'll get a pretty good idea how you can take advantage of scripts.


  4. In basic?

    Script is an external file, which you place in your ..\OFP\users\userName\mission\missionName folder. The script file can be/is built up by the different commands available.

    If you make bigger, more complex scripts, you'll notice that it's done pretty much as in simple programming, with the use of variables, and such things.

    Most people use NotePad to write their scripts in. To save you file in the correct format ( .sqs ), you just write the name of the script in quotes, with the .sqs ending, like this:

    "MyScript.sqs"

    ;-------------------

    Learn more about scripts at OFP editing center, where you can find many usefull tutorials, if you're new to editing and/or scripting.


  5. Flare will stop light when they hit the ground, so you'll have to place them high up in the air, and make 'em fall to the ground (or, you could have a looping script that places the flare at one point).

    Example (this will put the flare 100meters up in the air, and it will fall towards the ground):

    Place a trigger, and give it the name flare

    In the condition field, type: true

    In the onActivation field, type: flare1 = "Flare" camCreate [(getPos flare select 0),(getPos flare select 1),100]

    If it's that what you mean...?


  6. This can be achived very easily with a external camera script. By creating a loop that will make the camera stay fixed (or be in movement), in relation to the vehicle:

    #Update

    _myCam camSetTarget vehicleName

    _myCam setSetRelPos [x,y,z]

    _myCam camCommit 0

    ~0.01

    goto Update

    This will make the camera stay fixed at the X,Y,Z coordinates, relative to the target (in this example; "vehicleName").

    Then you can rewrite it, so that you can move the camera around, in the vehicle, while it's moving for example. Then you can add a counter, which keeps track on time, and after a X seconds the script will continue (stop the loop).

    If you're not familiar with camera scripting, or not scripting at all, I recommend you to visit OFP editing center's tutorial section. Look for the camera ( "How to script a cutscene" ) tutorial by snYpir.

    hmm.. maybe there's another solution?

    (Edited by Snake1999 at 5:06 pm on Dec. 27, 2001)

×