Jump to content

barbolani

Member
  • Content Count

    1197
  • Joined

  • Last visited

  • Medals

Everything posted by barbolani

  1. barbolani

    Helicopter extraction script

    Have you checked .rpt? Is your friend when you see everything should work and does not. Minor thing: deleteGroup _grouptmp; after the foreach, you are trying to delete a group while it has units on it, so it won't delete and you are wasting code. Check the .rpt file and let's see what it says (if says nothing, then we have to double think). Glad to see my dismount drill script made in the office while I'm pretending to work is... working :)
  2. barbolani

    Can I name my squads?

    Woods, if you are using pure editor placed units, instead of any fancy scripting, put the names you want in the leader's init and keep things simple and customized for your mission. So just a pure: groupname = group this; groupname setGroupId ["whatevername"] is what you need. My method works for scripted spawned groups (well not exactly that, but with a few changes) where you created the groups with local script variables and externally to this, you don't know the rest of the group names, so you search for all the groups on any side and put them a name dynamically. No need of that in your situation.
  3. select waypoints option, single click fireteam leaader, hold shift on the truck, doubleclick on the truck, edit waypoint... :) Second option, my favourite nowdays: script everything with 60 lines of code to cover all the possible issues, check: it is not working, check rpt, correct the 60 syntax error, check: it is not working, think 60 minutes why, change things, check: it is not working, post a thread on the forum, use the response, check: it is not working...
  4. A pity, in buildings it works and allows you to put several waypoints on the same building and different buildingPos
  5. Have you tried to add the GETIN waypoint of the second fire team pressing shift on the truck? This way instead of opening the first firetam existing GETIN waypoint you will add another one to the Kamaz...
  6. Yes, but the trigger will fire as soon as they are on the falling side, and it attaches the unit instantly to the building (complex calculation of the attachment position, but at least, it's the same building position used as reference allways, and is the same z starting coord), so they don't fall, make them play an anim, and smoothly change the z attach variable to the ground. Let's say the getPos building is [4,8,0]; Let's say the trigger fires on a unit which is on [8,4,30]; First, make the soldier look at the buildingPos: _dir = [_unit, building] call BIS_fnc_dirTo; Then, make the _unit setDir _dir (or _dir + 180, whatever) Will look tacky, cause will not look straight to the wall, but you may make some if (_dir > 0 and _dir < 20) then {_dir = 10} fine tuning the angle for better view, error and trial, but you are using an specific building, not difficult. _x = (getPos building _select 0) - (getPos _unit select 0);//-4 _y = (getPos building _select 1) - (getPos _unit select 1);//4 _z = getPos _unit select 2;//30 _unit switchMove "whateveranim"; while {!isTouchingGround _unit} do { _unit attachTo [building, [_x,_y,_z]]; _z = _z - 0.3; sleep 0.1; }; detach _unit; _unit switchMove ""; May worth a try....
  7. uhm, I've been giving a thought or two about this.... What about putting a trigger on the boundaries of the hospital? If any teammate enters, execute a script which checks the getpos unit select 2 number, if it higher than, let's say, 10 meters, play an anim like he's rappeling, you may setdir the unit to the building position and attach it in the same way the rappel heli insertions work. Very CoD :)
  8. barbolani

    Can I name my squads?

    My super auto squad namer script. Assuming you are BLUFOR. [] execVM "squadnamer.sqf"; And the script: _count = 1; {_group = _x; _text= ""; if (side leader _group == WEST) then { //add classes depending on the type of vehicle, for example: if ((vehicle leader _group) isKindOf "Man") then {_text= "Inf"}; if ((vehicle leader _group) isKindOf "Tank") then {_text= "Armor"}; if ((vehicle leader _group) isKindOf "Truck") then {_text= "Mot"}; //etc etc.. you may use also typeOf if you want to speacialise Inf units, like paratroopers, recon etc... _text= format ["%1-%2",_text, _count]; _group setGroupId [_text]; _count = _count + 1; }; } forEach allGroups; This will name the groups like "Inf-1","Mot-2","Inf-3","Armor-4" etc..
  9. barbolani

    AI Respawn

    Hi, For respawning pure AI I won't recommend the methods above. I assume you want this unit for decorative purposes. Just a trigger which detects the presence of the player or players, and creates the unit on activation and deletes it on deactivation. You only need to know the position on which create the unit.
  10. Hello! I'm asking this because some of you probably had the experience of it and you will save me time to test ;) When you have a UAV created with createVehicle + createVehicleCrew, say an AI manned UAV, the ones with laser designator. And an AI plane with guided bombs. Do they cooperate? One marking enemy vehicles and one firing it's guided bombs? Same with, for example the AAF Cars with only laser designators...
  11. one works, the other one not :) count is used to return a number from conditions, but they must be valid condition, like, for example {alive _x} count units group player; it returns the number of alive units in your group. The other line is different stuff... vehicle player returns the vehicle is using the player and not the soldier itself (except when it's not in a vehicle, of course)
  12. I suggest to try the office building near that, the rroftop has lots of buildingpos. and maybe AI does not mess up....
  13. AI walking in Kavala hospital helipad = pain in the ass.... Don't know why it hasn't building positions which maybe make some pathfinding AI easier...
  14. barbolani

    Random Array

    Yes. Instead of a random grenade script was a carpet bombing one... efective too :)
  15. vehicle player in thislist; or {vehicle player} count thislist > 0;
  16. Assuming you don't want enemies in a 250mts radius from the spawnpoint: while {(surfaceIsWater _tmpPos) and ({(side _x != EAST) and (_x distance _tmpPos < 250)} count allUnits > 0)} do.... But a more reliable and efficient way. Don't define _tmpPos before the while and: while {true} do { _tmpPos = [_posCurrent,250,random 360] call BIS_fnc_relPos; if ((!surfaceIsWater _tmpPos) and ({(side _x != EAST) and (_x distance _tmpPos < 250)} count allUnits == 0)) exitWith {}; sleep 1; }; player setPos _tmpPos; Or even better, to avoid in a crowded battlefield having the while loop looping eternally: _dist = 250; while {true} do { _tmpPos = [_posCurrent,250,random 360] call BIS_fnc_relPos; if ((!surfaceIsWater _tmpPos) and ({(side _x != EAST) and (_x distance _tmpPos < 250)} count allUnits == 0)) exitWith {}; _dist = _dist + 100; sleep 1; };
  17. barbolani

    Random Array

    You are trying to explode a grenade on a random position picked from an array, isn't it?
  18. EDIT: Asking stupid things makes me stupid, deleting my stupid questions, make me stupid too, but to a certain degree...
  19. Hello, to make a cache of garrison units, when player conquer a base I use this: server setVariable ["nameofbase",[]];//empty, no garrison as you conquered recently but when I make this: _info = server getVariable "nameofbase"; _garrison = _info select 0; hint format ["%1:%2","nameofbase",count _garrison]; instead of 0 I receive scalar..... only in cases when this empty array is with another arrays, like, for example: _data = [[],true]; server setVariable ["nameofbase",_data]; then, when I make this, and count the proper array, I get 0, which is the desired result. Why I am making this, because you may reinforce the base and, when you do, the array will contain the typeOf units, like: server setVariable ["nameofbase",["inftype","inftype","ATman" blabla]; and then, when I want to create them: _info = server GetVariable "nameofbase"; _arrayunits = _info select 0; {createunit of the type _x} forEach _arrayUnits; Hope I explained well... Thanks in advance for the help!!!
  20. aaaaaaaaaaaaahhhhhhhhhhh! you are true!!! Yes, my intention is _info being an array of arrays, so it stores on a first array the types, and in other optional arrays, other parameters. My mistake was, when I declared setVariable, I declared and empty array, and what I should have done is to declare an array with an empty array on it, so, when I make _garrison = _info select 0; it picks the empty array, and a count returns 0. WORKING! Thank you all!!! so the correct thing, with just one eement on the base is: server setVariable ["nameofbase",[[]]]; so when I call it: _info = server getVariable "nameofbase"; _garrison = _info select 0; hint format ["%1", count _garrison]; returns happily a 0 :)
  21. This: https://community.bistudio.com/wiki/primaryWeapon If the return is "" then, they have their weapon in backpack or no weapon. Please check it, I'm at the office.
  22. I suppose it's related to your EOS and COS, isn't it? If so, triggers are mandatory, yes? Because if not, this situation is the reason why I don't use triggers, make the function call depending on distances of an array of objects and you will be able to fine tune whatever + control everything. Like: while {true} do if (_marker in activatedarrayofmarkers) then { do something waitUntil {sleep 0.5; not (_marker in activatedarrayofmarkers}; do something else } sleep 0.5; };
  23. Sorry I thought you were asking about infantry and not vehicles, but anyway guys, I insist, my personal experiencie is AI never avoid mines even if detected. Has it changed???? And, an idea... spotdistance in the proximity of the mine of the vehicle?
×