barbolani
Member-
Content Count
1197 -
Joined
-
Last visited
-
Medals
Everything posted by barbolani
-
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I dont know about DAP, you should ask there, But I think what you want took me a few days to code and a whole life to learn. Let's try to make it less time compsuming for you ;) Anyway I think you are entering in a zone which you need more scripting knowledge than you have already if you want to do it by yourself instead of using some third party published work. BTC revive works fine with AI, but has some MP issues. In MP my suggestion is to go back a few posts and use the Antistasi one. AFAIK there is no other revives that work well with AI and MP. None of the Mod advanced medical systems will be managed by AI. So you must choose between having an AI revive or and advanced medical system made for MP and humans. It's my opinion with the info I have, perhaps some other can point you in other directions. -
Basic Scripting help
barbolani replied to cookies2432's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sorry but I don't understand a word of this phrase.. Maybe because I am not native english, don't know, but I need to read it in other easy words to help you. -
I am not an ACE expert, but there is for sure a way to disable the whole medical thing, isnt it? Yes man, but to avoid just that situation, in order to do it well, your less problem is to make a medic go in an automatic way to heal the injured, you gotta make a real integration for AI with ACE (something no one has done yet, so, you would be the first!!!) which is something complex. And if we instead make a domove and magically set all the variables as "new born soldier" (magically is against the reasons a player uses ACE IMHO), my first thought is "and why just not using ACE instead of coding anything?"... well is just thought...
-
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
On the units init which yyou want to give them that effect. The snippet I gave you is only for players. If you want to make this available for more players or even AI, then, copypaste this in the desired unit init field: this addEventHandler ["HandleDamage", { _dam = _this select 2; if (_dam > 0.95) then {_dam = 0.9}; _dam }]; -
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try this, in my last snippet I forgot to treat other parts damage: player addEventHandler ["HandleDamage", { _unit = _this select 0; _part = _this select 1; _dam = _this select 2; if (_dam > 0.95) then {_dam = 0.9}; _dam }]; -
Hi, If I understand well the problem if when you destroy the HQ building, you don't want to make it usable as respawn point, isn't it? Then the way to do so is in ForwardHQKilled.sqf, as the script you pasted is just the FOB creation. A first though is to have a global public array with the respawn point markers available, and remove from the array the marker associated with the building pos. All this done in ForwardHQKilled.sqf
-
Sorry guys but I see no sense on using ACE and trying to make an automated AI medic that heals everything for the unit. It's kinda cheating. ¿What's the fun or realism on that?
-
Hi! @alexcrook: Don't understand well your post. The title says CO8, but I think the lobby allows like 30 players(I initially thought about 8 but after I've seen the game can go well with more) @giorgygr: 1. Game is asking to load their PERSONAL stats, which is their rank, personal money and some clothing. 2. Vanilla nights. When the moon hides, yes, very dark. You can allways skip time in the fireplace. I personally enjoy playing with that and with just flashlights if AAF is in the same situation. 3. I assume you use ACE medical system and it works well. I haven't touched anything about damage tolerance except if you use my revive and disable ACE. So it's vanilla damage. The AAF skillset is a very tested one, but of course everything depends on the general AAF skill. Maybe I will nerf them more on lower levels. 4. ACE revive should work if configured with the right params. Just unpbo the mission and add it! 5. Small patrols are generated: in cities or in any other strategic zone (outposts, factories, bases, airports etc..) patrolling the surroundings. I think it's something realistic. In very crowded zones (Kavala, central island) you will find a lot of them, but in normal situations, they won't be that much.
-
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, is what I meant, if some script or mod suits your needs, don't mess trying to build it by your own, as a revive script needs a bit of testing around until you've got it (at least for me it was). -
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
unPBO Antistasi (in my signature) and check the revive folder. It's inspired by BTC but hasn't the MP problems it has. And it will be fully compatible with what you want to achieve, which in Antistasi is called "Termporally AI Control". The only thing you have to do is. In player's init (initPlayerLocal or editori init field) assigna a variable, "owner", so: player setVariable ["owner",player,true]; And when you spawn AI or the AI in the editor you assign it's owner as the player: _unit setVariable ["owner",player,true] I make the variables MP global in case you want to control HC groups, if not, you can make it totally local. So when you remote control the AI with select player, to return to the original player (in the way you want) you just have to code: player selectplayer (player getVariable "owner") That's totally compatible with the revive you see in Antistasi, which checks when you are injured, if you are your "original player" and if not, return to the original one. And same when the "original player" get's hurt. Hope this helps, it took me one week coding all this stuff... -
How to set markers on objects - alive players
barbolani replied to csk222's topic in ARMA 3 - MISSION EDITING & SCRIPTING
isNil should work. As variables assigned to object players which don't join from the begining are nil. So: if (!isNil "blufor1_1") then { if (alive blufor1_1) then { "ofrsp" setMarkerPos position blufor1_1; }; } should work. -
Hello everyone! I am pleased to publish current version 0.17 Alpha with a few very original improvements (NAPALM and CLUSTER Bomb Runs and Guard Dogs) No mods required :) Have fun!
-
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Anyway: maybe this snippet is enough for you: player addEventHandler ["HandleDamage", { _unit = _this select 0; _part = _this select 1; _dam = _this select 2; if ((_part == "") and (_dam > 0.95)) then {_dam = 0.9}; _dam }]; -
Can you limit a unit damage value to a set number so it will not go below the number.
barbolani replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
nonono, alex method could be ok if Arma was based on napoleonic wars (joking) Because you may receive in less than 1 sec a lot of damage from different sources, or even better, one source can damage serveral things at a time. What you are asking is what is called a "Revive". There are around 2 or 3 very good ones around the scene. All those are based on the HandleDamage event handler. Messing uo with it may take some time fo have complete functionality. Maybe using them is easier and enough or maybe you want the player to stay up and fighting no matter how much damage. Then the only part you have to tweak from those scripts is the one that calls to the incapacitated state. Or you can mess up with the EventHandler, your call! -
Show "live" map on billbord???
barbolani replied to loopdk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
no, when you want ppl to attend the map, and you must do it on very client. An easy way is to use a radio trigger, activation once, and when you are with your buddies, then tell them to pay attention.. you radio 0-0-1 and ta dah, everyone sees their map. -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's a good one! -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I don't think you may use that method if you are changing the scripts as they are getting saved in the editor folder, and not in the pboed version. I won't say my method is the best, but at least works for me: Save the script Export mission to MP Exit editor Open the Dedi Go to LAN Playtest Very boring indeed to make tests in MP, wish the standard editor had some MP emulator. It would save me a couple hundered of hours each year, literally. -
please help me out with a script?
barbolani replied to beastxjason's topic in ARMA 3 - MISSION EDITING & SCRIPTING
nonono don't change the _x My explanation was the simple one. The complex one: triggers ADMIT local variables if they are outside (or deeper, don't know the right word in english) the main scope. In other words. SOMETIMES, between brackets, you will be able to use the _variable. For example, inside a {} forEach or inside a spawn {} Sorry by giving you an incomplete explanation but I wanted to keep it as simple as I could. So, don't touch the _ in foreach and inside spawn. -
How to make music loop
barbolani replied to rekkless's topic in ARMA 3 - MISSION EDITING & SCRIPTING
A copy paste of Antistasi's situational music script, may be useful: _normaldia = ["LeadTrack01_F", "LeadTrack01a_F", "LeadTrack01b_F", "LeadTrack02_F", "AmbientTrack03_F", "BackgroundTrack01_F", "BackgroundTrack01a_F", "Track02_SolarPower"]; _normalnoche = ["Track08_Night_ambient", "Track09_Night_percussions","Track11_StageB_stealth"]; _combat = ["LeadTrack03_F", "LeadTrack04_F", "LeadTrack04a_F", "LeadTrack05_F", "BackgroundTrack03_F", "Track01_Proteus", "Track07_ActionDark","Track10_StageB_action"]; _stealth = ["LeadTrack06_F", "AmbientTrack01_F", "AmbientTrack01a_F", "AmbientTrack01b_F", "AmbientTrack04a_F", "AmbientTrack04_F", "Track04_Underwater1","Track05_Underwater2"]; _stance = behaviour player; _newstance = _stance; cambioMUS = true; _cancion = "LeadTrack01_F"; while {musicON} do { sleep 3; _newstance = behaviour player; //hint format ["El jugador está en esta stance: %1", _newstance]; sleep 3; if ((_newstance != _stance) or (cambioMUS)) then { removeAllMusicEventHandlers "MusicStop"; _stance = _newstance; if (_newstance == "COMBAT") then { _cancion = _combat call BIS_Fnc_selectRandom; cambioMUS = true; }; if (_newstance == "STEALTH") then { _cancion = _stealth call BIS_Fnc_selectRandom; cambioMUS = true; }; if ((_newstance == "AWARE") or (_newstance == "SAFE")) then { if ((daytime > 18) or (daytime < 6)) then { _cancion = _normalnoche call BIS_Fnc_selectRandom; cambioMUS = true; }; if ((daytime > 5) or (daytime < 19)) then { _cancion = _normaldia call BIS_Fnc_selectRandom; cambioMUS = true; }; }; 5 fadeMusic 0; }; if (cambioMUS) then { _EH = addMusicEventHandler ["MusicStop", {cambioMUS = true}]; cambioMUS = false; sleep 5; 1 fadeMusic 0.5; playmusic _cancion; }; if (!musicON) then { 1 fadeMusic 0.5; sleep 0; playMusic ""; }; }; musicON is the variable that turns on or off the music, use radio trigger, dialog or whatever. On act: musicON = true and execute the script, on deact: musicON = false; Don't know if it's good or not, but worked for ages. -
Performance: Multiple Paralell Loops vs One big loop
barbolani posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi! As in my environment is difficult sometimes to make performace tests I ask the wise guys. I have some soldier init script, which makes 1 loop to check if he's fleeing and if so, do some captive stuff. My question is, what's better, one script per unit (lets say 200 scripts) with this? waitUntil {sleep 1; fleeing _unit}; or one script server sided with this: while {true} do { sleep 1; { if (fleeing _x) then {do stuff} } forEach allunits; }; Thanks in advance. -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Uhm, have you debugged the dedi part? I mean, are you sure the dedi has reached the proper line? Because you have this on the script begining: waitUntil {!isNull player}; AFAIK in Dedi it will return false forever. Isn't it? Anyway I recommend you to debug your code. In dedi environment, you must create a function to broadcast messages and call it with BIS_fnc_MP (the new system is a mistery to me yet). The function I use: _unit = _this select 0; _text = _this select 1; _unit sideChat format ["%1",_text]; So, let's say you called the function "commsMP". To debug, in the (isDedicated) part, put this: [[playableUnits select 0,"We have reached the isDedicated part"],"commsMP", true] call BIS_fnc_MP; If you see the message then I'm still lost :) Anyway the debugging thing is a very valuable ally. Second advice is try to separate client scripts from server scripts. It is not a MUST, but will keep things ordered and specially will make your mind prepared to not thinking they are running the same lines of code, but paralell works instead, which you have to coordinate like this case. -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I had only a few mins to check the script, but I see the variable management is under a if (isDedicated), so in non dedi environment the variable will stay nil forever... And even that, if there is no WEST unit, the variable will remain undefined... Check that and tomorrow I will be able to test something more. -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It says This page has been removed! -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes it is! I have lots of scripts with this scheme and working. Lots of init.sqf around the scene run this way. publicVariable is the simplest thing to do what you want. If you can, try this: if (isServer) then { BWR1 = true; publicVariable "BWR1"; }; //back to everyone... waitUntil {sleep 1; !isNil "BWR1"} if (BWR1) then { ["round1B","Succeeded",true] call BIS_fnc_taskSetState; }; -
Passing Value outside isServer
barbolani replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What happens is: while the server is reading the line BWR1 = true the client guys passed it (they are not server) and are reading if (BWR1), and, as it still is false and hasn't been publicVariable'd yet, the if is ignored. So, the server is the only one who's doing the if part. Try this instead of if: waitUntil {BWR1}; ["round1B","Succeeded",true] call BIS_fnc_taskSetState;