Bart.Jan
-
Content Count
739 -
Joined
-
Last visited
-
Medals
Posts posted by Bart.Jan
-
-
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
-
Static objects can not be moved by setPos from v.1.90.
-
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
-
Do not end the script by camDestroy but use EnableEndDialog command.
-
It's compatibility problem. call is supported from version 1.85.
-
[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
...
-
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
-
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
-
Why not use the mod command?So do'er like this:
_wholeInteger = _number mod 1
Then you will have a whole integer to work with, I.E 1, 2, 3, 4...
edit
To make it easier for you:
_wholeIntegerWestSpawn = westspawn mod 1
0.999 mod 1 = 0.999
1.5 mod 1 = 0.5
9.25 mod 1 = 0.25
10 mod 1 = 0
-
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
-
<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.
-
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
-
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.
-
<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. Â
-
But why you use the nearestobject?A little extra cpu usage I think because I believe _this select 4 gives the ammo and you can just get the pos of that.
It returns type of ammo (string), not the projectile (object) itself.
-
<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.
-
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 !
-
clearMagazineCargo unit
clearWeaponCargo unit
-
Or you can group sqad leader with each of these markers and sqad members set to start in formation.
-
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.
-
</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.
-
</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'>
-
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?
-
Thanks for the tip, but there is nothing about macros. I found nothing about macros in tutorials and in any function there.
Multiple briefings / multiple intros
in OFP : MISSION EDITING & SCRIPTING
Posted
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?