Sexacutioner
Member-
Content Count
133 -
Joined
-
Last visited
-
Medals
Everything posted by Sexacutioner
-
1.63 Script issues
Sexacutioner replied to infection's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I have code like this in my script that worked before: waitUntil {!isNull attachLogic2}; It throws an undefined variable error when the entire reason for that is to wait until the variable is initualized before using it. So I am doing it proper and stuff like this is necessary when it comes to multiplayer scripts that you only want the server creating variables and the clients to wait for them. -
tell if there are units under position
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I ended up with a solution using nearEntities: _currentSpawnPos=getMarkerPos "eastStartSpawn"; while {count ((_currentSpawnPos) nearEntities 70)>0} do { _currentSpawnPos=[_currentSpawnPos select 0,(_currentSpawnPos select 1)+70,_currentSpawnPos select 2]; }; -
tell if there are units under position
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So this is a difficult thing to search for. I'm wondering if there is scripting command or similar to get all units around a certain position. What I'm trying to do is spawn an unknown amount AI in helicopters, but if I don't keep increasing the X or Y position they crash into each other. I would like if the space is empty to spawn the AI there, but if there is already someone there then spawn it a bit further and so on. I can accomplish this in a while loop if there is a command like "findEmptyPosition" or isAt(x,y,z) that can tell me if there is a vehicle already at this position. The AI will fly at different times and more are created at different times at the player control so it would be easiest to just check the area and move the position if it's occupied. -
Sometimes my MPKilled event is not being called
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So in a multiplayer game I'm creating around 50 rabbits on the map you can hunt for money. I was finding that sometimes the addaction that is supposed to be attached to the rabbit body on death isn't working. I tested with my friend with around 400 rabbits and put in messages to tell me when the rabbit was killed, who killed it, etc. What I found is that some of the time the "MPKilled" is not getting called at all. Does anyone see any problem with my spawn code? This is in the init, to create the initial rabbits, the minRandomLandX etc are the extents of where I want them to spawn: if (isServer) then { for [{_counter=0}, {_counter<_totalRabbits}, {_counter=_counter+1}] do { _randomX = (random minRandomLandX)+addRandomLandX; _randomY = (random minRandomLandY)+addRandomLandY; _locationWrong=true; while {_locationWrong} do { if (!surfaceIsWater [_randomX, _randomY]) then { if ({[_randomX, _randomY] distance _x < 300} count playableUnits==0) then { _locationWrong=false; } else { _randomX = (random minRandomLandX)+addRandomLandX; _randomY = (random minRandomLandY)+addRandomLandY; }; } else { _randomX = (random minRandomLandX)+addRandomLandX; _randomY = (random minRandomLandY)+addRandomLandY; }; }; _currentRabbit = createAgent ["Rabbit",[_randomX,_randomY], [],0,'FORM']; _currentRabbit addMPEventHandler ["MPKilled", {[_this,null,null,[4]] execVM "callScript.sqf"}]; }; }; And here is what I have in callScript.sqf. This script handles multiple things so I'm just pasting the stuff dealing with rabbit death: _scriptType=_this select 3 select 0; _doCreateRabbit=false; switch (_scriptType) do { case 4: { _victim = _this select 0 select 0; _killer = _this select 0 select 1; _killerSide = side _killer; _victimSide = side _victim; player globalchat format["dead rabbit: %1 %2 %3 %4",_killer,_victim,_killerSide,_victimSide]; //Added for debug _victim addAction [format ["Get Money ($%1)",moneyDroppedRabbit], "callScript.sqf",[1]]; if (_killer==player) then { attachLogic2 globalchat "Rabbit Killed"; }; if (isServer) then { if (typeOf _killer=="Rabbit") then { while { _victim distance player<300} do { sleep 10; }; player globalchat "removed event handlers"; //Added for debug _victim removeAction 0; _victim removeAllMPEventHandlers "MPKilled"; deleteVehicle _victim; _doCreateRabbit=true; }; }; }; }; if (_doCreateRabbit) then { _randomX = (random minRandomLandX)+addRandomLandX; _randomY = (random minRandomLandY)+addRandomLandY; _locationWrong=true; while {_locationWrong} do { if (!surfaceIsWater [_randomX, _randomY]) then { if ({[_randomX, _randomY] distance _x < 300} count playableUnits==0) then { _locationWrong=false; } else { _randomX = (random minRandomLandX)+addRandomLandX; _randomY = (random minRandomLandY)+addRandomLandY; }; } else { _randomX = (random minRandomLandX)+addRandomLandX; _randomY = (random minRandomLandY)+addRandomLandY; }; }; player globalchat "created new rabbit"; //Added for debug _currentRabbit = createAgent ["Rabbit",[_randomX,_randomY], [],0,'FORM']; _currentRabbit addMPEventHandler ["MPKilled", {[_this,null,null,[4]] execVM "callScript.sqf"}]; _currentRabbit addAction ["New Spawn", "callScript.sqf",[10]]; }; The problem I'm running into is sometimes a rabbit is killed and there is no message sent and no addAction attached to the rabbit. So it seems sometimes the "MPKilled" event is not happening at all. I've been through the code multiple times but can't seem to find anything wrong with it. Anyone else have an idea what I could be doing wrong? Thanks for any and all help on this! -
Computer spawning system
Sexacutioner replied to Tomater's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
For creating a custom interface you should look into dialog controls: http://community.bistudio.com/wiki/Dialog_Control For spawning units you should look into the createVehicle command: http://community.bistudio.com/wiki/createVehicle_array -
Sometimes my MPKilled event is not being called
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
setPos on the agents I get back from this array does nothing. I haven't been able to extract any information from them besides the fact they seem to be of type "object". I'm not even sure this array contains the rabbits, but it is my best guess. Oh and also it changes size as the game runs. I'll have to look into that class. I haven't made much for addons since OFP but from what I remember you can include them in missions yes? -
Removing Rabbits from Map
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I have a mission where you hunt rabbits, but the problem is there are default rabbits already spawned on the map that I can't keep track of for kills. Is there any way to remove these? I have tried looking through the agents array: { player globalChat "agent "+str(agent _x)+" "+str(agentCounter); } forEach agents; However typeOf returns an empty string so I have no idea if it's a rabbit and deleteVehicle or setdamage do not seem to have any effect. Ideas? -
Sometimes my MPKilled event is not being called
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sooo. After lots of testing against rabbits, cows, 1000's of animals on the map and so forth I found what the problem was. There are already rabbits on the map! I was way off :). That's why it seemed the error was so random. Sometimes we were killing rabbits I hadn't created. So now I'm looking for a way to delete them. I found the "agents" command and can find all the agents on the map like so: agentCounter=0; { agentCounter=agentCounter+1; player globalChat "agent "+str(agent _x)+" "+str(agentCounter); } forEach agents; The problem now is I don't know what is rabbits and what is not. The typeOf agent _x returns an empty string. The getPos returns [0,0,0]. Is there any way of telling if this agent is a rabbit? I don't wish to remove everything from the map. ---------- Post added at 00:20 ---------- Previous post was at 23:54 ---------- Another problem I've found is I cannot find a way to delete these guys. Even if I can verify if it is a rabbit, deletevehicle or setdamage do not seem to change the agents array at all. -
can't createUnit tried everything
Sexacutioner replied to peterius's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Using this should help you create vehicles of any side: createcenter civilian; createcenter east; createcenter west; createcenter resistance; createCenter sideLogic; I have found setting friendly options is sometimes necessary when there aren't any units of type on the map as well: West setFriend [Resistance, 0]; West setFriend [East, 0]; West setFriend [West, 1]; East setFriend [Resistance, 0]; East setFriend [West, 0]; East setFriend [East, 1]; Resistance setFriend [East, 0]; Resistance setFriend [West, 0]; Resistance setFriend [Resistance, 1]; You only have to do that once. Then just create a new group when creating the unit (i.e. _civGroup = Creategroup civilian;) -
Military Symbols Locality
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm working on a multiplayer mission where I would like all units of only the side the player is on to show up on the hud. I used the military units moduled and tried the following: setGroupIconsVisible [true,true]; if (side player==west) then { BIS_marta_mainscope setvariable ["rules",[ ["o_", [0,.5,1,0] ], ["b_", [0,.5,1,1] ], ["n_", [0,.5,1,0] ], ["n_", [0,.5,1,0] ] ],true]; }; if (side player==east) then { BIS_marta_mainscope setvariable ["rules",[ ["o_", [0,.5,1,1] ], ["b_", [0,.5,1,0] ], ["n_", [0,.5,1,0] ], ["n_", [0,.5,1,0] ] ],true]; }; if (side player==resistance) then { BIS_marta_mainscope setvariable ["rules",[ ["o_", [0,.5,1,0] ], ["b_", [0,.5,1,0] ], ["n_", [0,.5,1,1] ], ["n_", [0,.5,1,0] ] ],true]; }; However it doesn't seem to be working at all. Sometimes nothing shows up and other times enemy units or vehicles show up. Anyone know if it's possible to set this up for each side to only see their teamates? -
How do you place multiple units at once?
Sexacutioner replied to Headless_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well there are groups that can be placed in the editor or you can select and ctrl-c ctrl-v to copy and paste them. For scripting you can use the createVehicle command. -
Easier way to count # of player units per side in trigger?
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So I'm converting a bunch of my OFP scripts to Arma II and I was wondering if there are any new tricks someone knows of to check a trigger area for the number of (players only) units per side present. I used to have to do it with a mess of code like this: _triggerArray=list currentCaptureTrigger; _totalPresent=count _triggerArray; _numResPresent=0; _numEastPresent=0; _numWestPresent=0; _countList=0; _maxHeight=captureHeightArray select currentCaptureNumber; while "_countList < _totalPresent" do { _currentUnit=_triggerArray select _countList; _currentUnitCrew=crew _currentUnit; if (((getpos _currentUnit) select 2)<=_maxHeight) then { if (east1 in _currentUnitCrew) then {_numEastPresent=_numEastPresent+1}; if (east2 in _currentUnitCrew) then {_numEastPresent=_numEastPresent+1}; if (east3 in _currentUnitCrew) then {_numEastPresent=_numEastPresent+1}; if (east4 in _currentUnitCrew) then {_numEastPresent=_numEastPresent+1}; if (east5 in _currentUnitCrew) then {_numEastPresent=_numEastPresent+1}; if (res1 in _currentUnitCrew) then {_numResPresent=_numResPresent+1}; if (res2 in _currentUnitCrew) then {_numResPresent=_numResPresent+1}; if (res3 in _currentUnitCrew) then {_numResPresent=_numResPresent+1}; if (res4 in _currentUnitCrew) then {_numResPresent=_numResPresent+1}; if (res5 in _currentUnitCrew) then {_numResPresent=_numResPresent+1}; if (west1 in _currentUnitCrew) then {_numWestPresent=_numWestPresent+1}; if (west2 in _currentUnitCrew) then {_numWestPresent=_numWestPresent+1}; if (west3 in _currentUnitCrew) then {_numWestPresent=_numWestPresent+1}; if (west4 in _currentUnitCrew) then {_numWestPresent=_numWestPresent+1}; if (west5 in _currentUnitCrew) then {_numWestPresent=_numWestPresent+1}; }; _countList=_countList+1; }; That loop contains all units from each team that are assigned names in the editor. It's the only way I found to get it to count actual players (not AI) and count crew in vehicle separate (not a vehicle as only 1 unit). Are there any fancy new scripting commands since OFP that make this task a bit easier, like just returning #players east? -
Remove camSetTarget target
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If I do a camSetTarget on a camera is it possible to make it a free cam again? I tried camSetTarget objNull but it still retains it's target. Thanks! -
switchCamera "EXTERNAL" on Expert Difficulty
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello all! I'm working on my death spectator cam and have run into a problem when trying to watch a player from 3rd person. If I attemp to do _unit switchCamera "EXTERNAL"; when on expert difficulty it doesn't allow it since it only allows first person view. I'd like to allow watching from 3rd person after you as a spectator. -
Keep AI head in place after doWatch
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm making a camera scene from the AI perspective and I would like him to look down for a period of time. If I doWatch the ground he keeps looking back and forth from the doWatch direction and up again. Is there any way to keep his head down? So far I've tried disableAI TARGET/AUTOTARGET with no effect and enableSimulation shuts off breathing/walking which I would like to keep. -
Keep AI head in place after doWatch
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks. I was messing around with that, and wanted him walking with his head down. I can get it sometimes but I cannot refresh the doWatch to another position to keep his head in place. Might be the closest solution I'm going to find though. -
switchMove for" V" step over animation
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'd like to force an AI to do the "step over" move but am having a hard time finding it. I've looked over the moves here: http://community.bistudio.com/wiki/ArmA2:_Moves and haven't been able to find it. Does anyone know what this animation is, or can it be called another way like through an action? Thanks. ---------- Post added at 00:11 ---------- Previous post was at 00:07 ---------- Man, the way to figure out a problem is to give up and ask on the forums. Then the answer presents itself :). For anyone else looking, it's an action instead of an animation and shown here: http://community.bistudio.com/wiki/ArmA_2:_Actions#GetOver -
How to make doorway impassable for AI
Sexacutioner replied to BLQQD's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Is this door created after the mission is loaded? As far as I've been able to tell, all pathways appear to be calculated and permanent after mission load. So if it's in the editor the AI will recognize a wall, but if it's created after load they will go through it. Some goes both ways as a wall removed will still block ai after load. That's been my experience since OFP, however things might have changed that I am unaware of. Best answer I have would be to use trigger areas or geometry scripting to manually move the AI away from there. -
Alternative for Setcaptive
Sexacutioner posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So I've been trying to make a mission in which you originally start out as captive and then have to fight your way out of the enemy base. There are some major issues I've ran into with setCatpive and was wondering if there was a better way to go about this. Here is what I am running into: If the mission starts with the player setCaptive true, then after it is changed to false most enemies still do not fire at the player. I was able to work around most of these issues with the following: { _currentPlayer=_x; _currentPlayer setCaptive false; {if (side _x==west) then {_x reveal _currentPlayer;};} forEach allGroups; } forEach arrayForPlayers; That pretty much calls a "reveal" for every unit on the map of the players location and causes them to open fire again. However... Any unit set to "Safe" still will not fire even after I call reveal on them. Even after using reveal the enemy fires a lot less. If I disable the initial setCaptive call there is tons of fire coming from all directions in the mission, however after turning setCaptive off and calling reveal you have to get right up on an enemy for them to do anything. So is there a better way to do this. I'd like to have the player "captured" then have a gun snuck to them and make them "uncaptured" at that point. ---------- Post added at 13:10 ---------- Previous post was at 12:08 ---------- After messing around a bit I came up with this method that works a little better (although requires more hands on for each unit); To set "captive" { _x disableAI "MOVE"; _x disableAI "TARGET"; _x disableAI "AUTOTARGET"; } forEach allUnits; To remove "captive" { _x enableAI "MOVE"; _x enableAI "TARGET"; _x enableAI "AUTOTARGET"; } forEach allUnits; -
There are plenty of times while browsing the command reference on the wiki (http://community.bistudio.com/wiki/Main_Page) that I come across entries that are missing vital information or are incorrect in some ways. I was going to sign up so next time this happens I can contribute however looking around I cannot find a working registration page for it anywhere.
-
Thanks. I sent an email btw.
-
Sometimes my MPKilled event is not being called
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So just an update on what I've tried and it's still not working. Put in a very long sleep before creating the initial rabbits, some were still duds (did not call the MPKilled event when killed) I tried spawning the rabbits all right on top of the players in a multiplayer game to make testing quicker. For whatever reason when surrounded by 100 rabbits instead of them spread out across the map this worked every time. Restarted the mission like 5 times and did not have one dud rabbit after tons of shooting. After thinking it was fixed I went and spawned the rabbits spread across the map far away from the players again and back to having random duds. I made the ressurected rabbits cows to tell them apart and see if only that part of the script was missing. It wasn't as some rabbits were still duds. I actually think the initial created ones are the only duds. Wondering if there is some sync issue while the map is first starting and the clients are loading it while the server makes rabbits. But I tried with a long sleep and it still messes up occasionally. I'm out of ideas right now, wondering if it is something weird like an automatic resource culling if rabbit is out of range of player I dunno. -
Any way to remove the microphone icon in the middle of the screen?
Sexacutioner posted a topic in ARMA 2 & OA - GENERAL
As the title says, I'm wondering if anyone knows of a mod or settings option that will remove the microphone icon when voice chat is locked on. Playing with friends we keep global voice on the entire time and that icon is seriously bugging me. My brain keeps associating it with a crosshair and it's throwing my aim off :butbut: -
Any way to remove the microphone icon in the middle of the screen?
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA - GENERAL
The microphone icon that shows up when using voice chat? What is that setting called? -
Deleting Group when all are dead
Sexacutioner replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Oh duh, why didn't I think of using alive in conjunction with group. Yea just count those alive in the group and if it's zero remove the group. Thanks.