xxanimusxx
Member-
Content Count
453 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by xxanimusxx
-
Custom MP Mission, MASTERUIDLIST error.
xxanimusxx replied to ThisIsZoid's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
-
Sure thing, as long as the config of that vehicle untimately inherits from the superclass Tank, it will count towards the trigger condition. You could test this out with (myModdedVehicle isKindOf "Tank") and see if it returns true :)
-
Do you mean tanks or humvees with armoured units? What didn't work with isKindOf? Could you provide us with your sample? this && ({_x isKindOf "Tank"} count thisList) > 0 This condition would trigger if there is at least one tank in your trigger area and bluefor detected by opfor also equals true. If you want to detect various unit-type, just search for their superclass (Tank is a superclass for example) and replace it in the above condition or use logical OR to define more classes.
-
Loadingscreen in JPG shows really ugly color banding
xxanimusxx replied to IT07's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Made my friend join and he's seeing it just fine :S Now im puzzled o_o -
Loadingscreen in JPG shows really ugly color banding
xxanimusxx replied to IT07's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Okay, apparently I'm also hosting a DayZ-Server and put your image as the loading screen: I had no problems whatsoever. No colour banding or other uncomely effects. Maybe your game settings mess up something? Did you get the feedback from one of your players? If they see it without any problems it will be clear that the source of this problem lies within your game :D -
Loadingscreen in JPG shows really ugly color banding
xxanimusxx replied to IT07's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well, for starters you could provide us with your image :) Nobody can find a solution based on a description to an image, without the actual image :D I don't know if the game engine is messing up the image, but it's normally strict with attributes your image has to have (square/n²), so I could think of something like the compression being unfavorable for the game engine or smth :S -
Marker name iterations
xxanimusxx replied to jakerod's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
As this is a popular method of dynamically accessing pre-placed map objects, you could also get rid of the static numbers if you just add a little query before execVM'ing :D _prefix = "bunker"; _lastMkrFound = true; _lastMarker = ""; _objectCount = 1; while {_lastMkrFound} do { _lastMarker = format ["%1_%2", _prefix, _objectCount]; _lastMarkerFound = !(isNil _lastMarker); if (_lastMarkerFound) then { _lastMarker execVM "bunker.sqf"; }; _objectCount = _objectCount + 1; }; This script should automatically find every marker with the prefix "bunker_" regardless of the number of markers placed in the editor. -
Conditions in an exterior script?
xxanimusxx replied to RippedHalo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well the condition you set is correct, but you need to wrap it up with another command :D // issuing unitPlay command here; flying to the rooftop. waitUntil {count crew MH6J == 2}; // issuing unitPlay command here; flying off -
Easier way to count # of player units per side in trigger?
xxanimusxx replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Maybe the command playableUnits is of interest for you, it returns, well, as it says, all playable units, which are normally always players, but could also be AI ones which are there for you to switch in them, so you would also check with isPlayer just to be sure. -
Scripting a big mssion; problems in getting the units to obey their waypoints
xxanimusxx replied to cadmium77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello there Cadmium77 :) I hope you already noticed that you're writing in the ArmA2-Subforum, not the ArmA3 one, which seems to be the game version you're using for your mission. But nevertheless, you're problem seems to be a generic one - but if it turns out to be an ArmA3 specific problem, I'm afraid you won't get the solution in here. Okay, back to your case. How about setting the helis which should head back after unloading to captive? This would prevent any enemies shooting them, so at least you could pull your helis back out of sight and set them back to normal afterwards. -
Spawn object in air - record speed at certain point?
xxanimusxx replied to -Gews-'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
showFallData = { _object = _this; _height = 1; _vel = 0; _time = 0; while {alive _object && _height > 0} do { _time = _time + 0.1; _height = getPosATL _object; if (surfaceIsWater _height) then { _height = getPosASL _object; }; _vel = abs ((velocity _object) select 2); hintsilent format ["Falling object's data:\n\nVelocity: %1 m/s\nPosition: %2\nTime: %3s", _vel, str _height, _time]; _height = _height select 2; sleep 0.1; }; }; Call it like this: yourObject spawn showFallData; This will constantly show the velocity, 3D position and spent time until the object is either destroyed or hits the ground. // edit: I originally used some triangular arithmetic to calculate the velocity of the object, but taking the Z-velocity will almost yield the same results and as you're just interested in the velocity while the object is falling, this is an acceptable approximation. -
Easier way to count # of player units per side in trigger?
xxanimusxx replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well there is a command called countSide, with an example just showing you what you want - except the fact that it counts all units, including AIs. Another way was showed by Silderoy, although not entirely correct (_x == player) => (isPlayer _x). I'd do it like this: _allUnits = list myTrigger; _sides = [west, east, resistance]; for "_i" from 0 to count _sides - 1 do { _sides set [_i, {isPlayer _x && side _x == (_sides select _i)} count _allUnits]; }; After executing this script, the array _sides will contain the number of players in each respective side. _sides select 0 = number of players in side west _sides select 1 = number of players in side east _sides select 2 = number of players in side resistance Didn't test it tho ^^ -
Triggering setCaptive inside a certain vehicle
xxanimusxx replied to macusercom's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you have a static set of classnames, you could do it like this: captiveInVehicle = { (_this select 2) setCaptive ((_this select 2) in (_this select 0)); }; _vehicleTypes = ["UH60M_MEV_EP1", "M1133_MEV_EP1"]; { if ((typeOf _x) in _vehicleTypes ) then { { _x setCaptive true; } forEach crew _x; _x addEventHandler ["GetIn", "_this call captiveInVehicle;"]; _x addEventHandler ["GetOut", "_this call captiveInVehicle;"]; }; } forEach vehicles; Now you can easily add more classes to the _vehicleTypes-Array. -
Triggering setCaptive inside a certain vehicle
xxanimusxx replied to macusercom's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Did this problem occur while testing the code I supplied or with your own code? The "my problem was" confuses me somehow :D Well of course the AI will target and engage the soldiers who get out of the heli, because they're not captive anymore if they do. The rest of your soldiers in the heli should be captive though, but please be advised that the eventhandler will only trigger upon someone entering/leaving the vehicle, if you script-move your soldiers into your heli or spawn the heli with soldiers, they won't be captive. But we can easily overcome that problem: captiveInVehicle = { (_this select 2) setCaptive ((_this select 2) in (_this select 0)); }; { if (_x isKindOf "UH60M_MEV_EP1") then { { _x setCaptive true; } forEach crew _x; _x addEventHandler ["GetIn", "_this call captiveInVehicle;"]; _x addEventHandler ["GetOut", "_this call captiveInVehicle;"]; }; } forEach vehicles; -
Triggering setCaptive inside a certain vehicle
xxanimusxx replied to macusercom's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
How about using an event handler which automatically sets the player getting in to captive and deactivates it upon disembarking: UH60_medevac addEventHandler ["GetIn", {(_this select 2) setCaptive true;}]; UH60_medevac addEventHandler ["GetOut", {(_this select 2) setCaptive false;}]; And if you have the superclass of your vehicle or the exact classname, you could do an automatic search: captiveInVehicle = { (_this select 2) setCaptive ((_this select 2) in (_this select 0)); }; { if (_x isKindOf "UH60") then { _x addEventHandler ["GetIn", "_this call captiveInVehicle;"]; _x addEventHandler ["GetOut", "_this call captiveInVehicle;"]; }; } forEach vehicles; -
Immobile Crate
xxanimusxx replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Maybe deactivating simulation would yield the same result. -
Checking server side
xxanimusxx replied to Sexacutioner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well there is no entity/object named "server" you can check the locality on, but isServer will return true if the code is executed upon the server side. -
[Beginners guide]: Arrays
xxanimusxx replied to [frl]myke's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This piece of code will automatically create global variables and assign the respective groups to it: for "_groupIndex" from 1 to count allGroups do { call compile format ["group%1 = (allGroups select (%1-1));", _groupIndex]; }; So using the global variables will refer to the respective groups: group1 addWaypoint [_center, 0]; // is equal to: (allGroups select 0) addWaypoint [_center, 0]; _numCrew = count (crew group3); // is equal to: count (crew (allGroups select 2)) But to be honest I dont understand your last part, if you want to "label" your groups in order to loop through them, why not use allGroups and a forEach-loop in the first place? -
How can I add more magazines to the door gun of a helicopter?
xxanimusxx replied to JakeDK's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I assume you didn't understand how the turretPath is used, so here's a really simple explanation: Check the config of the vehicle and find the turrets-class. Every item in there is an index for the turretpath. For the UH-1H it would be the MainTurret ([0]) and the LeftDoorGun ([1]). Using this information and combining it with the command you already tried out, you can fix some code like this: myHelo addMagazineTurret ["100Rnd_762x51_M240", [0]]; // main-turret myHelo addMagazineTurret ["100Rnd_762x51_M240", [1]]; // left-door-turret Or you could write a function which automatically adds a set number of magazines to all turrets in a vehicle, like this: addTurretAmmo = { private ["_turretConf", "_vehicle", "_turretPath", "_numAmmo", "_numTurrets", "_turretID", "_turret", "_subTurrets", "_ammoTypes", "_subTurretPath", "_this"]; if (isNil "_this") exitWith{}; if (typeName _this != "ARRAY") exitWith{}; if (count _this < 2) exitWith{}; _turretConf = _this select 0; _numAmmo = _this select 1; _subTurretPath = -1; _turret = objNull; _subTurrets = objNull; _vehicle = objNull; _numTurrets = 0; _ammoTypes = []; _turretPath = []; if (typeName _turretConf == "OBJECT") then { _vehicle = _turretConf; _turretConf = configFile >> "cfgVehicles" >> typeOf _vehicle >> "turrets"; }; _numTurrets = count _turretConf; if (count _this > 2) then { _subTurretPath = _this select 2; _vehicle = _this select 3; }; for "_turretID" from 0 to _numTurrets-1 do { _turret = _turretConf select _turretID; _ammoTypes = []; _turretPath = [_turretID]; if (_subTurretPath != -1) then { _turretPath set [1, _subTurretPath]; }; // gather unique ammo types { if (!(_x in _ammoTypes)) then { _ammoTypes set [count _ammoTypes, _x]; // add them into the turret! for "_i" from 1 to _numAmmo do { _vehicle addMagazineTurret [_x, _turretPath]; }; }; } forEach (getArray (_turret >> "magazines")); // check for subturrets! _subTurrets = _turret >> "turrets"; if (count _subTurrets > 0) then { [_subTurrets, _numAmmo, _turretID, _vehicle] call addTurretAmmo; }; }; }; // Adds 10 more ammunition to all turrets in myHelo [myHelo, 10] call addTurretAmmo; Didn'T try that out but I'm pretty sure it will work :D -
Putting parts of a mission server side to stop mission theft
xxanimusxx replied to pballer29's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well you could set all of your scripts serverside and exchange data using PVEH's and remote execution, heck, you could even dump all the code you want on the clients using a simple PVEH which simply evaluates the strings it receives (call compile). But that would end up being a serious performance killer, so no sane person would ever consider this drastic step :D This is the same problem you have with JavaScript-Code - it's easily accessible in every site you visit and you can't do anything from getting copied/robbed of your own created code. I found out the best way of stopping code theft is to outsource the crucial parts of your mission to the server - like database-access. If you have a mission with a database-link, you're naturally gonna store the code to access the database on the server, so the client doesn't get to know the structure of your database tables or other informations which could help to reverse-engineer this part of your mission - et voilá, even if your mission get's copied without giving any credits, it will be a pain in the ass to reconstruct the missing parts to make the mission work, and if they finally manage to reconstruct these parts, you'll have to admit that the work they put into that should be enough to legitimate AVIBIRD 1 rant from above :) -
Helicopter Start Up times
xxanimusxx replied to tom.tucka's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well, as I understand he wants the helis to have a more realistic startup behavior - there's no helicopter out there being ready in less than 30 seconds :D Normally you do a thorough checkup, start the engine, check for the temperature, set throttle to idle, stop the engine starter, wait till its at ~60% of rpm, check the temperature values, set throttle to full and wait until the rpm is at 100% - repeating this routine for every engine in the helicopter (usually 2 for bigger ones). This takes some time (up to several minutes) and gives you the feeling of handling a real helicopter. But unfortunately this is just to be seen in Take on Helicopters, I don't know how much you could temper with the model data of Arma2-Helis to achieve something similar (adding actions/buttons would be a good start I guess). -
init for trigger spawned unit interfers with spawn script
xxanimusxx replied to magicool's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_spawnPos = getMarkerPos _this; _groupTerror1 = createGroup EAST; _unit1 = _groupTerror1 createUnit ["ETerrorist8", _spawnPos, [], 1, "FORM"]; sleep 0.2; _unit2 = _groupTerror1 createUnit ["ETerrorist3", _spawnPos, [], 1, "FORM"]; sleep 0.2; _unit3 = _groupTerror1 createUnit ["ETerrorist1", _spawnPos, [], 1, "FORM"]; sleep 0.2; _unit4 = _groupTerror1 createUnit ["ETerrorist4", _spawnPos, [], 1, "FORM"]; sleep 0.2; _nul = [_unit4, 1, 10, _this] execVM "AI_respawn\AI_respawn_init.sqf"; Call it with: nul = "myMarkerName" execVM "spawnterror1.sqf"; -
Compiled mission read from external file
xxanimusxx replied to zodd's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well you could always use loadFile to load the contents of any file into a string or preprocessFile if it's in a form usable in scripts, both work great if the files you're reading are accessible in your ArmA2-Folder. -
init for trigger spawned unit interfers with spawn script
xxanimusxx replied to magicool's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Quotes in quotes :D You have to double-quote quotes xD createUnit [getMarkerPos "east_spawn", _groupTerror1, "nul = [this, 3, 10, ""east_spawn""] execVM ""AI_respawn\AI_respawn_init.sqf"";"]; You should look into your rpt-file, I'm sure the error was shown there ;) -
'hide' waypoint
xxanimusxx replied to forzajuve's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Would this solve your problem? http://community.bistudio.com/wiki/setWaypointVisible