Ub3rObama
Member-
Content Count
31 -
Joined
-
Last visited
-
Medals
Everything posted by Ub3rObama
-
Dynamic Placement CreateVehicle
Ub3rObama posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So after seeing an admin complain about how hard it is to make a vehicle spawning script I thought hell I'd give it ago because I'm bloody bored atm. Anyway this is what I have come up with so far: _vehiclesArray = [ "ATV_US_EP1", "HMMWV_M1035_DES_EP1", "Ikarus_TK_CIV_EP1", "LandRover_CZ_EP1", "2S6M_Tunguska", "MAZ_543_SCUD_TK_EP1", "Offroad_SPG9_TK_GUE_EP1", "SUV_UN_EP1", "Ural_UN_EP1", "VolhaLimo_TK_CIV_EP1" ]; _weaponsArray = [ "m107_TWS_EP1", "M24_des_EP1", "AKS_74_GOSHAWK", "M4A3_RCO_GL_EP1", "SCAR_L_STD_EGLM_TWS", "M60A4_EP1", "MG36_camo" ]; _magsArray = [ "10Rnd_127x99_m107", "5Rnd_762x51_M24", "30Rnd_762x39_AK47", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "100Rnd_762x51_M240", "100Rnd_556x45_BetaCMag" ]; a = 0; for "a" from 0 to 20 do{ _veh = createVehicle [ _vehiclesArray select random count _vehiclesArray,getMarkerPos "1",["1","2","3"], 50, "FLY"]; _veh setDir random 360; _veh setFuel (100 - random 80) * 0.01; _veh setVehicleArmor (100 - random 50) * 0.01; _weapon = random count _weaponsArray; _veh addWeaponCargo [_weaponsArray select _weapon, 1]; _veh addMagazineCargo [_magsArray select _weapon, (random 6) + 1]; sleep 0.1; }; My only problem is the placement radius. Its static, I want it to vary with the size of the marker, but I don't think that will work. I need a completely different way of doing it I think. Any ideas are appreciated or if you notice bad problems, I only started scripting for Arma today. Also, DAM its difficult to post on these forums, got enough anti bot stuff? Sheesh. -
I haven't done anything with addons, lots of scripting though. I was just wondering if anyone could give me a 3 second run down on something like taking a normal already ingame weapon like the M107, creating a copy that shoots something silly like GBU 12's thats full auto. Always thought that would be a bit of fun with a bunch of friends in a server. I imagine this would be just a matter of copy/pasting the current weapon, changing the classname and then having a config somewhere that declares the projectile?
-
Ever since installing the beta, a long time ago, back when Day Z was 1.7.2.0 I have not been able to use filters in normal OA. If I have Day Z loaded filters work fine, but if I have normal arma + beta and put anything in the filters absolutely nothing will come up. I have searched and seen that not a single person has the problem, its extremely irritating. Thanks to Day Z commander, it also overwrote the normal OA exe, which I no longer have so I can't go back without redownloading arma. Just wondering if anyone has heard of this and can help? I am using the latest beta.
-
What is entities "AllVehicles"
Ub3rObama posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
What is entities "AllVehicles" I found it in a wasteland script, and there is absolutely no documentation of it anywhere, and its not referenced anywhere else in the wasteland files. Its used in this form: { } foreach entities "AllVehicles"; -
This line right here gives me an error: _soldier addEventHandler["Killed",{[nil,(_this select 1),"loc",execVM "client\money.sqf"] call RE;}]; The error is: Error in expression <rC:\Users\name\Documents\ArmA 2 Ot> Error position: <\Users\nameDocuments\ArmA 2 Ot> Error Invalid number in expression But the code still works exactly as intended. So whats the problem? Also I read in a thread to use CBA instead of Multiplayer Framework, but CBA is an addon? Wouldn't all clients need it as well?
-
A non helpful error
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks I managed to use: _soldier addEventHandler["Killed",{[nil,(_this select 1),"loc",rEXECVM,"client\money.sqf"] call RE;}]; (Notice the comma) Which works well, but I'm wondering if your second method would be better performance wise, since the code is already loaded and is simply only being called in new thread, but then again execVM is also doing a very similar thing. -
Dialog Tutorial For Noobs [By A Noob]
Ub3rObama replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Forgot to say thanks for them classes! -
Dialog Tutorial For Noobs [By A Noob]
Ub3rObama replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hmm I found the CA pbo but it didn't have much in it, but I noticed other pbos with similar names (e.g. warfare.pbo) so I de pbo'd them and found quite a few things. I also de pbo'd warfare and looked for any reference to the paa files for the unit icons that come up when you buy units, absolutely nothing. Found some stuff for the warfare side of things, but not unit building, which is really strange. What I am looking for is, icon's of buildings like bunkers and machine gun nests. I de pbo'd A LOT of the arma ones and couldn't find what I wanted, anyone know if they even exist? -
Dialog Tutorial For Noobs [By A Noob]
Ub3rObama replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Wow nice timing, I just decided I wanted to create dialogs. I was looking the Warfare mission, and wanted to see how they got the pictures of units to show. The path they used is this : \CA\warfare2\Images\con_barracks.paa Wheres this CA folder? Its certainly not in the mission. -
Yeah but trying to find specific servers, or hosted games by friends is next to impossible.
-
Script not executing properly client/server
Ub3rObama posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm using this to call script.sqf, in a number of unit (player) slots. Null = ["12345678"] execVM "script.sqf"; script.sqf WaitUntil{not isNull player}; waitUntil{(getPlayerUID player) != ""}; _uid = getPlayerUID player; if(_uid != (_this select 0)) then { endMission "LOSER"; }; This is designed to check if a player is in his correct slot. Now I'm really stumped by this, because whats happening is when 2 people join the game in their correct slots, it kicks them straight away. I'm sure its the exec, and that it must be executing on the server, but I've tried changing it around and haven't gotten any good results. I think I'm having a dumb moment because it seems obvious but I just can't work it out. Should be bloody simple. The script works fine, if its only 1 person joining. -
Script not executing properly client/server
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Whats happening is when the first person goes through a check the _uid gets stuck. So when another person comes along and goes through the check, it uses the previous _uid, which breaks everything. I don't understand how thats happening, I thought execVM opened a new thread every time it was called, meaning fresh variables but it looks like it keeps the same thread open, re uses it and doesn't update the variables, or is skipping code, its really odd. What needs to happen is the script only on the client machine, but I have no idea how to get that to happen. -
Script not executing properly client/server
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Its supposed to kick anyone who is in that slot (unit) who doesn't have that specific UID, its designed to make that slot/unit so only 1 person can join it. -
Error 0 elements provided, 3 expected, driving me nuts!
Ub3rObama posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So I can't get rid of this bloody error, even though it doesn't actually effect anything it still spams like crazy. I've tried everything I can think of, such as adding an if statement which checks if the array exists/the size of the array but whatever is going on keeps getting past the if statements. Error: a = 0; for "a" from 0 to 20 do{ _veh = createVehicle [_vehiclesArray select ran> Error position: <createVehicle [_vehiclesArray select ran> Error 0 elements provided, 3 expected Script: if (!isServer) exitWith {}; private ["_pos","_veh","_weapon","_vehiclesArray","_weaponsArray","_magsArray","_townsArray","_car"]; _vehiclesArray = [ "ATV_US_EP1", "HMMWV_M1035_DES_EP1", "Ikarus_TK_CIV_EP1", "LandRover_CZ_EP1", "2S6M_Tunguska", "MAZ_543_SCUD_TK_EP1", "Offroad_SPG9_TK_GUE_EP1", "SUV_UN_EP1", "Ural_UN_EP1", "VolhaLimo_TK_CIV_EP1" ]; _weaponsArray = [ "m107_TWS_EP1", "M24_des_EP1", "AKS_74_GOSHAWK", "M4A3_RCO_GL_EP1", "SCAR_L_STD_EGLM_TWS", "M60A4_EP1", "MG36_camo" ]; _magsArray = [ "10Rnd_127x99_m107", "5Rnd_762x51_M24", "30Rnd_545x39_AK", "30Rnd_556x45_Stanag", "30Rnd_556x45_Stanag", "100Rnd_762x51_M240", "100Rnd_556x45_BetaCMag" ]; _secondaryMagsArray = [ "", "", "", "1Rnd_HE_M203", "1Rnd_HE_M203", "", "" ]; _townsArray = [ "Kamenyy", "Strelka", "Airfield" ]; x = 0; for "x" from 0 to count _townsArray do{ a = 0; for "a" from 0 to 20 do{ _veh = createVehicle [_vehiclesArray select random count _vehiclesArray,[_townsArray select x] call SHK_pos,[], 0, "FLYING"]; _veh setDir random 360; _veh setFuel (100 - random 80) * 0.01; _veh setVehicleArmor (100 - random 50) * 0.01; clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; _weapon = random count _weaponsArray; _veh addWeaponCargoGlobal [_weaponsArray select _weapon, 1]; _veh addMagazineCargoGlobal [_magsArray select _weapon, (random 6) + 1]; if(!(_secondaryMagsArray select _weapon == "")) then{ _veh addMagazineCargoGlobal [_secondaryMagsArray select _weapon, (random 5) + 1]; }; sleep 0.1; }; }; -
Armored SUV player animation.
Ub3rObama posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Does anyone know the name of the animation that goes with the minigun up? I've searched and searched but can't find anything. That or I need someway to hide the player, because when the doors close he still sticks out, I thought I might of been able to use an animation on him, but I can't get animations to work whilst he is in the gunner seat. I already have the code that lowers/raises the minigun just need someway of either animating the player or hiding him. -
Armored SUV player animation.
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I think that helped, but I also think I did something else that fixed the problem as well, not sure, but it works now! Just a quick question, are infinite loops in arma bad? Like if I want to keep checking if someone is in the gunner seat then switch them to the animation. I can't find any event handlers that handle switching from the driver to the gunner, only entering the vehicle so I want to have a constant loop checking if there is someone in the gunner seat and if there is switch animation on them. Generally I always thought infinite loops were incredibly bad, but I read somewhere someone reckon mending them, so I'm just checking now. Also how to I escape characters like ", for example I want to have String = "Your going to have a very very "bad" day"; -
Error 0 elements provided, 3 expected, driving me nuts!
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
What happens if random 3 = 3? or is that impossible? -
Armored SUV player animation.
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Strange then, because this is my code here: suv_close_action = this addAction ["Close Cover","lg.sqf",[],1,false,true]; _target = _this select 0; _caller = _this select 1; _id = _this select 2; _nic = [nil,nil,"per",rremoveAction, _target, _id] call RE; _gunner = gunner _target; _gunner switchMove "ArmoredSUV_GunnerTurnIn_PMC"; _target removeAction _id; _target animate["HideGun_01",1]; sleep 0.5; _target animate["HideGun_02",1]; sleep 0.5; _target animate["HideGun_03",1]; sleep 0.5; _target animate["HideGun_04",1]; sleep 1; _target animate["CloseCover1",1]; _target animate["CloseCover2",1]; suv_open_action = _target addAction ["Open Cover","rg.sqf",[],1,false,true]; But my mate on my server which I was hosting couldn't see the animations, I could but he couldn't, was sure it was because he doesn't have the full PMC. -
Armored SUV player animation.
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Wait, will these animations work for all people, even if they don't have the full PMC, just the lite version? -
Armored SUV player animation.
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well I was close, I was using those commands, but me being dumb I was using: SUVmatildaTurnOut.rtm instead of ArmoredSUV_GunnerTurnOut_PMC ah well I was close anyway. Thanks. -
Armored SUV player animation.
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I hate to say this, but how do I use it? Is this one of them .cpp files? Because I want to put this in a mission, without extra add ons. -
Error 0 elements provided, 3 expected, driving me nuts!
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
floor only rounds down correct? Which means it would never get the highest index. Round would be better yeah? Upon thinking about that, I realize how floor is so much better and that was quite a dumb comment. -
Error 0 elements provided, 3 expected, driving me nuts!
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
GUYS GUYS I WORKED IT OUT, THE ANSWER TO ALL MY PROBLEMS EVERY SINGLE BLOODY ONE! Its this line right here, that I have used multiple times: _vehiclesArray select random count _vehiclesArray Looks good right? Wrong. Arrays start at 0, count doesn't. So whats been happening is when it gone to use a random index, its actually been pulling an index thats 1 to high which has been causing errors. Now its: _vehiclesArray select random (count _vehiclesArray - 1) I did this to all the others and no errors at all! And weapons are spawning in every car like it should! Bloody amazing how these tiny things can cause such a pain in the ass. -
Error 0 elements provided, 3 expected, driving me nuts!
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Tried the first one already, thats where I also added in if statements to check if it was an array and if it had something in it, Ill try the other now. Got this error, which is just confusing. Error in expression <rray select random count _vehiclesArray,position _pos,[], 0, "FLYING"]; _veh set> Error position: <position _pos,[], 0, "FLYING"]; _veh set> Error position: Type Array, expected Object,Location But it makes me think that SHK_pos is returning an array instead of position? Even though I thought they were the same thing. -
Error 0 elements provided, 3 expected, driving me nuts!
Ub3rObama replied to Ub3rObama's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Dam, that is the problem. I really need a way to get a random position in a marker area, and SHK pos seemed to be perfect, but it must be spitting out something that messes with it. Sigh. I'm gonna have to keep looking or come up with something else.