Jump to content

Bart.Jan

Member
  • Content Count

    739
  • Joined

  • Last visited

  • Medals

Posts posted by Bart.Jan


  1. I am planning a somewhat different approach for a&d mission and I would like to know if it is possible to make two or more different briefings for one mission.

    one side = one briefing

    And you can hide and show different sections of briefing via objStatus command.

    Quote[/b] ]Also is it possible to show different intros for Resistance and East players? I was thinking something like below...

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

    ?(side player)==resistance : goto "res"

    player exec "rusintro.sqs"

    exit

    #res

    player exec "resintro.sqs"

    exit

    I think it's possible.

    Quote[/b] ]Third possibility is to give orders with radio commands in beginning of the mission. But I would like to avoid this if possible, since some players just never seem to listen or pay attention...

    You can use sideRadio command. Or you mean something with radio-triggers?


  2. Nope and nope thanks anyways guys.

    Figured it out by the way -

    {[_x] Exec "Scriptname"} forEach _array

    You can also use

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"[_x] Exec ""Scriptname""" forEach _array

    for OFP v.<1.85


  3. I can not help you with onPlayerDead script. All I know is that it shoud be ended by enableEndDialog.

    In your modification try to use global varible x instead of local variable _x.

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

    _code2=format["x=(getdammage %1)", _unit]

    _code=_code+format["%1 damage: %2\n",_unit,x]

    Or you can use already used global variable dd (instead of _x). It saves you one variable wink_o.gif


  4. [bob,["m1","m2","m3"]] exec "markermove.sqs"

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

    _unit = _this select 0

    _grp = group _unit

    _markersarray = _this select 1

    _allmarkers = count _markersarray

    ...


  5. Try this script:

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

    _units=["a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13"]

    ;CHECKING SOLDIERS

    _i=0

    _dead=[]

    #loop1

    _unit=_units select _i

    _code=format["dd=!(alive %1)",_unit]

    call _code

    ~0.001

    ?dd:_dead=_dead+[_unit]

    _i=_i+1

    ?_i<count _units:goto "loop1"

    ;CREATING RESULTS

    ?count _dead==0:goto "end"

    _i=0

    _units=[]

    _code=""

    #loop2

    _unit=_dead select _i

    _code=_code+format["%1 is dead\n",_unit]

    _i=_i+1

    dd=false

    ;10 names on page (11 lines on page)

    ?(_i mod 10)==0:dd=true

    ?(_i==count _dead):_units=_units+[_code+"--end of list"];_code=""

    ?(dd and _i!=count _dead):_units=_units+[_code+">>next page"];_code=""

    ~0.001

    ?_i<count _dead:goto "loop2"

    ;SHOWING RESULTS

    _i=0

    #loop3

    _code=_units select _i

    cutText [format["%1",_code],"plain"]

    ;pause between pages

    ~10

    _i=_i+1

    ?_i<count _units:goto "loop3"

    #end

    bb=nil

    exit

    Put names of your named units as strings into array _units. (example: you have soldier named west1 -> put "west1" into array). They can be from any side.

    You can run script anytime during the mission, but you should use it as part of onPlayerKilled.sqs. Modify script as you wish.

    But better way of showing results can be dialog with scrollbars. But I can not work with dialogs in OFP.

    and your VB example in OFP:

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

    Mystring1 = "West1:"

    Myinteger1 =1

    Mystring1 = format["%1%2",Mystring1,Myinteger1]

    hint Mystring1result is: West1:1

    or

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

    Mystring1 = "West1"

    Myinteger1 =1

    Mystring1 = format["%1: %2",Mystring1,Myinteger1]

    hint Mystring1result is: West1: 1


  6. Have you tested that in OFP?

    Because # mod 1 has worked for me in the past...

    Yes, I tested it in OFP.

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

    a mod b

    Operand types:

       a: Number

       b: Number

    Type of returned value:

       Number

    Description:

       remainder of a divided by b. Note remainer is calculated in real domain.

    Example:

       3 mod 2 , result is 1


  7. write <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"Civilian" createUnit [getMarkerPos "house" ,zombies, "houseZombie=this"]

    mind the M in zombies!

    Thanks. Post updated.

    @LoneSoldier:

    you need marker "house"

    and then do it RED's way or place civilian on the map and into his init line put:

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

    zombies = group this; deletevehicle this


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

    "Civilian" createUnit [getMarkerPos "house" , zombies, "houseZombie=this"]

    ~1

    houseZombie move getPos player

    @houseZombie distance player <2

    houseZombie action ["strokefist"]

    These are the basics you need.


  9. Name the group: put into leader's init line

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

    and then condition is:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"alive _x" count (units sqad) == 0


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

    #start

    westspawn = random 10

    eastspawn = random 10

    westspawn=westspawn-(westspawn%1)

    eastspawn=eastspawn-(eastspawn%1)

    _w=format["respawn%1",westspawn]

    _e=format["respawn%1",eastspawn]

    "respawn_west" setMarkerPos getMarkerPos _w

    "respawn_east" setMarkerPos getMarkerPos _e

    ~10

    goto "start"

    But there can be both respawns at the same place in the same time.  rock.gif


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

    #start

    ~_wait

    _dam=10 * (getDammage _unit)

    _dam=_dam-(_dam%1)

    goto (format["%1",_dam])

    #0

    goto "start"

    #1

    ...

    goto "start"

    #2

    ...

    goto "start" wink_o.gif

    The pictures must be (somehow) defined in description.ext and then called by titleRsc.


  12. I think it's not possible.

    Maybe in the campaign it's possible with the weaponPool commands :

    crate ... name of the empty crate

    m16 ... activating weapon

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

    clearWeaponPool

    #loop

    pickweaponPool crate

    ~1

    ?queryWeaponPool "m16" <1:goto "loop"

    hint "action"

    not tested and it'll destroy actual campaign weapon pool !


  13. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (bn880 @ April 19 2003,17:36)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (The Corinthian @ April 19 2003,11:14)</td></tr><tr><td id="QUOTE">a) If the player is already in a vehicle when the script is called do I first have to eject/unassign him from that vehicle before reassigning him to the recently moved parachute?<span id='postcolor'>

    I don't think you have to move/unassign frist.  Anyone else?<span id='postcolor'>

    You don't need to unnasign him. But you must setpos or eject him out of the vehicle.


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

    _number=random 10

    _number=_number-(_number mod 1)

    <span id='postcolor'>

    or better

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

    _number=random 10

    _number=_number-(_number%1)

    <span id='postcolor'>


  15. Thanks. It's clear now. smile.gif

    Just few another questions :

    I can use math macros. example: #define plus(_x,_y) (_x+_y)

    1a)Can I use any (non reserved) names for macro variables? example #define plus2(_frt,_pke,_hoho) (_frt+_pke+_hoho)

    1b)I presume I can not use names of macro variables in the body of function. Am I right?

    example: private ["_x","_frt"];

    I can also use commands macros. examples:

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

    #define kill(_x) _x setDamage 1

    #define minus2(_x,_y) [_x,_y] call loadFile "minus2.sqf"

    ...

    kill(player);

    _v=minus2(4,6);

    ...

    <span id='postcolor'>

    2a)Can I include somehow "minus2.sqf" into macro?

    model example:

    minus2.sqf

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

    private ["_a","_b","_c"];

    _a=_this select 0;

    _b=_this select 1;

    if (_a>=_b) then {_c=_a-_b} else {_c=_b-_a};

    _c=2*_c;

    _c

    <span id='postcolor'>

    transformed into:

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

    #define minus(_x,_y) if (_x>=_y) then {_z=_x-_y} else {_z=_y-_x};_z=2*_z;_z

    <span id='postcolor'>

    2b)Or definition must be one line code* with variables that are "defined" in arguments?

    *If not, how compiler recognize end of definition?

×