Jump to content

JCataclisma

Member
  • Content Count

    136
  • Joined

  • Last visited

  • Medals

Everything posted by JCataclisma

  1. JCataclisma

    Making enemies "flock" to gunfire

    As far as I have seen around, this script seems to me the one which offers the closest to what you'd like:
  2. JCataclisma

    Respawn AI with same name

    Hey! Take a look at the answer from _foley in the link below. I am almost sure the solution would be to set/reset a variable/name for the AI every time it despawns, or something alike. And Larrow's answer, in the same topic, has another important tip regarding Global variables.
  3. JCataclisma

    Help with spawning compositions script

    By a fortunate coincidence, we have just talked about notepad++ in another topic today, so I also ask: are you using a software like it for your code/tests, or just regular notepad/wordpad? Because when in Notepad++ (or any other script software), if you activate a language like C++, it will instantly show you everything that might be considered CODE or COMMENT 😉
  4. JCataclisma

    Help with spawning compositions script

    Similar to //comments, which will "end" at the end of the line, you can have /*/ comments /*/ or /* comments * / . Meaning, if you have more things to comment or to write that are NOT part of the code, you can add all that stuff inside /* ..... */ or /*/ .... /*/ . In your case up there, it's very likely "Grab data... " is part of a comment (note the /* before it), and if so it's probably missing its closure */ . Such things you can track more easily when you realize the game will add a symbol # right before the error it detects.
  5. JCataclisma

    WARLORD ASSET

    Please use the "code" <> option and preferably select C++ language inside it, so it will be MUCH cleaner and also show different colors to people try and look for eventual mistakes. It also avoids those html/code errors which will be shown whether we copy the code and paste it in another software for analyzing. Also would be better to use the spoiler (the eye) option, so the post won't bee too long every time we open it. 😉 It really SUCKS to have to search in a big, plain code that was just thrown here.
  6. JCataclisma

    Offset Teleport

    Oh, apologies: it was ME who had wrote it in the wrong way. What I meant was that when you put the cursor/blinker over one of those characters { [ ( / ) ] } , if it shows in regular white that means it all right, but whether it's missing it open or close pair, it will show in light red. Try and paste that line of code from your previous attempt, mouse/cursor over the parenthesis in (pb2 and you will see what I mean. 😎 That's very helpful, but as you start to play more and more with the language, you will naturally guess where something could be missing or duplicated. Although I think such feature will not help you find missing semicolons.
  7. JCataclisma

    Offset Teleport

    Usually, the game will show a # before the word/code it expects to be different. In this case, it seems to be missing the ) to close the (pb2 , so try this: this addAction ["Teleport Central",{player setPos (pb2 getRelPos [1, (random 360)])}]; Would you happen to be using wordpad or some simple text editor? Because if you try free and good stuff like Notepad++ and activate the C++ language, it will show you in different colors which of these characters are missing their enclosures 😉
  8. JCataclisma

    Offset Teleport

    Also this one
  9. JCataclisma

    Offset Teleport

    This recent post might have just what you need:
  10. You could probably try to add // deleteVehicle _item // after removeItem: // Remove the selected item _unit removeItem _item; // Delete it right after removing deleteVehicle _item; // Display a hint to inform the player about the lost item hint format ["You lost %1", displayName _item]; I think you have to remove it before delete, or it will remain on the player.
  11. I don't know if this will actually help you, but you can create a variable for the action inside the action itself, and then request the same action remove itself (again). The action will recognize it as "select # 2", so you could try: _holdForDelete = _this select 2; // add it in the first lines of the action /*/ add all the code you wish for the action here /*/ _player removeAction _holdForDelete; // this at the very end of codes inside the action, so to it remove itself But this will probably remove that action ONLY from the player who executes it. I can't suggest how could you adapt it to remove the action from everybody's list.
  12. I would guess you are missing some quotes at the first "private" array setup. Also I don't know about the "str" you have used after the "teleport to" - it might not be necessary. Finally, there should be some code defining what is "_Location"... or not? Or will the script automatically understand it as the "# select 0"...? Sorry, I had a blank here! 🤦‍♂️ But with this new syntax, I believe you will not get the error "undefined variable _Location", or something. Try something like this: JeanTeleportFnc = { params ["_Location"]; private _NamesArray = ["Victory Airbase", "Multi Use Range Complex"]; private _LocationsArray = ["VictoryAirbaseAnchor", "RangeComplexAnchor"]; for [{_i = 0}, {_i < 2}, {_i = _i + 1}] do { test1 addAction [ "Teleport to " + (_NamesArray select _i), {player setPosASL (getPosASL (_LocationsArray select _i));} ]; }; };
  13. I have never used such respawn/fnc style, but in case it is really no longer working, you can use those same codes in some trigger at the spawning/respawnin area of the desired vehicles. So every time one of them appears there, its textures would be instantly changed. It would be something without the brackets and in the activation field, not exactly requiring more code on external SQFs, like if ( (_this iskindof "C_Heli_Light_01_civil_F") or (_this iskindof "B_Heli_Light_01_dynamicLoadout_F") ) then { _this setObjectTexture [0,"textures\police_heli.paa"]; };
  14. JCataclisma

    A3 mission performance overload

    Hello! Please ignore this. Gunther's answer bellow is SO MUCH better and elusive. Good luck! 😎 There are SO MANY things that might be causing that. It's probably one (or more) scripts related to spawning/despawning of enemy units, especially if you use performance-saving setting like "dynamic simulation" on them - so the time players come closer such units, they will "wake up" and require computer's processing power. If you are using scripts, one of the first tip guys usually work here is: disable them all and test mission using one or only a very few at once. Or even send all your mission files to google-driver and post the download link here, so people can take a closer look at them.
  15. JCataclisma

    Teleport Rally point

    You can probably adapt the same system working in the link bellow, from a very recent post that you might have missed. https://forums.bohemia.net/forums/topic/243756-teleport-ai-that-enters-a-trigger/
  16. I don't know how much a permanent/infinite "searching" for menaces around vehicle could impact performance - and I haven't exactly tried a way to do it, but you will probably need to add such code in the init.sqs just like the markers' stuff you have already figured out. But, as an idea, you could try and use an addAction to the vehicle, and so run a "searcher.sqf" external file. this addAction ["<t color='#f0cc0f'>Clear Threats!</t>", { [] spawn { execVM "searcher.sqf"; }; }]; Such file could contain something like the code below, adapted from a "searcher" script I run for my creations: // searcher.sqf _droneStuffClasses = ["O_UAV_01_F","O_Static_Designator_02_F","O_UAV_06_medical_F","O_UAV_06_F"]; _flyingMenaceClasses = _droneStuffClasses; _nearbyFlyingMenaces = nearestObjects [player, _flyingMenaceClasses, 3500, false, false]; { _menaceClass = typeOf _x; if (_menaceClass in _droneStuffClasses) then { deleteVehicle _x; }; } forEach _nearbyFlyingMenaces; As guys here have taught me, it might be much more efficient if you create an array with the vehicles' classes you want to destroy, so you could easily edit it in future, just by adding or removing from such list, without needing to search for them in the entire code. In the script above, firstly we create an array. But such is not accepted for searching in "nearby", so we create a "simple" variable (_flyingMenaceClasses) containing everything in the previous array. Then we say what we want to search and delete in case it matches what we (don't) want. You can even go crazy and add some visual stuff like, instead of "delete", use "setDamage 1;" and also create some grenades or explosions around eliminated threats 😁
  17. But if your doubt is regarding attachTo, it's not that different. It works in a very similar way, but instead of cardinal directions, X = forward(+)/backwards(-), Y = right(+)/left(-), Z = above(+)/below(-) relative to the CENTER of the vehicle/unit you are attaching things to.
  18. Oh, yeah. The first time I adapted that script (flares), I kind of mixed up the ideas of direction vs. position. It took me a while to actually pay attention to the word WORLD in modeltoWorld 😁 I don't know if you misspelled or not, just please note they are X Y Z, not y x z. For the "modelToWorld", think of them as you were looking at the 2D map, from above: X would be North (+) and South (-), Y for East (+) and West (-), Z would be for the height (+ and - ). But as we created those flares using "player" as their relative/initial position, the script will create them STARTING from player, but adding that respective distance in every specific direction OF WORLD. For instance, using those lines from your last post: flareN = "AT_Mine_155mm_AMOS_range" createvehicle ((player) ModelToWorld [65,0,150]); // starting from player, 65 meters NORTH, no displacement E/W and 150 meters higher; Now looking at another line from a previous post of mine: flareNW = "F_20mm_Yellow" createvehicle ((player) ModelToWorld [-15,25,150]); // starting from player, 15 meters SOUTH, 25 meters EAST (is a positive value) and 150 meters higher In the other things I have posted like setVelocity, it's a similar concept: script will not just create the flares, but get them moving in different speeds towards those specific directions (north+, south-, east+, west-, up+, down- . Note the difference: they will be created in a place relative to the POSITION of player, but NOT relative to the DIRECTION player is looking. https://community.bistudio.com/wiki/modelToWorld
  19. I don't know whether "human" units can have their simulation disabled. If yes, you could try to do that and then something like " sleep 0.25; enableSimulation true;" after they touch ground. EDIT: oh, but with simulation disabled, they would probably NOT fall down and just hang locked mid-flight.... 😑
  20. Another example, this is what I use to randomly force units to wear some pre-defined civilian uniforms, so you could change those for arrays of wepons, items, etc. inside the "[...]": _headgearArray = [ "H_Construction_basic_orange_F", "H_Construction_earprot_orange_F", "H_Cap_Orange_IDAP_F", "H_Hat_tan", "H_Bandanna_surfer", "H_Cap_red" ]; _vestArray = [ "V_Plain_medical_F", "V_Safety_orange_F" ]; _uniformArray = [ "U_C_Scientist", "U_C_Poor_2_sick", "U_NikosBody", "U_C_Poloshirt_redwhite", "U_C_Journalist", "U_OrestesBody" ]; _randomHeadgear = _headgearArray call BIS_fnc_selectRandom; _randomVest = _vestArray call BIS_fnc_selectRandom; _randomUniform = _uniformArray call BIS_fnc_selectRandom; (_unit) addHeadgear _randomHeadgear; (_unit) addVest _randomVest; (_unit) forceAddUniform _randomUniform; And there are users here, like PierreMGI and GuntherSeverloh who already have sorts of loadouts and modules for several types of stuff to use - check their signatures.
  21. You could try something like the code below, which I use to add different kinds of damage to units regarding their side in the game. Or use "select" in different ways, for instance replace what's after "isKindOf" for the name you can find in "view in config file" (right-click on editor), or even change its syntax for {typeOF _x in "classNameHere"} if you'd rather use class names. // "7" in the three lines below is the distance - in meters - to the search for units around the player private _nearbyEastTroops = nearestObjects [player, ["Man"], 7] select {_x isKindOf 'SoldierEB'}; // for OPFOR private _nearbyGuerTroops = nearestObjects [player, ["Man"], 7] select {_x isKindOf 'SoldierGB'}; // for Independent private _nearbyBlueTroops = nearestObjects [player, ["Man"], 7] select {_x isKindOf 'SoldierWB'}; // for NATO // you could change the specific actions for each type of units in the lines between the "{ ..... } forEach ..." { removeAllWeapons _x; _x addPrimaryWeaponItem "muzzle_snds_H"; _x addPrimaryWeaponItem "acc_pointer_IR"; } forEach _nearbyEastTroops; { removeAllWeapons _x; _x addPrimaryWeaponItem "muzzle_snds_H"; _x addPrimaryWeaponItem "acc_pointer_IR"; } forEach _nearbyGuerTroops; { removeAllWeapons _x; _x addPrimaryWeaponItem "muzzle_snds_H"; _x addPrimaryWeaponItem "acc_pointer_IR"; } forEach _nearbyBlueTroops;
  22. Maybe it could make any difference if you disable civilians' damage until they reach the ground... ? Let´s say use " _x allowDammage false; " in the first part and " _x allowDammage true; " inside the "waitUntil" part. I was also thinking about using 'setCaptive true", but then remembered that civilians are already recognized as captives by default. And you have probably already tried using "setCombatBehaviour" instead... ========== EDIT: by the way, recently someone has posted in a thread regarding to avoid AI to go prone while inside buildings. Maybe you can find something for your case there as well (they used _x setUnitPos "UP"; https://community.bistudio.com/wiki/setUnitPos ):
  23. JCataclisma

    Make ai move and return

    Maybe you could add any simple object at their starting positions, like a crate let's say, even making it invisible ( _this hideObjectGlobal true; ), and give each one of them a variable name. So when you activate a trigger or whatever which commands civilians to walk towards original position, you could use the same method you are using for the initial move, but adding something like "GetPos _crate1" from the specific objects at the positions you want them to move.
×