barbolani
Member-
Content Count
1197 -
Joined
-
Last visited
-
Medals
Everything posted by barbolani
-
foreach on a multidimensional array? how?
barbolani replied to twisted's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Totally true! Just removing the [] will do the trick! -
foreach on a multidimensional array? how?
barbolani replied to twisted's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm not in the editor, but.... for "_i" from 0 to (count _weaponArray) - 1 do { _weapon = _weaponArray (select _i (select 0)); _amount = _weaponArray (select _i (select 1)); _ammoPackBox addWeaponCargoGlobal [_weapon, _amount]; }; -
How do loop foreach allUnits+vehicles thoughout the game?
barbolani replied to BEAKSBY's topic in ARMA 3 - MISSION EDITING & SCRIPTING
In the script which spawns the new unit or vehicle, so: _veh = createVehicle blablabla _veh addeventhandler ["killed",{_this execvm "veh.sqf";}]; Because looping allUnits constantly will make checks of every unit all the time, even the ones you already added the eventhandler. Not very useful. -
Why use the spawn command?
barbolani replied to yacobm8's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you very much cuel! So. As more or less 99% of my scripts run more than once, you recommend me to compile all of them so they get stored in memory, and call them whenever I need in a faster way. Even more, the script itself won't have to be changed on anything. Regarding the scheduled / non scheduled enviroment. Maybe this is the cause of one problem in the mission. It has a script that checks distances to arrays containing markers, and checks if those markers are in one side or another (arrays too). After distance checks, it stores the markers in another two arrays, the "far" markers and the "near" markers. All this to spawn/despawn units, of one side or other. Of course all this in a while loop. The problem seems when, externally to that script, I change those arrays. For example: when you conquer a marker, you change the marker from the array which contains blufor owned markers to another. That's not made in the "checkdistances" script. About 5% of times, script messes and no array marker movement is made, and you find the whole island empty :( Maybe the thing is messing because two scripts are doing things on the same array at the same time. This makes me think about playing with this scheduling things, so one script has priority, and everything must wait until it has done it's commands before any other. And a second question: I'm running the script once, but it will loop forever, should I still use execVM? Thanks A LOT in advance. -
Why use the spawn command?
barbolani replied to yacobm8's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi! Regarding this I'm working on a mission, very complex (Arma 3 - Antistasi, check my signature), everything is dynamical, missions, assets, everything scripted. Only the intro is editor placed + lots of scripting too. All the mission is execVM except third party scripts (UPSMon for example), because my lack of knowledge on functions and some features like setvariable... you won't see one of these on my scripts. Just arrays, common commands... old school. I'm not pro programmer, I'm an amateur mission maker with a big project indeed. The question is, as it does not seem any serious fps drop present except when you get to an area with lot's of spawning units, which AFAIK the call / spawn / execVM does not matter. Would get the mission that better using call / spawn, converting scripts to functions etc???? execVM is very useful as is called newly everytime the script needs to run, so if you want to make any changes on the fly to the script, without restarting you may call the script again with the new changes. This, in a dynamic sandbox, is important, due you may need to run the script in certain stages of the game and restarting would be a pain in the ass. I would appreciate if one of the performance gurus here would take a closer look to that mission unpboing it and check those scripts if he sees any mandatory need of doing things in another way. -
[SP/MP] Dynamic Whole Map ArmA3 Missions by SaOk
barbolani replied to SaOk's topic in ARMA 3 - USER MISSIONS
OMG Germany! -
Soldiers should not refill their ammo
barbolani replied to Voltagez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Why you want the poor guys fight until being out of ammo, and then die, in front of a f*****g ammobox??????????????? Let them refill!! -
AI squads: Assigning and commanding units in fireteams like team "RED" via scripts?
barbolani replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think I understand, you want to make a semi-HC-AI which manages groups depending on specialities (snipers, don't get too close, grunts, flank and get as close as possible, MGs supress). UPS does this but I think it does not care about "specialities" ,and using reveal is not the same experience for the AI than being in the same group... Not easy, I suppose the way of doing that. Having original group leader, his waypoints, check behaviour loop, check distance to waypoint, array of known enemies, looped reveal + dynamically create subroups depending on typeOf, with dynamic waypoints (you have original waypoint + enemies positions as references), and after leader reching the original waypoint or no enemies nearby, everyone joins again... Doing that, you will create let's say 4 groups as much for each, and just one waypoint on them, finding caps, if you do things clean and deletegroups, could mean more than 60 groups per side... -
AI squads: Assigning and commanding units in fireteams like team "RED" via scripts?
barbolani replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You are working on something with more than the group cap???? Anyway, I suggest you to check exactly how is done in UPS... -
Create flying drone
barbolani replied to yoannis1995's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's been 2 months since I found this problem. Can't remember everything I did, but I remember the solution: createVehicle + createVehicleCrew. This way you make a flying drone which will be autonomous on waypoints, or you may join the crew to another existing group... -
UPSMON Updated to ArmaIII
barbolani replied to cool=azroul13's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Cool: found another "debug when debug is deactivated", this: if ( isnil "_obj") exitwith { hint format ["Object: %1",_obj]; diag_log format ["UPSMON: Object for _npc: %1",_obj]; }; line 74 -
Help with Unconventional AI Respawn Script
barbolani replied to LOzan's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You want a lot of things that have to be treated separatedly.... Please, specify your progress on each of the matters, because, if your post is "I want a script that makes all of this things" the answer is no, you need 7 scripts.... -
Can't stop the epileptic attacks for the Artillery Gunner.
barbolani replied to EvilDutch's topic in ARMA 3 - MISSION EDITING & SCRIPTING
workaround: disableAI "TARGET" and "AUTOTARGET" on the commander... -
AI squads: Assigning and commanding units in fireteams like team "RED" via scripts?
barbolani replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi! Well, looking at the wiki: https://community.bistudio.com/wiki/forEachMemberTeam But, if you click on the "Team Member" link, it says: "This is a reserved Type for future implementations. In Armed Assault it is not implemented yet" Weird. I never tried to script AI with teams. Workaround: ¿why not make subarrays of units of a group and issue separate commands to them? I suppose UPS / UPSMon does something like that.... -
UPSMON Updated to ArmaIII
barbolani replied to cool=azroul13's topic in ARMA 3 - MISSION EDITING & SCRIPTING
chondo, someone in your other post gave the solution (I think) it's (sorry Azroul but you are 50% wrong): {_nul = [_x] execVM "loadout1.sqf";} forEach units _spawngrp; or forEach units (group _leader); And the mistake in loadout1.sqf is (Cool here is right): _unit = _this select 0; Nothing with UPSMon, as you are calling it perfectly ;) -
Hello everyone, I am very pleased to present you my first public mission. You may find it here: http://steamcommunity.com/sharedfiles/filedetails/?id=194083089 You and your squad will deploy a paradrop assault on a vital point for NATO invasion. Once you've taken the position, you must hold it at any cost, no matter what ir comes. Mission is fully voiced (sorry about the low level audio) and with custom music!!! NO ADDONS REQUIRED No showstoppers should appear. Please do not hesitate to make any comment. I tried to make it "not easy but finishable". From here, thanks to bardosy for testing and advicing, and generally to all the comunity of this forum (and OFPEC forum) for all the support, and some stolen code snippets ;) Have fun!
-
WoW! Good to see somebody posts here! Specially a special OFPEC member! I'm 100% concentrated on Arma 3 - Antistasi now (check my signature) but will make a check on the arty thing, it's the first report about that. Submitting to OFPEC? Of course! but... is it alive? Last time I entered was down again, and I see no activity there. The real mission makers work on OFPEC!!!!
-
¿?¿?¿? thread mistake or I am missing something?
-
Hi! I see several mistakes here: First, that If has to be in some loop (trigger or scripted), an if condition on init's unit will check right after creating the unit, only once, so when action starts, nothing will happen. You need to put that "If" in a loop. Second: "soldierWB" is not a valid type of soldier in Arma 3. The unit will never create, I'm surprised you say the guy does not move, shouldn't even exist. Check the types list here Third: check fleeing command in wiki, you need an object to refer, so, instead of "soldierWB" which is the type of the unit you created, you need a variable. So instead use this example: Create the soldier: _guardguy = "B_Soldier_F" createUnit [getMarkerPos "marker_1", _groupAlpha]; (not checked syntax, check with createunit command in wiki). Now we can do things with _guardguy, like: _guardguy setUnitPos "UP"; _guardGuy allowFleeing false; _guardguy sideChat "Im bered here, guarding this point"; you see? Explaining in depth the first point: Your "if" statement needs to be in a loop. Why? Because if not, the check will be made only once, if conditions are met, will fire, but in your case, is impossible: _guardguy will never flee right after it's creation, so a loop like this is a must: while {alive _guardguy} do { if (_fleeing _guardguy) then {_guardguy doMove (getMarkerPos "marker_1"} sleep 1; }; Every second this script will check if _guardguy is fleeing, and if yes, the doMove command is issued. If he dies, script is finished. I recommend you a scripting tutorial to understand a bit in depth the way scipting is done. Armaholic has one from Fockers which is really good. Hope I helped!
-
Hello kaski, Sounds a good scene. You didn't mention so maybe you are missing the key point. Driver must be CARELESS, by waypoint or scripting command. Indeed I recommend you the command, don't ask me why in a chopper insertion on Antistasi, creating waypoints with CARELESS didn't work. This will solve, for example, the issues when under fire... An additional disableAI "TARGET" and "AUTOTARGET" may help. BUT, maybe also you are having pathfinding problems. If the driver encounters units on the road, he may try to search for another route, or stop and wait.... EVEN (sometimes happens), ingame engines meeses up the specific route you want. It happens for example from Stratis Airport to Agia Marina, vehicles never reach destination and it's a reported bug. Hope this helps.
-
Cannot edit entry
barbolani posted a topic in Arma 3 - MAKE ARMA NOT WAR CONTEST - QUESTIONS & ANSWERS
Hi, I added my entry. Here. But when I login (with steam account), from the welcome page, I click on Edit / Add entries and it just refresh the page.... From the entry itself I see no option of editing anything. Using Internet Explorer. Someone can guide me? Thanks in advance!! -
Cannot edit entry
barbolani replied to barbolani's topic in Arma 3 - MAKE ARMA NOT WAR CONTEST - QUESTIONS & ANSWERS
Solved! Thank you very much! -
Heli TRULY stop when I want
barbolani replied to barbolani's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Damm, this is solved.... You know what? I HATE SETWAYPOINTBEHAVIOUR.... After some debugging I found that command, dont know why, is not working... A fine setBehaviour made the trick... f**k. -
Hi! Anybody of this gentlemen knows a way of stopping a heli in an accurate way, wherever you want? I'm working on a dynamic AI controlled fastrope script, everything ok, except the heli stops (speed heli < 1) two or three hundereds of meters away. I tried forcespeed, dostop, disableAI "MOVE" on the pilot when reaches a distance < 150 mts from the landing pos, and nothing. The AI has everything disableAI. The waypoint is CARELESS and LIMITED. It does not respect my flyinheight too.... The main thing with this is the landpos is fine calculated not to be on the sea, but as the heli is doing weird things, sometimes it drops the units in water.... EDIT: It is not a matter of accurate stopping, cause the heli when it's close starts to deccelerate, but, after two seconds, accelerates again...
-
Heli TRULY stop when I want
barbolani replied to barbolani's topic in ARMA 3 - MISSION EDITING & SCRIPTING
uffffff setvelocity would make it magically stop, even at low speed will be noticeable.... It is a possible workaround, but requires a ton of maths, isn't it? I mean, check the velocity, check if each element is more or less than zero, gradually change each element from original status to zero.... And the heli won't change it's "stance".... EDIT: or not? Have you ever tried something like this? _vel = velocity _vehicle; _dir = direction _vehicle; _speed = speed _vehicle; while {_speed > 1} do { _vehicle setVelocity [ (_vel select 0) + (sin _dir * _speed - 1), (_vel select 1) + (cos _dir * _speed - 1), (_vel select 2) ]; sleep 0.5; _dir = direction _vehicle; _speed = speed _vehicle; };