Sexacutioner
Member-
Content Count
133 -
Joined
-
Last visited
-
Medals
Everything posted by Sexacutioner
-
Deleting Group when all are dead
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello. I have a script that allows players to spawn units and I read you need to make sure and remove created groups to keep below the 144 limit. I've been trying to find a way to check if everyone in the group is dead however it's not working. For instance in a "Killed" event listener if I put the following: sleep 10; _cnt = count units _victimGroup; player globalchat format["count %1",_cnt]; It never gives me a zero group count. I killed 7 guys in a group one by one and on the last guy it returned "2" instead of "0". Does this mean the group is auto-removed and it's messing up or does it just get it wrong because there is no one in the group to take a census? I'd like to use deleteGroup if the count is at zero, but first I need a way to find out when that is. -
Sometimes my MPKilled event is not being called
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I can't find anything relevant in .rpt and have ui_cc -showScriptErrors with no errors. I'm not sure I have to get feedback for the creation loop because it's for sure the rabbit is created as we can see them. It's just that some don't trigger the MPKilled after they are shot. But they are for sure getting created... -
I think you can still find Operation Flashpoint servers, so no Arma 2 isn't going to "die" anytime soon.
-
forEach units of cargo
Sexacutioner replied to typ9's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try this: {myCode _x;} forEach crew _vehicle; -
How can I get rid of ennemy markers ?
Sexacutioner replied to neodammerung's topic in ARMA 2 & OA - QUESTIONS & ANSWERS
Could be related to difficulty setting, however even on expert you get dots on the side of the screen. I was trying to get rid of the dots and found this: http://www.armaholic.com/page.php?id=5908 That allows you to remove quite a few hud elements. Just pick the .pbo files you want to use from the mod and delete the rest. -
Brand new player - a few questions
Sexacutioner replied to arma2zombies's topic in ARMA 2 & OA - QUESTIONS & ANSWERS
I own both but beyond just trying a few things out in 3 I have went back to 2 for the time being. In a nutshell, 3 does not really seem finished yet. I tried making a few missions to play with friends but too many bugs and things not working as intended led me to keep playing 2. 3 looks really pretty (if not in a closer to mario kart grass sort of way), but for now I think 2 is the most robust and least buggy of them. Also if you are looking for playing zombie mods personally I think Arma 2 has environments that are more toned down and fit the "spooky" environment more than arma 3's high saturated super blue skies and super green grass. -
Will ArmA auto convert to an integer, if necessary?
Sexacutioner replied to tortuosit's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I've seen functions do both, so you really would have to test it to see. Probably best to convert it yourself though as an update could change if it auto-converts as well. -
Does anyone know if the peripheral dots are working for 4:3 monitors? My brother and I are playing against each other on LAN with Expert difficulty, however he sees the dots that show units on the edge of his screen and I do not. I am server and have a 4:3 monitor and he is client with 16:10. I'm guessing maybe my monitor aspect has something to do with it not working?
-
peripheral vision dots and 4:3 monitor
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA - GENERAL
Both 3d and 2d are set to the same resolution. I've tried both 2048x1536 and 1600x1200 for both and on expert I see nothing when standing right next to my friend who sees me as a red dot. If I changed the difficulty to recruit I see dots all over the place, but on expert the ones that are supposed to show on the edge of the screen aren't there. Yea I'm wondering about mods. I don't have any downloaded manually right now but I did use "Play with six" to join a multiplayer game once. I checked my expansions and documents arma 2 folder and could find nothing but the official stuff, so unless six puts files into the main directory I don't think I have any mods... -
Suppressing Fire Question
Sexacutioner replied to jakkob4682's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I believe sleep only works with spawn or execVM scripts. They have create a new "thread" in order for sleep to work. -
Bank Robbery Script
Sexacutioner replied to JTrickZ's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm not sure exactly what you are looking for, but if you are just wanting to count num civilian players this might help: captureTrigger=createTrigger["EmptyDetector",getMarkerPos "captureMarker"]; captureTrigger setTriggerArea[_randomWidth,_randomHeight,_randomAngle,false]; captureTrigger setTriggerActivation["ANY","PRESENT",true]; while {true} do { _numEast=0; _numWest=0; _numRes=0; { _numEast=_numEast+({isPlayer _x; side _x == east} count crew _x); _numWest=_numWest+({isPlayer _x; side _x == west} count crew _x); _numRes=_numRes+({isPlayer _x; side _x == resistance} count crew _x); } forEach list captureTrigger; sleep 1; }; I made this to have a capture point map and needed to detected how many of each side was in the trigger. I was running into problems where all people in vehicles weren't counted and non player ai,animals, and vehicles were also counted. This seems to work in all those cases and you can just replace the east/west/res count with civ. -
spawn to xyz coordinates with direction
Sexacutioner replied to _qor's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You should be able to save the info you need from the first unit by doing this: unitSpawnPos=getPos firstUnit; unitSpawnDir=getDir firstUnit; unitSpawnGroup=group firstUnit; Where firstUnit is whatever you named the unit in the editor. Then you can spawn the unit with something like this: _unit = unitSpawnGroup createUnit ["USMC_Soldier_Pilot",unitSpawnPos,[],0,"FORM"]; _unit setPos unitSpawnPos; _unit setDir unitSpawnDir; For putting it together with the event handler, this should work (untested): unitSpawnPos=getPos firstUnit; unitSpawnDir=getDir firstUnit; unitSpawnGroup=group firstUnit; firstUnit addEventHandler ["killed", { _unit = unitSpawnGroup createUnit ["USMC_Soldier_Pilot",unitSpawnPos,[],0,"FORM"]; _unit setPos unitSpawnPos; _unit setDir unitSpawnDir; } ]; -
Deleting Group when all are dead
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
For the sleep I have the event call another thread with execVM, which I think works? This is how the event is called: _unit addMPEventHandler ["MPKilled", {[_this,null,null,[7]] execVM "callScript.sqf"}]; I tried the count units group, but haven't been able to get it to return zero. Instead I decided to go with counting all groups in the event. Some will slip by but hopefully will get caught the next time an AI dies. It's either that or have a loop constantly counting the groups which I'd rather not do. I'm making a multiplayer game that allows teams to call in ai support pretty often so the spawned AI is always coming and going :). -
Deleting Group when all are dead
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for the script. Looking through it I found this line: {if ((count (units _x)) == 0) then {deleteGroup _x; _x = grpNull; _x = nil}} foreach allGroups; Which if I check the "count (units _x)" part it's still inaccurate for a period of time after an entire group is wiped out, so the bummer part is it will need to be checked in a loop, but I suppose it will work if a bit less efficient than I'd hoped. -
So I'm trying to keep track of a variable (money) for each player and I'm a little unsure of how setvariable works in this case. The description says you can set variables attached to the scope of an object. Does this mean variables in scripts that are local to the player? For instance if in the init I have something like this: localMoney=15000; Then elsewhere I have this: _currentMoney=_caller getVariable "localMoney"; _caller setVariable ["localMoney", (_currentMoney+300), false]; Where "_caller" is the player I want to give money too. Will this change the variable localMoney or does setVariable use different variables than ones set in scripts?
-
Using setVariable
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Just tested it out by running two clients in multiplayer. It seems to stick to the player after they die. -
Using setVariable
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ok I think I got it. Thanks for the explanation. Oh do you know if this is persistant across respawn or should I attach new variables to the respawn? -
Easier way to count # of player units per side in trigger?
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
For anyone interested in doing the same this is what have come up with so far: _numEast=0; _numWest=0; _numRes=0; { _numEast=_numEast+({isPlayer _x && side _x == east} count crew _x); _numWest=_numWest+({isPlayer _x && side _x == west} count crew _x); _numRes=_numRes+({isPlayer _x && side _x == resistance} count crew _x); } forEach list _currentTrigger; That counts the number of players per side in a trigger area (_currentTrigger) regardless of if they are in a vehicle or not. Still seems a bit inefficient but it's the best I have. -
Mission Fails to Load
Sexacutioner replied to dealman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Not sure about the # of decimals as I've never gone that far. I guess test it by adding a large decimal number in a working mission. Other than that my next step would be taking a working mission and slowly adding a chunk of the other code until it breaks and there's where the problem is... -
Easier way to count # of player units per side in trigger?
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks guys, definitely some new commands that will come in handy, although not sure if either of these scripts will work I can definitively use this new information to make my script better. @Silderoy The "allUnits" command should really come in handy. I used to keep track of all the players by assigning them to an array in the init/publicVariable, but this new command is much better. In this case I only wanted to count players in the trigger area so might be overkill listing through them all, but a useful command for the future just the same. @XxAnimusxX That script very looks useful for the "isPlayer" command. Something I was trying to do by comparing them to variables so I can cut all that part of the code out and just use isPlayer. Unless "list myTrigger" returns crew in a vehicle now I'll still need the sub-loop though. I'll do some testing and see. -Shawn -
createUnit Enemy not enemy (salutes me)
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ok I know I've done this before in OFP but been hours and can't seem to get this to work. It's a simple spawn, but the enemy will not shoot at me. I'm playing a BLUFOR-USMC-Rifleman I create a unit with this: _curCreatePos=getMarkerPos "eastSpawn1"; eastCenter = createcenter east; _orderGroup = Creategroup east; "RU_Soldier_Crew" createUnit [_curCreatePos,_orderGroup,"currentGunner=this;"]; The enemy will not fire at me and sometimes he salutes me. What could I be doing wrong? ---------- Post added at 08:06 ---------- Previous post was at 07:46 ---------- Just tried spawning units of group west and they fire at the east group, but east group does not fire back? -
createUnit Enemy not enemy (salutes me)
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ahh nice, thanks! Yea I was doing setFriend before I created center. -
Mission Fails to Load
Sexacutioner replied to dealman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Looks like your brackets are wrong. Class mission encompasses the entire script and comparing it to an existing one, it should only ecompass up to the end of "Markers" (Intro/Outro should be seperate). The bracket before Markers (line 1139) is the end of Class Groups even though the tabbing doesn't reflect that. So looks like you just need to move the last bracket up before the class Intro. -
AI doesn't engage anymore
Sexacutioner replied to Raandom's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I read elsewhere that the more AI you have the slower they respond, making missions with less AI more difficult than missions with more. I'd test a copy with less AI and see if this is the case. If so, then it's kind of a crappy engine limitation that is causing the problem. -
createUnit Enemy not enemy (salutes me)
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ok, starting to pull my hair out here. Just created a new clean level to make sure there was nothing in my code messing it up and put this in the init.sqf: eastCenter = createcenter east; _orderGroup = creategroup east; _unit = _orderGroup createUnit ["RU_Soldier",position player,[],0,"NONE"]; The enemy stands there and does not fire at me. ---------- Post added at 08:36 ---------- Previous post was at 08:33 ---------- I've tried west setFriend [east,0]; east setFriend [west,0]; As well as a number of enableAI,setCombatMode and setBehaviour commands with no success. ---------- Post added at 09:25 ---------- Previous post was at 08:36 ---------- UPDATE: I figured out how to make it work. I need to have at least one east unit placed in the editor before they will treat shoot at me. I know I used to have to do this in OFP to create groups but I thought the createcenter command was supposed to fix this. I find it strange that everyone making maps at Bohemia creates a dead soldier in the editor before they can spawn working enemies.