Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. /*
  2. __ __ _ _ _ _____ __ _ _ _ _______ _
  3. \ \ / / | | | | (_) / ____| / _| (_) | | |__ __| | |
  4. \ \ /\ / /__ _ __| | __| | _ _ __ | | ___ _ __ | |_| |_ ___| |_ | | ___ ___ | |
  5. \ \/ \/ / _ \| '__| |/ _` | | | '_ \ | | / _ \| '_ \| _| | |/ __| __| | |/ _ \ / _ \| |
  6. \ /\ / (_) | | | | (_| | | | | | | | |___| (_) | | | | | | | | (__| |_ | | (_) | (_) | |
  7. \/ \/ \___/|_| |_|\__,_| |_|_| |_| \_____\___/|_| |_|_| |_|_|\___|\__| |_|\___/ \___/|_|
  8.  
  9. ,---. ,---. ,--.,--.,--. ,--.,--.
  10. / O \ ,--.--.,--,--,--. / O \ | || || ,---. ,---. | |`--' ,---.
  11. | .-. || .--'| || .-. || || || .-. || .-. || |,--.| .--'
  12. | | | || | | | | || | | || || || | | |' '-' '| || |\ `--.
  13. `--' `--'`--' `--`--`--'`--' `--'`--'`--'`--' `--' `---' `--'`--' `---'
  14.  
  15. Takes the base type, generates lists and makes trigger zones for you :)
  16. */
  17. _baseType = "";
  18. _baseType = _this select 0;
  19. _trigRadius = _this select 1;
  20. _trigTime = _this select 2;
  21.  
  22. /* Generates the list of the bases, checks first if they exist in the editor!!! */
  23. _flaglist = [];
  24. _genericBase = "";
  25.  
  26. for "_i" from 0 to WICT_flagLoopLimit do
  27. {
  28. call compile format ["_markerType = getMarkerType ""%1_%2""; if (_markerType !="""") then {_flaglist = _flaglist + [""%1_%2""];};",_baseType,_i];
  29. };
  30.  
  31. //diag_log format ["Flag list : %1",_flaglist];
  32.  
  33. /* Putting flags in the lists and creating triggers. */
  34. {
  35. _marker = _x;
  36.  
  37. /* Puts the flag in a appropriate list according to the color in editor */
  38. if (getMarkerColor _marker == "ColorBlue") then {WICT_wbl = WICT_wbl + [_marker];};
  39. if (getMarkerColor _marker == "ColorRed") then {WICT_ebl = WICT_ebl + [_marker];};
  40. if (getMarkerColor _marker == "ColorBlack") then {WICT_nbl = WICT_nbl + [_marker];};
  41.  
  42. /* Creates necessary triggers */
  43.  
  44. _trgW = createTrigger["EmptyDetector",getMarkerPos _marker];
  45. _trgW setTriggerArea[_trigRadius,_trigRadius,0,false];
  46. _trgW setTriggerActivation["ANY","PRESENT",true];
  47. _trgW setTriggerTimeout [(_trigTime select 0),(_trigTime select 1),(_trigTime select 2),false];
  48.  
  49. _string = format ["WICT_flag = [""west"",[""%1""],""none"",1]; publicVariable ""WICT_flag"";",_marker];
  50.  
  51. _trgW setTriggerStatements["west countSide thisList > 0",_string,""];
  52.  
  53.  
  54.  
  55. _trgE = createTrigger["EmptyDetector",getMarkerPos _marker];
  56. _trgE setTriggerArea[_trigRadius,_trigRadius,0,false];
  57. _trgE setTriggerActivation["ANY","PRESENT",true];
  58. _trgE setTriggerTimeout [(_trigTime select 0),(_trigTime select 1),(_trigTime select 2),false];
  59.  
  60. _string = format ["WICT_flag = [""east"",[""%1""],""none"",1]; publicVariable ""WICT_flag"";",_marker];
  61.  
  62. _trgE setTriggerStatements["east countSide thisList > 0",_string,""];
  63.  
  64.  
  65. } forEach _flaglist;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement