Jump to content

Bart.Jan

Member
  • Content Count

    739
  • Joined

  • Last visited

  • Medals

Everything posted by Bart.Jan

  1. one side = one briefing And you can hide and show different sections of briefing via objStatus command. I think it's possible. You can use sideRadio command. Or you mean something with radio-triggers?
  2. Bart.Jan

    Simple question

    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. Static objects can not be moved by setPos from v.1.90.
  4. Bart.Jan

    Script idea by a newb

    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
  5. Bart.Jan

    Script idea by a newb

    Do not end the script by camDestroy but use EnableEndDialog command.
  6. Bart.Jan

    Script idea by a newb

    It's compatibility problem. call is supported from version 1.85.
  7. Bart.Jan

    Script q

    [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 ...
  8. Bart.Jan

    Script idea by a newb

    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
  9. Bart.Jan

    Var and random  not working :(

    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
  10. Bart.Jan

    Var and random  not working :(

    0.999 mod 1 = 0.999 1.5 mod 1 = 0.5 9.25 mod 1 = 0.25 10 mod 1 = 0
  11. Bart.Jan

    Creating a unit

    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
  12. Bart.Jan

    Creating a unit

    <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.
  13. Bart.Jan

    One annoying question

    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
  14. Put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> "respawn_west" setMarkerPos getPos this into "on activation" line of each waypoint.
  15. Bart.Jan

    Var and random  not working :(

    <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. Â
  16. It returns type of ammo (string), not the projectile (object) itself.
  17. Bart.Jan

    Detecting a unit's dammage

    <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" The pictures must be (somehow) defined in description.ext and then called by titleRsc.
  18. 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 !
  19. clearMagazineCargo unit clearWeaponCargo unit
  20. Bart.Jan

    Setpos a whole group ?

    Or you can group sqad leader with each of these markers and sqad members set to start in formation.
  21. All that you need is "group1 = group this" in commander's init. Then use [sold1] join group1 to force man (named sold1) to join that group. Even with dead group leader the group name is already set to group1. Groupname is name of the group (group1) or name of one group member - it returns group name too.
  22. Bart.Jan

    Parachute query

    </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.
  23. Bart.Jan

    Round()

    </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'>
  24. I want know something about macros. Can anybody give me several simple examples, please? I found only one example, but it's too abstract for me. Â
  25. Bart.Jan

    Macros in functions

    Thanks. It's clear now. 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?
×