-
Content Count
1041 -
Joined
-
Last visited
-
Medals
-
Medals
-
Everything posted by silola
-
Simple Group spawn script
silola replied to wiggum2's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi again, I've tested your script and found one bug... wrong: right: now have fun :D Greeting Silola -
Simple Group spawn script
silola replied to wiggum2's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi m8 :) this ... _Marker = _this select 0; _MarkerX = getMarkerSize _marker select 0; _MarkerY = getMarkerSize _marker select 1; _Markerdir = Markerdir _marker; and this ... _Targetmarker = _this select 6; _targetmarkerX = getMarkerSize _Targetmarker select 0; _targetMarkerY = getMarkerSize _targetmarker select 1; ... could be a mistake, because I think Arma interprets this as follows: _Marker = _this select 0; _MarkerX = getMarkerSize (_marker select 0); _MarkerY = getMarkerSize (_marker select 1); _Markerdir = Markerdir _marker; so please try this first: _Marker = _this select 0; _MarkerX = ((getMarkerSize _marker) select 0); _MarkerY = ((getMarkerSize _marker) select 1); _Markerdir = Markerdir _marker; and this ... _Targetmarker = _this select 6; _targetmarkerX = ((getMarkerSize _Targetmarker) select 0); _targetMarkerY = ((getMarkerSize _targetmarker) select 1); maybe it helps you ;) Greeting Silola -
Hi, really Awesome. It looks very natural. I like your style :) I hope to see more pictures soon ;) Grreting Silola
-
DAC V2.1 (WIP) discussion
silola replied to silola's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
Hi :) @anfiach Sorry, but what do u mean exactly? @DMarkwick I like that idea :) I think the main problem is that the waypoints are unknown, which are used by the groups. For example, if DAC is generated in a zone 50 waypoints and 2 infantry groups, and each group gets 10 waypoints at random from the waypoint pool, then it is only known that minimum 10 and maximum 20 waypoints are used from the pool. Nothing else. But there is a simple solution to determine the correct waypoints, if someone knows the internal data of DAC, as I do :D I have prepared a small example which you can try with the old DAC version. First you need a global array to save all the waypoints that are actually used (for example from Zone "Z1"): The next step is to put a magic string into the "DAC_Config_Events" and load this event with your zone: _Events_Unit_S = [ ["{if(!(_x in WpFromZone1)) then {WpFromZone1 = WpFromZone1 + [_x]}}foreach _wparray"], [], [], [], [], [] ]; This entry takes the waypoints from each group and stores them in the global array "WpFromZone1". You notice the local Var "_wparray"? Before a group is generated, the waypoints are already chosen and are cached in this array. After a group is generated, the array is passed along with the group information to the main movement script. The waypoints are saved as string and the array WpFromZone1 looks like this: The last step is to start a script that processes all the positions (waypoints). The following script looks at each position for a building within a radius of 100 meters (as in your example), and generates (if possible) a random weaponbox at a random positions, with a probability of 70% Hint: the script is not tested. private ["_buildings","_positions","_weaponBoxes","_nextWP","_nextBuilding","_posLogic","_i","_c","_randomPos","_randomUse","_randomBox","_newObj","_countObj"]; _buildings = [];_positions = [];_nextWP = [];_nextBuilding = objNull;_i = 0;_c = 0;_newObj = objNull; _posLogic = "logic" createvehiclelocal [0,0,0];_randomPos = 1;_randomUse = 70;_countObj = 0; _weaponBoxes ["USBasicWeaponsBox","USLaunchersBox","USSpecialWeaponsBox"]; while{_i < count WpFromZone1} do { _nextWP = call compile (WpFromZone1 select _i); _posLogic setpos _nextWP; _nextBuilding = nearestBuilding _posLogic; if(((!(isNull _nextBuilding)) && (!(_nextBuilding in _buildings)) && ((_nextBuilding distance _posLogic) < 100)) then { if(((_nextBuilding buildingpos 1) select 0) == 0) then { _i = _i + 1; } else { _buildings = _buildings + [_nextBuilding]; if((random 100) < _randomUse) then { _c = 1; while{(((_nextBuilding buildingpos _c) select 0) > 0)} do {_positions = _positions + [_c];_c = _c + 1}; _randomPos = (random ((count _positions) - 1));_randomBox = (random ((count _weaponBoxes) - 1)); _newobj = (_weaponBoxes select _randomBox) createvehicle (_nextBuilding buildingpos _randomPos); _newobj setpos (_nextBuilding buildingpos _randomPos);_countObj = _countObj + 1; }; _i = _i + 1; }; } else { _i = _i + 1; }; }; player sidechat format["%1 weaponboxes created.",_countObj]; Maybe u can test this solution and give me some feedback ;-) Greeting Silola ---------- Post added at 06:57 PM ---------- Previous post was at 05:32 PM ---------- Hi and sorry, I found 3 bugs within the script (after my first test @home) :p Here the final version: private ["_buildings","_positions","_weaponBoxes","_nextWP","_nextBuilding","_posLogic","_i","_c","_randomPos","_randomUse","_randomBox","_newObj","_countObj"]; _buildings = [];_positions = [];_nextWP = [];_nextBuilding = objNull;_i = 0;_c = 0;_newObj = objNull; _posLogic = "logic" createvehiclelocal [0,0,0];_randomPos = 1;_randomUse = 70;_countObj = 0; _weaponBoxes = ["USBasicWeaponsBox","USLaunchersBox","USSpecialWeaponsBox"]; while{_i < count WpFromZone1} do { _nextWP = call compile (WpFromZone1 select _i); _posLogic setpos _nextWP; _nextBuilding = nearestBuilding _posLogic; if((!(isNull _nextBuilding)) && (!(_nextBuilding in _buildings)) && ((_nextBuilding distance _posLogic) < 100)) then { if(((_nextBuilding buildingpos 1) select 0) == 0) then { _i = _i + 1; } else { _buildings = _buildings + [_nextBuilding]; if((random 100) < _randomUse) then { _c = 1;_positions = []; while{(((_nextBuilding buildingpos _c) select 0) > 0)} do { _positions = _positions + [_c];_c = _c + 1; }; player sidechat format["%1",_positions]; _randomPos = (random ((count _positions) - 1));_randomBox = (random ((count _weaponBoxes) - 1)); _newobj = (_weaponBoxes select _randomBox) createvehicle (_nextBuilding buildingpos _randomPos); _newobj setpos (_nextBuilding buildingpos _randomPos);_countObj = _countObj + 1; }; _i = _i + 1; }; } else { _i = _i + 1; }; }; player sidechat format["%1 weaponboxes created.",_countObj]; Greeting Silola- 327 replies
-
- dac
- dynamic ai creator
-
(and 1 more)
Tagged with:
-
DAC V2.1 (WIP) discussion
silola replied to silola's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
Hi :) There are minor news ... As I had indicated earlier, it is now also possible to create zones in the form of an ellipse, as it appears on the following image: Another news is that the DAC can now generate objects within a zone instead of waypoints. For example, to place random empty vehicles into a specific area. Of course there are many other potential applications for this feature. I made a few extreme attempts, just to illustrate the possibilities a little bit better ;-) Here the result: Greeting Silola- 327 replies
-
- dac
- dynamic ai creator
-
(and 1 more)
Tagged with:
-
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi :) sorry for the delayed response. Below, the new version with correct distance calc ... private ["_vcl","_val","_pos1","_pos2","_action1","_action2","_dist","_diff","_log1","_log2"]; _val = _this select 0;_pos1 = [];_pos2 = [];_dist = 0;_action1 = true;_action2 = true; mString = "";_vcl = objNull;_log1 = objNull;_log2 = objNull;_diff = 0; waituntil{time > 2}; if((isServer) && (!(local player))) then { _val = 1; } else { if(_val == 0) then { [1] execVM "jumpdistance.sqf"; _log1 = "logic" createvehiclelocal [0,0,0]; _log2 = "logic" createvehiclelocal [0,0,0]; while{_action1} do { sleep 1; player sidechat format["player outside vehicle - %1",time]; if(!(alive player)) then { _action1 = false; } else { if(!(player == vehicle player)) then { _vcl = vehicle player;_action2 = true; player sidechat "Player getin vehicle"; while{_action2} do { sleep 0.01; if(((position _vcl select 2) > 1) && (!(player == vehicle player))) then { _log1 setpos position _vcl; sleep 0.2; waituntil{(((position _vcl select 2) < 1) || (player == vehicle player))}; if(player == vehicle player) then { _action2 = false; player sidechat "Player getout vehicle"; } else { _log2 setpos position _vcl; _diff = ((getPosASL log1) select 2) - ((getPosASL log2) select 2); log2 setpos [(position log2 select 0),(position log2 select 1),_diff]; _dist = round(_log1 distance _log2); if(_dist > 1) then { mString = format["%2 jumped %1 meters!!!",_dist,name player]; publicvariable "mString"; }; sleep 2; player sidechat "Player has jumped"; }; } else { if(!(alive player)) then { _action2 = false;_action1 = false; } else { if(player == vehicle player) then { _action2 = false; player sidechat "Player getout vehicle"; }; }; }; }; }; }; }; } else { while{alive player} do { sleep 0.1; if(format["%1",mString] != "") then { player sidechat mString; mString = ""; sleep 1; }; }; }; }; if(_val == 0) then {{deletevehicle _x}foreach [_log1,_log2]}; Greeting Silola -
Hi :) this is only one (sqf) example for your script: private ["_player","_killer","_camera"]; {_x = objNull} foreach [_player,_killer,_camera]; if(!(forceGameOver)) then { [] exec "music.sqs"; _player = _this select 0; _killer = _this select 1; _camera = "camera" camCreate getPos _player; _camera cameraEffect ["internal","back"]; showcinemaborder False; titleText ["You have been killed!!","Plain"];titleFadeOut 5; _camera camSetTarget _player; _camera camSetRelPos [1.00,-1.00,0.00]; _camera camSetFOV 0.700; _camera camCommit 0; waituntil{camCommitted _camera}; if((_killer != _killer) || (_killer == _player)) then { _camera camSetTarget _player; _camera camSetRelPos [4.00,-4.00,4.00]; _camera camSetFOV 1.000; _camera camCommit 3; waituntil{camCommitted _camera}; _camera camSetTarget _player; _camera camSetRelPos [-15.00,15.00,10.00]; _camera camSetFOV 1.000; _camera camCommit 6; waituntil{camCommitted _camera}; } else { _camera camSetTarget _killer; _camera camSetRelPos [2.00,2.00,2.00]; _camera camSetFOV 1.000; _camera camCommit 5; waituntil{camCommitted _camera}; _camera camSetTarget _player; _camera camSetRelPos [-15.00,15.00,10.00]; _camera camSetFOV 1.000; _camera camCommit 4; waituntil{camCommitted _camera}; }; if(!(forceGameOver)) then { TitleText ["Death Penalty: 2 points!","BLACK OUT",5];titleFadeOut 1; sleep 6; player cameraEffect ["terminate","back"]; camDestroy _camera; }; }; Greeting Silola
-
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hey, that's really nice :bounce3: I'm a little bit happy, because now I can get back to my little script project :p I think u can delete the sidechats by yourself? ok, have a nice time and good luck with your mission! Greeting Silola -
DAC V2.1 (WIP) discussion
silola replied to silola's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
I crossed all my 12 fingers too :D- 327 replies
-
- dac
- dynamic ai creator
-
(and 1 more)
Tagged with:
-
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok, now I've added some sidechats to see what happens within the script. I've also changed the code a little bit...give it a try :p private ["_vcl","_val","_pos1","_pos2","_action1","_action2","_dist"]; _val = _this select 0;_pos1 = [];_pos2 = [];_dist = 0;_action1 = true;_action2 = true;mString = "";_vcl = objNull; waituntil{time > 2}; if((isServer) && (!(local player))) then { //exit; } else { if(_val == 0) then { [1] execVM "jumpdistance.sqf"; while{_action1} do { sleep 1; player sidechat format["player outside vehicle - %1",time]; if(!(alive player)) then { _action1 = false; } else { if(!(player == vehicle player)) then { _vcl = vehicle player;_action2 = true; player sidechat "Player getin vehicle"; while{_action2} do { sleep 0.01; if(((position _vcl select 2) > 1) && (!(player == vehicle player))) then { _pos1 = format["%1",position _vcl]; sleep 0.2; waituntil{(((position _vcl select 2) < 1) || (player == vehicle player))}; if(player == vehicle player) then { _action2 = false; player sidechat "Player getout vehicle"; } else { _pos2 = format["%1",position _vcl]; _dist = call compile format["round(%1 distance %2)",_pos1,_pos2]; if(_dist > 1) then { mString = format["%2 jumped %1 meters!!!",_dist,name player]; publicvariable "mString"; }; sleep 2; player sidechat "Player has jumped"; }; } else { if(!(alive player)) then { _action2 = false;_action1 = false; } else { if(player == vehicle player) then { _action2 = false; player sidechat "Player getout vehicle"; }; }; }; }; }; }; }; } else { while{alive player} do { sleep 0.1; if(format["%1",mString] != "") then { player sidechat mString; mString = ""; sleep 1; }; }; }; }; -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok, looks good to me too ;) I hope we get it final today ... *lookingforsolutionnow* ---------- Post added at 07:37 PM ---------- Previous post was at 07:32 PM ---------- Ok, I've found the (my) mistake :p Here the newest version: private ["_vcl","_val","_pos1","_pos2","_action1","_action2","_dist"]; _val = _this select 0;_pos1 = [];_pos2 = [];_dist = 0;_action1 = true;_action2 = true;mString = "";_vcl = objNull; waituntil{time > 2}; if((isServer) && (!(local player))) then { //exit; } else { if(_val == 0) then { [1] execVM "jumpdistance.sqf"; while{_action1} do { sleep 1; if(!(alive player)) then { _action1 = false; } else { if((player != vehicle player) && (player == driver (vehicle player))) then { _vcl = vehicle player;_action2 = true; while{_action2} do { sleep 0.01; if((position _vcl select 2) > 1) then { _pos1 = format["%1",position _vcl]; sleep 0.2; waituntil{((position _vcl select 2) < 1)}; _pos2 = format["%1",position _vcl]; _dist = call compile format["round(%1 distance %2)",_pos1,_pos2]; if(_dist > 1) then { mString = format["%2 jumped %1 meters!!!",_dist,name player]; publicvariable "mString"; }; sleep 2; } else { if(!(alive player)) then { _action2 = false;_action1 = false; } else { if((player == vehicle player) || ((player != vehicle player) && (player != driver (vehicle player)))) then { _action2 = false; }; }; }; }; }; }; }; } else { while{alive player} do { sleep 0.1; if(format["%1",mString] != "") then { player sidechat mString; mString = ""; sleep 1; }; }; }; }; Good luck again ! -
DAC V2.1 (WIP) discussion
silola replied to silola's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
Thx :) I have added the new features in the list: Greeting Silola #edit: the zone form "ellipse" is WIP (thx to CarlGustaffa for the marker tip :) )- 327 replies
-
- dac
- dynamic ai creator
-
(and 1 more)
Tagged with:
-
DAC V2.1 (WIP) discussion
silola replied to silola's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
DMarkWick, thank you for your very good explanation. I myself have some problems with it, to explain the rough features of the DAC (in English) :) Greeting Silola- 327 replies
-
- dac
- dynamic ai creator
-
(and 1 more)
Tagged with:
-
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
sorry ... I found 2 errors ... my fault :mad: a new one: private ["_vcl","_val","_pos1","_pos2","_action1","_action2","_dist"]; _val = _this select 0;_pos1 = [];_pos2 = [];_dist = 0;_action1 = true;_action2 = true;mString = "";_vcl = objNull; waituntil{time > 2}; if((isServer) && (!(local player))) then { //exit; } else { if(_val == 0) then { [1] execVM "jumpdistance.sqf"; while{_action1} do { sleep 1; if(!(alive player)) then { _action1 = false; } else { if((player != vehicle player) && (player == driver (vehicle player))) then { _vcl = vehicle player; while{_action2} do { sleep 0.01; if((position _vcl select 2) > 1) then { _pos1 = format["%1",position _vcl]; sleep 0.2; waituntil{((position _vcl select 2) < 1)}; _pos2 = format["%1",position _vcl]; _dist = call compile format["round(%1 distance %2)",_pos1,_pos2]; if(_dist > 1) then { mString = format["%2 jumped %1 meters!!!",_dist,name player]; publicvariable "mString"; }; sleep 2; } else { if(!(alive player)) then { _action2 = false;_action1 = false; } else { if((player == vehicle player) || ((player != vehicle player) && (player != driver (vehicle player)))) then { _action2 = false; }; }; }; }; }; }; }; } else { while{alive player} do { sleep 0.1; if(format["%1",mString] != "") then { player sidechat mString; mString = ""; sleep 1; }; }; }; }; Greeting Silola -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello :) since OFP:R the behavior in MP has changed alot. Some things have changed only in detail but have a large impact in the area of MP. But anyway, maybe u can try the new version to see what happens? Hint: The best way to start the script, put this in your init.sqf: [0] execVM "jumpdistance.sqf" Don't forget to delete the old script calls from vehicle init. New script: private ["_vcl","_val","_pos1","_pos2","_action1","_action2","_dist"]; _val = _this select 0;_pos1 = [];_pos2 = [];_dist = 0;_action1 = true;_action2 = true;mString = "";_vcl = objNull; waituntil{time > 2}; if(isServer && (!(local player)) then { //exit; } else { if(_val == 0) then { [1] execVM "jumpdistance.sqf"; while{_action1} do { sleep 1; if(!(alive player)) then { _action1 = false; } else { if((player != vehicle player) && (player == driver (vehicle player))) then { _vcl = vehicle player; while{_action2} do { sleep 0.01; if((position _vcl select 2) > 1) then { _pos1 = format["%1",position _vcl]; sleep 0.2; waituntil{((position _vcl select 2) < 1)}; _pos2 = format["%1",position _vcl]; _dist = call compile format["round(%1 distance %2)",_pos1,_pos2]; if(_dist > 1) then { mString = format["%2 jumped %1 meters!!!",_dist,name player]; publicvariable "mString"; }; sleep 2; } else { if(!(alive player)) then { _action2 = false;_action1 = false; } else { if((player == vehicle player) || ((player != vehicle player) && (player != driver (vehicle player)))) then { _action2 = false; }; }; }; }; }; }; }; } else { while{alive player} do { sleep 0.1; if(format["%1",mString] != "") then { player sidechat _string; mString = ""; sleep 1; }; }; }; }; Greeting Silola -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi :) I think we must start a script for each player, and not for each vehicle. That's the main problem. I will write a new script and will see how it works ;) Two little questions: - The name of the script is still "jumpdistance.sqf" ? - The script is stored in the main folder of your mission ? cu later Silola -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok, last try for today :p private ["_vlc","_pos1","_pos2","_action1","_action2"]; _pos1 = [];_pos2 = [];mDistance = -1;_action1 = true;_action2 = true;_vcl = objNull;mDriver = ""; if(typeName _this == "ARRAY") then {_vcl = _this select 0} else {_vcl = _this}; waituntil{time > 2}; if(isServer) then { while{_action1} do { waituntil{((_vcl emptyPositions "driver") == 0)}; sleep 0.1; if(!(58 in toArray(name driver _vcl))) then { mDriver = str(name driver _vcl);publicvariable "mDriver"; while{_action2} do { sleep 0.01; if((position _vcl select 2) > 1) then { if(local player) then {player sidechat "measuring jump distance"}; _pos1 = format["%1",position _vcl]; sleep 0.2; waituntil{((position _vcl select 2) < 1)}; _pos2 = format["%1",position _vcl]; mDistance = call compile format["round(%1 distance %2)",_pos1,_pos2]; if(mDistance > 1) then { publicvariable "mDistance"; if(local player) then { player sidechat format [ "%2 jumped %1 meters!!!", mDistance, mDriver ]; }; }; sleep 2; } else { if((getdammage _vcl) == 1) then { _action2 = false;_action1 = false; if(local player) then {player sidechat "vehicle destroyed"}; } else { if((_vcl emptyPositions "driver") == 1) then {_action2 = false}; }; }; }; }; }; } else { while{_action1} do { waituntil{(mDistance > 0) || ((getdammage _vcl) == 1)}; if(mDistance > 0) then { sleep 1; player sidechat "measuring jump distance"; player sidechat format [ "%2 jumped %1 meters!!!", mDistance, mDriver ]; mDistance = -1;mDriver = ""; sleep 0.5; } else { player sidechat "vehicle destroyed";_action1 = false; }; }; }; sorry for my bad mp skill :( -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Maybe a timing prob. The following version is with larger breaks: private ["_vlc","_startgl","_landlogic","_action"]; _startgl = objNull;_landlogic = objNull;mDistance = -1;_action = true;_vcl = objNull;mDriver = ""; if(typeName _this == "ARRAY") then {_vcl = _this select 0} else {_vcl = _this}; if(isServer) then { _startgl = "logic" createvehiclelocal [0,0]; _landlogic = "logic" createvehiclelocal [0,0]; while{_action} do { sleep 0.01; if((position _vcl select 2) > 1) then { if(local player) then {player sidechat "measuring jump distance"}; _startgl setpos position _vcl; waituntil{((position _vcl select 2) < 1)}; _landlogic setpos position _vcl; mDriver = str(name driver _vcl);publicvariable "mDriver"; mDistance = round(_startgl distance _landlogic); publicvariable "mDistance";publicvariable "mDriver"; if(local player) then { player sidechat format [ "%2 jumped %1 meters!!!", mDistance, mDriver ]; }; sleep 2; } else { if((getdammage _vcl) == 1) then { _action = false; if(local player) then {player sidechat "vehicle destroyed"}; deletevehicle _startgl;deletevehicle _landlogic; }; }; }; } else { while{_action} do { waituntil{(mDistance > 0) || ((getdammage _vcl) == 1)}; if(mDistance > 0) then { sleep 1; player sidechat "measuring jump distance"; player sidechat format [ "%2 jumped %1 meters!!!", mDistance, mDriver ]; mDistance = -1;mDriver = ""; sleep 0.5; } else { player sidechat "vehicle destroyed";_action = false; }; }; }; :j: try it -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Good luck with this code (Please the same procedures as before) ;) : private ["_vlc","_startgl","_landlogic","_action"]; _startgl = objNull;_landlogic = objNull;mDistance = -1;_action = true;_vcl = objNull;mDriver = ""; if(typeName _this == "ARRAY") then {_vcl = _this select 0} else {_vcl = _this}; if(isServer) then { _startgl = "logic" createvehiclelocal [0,0]; _landlogic = "logic" createvehiclelocal [0,0]; while{_action} do { sleep 0.01; if((position _vcl select 2) >= 1) then { mDistance = 0;publicvariable "mDistance"; mDriver = format["%1",name (driver _vcl)];publicvariable "mDriver"; if(local player) then {player sidechat "measuring jump distance"}; _startgl setpos position _vcl; waituntil{((position _vcl select 2) < 1)}; _landlogic setpos position _vcl; mDistance = round(_startgl distance _landlogic); publicvariable "mDistance"; if(local player) then { player sidechat format [ "%2 jumped %1 meters!!!", mDistance, mDriver ]; }; sleep 0.1; } else { if((getdammage _vcl) == 1) then { _action = false; if(local player) then {player sidechat "vehicle destroyed"}; deletevehicle _startgl;deletevehicle _landlogic; }; }; }; } else { while{_action} do { waituntil{(mDistance > -1) || ((getdammage _vcl) == 1)}; if(mDistance > -1) then { player sidechat "measuring jump distance"; waituntil{(mDistance > 0)}; player sidechat format [ "%2 jumped %1 meters!!!", mDistance, mDriver ]; mDistance = -1;mDriver = ""; sleep 0.1; } else { player sidechat "vehicle destroyed";_action = false; }; }; }; Greeting Silola -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok, next I will try to change the code a little bit to fix the p3d message error... :cool: -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok, thx for report. please try this (just to see what happens): Use only one bike in a test mission, so that the script is starting only one time. Then zombie drive the first round ... be careful what happens about the distance (synched?). After this action, zombie gets out and you get in and drive the second round. What happens then? First we have to fix this distance problem ;) Greeting Silola -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi, maybe you have made an error while paste© the script? On the other hand, I see two unnecessary ";" characters. So, we made a new test :) private ["_vlc","_startgl","_landlogic","_action"]; _startgl = objNull;_landlogic = objNull;mDistance = -1;_action = true;_vcl = objNull; if(typeName _this == "ARRAY") then {_vcl = _this select 0} else {_vcl = _this}; if(isServer) then { _startgl = "logic" createvehiclelocal [0,0]; _landlogic = "logic" createvehiclelocal [0,0]; while{_action} do { sleep 0.01; if((position _vcl select 2) >= 1) then { mDistance = 0;publicvariable "mDistance"; if(local player) then {player sidechat "measuring jump distance"}; _startgl setpos position _vcl; waituntil{((position _vcl select 2) < 1)}; _landlogic setpos position _vcl; mDistance = round(_startgl distance _landlogic); publicvariable "mDistance"; if(local player) then { player sidechat format [ "%2 jumped %1 meters!!!", mDistance, if(format["%1",driver _vcl] == "<NULL-object>") then {_vcl} else {name driver _vcl} ]; }; sleep 1; } else { if((getdammage _vcl) == 1) then { _action = false; if(local player) then {player sidechat "vehicle destroyed"}; deletevehicle _startgl;deletevehicle _landlogic; }; }; }; } else { while{_action} do { waituntil{(mDistance > -1) || ((getdammage _vcl) == 1)}; if(mDistance > -1) then { player sidechat "measuring jump distance"; waituntil{(mDistance > 0)}; player sidechat format [ "%2 jumped %1 meters!!!", mDistance, if(format["%1",driver _vcl] == "<NULL-object>") then {_vcl} else {name driver _vcl} ]; mDistance = -1; sleep 1; } else { player sidechat "vehicle destroyed";_action = false; }; }; }; Good luck :) -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
hmm ... bad :confused: ok, try this one: private ["_vlc","_startgl","_landlogic","_action"]; _startgl = objNull;_landlogic = objNull;mDistance = -1;_action = true;_vcl = objNull; if(typeName _this == "ARRAY") then {_vcl = _this select 0} else {_vcl = _this}; if(isServer) then { _startgl = "logic" createvehiclelocal [0,0]; _landlogic = "logic" createvehiclelocal [0,0]; while{_action} do { sleep 0.01; if((position _vcl select 2) >= 1) then { mDistance = 0;publicvariable "mDistance"; if(local player) then {player sidechat "measuring jump distance"}; _startgl setpos position _vcl; waituntil{((position _vcl select 2) < 1)}; _landlogic setpos position _vcl; mDistance = round(_startgl distance _landlogic); publicvariable "mDistance"; if(local player) then { player sidechat format [ "%2 jumped %1 meters!!!", mDistance, if(format["%1",driver _vcl] == "<NULL-object>") then {_vcl} else {name driver _vcl}; ]; }; sleep 1; } else { if((getdammage _vcl) == 1) then { _action = false; if(local player) then {player sidechat "vehicle destroyed"}; deletevehicle _startgl;deletevehicle _landlogic; }; }; }; } else { while{_action} do { waituntil{(mDistance > -1) || ((getdammage _vcl) == 1)}; if(mDistance > -1) then { player sidechat "measuring jump distance"; waituntil{(mDistance > 0)}; player sidechat format [ "%2 jumped %1 meters!!!", mDistance, if(format["%1",driver _vcl] == "<NULL-object>") then {_vcl} else {name driver _vcl}; ]; mDistance = -1; sleep 1; } else { player sidechat "vehicle destroyed";_action = false; }; }; }; Greeting Silola -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
:) np. And yes, Arma community is great ! The script checks how the parameter is passed. For example: check = [vehicle] execVM "jumpdistance.sqf" >>> within an array check = vehicle execVM "jumpdistance.sqf" >>> without an array -
tweaking an old script
silola replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok, a new try ;) ... private ["_vlc","_startgl","_landlogic","_action"]; _startgl = objNull;_landlogic = objNull;mDistance = -1;_action = true;_vcl = objNull; if(typeName _this == "ARRAY") then {_vcl = _this select 0} else {_vcl = _this}; if(isServer) then { _startgl = "logic" createvehiclelocal [0,0]; _landlogic = "logic" createvehiclelocal [0,0]; while{_action} do { sleep 0.01; if((position _vcl select 2) >= 1) then { mDistance = 0;publicvariable "mDistance"; if(local player) then {player sidechat "measuring jump distance"}; _startgl setpos position _vcl; waituntil{((position _vcl select 2) < 1)}; _landlogic setpos position _vcl; mDistance = round(_startgl distance _landlogic); publicvariable "mDistance"; if(local player) then {player sidechat format ["%2 jumped %1 meters!!!",mDistance, name driver _vcl]}; sleep 1; } else { if((getdammage _vcl) == 1) then { _action = false; if(local player) then {player sidechat "vehicle destroyed"}; deletevehicle _startgl;deletevehicle _landlogic; }; }; }; } else { while{_action} do { waituntil{(mDistance > -1) || ((getdammage _vcl) == 1)}; if(mDistance > -1) then { player sidechat "measuring jump distance"; waituntil{(mDistance > 0)}; player sidechat format ["%2 jumped %1 meters!!!",mDistance, name driver _vcl]; mDistance = -1; sleep 1; } else { player sidechat "vehicle destroyed";_action = false; }; }; }; ... and this script call is right (from init line): maybe it's better to use the right name: Greeting Silola ---------- Post added at 03:53 PM ---------- Previous post was at 03:33 PM ---------- You can also try to start the script from an init.sqf like this: // the names of all vehicle placed in the editor; _myVehicles = [car1,car2,car3,car4]; //start the script for all vehicles; {[_x] execVM "jumpdistance.sqf"}foreach _myVehicles; Greeting Silola
