Any idea how to get these scripts to work serversided but to be shown client side (show all west damage/deaths)?
Any idea how to get these scripts to work serversided but to be shown client side (show all west damage/deaths)?
Somehow never dug into the secrets of MP scripting, so can't help. I know only, what is written here:
"createMarker is global, use createMarkerLocal if you want to create a marker locally"
Whether it does not mean precisely what is needed? If not, then maybe someone else can help here.
Spoiler:
I'll test it and see how we get on![]()
More improvements:
http://www8.zippyshare.com/v/92714120/file.html
- spawned during mission units/vehicles are (should be) considered;
- "Blood Drops" is side sensitive, set for "west" currently;
- resolved problem with side of destroyed vehicles (is always civilian, so implemented some setVariable for each vehicle containing its initial side), so "KIA Sparks" also can be in this version side-sensitive, and is;
- easy way to set for given side(s) - see init.sqf for each demo to know, how to initialize for chosen side or sides. This is achieved by adding a letter in quotes to array before execVM. These letters are: "W" for west, "E" for east "R" for resistance and "C" for civilian. Any combination of counted sides may be achieved this way. Order is not important, but it is (I suppose) case-sensitive. Example of init.sqf of both scripts:
and init by in-editor init field of unit/object/trigger/whatever:PHP Code:["E","W"] execVM "BDStart.sqf";
["W","E","R"] execVM "KIAStart.sqf";
- both are slightly heavier for CPU now.Code:nul = ["W","E"] execVM "BDStart.sqf";nul = ["W","E","R"] execVM "KIAStart.sqf";
Not tested with any "spawner" script, but I hope, these work fine.
EDIT: And some more "real combat" Chernaruss demo, that combinig both scripts. First markers should be on map after a minute or so, when fight gets more intense.
BD-KIASdemo
Known issue: sometimes some blood drop may be duplicated and stay on map even, if should disappear (rare). Not sure, why, but hey, it is hard to wash off blood, is not it?
Last edited by Rydygier; Apr 24 2012 at 11:17.
AVIBIRD 1
When playing this game, Keep Chuck Norris home!
If they make this game, They will play!
The truth is out there, If you look!
"Blood Drops" still needs some attention. Work in progress...
Excellent work mate. This is just great. I love seeing these spots appearing, and when you have 300 units in a battle there are a LOT![]()
"MEMENTO MORI, or a sad story about life, death and veng... and miserable life of scripter"
As is known, each unit after death becomes civilian side.
So how to determine, to which side belonged unit before?
Had only one idea: to give all units "dog tags", means setVariable with hardcoded side to retrive by getVariable from the body, and this seems to be enough for vehicles in "KIA Sparks" (script works) but...
...after some tests with "Blood Drops" I noticed, that units of proud names such as "O 1-1-A:1" and similar shortly after death remain only as pitiful remnants kind of "1e5a6900# 17507: soldier_light.p3d".![]()
In this moment value stored by setVariable seems to be gone...![]()
![]()
Ergo there is no known to me method of retrieving initial side of dead unit from its body...
So what to do with side filter in "Blood Drops"? I see five possibilities:
1. To sift units of chosen side at the beginning and to store them in an separate array. But this is bad idea, because then all spawned later units will be ignored;
2. To change sides with factions (filtering by faction, not by side). But this is bad idea, because then will be excluded non-generic factions (from unofficial addons);
3. To count damage of only wounded, and ignore dead;
4. To count wounded of chosen side and all dead, regardless of side;
5. To use procedure described by me yesterday, and to make, that every just spawned unit will be somehow added to array of counted by script units, if is of chosen side - but here method is dependent of used spawning script (code must be added to the spawner, not to the counter).
Last one combined with first looks best for me, but if this should be universal visualiser, then 4th option becomes most promising.
Does it matter who dies ? A death is a death, and needs to be investigated. The idea is to find the heart of the action, so from my point of view number 4 is the winner mate.
There is also sixth option: bodies will be counted as long, as they not turn into ".p3d" remnants (about 20-30 sec. ?) here is same demo as above with rewritten in a such way "Blood Drops":
BD&KIASdemo
and here is with option 4:
BD&KIASdemoB
(more blood and more long lasting spots)
Note: users of OA 1.57 and above will probably (I can't check) see slightly better effect, because script utilizes for "blood cleaning" additional loop with AllDead command, introduced in OA 1.57.