Jump to content

sarogahtyp

Member
  • Content Count

    2494
  • Joined

  • Last visited

  • Medals

Everything posted by sarogahtyp

  1. Hey guys! This is a simple script to turn a unit into a suicide bomber which waits for a nearby player and then follows and explodes. Have fun with it. In those spoiler below u can see how to use this script with COS - Civilian Occupation System /* SSSB - Sarogahtyps Simple Suicide Bomber Description: Function can be called wherever u want even in init line. It waits for player who is in range and follows him until reached and then BOOOOM! The bomber is walking if player can see the bomber. If there is no line of sight to player then the bomber will run. Works even if the bomber is driving a vehicle. If player is out of range before bomber can reach him then the bomber will just wait for the next player in range. You can pass a chance to get a bomber to the function. This is useful for implementing the script into COS - Civilian Occupation System. You can apply the script to all civilians and if u pass e.g. 1 % as chance then only every 100th civ will become a bomber and wait for near players. Enjoy the boom. :-) Cheers Saro. Paramameters: object - the object of your unit which should become a bomber number (optional) - range to seek for players (default is 300 m) number (optional) - chance to turn the unit into a bomber. (default is 100 %) Return values: number - handle of spawned script if someone likes to check if bombers script has ended (scriptDone) will return -1 if script ends without spawning code (in case no civ was turned into bomber) */ params [["_civ", objNull,[objNull]], ["_act_range", 300, [0]], ["_chance", 100, [0]]]; if ((random 100 > _chance) || !(alive _civ)) exitWith {-1}; _handle = [_civ, _act_range] spawn { params ["_bomber", "_act_range"]; private _melee_dist = 15; private _boom_dist = 5; private _dist_target = _act_range; private _lost_range = round (_act_range * 1.2); private _act_range_sqr = _act_range ^ 2; private _melee_dist_sqr = _melee_dist ^ 2; private _boom_dist_sqr = _boom_dist ^ 2; private _dist_target_sqr = _act_range ^ 2; private _lost_range_sqr = _lost_range ^ 2; private _grp_bomber = group _bomber; private _is_vec = if (isNull objectParent _bomber) then {false} else {true}; private _target_players = []; private _wp =[]; while {(alive _bomber) && (_dist_target_sqr > _boom_dist_sqr)} do { // wait until players are in range waitUntil { sleep (2 + random 1); _target_players = (allPlayers - entities "HeadlessClient_F") select {(alive _x) && ((_x distanceSqr _bomber) < _act_range_sqr)}; ((count _target_players > 0) || !(alive _bomber)) }; // end everything if suicide bomber is already dead if !(alive _bomber) exitWith {}; // follow nearest player as long as bomber lives, target is in range and target is not close enough to boom while {alive _bomber && (_dist_target_sqr < _lost_range_sqr) && (_dist_target_sqr > _boom_dist_sqr)} do { _target_players = (allPlayers - entities "HeadlessClient_F") select {(alive _x) && ((_x distanceSqr _bomber) < _act_range_sqr)}; // get nearest player _target_players = _target_players apply {[(_x distanceSqr _bomber), _x]}; _target_players sort true; _target_plyr = _target_players select 0 select 1; // check distance and visibility _dist_target_sqr = if(count _target_players > 0) then {_target_players select 0 select 0} else {_lost_range_sqr}; _can_see = [_target_plyr, "VIEW", _bomber] checkVisibility [(eyePos _target_plyr), (eyePos _bomber)]; // add waypoint and set bombers behavior if (count _wp > 0) then {_grp_bomber setCurrentWaypoint _wp;} else {_wp = _grp_bomber addWaypoint [position _target_plyr, 0];}; _wp setWaypointPosition [position _target_plyr, 0]; _wp setWaypointBehaviour "CARELESS"; _wp setWaypointCombatMode "BLUE"; _wp setWaypointCompletionRadius 0; _grp_bomber setBehaviour "CARELESS"; _grp_bomber setCombatMode "BLUE"; //run if close enough or if target cant see bomber if ( (_can_see < 0.3) || ((_dist_target_sqr < _melee_dist_sqr) && !_is_vec) || ((_dist_target_sqr < (2 * _melee_dist_sqr)) && _is_vec) ) then { _wp setWaypointSpeed "FULL"; } else { _wp setWaypointSpeed "LIMITED"; }; sleep (0.5 + random 0.5); }; // end follow while _wp = []; }; // main while end if (_is_vec) then { _boom = createVehicle ["Bo_GBU12_LGB", getPos _bomber, [], 0, "CAN_COLLIDE"]; } else { _boom = createVehicle ["R_60mm_HE", getPos _bomber, [], 0, "CAN_COLLIDE"]; }; deleteVehicle _bomber; }; //spawn end _handle Init Line usage: COS - Integration: Changelog SSSB 1.0 -changed from distance to distanceSqr for performance reasons -fixed bug with targets distance (variable not defined) -changed return value from true to script handle to make scriptDone check available SSSB 0.9 (initial version) -just created it because of so much requests for something like this seen in forum version with sound integration:
  2. Map markers are created by adding the component MapDescriptorComponent or SCR_MapDescriptorComponent to any entity. If added to a moveable entity then marker will move with entities movement. If there is no entity at the position where you want to have a map marker at then you can just create a GenericEntity by using the Create-Subwindow of the world editor. I ll create a list with the markers which are currently possible (most of them seem to be placeholders at the moment) with the MapDescriptorComponent here: Main Type / Unit Type IMAGE
  3. Sarogahtyps Simple Loot Spawner - SSLS V-1.2 Spawns weapons, items and bags in buildings near to alive players maybe inside a trigger area or marker area. Deletes stuff if players are not close enough anymore. The script doesnt care about any trigger preferences except the trigger area. Soft delayed item spawning to prevent performance impact. Script reads your missions config files and should spawn loot of your mods (e.g. CUP weapons, Etc.) as well DOWNLOAD V-1.2 DOWNLOAD V-1.1 Usage: initServer.sqf fnc_spawn_loot = compileFinal preprocessFileLineNumbers "SSLSv1-1.sqf"; _d = [] call fnc_spawn_loot; you are able to stop the loot spawning script at any time by SSLS_script_switch_off = true; If you set up high spawn chances (see top of script) and have a high player count on your server then I recommend to make trigger or marker areas for spawning to get the needed performance. But if you do not encounter performance issues then spawning loot everywhere near players should be okay. Tweakable features (can be found on top of the script): //***** EDIT BELOW TO ADJUST MAIN BEHAVIOR // (L) means lower values are better for performance - (H) means the opposite SSLS_script_switch_off = false; //if you want to stop spawning loot then set this to true at any time in your mission _trigger_array = []; // contains the names of triggers/markers in which area loot should spawn. _spawn_chance = 100; // (L) The chance to spawn loot inside of a specific house. _launcher_chance = 30; // chance to spawn a launcher as weapon instead of rifle, pistol or machine gun _item_chance = 70; // chance to spawn an item instead of a weapon _bag_chance = 50; // chance to spawn a backpack instead of an item _max_magazines = 7; // the maximum number of magazines spawned for a gun _max_magazines_launcher = 3; // maximum number of ammo to spawn for rocket launchers _max_magazines_gl = 5; // maximum number of ammo to spawn for grenade launchers _house_distance = 25; // (L) houses with that distance to players will spawn loot _player_exclude_distance = 15; //if 2 players or more are closer together than this then only 1 player is considered _exclude_loot = []; //classnames of items which should never spawn (blacklist) _exclusive_loot = []; //add classnames here and nothing else will be spawned (whitelist) _use_bohemia_classes = true; // for spawning bohemia created stuff set this to true _use_mod_classes = true; //// for spawning stuff from loaded mods set this to true _debug = false; //information about number of places where items were spawned or deleted // if you have performance issues then consider introducing spawning areas (_trigger_array) before changing following values! _spawn_interval = 1.5; // (H) desired runtime for the main loop. time which is not needed will be used for soft spawning or a break. //***** EDIT ABOVE TO ADJUST MAIN BEHAVIOR details: Changelog 1.1 (download) -fixed a major bug which showed an error message during spawning -added feature to enable/disable Mod/Bohemia classes spawning -huge performance optimizations (shorter arrays, better smooth spawning and other stuff) Changelog 1.0 (download) -added script
  4. Saros Tweak For Higher FPS On Maps Singleplayer / Multiplayer / Eden-Editor compatible. CBA required. Server and clients need the mod. Addon deletes (by hideing) terrain objects to boost fps on maps. Its fully customizable through CBA-Settings. YOU HAVE TO ADJUST ADDON-SETTINGS IN OPTIONS MENU or the mod does nothing! See notes below for usage. It can be used by server admins to get better fps on clients. Server settings will force the client to the same settings. You are able to configure deletion percentages of rocks, trees, bushes, walls, fences and hides. Those objects are not transferred through network. Every machine executes the hiding local for itsself but the algorithm ensures that every machine deletes the same objects. This addon tries to solve fps problems in Singleplayer and Multiplayer environments caused by a heavy terrain-object count on maps. On some maps there are so many rocks, trees, bushes, walls, fences and hides that some CPUs/GPUs get to their limits and the player is forced to limit the viewdistance by far to get an acceptable framerate. Also on some maps these objects are not well optimized and fps drops occur therefore. For Serveradmins it is recommended to use a cba settings file in userconfig folder and to enable filePatching. cba settings file and user config folder is described here: CBA - Settings - Documentation This mod is on your side 🙂 Steam Workshop Singleplayer/Editor usage: 1. Open your Singleplayer/Editor mission. 2. After it is started press Escape key. 3. Then click on "Options"->"Addon Options". 4. Choose "Saro Tweak Map FPS" from the drop down menu named "ADDON". 5. Choose your prefered deletion rates. 6. Press "OK". 7. Pause Menu is disabled now until new settings are processed completely. If you have questions or suggestion just ask and/or tell! The idea for this mod was born in this thread. versions archive: version 0.4 (latest) version 0.3 version 0.21 version 0.2 (partially broken, see here) version 0.1 Full Changelog:
  5. The terms acceleration and deceleration are one-to-one interchangeable. The only difference is that some people call positive values acceleration and negative values deceleration. Others use the term acceleration for both ranges of values.
  6. @zacharypw currently I did not understand what exactly you need and what exactly you are trying. But! I know I wrote a script that predicts the position of a moving target at the time the currently used bullet or missile will hit the target if the trigger is pulled now. Or in short: The script calculates the position for a lead assist system. In those script I had to simulate the complete flight path of bullets and rockets to get the desired target position. Therefore the script should contain the information you are looking for (whatever this is). Predict Target Position If you have questions, just ask.
  7. sarogahtyp

    ı cant connet server

    Maybe this server is to far away and your ping is to high to play on it. Such connection problems are indicated by a yellow or red chain icon on the bottom right. You just cant play there. You should not connect to servers with a ping above 200ms ideally the ping should be below 100ms to have a smooth game experience.
  8. should not. You r just assigning the texture on each client with setobjecttextureglobal and u r playing the video on each client using remoteexec. That way u ensure that the video is playing on each client locally. It just could get weird if more than one player starts the video via the action menu. But idk what happens in that case. Just test it and report any problems here
  9. _screen setObjectTexture [0, _video]; should be _screen setObjectTextureGlobal [0, _video];
  10. No, i am flying littlebird, ghosthawk an huron on a vanilla domination server for some hours every day and the behavior u described is not present there. But i do not use the advanced flight model. Do you?
  11. sarogahtyp

    Help with the user interface

    This is an english only forum. Please use a translator page like https://www.deepl.com/translator if you have no english skills.
  12. sarogahtyp

    String Comparisons

    in your code you cycle through the array of strings _magsArr using a forEach loop which gives you the current string in _x. But you are comparing _x wich is a string with the array of strings _priMag. Thats the problem, primaryWeaponMagazine returns an array of strings but not a single string. Edit: you could use: _x in _priMag https://community.bistudio.com/wiki/in
  13. Yeah, I tested it now. You are absolutely right and its totaly nuts.
  14. A trigger has to check the condition after activation to recognize if it reaches deactivation state and run ondeactivation code. Thats the logic u missed. Edit: It should be like I described above but sadly it is not... see @pierremgis post below.
  15. U can use the first scripted eh to detect if player opened the pause menu: https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers But because the client could do this very often in a short time period u may want to implement some kind of spam protection for ur database updates.
  16. sarogahtyp

    Exile bikey/bisign problem!

    idk bout that text file but the server is kicking because of a wrong key signature. As you say you are playin with some friends only you could just set a password to make your server private and then set the option verifySignatures = 0; in your servers config file.
  17. sarogahtyp

    Custom image shows up black in game

    Long ago i had a similar issue woth jpg showin black from some distance. Since then i m usong .paa files only. There is also a .paa exporting plugin for gimp out on github. This makes paa converting easy with gimp...
  18. Map markers are not belonging to a group. I guess stripping the mods which created many modules did it.
  19. sarogahtyp

    Syntax question for hints

    _variable = "abc"; - local variable to script scope variable = "abc"; - global variable on executing machine missionNamespace setVariable ["variable", "abc", true]; - public variable - known on all machines
  20. sarogahtyp

    Dedicated server.

    You should post ur full .rpt file in a spoiler or on an external page like pastbin...
  21. copyToClipboard str (getItemCargo this + getWeaponCargo this + ... + ...);
  22. sarogahtyp

    AI Kills in Scoring System

    Idk if it helps but this article has some words bout scoring: https://community.bistudio.com/wiki/Arma_Reforger:Scripting_Modding
  23. Vector dir and up explanation: https://community.bistudio.com/wiki/setVectorDirAndUp Edit: read the comments and follow links for better understanding The velocity vector is just the speed in xyz directions in m/s
×