

samatra
Member-
Content Count
652 -
Joined
-
Last visited
-
Medals
-
Medals
-
Everything posted by samatra
-
how would I go about detecting number of players near a player?
samatra replied to zamani532's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
{ if(isPlayer _x) then { private ["_cnt", "_plr"]; _plr = _x; _cnt = 0; { if(isPlayer _x) then { _cnt = _cnt + 1; }; } forEach nearestObjects [_x, ["Man"], 50]; hint format ["%1 players around %2", (_cnt - 1), name _plr]; }; } forEach allUnits; Didn't actually test the code, but it should work. This cycles through all players and counts players around them and puts number into _cnt. It will include player himself (so it is _cnt - 1 players around him). 50 is radius to check around each player. -
[R3F] Artillery and Logistic: Manual artillery and advanced logistic (mission script)
samatra replied to madbull's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
- Wrong info - -
Check if user has scoreboard open
samatra posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello. Is there any way to check if user has scoreboard open? (the one you have by pressing "i") Maybe you can somehow get it with findDisplay? Thanks. -
Civilian question
samatra replied to smacker909's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can also use isKindOf. According to vehicle class tree womans can be checked with if((_x isKindOf "Woman") || (_x isKindOf "Woman_EP1")) then { //Females } else { //Males } -
weaponholder pushes weapons outside building
samatra replied to twisted's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You should know the difference between setPos, setPosATL and setPosASL, since you use ATL this will mean that any invisible ground elevation under building will move your weaponholder position accordingly, i would recommend you to spawn weaponholders relative to building position\elevation, not relative to terrain level. Also I would recommend you to use createVehicle array instead of old deprecated way of creating vehicles you use right now, to be more specific you might want to experiment with different "special" parameters of newly created vehicle (Should be CAN_COLLIDE i think). Also take a look at http://community.bistudio.com/wiki/modelToWorld and http://community.bistudio.com/wiki/worldToModel, this might help you creating predefined spots for weapon holders for each building class. Edit: Here is my loot position generation mission I used for myself, basically it creates loot spots relative to building and dumps them into ArmA2OA.RPT (delete "# and #" in dump to get array of loot positions), scripts are bit messy but maybe you will find it useful. -
set ObjectTexture mapping
samatra replied to bloodxgusher's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No, there is no way around that without altering model which is impossible since models are closed for modifications and you will need a mod for that -
Shouldn't it be like #define __ccppfln(file) call compile preprocessFileLineNumbers "file" ?
-
set ObjectTexture mapping
samatra replied to bloodxgusher's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Either you got lite texture (PMC, BAF) or did something wrong. Yesterday I unpacked SUV texture and it was 4 megabytes in size. -
set ObjectTexture mapping
samatra replied to bloodxgusher's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Just use original textures as an example (extract them using Bitools). -
Empty array comparison
samatra replied to anessen's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can't compare arrays with == and others, you will have to walk through each array item and compare it by yourself. -
Script doesn't work after unit respawns.
samatra replied to Heaney's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Add into each player unit init: this addMPEventHandler ["MPRespawn", {h1pilots = h1pilots + [_this select 0];}]; -
Script doesn't work after unit respawns.
samatra replied to Heaney's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Something like this in init.sqf: p2 addMPEventHandler ["MPRespawn", {h1pilots = h1pilots + [_this select 0];}]; Add this for each player unit. -
Script doesn't work after unit respawns.
samatra replied to Heaney's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You probably need to add newly spawned unit into h1pilots Add event handler for respawn and add new unit into this array. -
Vehicle Location Markers
samatra replied to Nissen's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Make a cycle of walking through all vehicles, delete old marker (store marker name\id\number with setVariable), add new local marker. Something like that. -
questions concerning a multiplayer senario !!
samatra replied to dimdic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
1) Use if(!isServer) exitWith {}; this will exit activation script if player is not server and will execute it on server only The main thing that you should know is Multiplayer Locality, always check if certain command executes only on one machine or all clients before using it and adjust your scripts accordingly. -
Has anyone made a "hunting" game in Arma?
samatra replied to DieAngel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There was hunting mission by Xeno where you hunt various animals and gain points (and you can also hunt other hunters), don't remember its name though. -
publicVariableServer? Was it removed?
samatra posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello. I stumbled upon several announcements about publicVariableServer command which syncs variable only with server which will be extremely useful for my mission. I've tried it and it looks like command doesn't exists in last beta build, was it revoked or I'm doing something wrong? There is also barely any mention about this command apart from dayz change logs copy-pasted all over the internet. I will really appreciate if somebody could explain what is going on. Thank you. -
publicVariableServer? Was it removed?
samatra replied to samatra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This thread needs a bump. I will really appreciate an answer. Thank you. -
nearObjects returning p3ds not vehicles?
samatra replied to Tankbuster's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
"f8580f00# 8335: datsun02t.p3d" IS reference to vehicle object, it is just what object->string conversion returns. -
Arrays and copies of array
samatra replied to samatra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Tested it, it creates a reference, not copies array itself. Thanks for help. -
I'm wondering if I will have another array as part of other array, will it copy first array or just leave a link\reference to second array? For example hugeArray1 = [ ... ]; mySmallArray1 = ["hurr", hugeArray1]; mySmallArray2 = ["durr", hugeArray1]; Will I have copies of hugeArray1 inside mySmallArray1 (and mySmallArray2) or it will be just a link to that array and if I will change something in hugeArray1 will this change by accessible through mySmallArray1? Thank you.
-
Check if any players are nearby
samatra posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello. How can I check if there are any players are nearby certain position? And I mean players only, not AI. Thanks. -
Check if any players are nearby
samatra replied to samatra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for help -
Drag Carry Ammobox
samatra replied to A-SUICIDAL's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Take a look at this: http://forums.bistudio.com/showthread.php?94280-R3F-Artillery-and-Logistic-Manual-artillery-and-advanced-logistic-(mission-script) This script includes ability to move objects and even put them inside vehicles. Has lots of configuration options. Oh and about KeyDown stuff, sometimes findDisplay doesn't return display properly and you can't (obviously) add event handlers to it. Here is how I solve this problem: [] spawn { private ["_display"]; _display = null; disableSerialization; while {true} do { _display = findDisplay 46; if(!isNull(_display)) exitWith {}; sleep 1; }; _display displaySetEventHandler ["KeyDown", "hint ""KeyDown"";"]; }; It basically tries to get display indefinitely each second until it finds it and adds event handler -
Scripting commands you want in a future patch
samatra replied to celery's topic in ARMA 2 & OA - SUGGESTIONS
This. Ten times this.