Jump to content

zeeb

Member
  • Content Count

    15
  • Joined

  • Last visited

  • Medals

Everything posted by zeeb

  1. Hey there! I've been working on a Wave based mission that will be playable by 5 people. I'm not the most adept when it comes to scripting in Arma so I could use some of your help. The script I've created is very basic and I could need some help in evolving it, currently I have some issues with it; 1. I don't know how to make the script count the Waves, adding a number behind like "Wave 1, Wave 2" etc. (This would be very nice to have to see what wave you're at and to add maybe a Tank as enemy every 10th wave) 2. I feel like my countdown system could be better. 3. I managed to make the script select from different units when spawning them, however everyone spawns as the same selection, I can tell why it does but not how to fix it. 4. I currently use the Waypoint MOVE for the enemies and assigned it to a marker in the middle of the player's base, but have no idea if this is the most effective way of doing it. 5. I feel like the code is not optimized as well as it could be, if you have any insights on how to improve it or make it more optimal, please share. Here it is: waveScript.sqf // Arsenal arsenal_box hideObject false; hint "Arsenal is available for 30 seconds."; sleep 20; // Countdown hint "Next wave in 10 seconds."; sleep 1; hint "Next wave in 9 seconds."; sleep 1; hint "Next wave in 8 seconds."; sleep 1; hint "Next wave in 7 seconds."; sleep 1; hint "Next wave in 6 seconds."; sleep 1; hint "Next wave in 5 seconds."; sleep 1; hint "Next wave in 4 seconds."; sleep 1; hint "Next wave in 3 seconds."; sleep 1; hint "Next wave in 2 seconds."; sleep 1; hint "Next wave in 1 second."; sleep 1; // Next Wave arsenal_box hideObject true; hint "Wave incoming!"; // AI Spawning _groupAlpha = createGroup [east, true]; //selected_spawn = selectRandom ["spawn_1", "spawn_2", "spawn_3", "spawn_4", "spawn_5"]; selected_spawn = selectRandom ["spawn_test"]; enemy_type = selectRandom ["O_Soldier_F", "O_Soldier_GL_F", "O_Soldier_AR_F", "O_Soldier_M_F"]; enemy_type createUnit [getMarkerPos selected_spawn, _groupAlpha]; enemy_type createUnit [getMarkerPos selected_spawn, _groupAlpha]; enemy_type createUnit [getMarkerPos selected_spawn, _groupAlpha]; enemy_type createUnit [getMarkerPos selected_spawn, _groupAlpha]; enemy_type createUnit [getMarkerPos selected_spawn, _groupAlpha]; _groupAlpha allowFleeing 0; _groupAlpha move getMarkerPos "player_base"; Any sort of input is appreciated. Thanks in advance! /zeeb
  2. Wow, you really nailed all the steps too. What a legend! Big thanks to you mate, appreciate it big time. ๐Ÿ˜„ Cool if I ask you stuff in PM's going forward with the script?
  3. Thank you George, I'm actually planning on learning Event Handlers today so that BIKI link will come in handy. Appreciate your help! ๐Ÿ™‚
  4. UPDATED: Script is now working as intended, a little personal tweaks and it should be good to go for extensive use. I will update the script if anyone comes up with better solutions/performance fixes. (just post them in this thread) Thank you guys for the assist! Script: jetFixer.sqf _veh = vehicle player; while {true} do { waitUntil { sleep 1; getPosATL _veh # 2 < 10 && speed _veh == 0 }; hint "Your jet will be fixed in 10 seconds"; _veh setFuel 0; sleep 10; _veh setDamage 0; _veh setFuel 1; _veh setVehicleAmmo 1; hint "Your jet has been fixed (Cooldown 30 seconds)"; sleep 30; }; Init.sqf: // Jet Fixer this = [] execVM "scripts\jetFixer.sqf"; _No Longer Relevant_ Anyone know what I'm doing wrong? Because I get the Missing ; error. Besides, I don't think this script will work, but you never know. (I used the biki to find the info) ๐Ÿ˜…
  5. Thank you man, I appreciate you helping out, I'll check it out! ๐Ÿ™‚ Anyway, it's more or less solved, I'll post the working script in the first post. I thank all of you, you've helped me out a lot and I learned a lot in the process! Keep doing what you're doing.
  6. I tried this script: params ["_veh"]; _gun = currentWeapon _veh; _vehNeedAssist = false; null = [] spawn { while {true} do { waitUntil { sleep 1; (getPosATL _veh # 2) < 10; (speed _veh) == 0; true }; _vehNeedAssist = true; }; }; while {_vehNeedAssist} do { hint "Stay parked for 10 seconds to fix your jet"; sleep 10; _veh setDamage 0; _veh setFuel 1; _veh setVehicleAmmo 1; hint "Your jet has been fixed"; _vehNeedAssist = false; }; But now I get Undefined variable in expression: _veh. I've been looking at the BIKI, at other threads etc for solutions and nothing is working, tried with/without brackets, spawn, <insert more stuff here>. Not gonna lie, after being at it for over 8 hours, without having it working as intended, is taking its toll on my psyche. About to smash my F'ing keyboard and throw this mission into the trashcan then light it on fire.. ๐Ÿคฌ
  7. Appreciate the assist. I already do have that line of code, however I haven't found out yet how to only implement it when vehicle is controlled by the AI and not the player. However, I guess I'll put that last on the list since the rearm/repair/refuel function for the players is of higher priority, been at it for some time now haha.
  8. Thanks for your input, switched out the while{true} statement. ๐Ÿ™‚ Do you know how I can call this globally on all player controlled vehicles? Because when everything works as it should I'll have to tackle adding infinite ammo to AI controlled vehicles. Which may turn bothersome since AI and players share the same vehicles, depending on how many players are playing the mission. But I don't know, it might be really easy. Like: if (isPlayer) then { // Land, go stationary for 10 seconds, rearm/refuel/repair. } else { // Get infinite ammo }; More or less what I'm going for.
  9. Tried to make a global ammo check script, but it didn't work. Don't know why it wont, but I'm so tired right now that I have no energy left to read anymore biki. Been at this script for a few hours now and the batteries are empty. If you have any inputs on why it wont work the script is below (tried to remove the vehicle init to make it affect all player driven vehicles present in the mission): _veh = (vehicle player); _gun = currentWeapon _veh; _vehNoAmmo = false; while {true} do { if ((_veh ammo _gun) == 0) then { _vehNoAmmo = true; }; }; while {_vehNoAmmo} do { hint "Your jet will be rearmed in 10 seconds."; sleep 10; _veh setVehicleAmmo 1; hint "Your jet has been rearmed!"; _vehNoAmmo = false; }; This is in the Init.sqf: // Jet Rearm execVM "scripts\jetRearm.sqf";
  10. Ah, thank you. Just confused me since it's while() in C++. ๐Ÿ˜œ Anyway, I managed to fix it. Now I just have to find out how to globally find the turret on each plane. (Which is why I tried primaryWeapon, really hoped it would work ๐Ÿ˜•) I don't want it to trigger just because you lack some flares, rather only when turret ammo is 0. Back to reading!
  11. Thanks Grumpy! By the way guys, how come this one is not working? while {(_veh ammo primaryWeapon) == 0} do { //stuff here }; It gives me Generic error in expression. And what is up with the while{}, shouldnt it be while()?
  12. Thank you for the explanations, I had to actually check the difference on the underscore and without, turns out I had them backwards. I didn't actually know that select 0 and #0 was the same, will use the latter going forward. This explains the #2 that Grumpy added. Thanks, I'll try it out and it's totally OK if it doesn't work as intended (Which it doesn't by the way haha), just means I got some learning to do. ๐Ÿ™‚
  13. I didn't get any errors, but the script didn't execute correctly. ๐Ÿ˜• Why use params ["_veh"]; instead of _veh = this select 0;? Indeed, I want the jet to repair, rearm and refuel when it's on the ground and parked after a set amount of time. I'm making a 5v5 jet fighter mission with sector control without missiles, so I want the players to be able to rearm after landing instead of using infinite ammo since the cannon on the jets has very limited ammo. Thanks for taking your time!
  14. Hey, I've seen you around this forum a lot helping people out, I appreciate you stopping by. I've fixed that issue, but as usual another one pops up.. This time it says Type Script, expected Object This is the updated code: _veh = this; if ((getPosATL _veh) < 10) && ((speed _veh) == 0) then { hint "Stay parked for 10 seconds to fix your jet."; sleep 10; _veh setDamage 0; _veh setFuel 1; _veh setAmmo 1; hint "Your jet has been fixed, you are ready for takeoff!"; }; If I use this select 0, I get met with a Type Script, expected Array,String,Config entry
  15. Hey guys, this will be my first post on this forum. I've recently starting to go deeper into the editor and that involves scripting. I have set the MP mission to respawn on selected area with the player given the ability to choose loadout. The problem is that I can't define in the loadouts where the items should go, so on some loadouts not all items are included, or put into inventories I dont want them to be. (First Aid Kit's in the vest instead of uniform etc) Maybe someone here knows how I can fix it, heres my script: Loadout.cpp class CfgRoles { class Assault { displayName = $STR_A3_Role_Assault; icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa"; }; class Support { displayName = $STR_A3_Role_Support; icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\support_ca.paa"; }; class Recon { displayName = $STR_A3_Role_Recon; icon = "a3\Ui_f\data\GUI\Cfg\RespawnRoles\recon_ca.paa"; }; }; class CfgRespawnInventory { class WEST1 { displayName = "Rifleman"; // Name visible in the menu icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa"; // Icon displayed next to the name (private, corporal, sergeant, lieutenant, captain, major, colonel, general) role = "Assault"; // Loadout definition, uses same entries as CfgVehicles classes weapons[] = { "arifle_MX_F", "hgun_P07_F", "Binocular" }; magazines[] = { "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "MiniGrenade", "MiniGrenade", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell" }; items[] = { "FirstAidKit", "FirstAidKit" }; linkedItems[] = { "V_PlateCarrier2_rgr", "H_HelmetSpecB", "G_Combat", "optic_Holosight", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio", "ItemGPS", "NVGoggles" }; uniformClass = "U_B_CombatUniform_mcam"; //backpack = ""; }; class WEST2 { displayName = "Medic"; // Name visible in the menu icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa"; // Icon displayed next to the name (private, corporal, sergeant, lieutenant, captain, major, colonel, general) role = "Support"; // Loadout definition, uses same entries as CfgVehicles classes weapons[] = { "arifle_MXC_F", "hgun_P07_F", "Binocular" }; magazines[] = { "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "30Rnd_65x39_caseless_mag_Tracer", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell" }; items[] = { "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "FirstAidKit", "Medikit" }; linkedItems[] = { "V_PlateCarrier1_rgr", "H_HelmetB", "G_Bandanna_khk", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio", "ItemGPS", "NVGoggles" }; uniformClass = "U_B_CombatUniform_mcam_tshirt"; backpack = "B_AssaultPack_rgr"; }; class WEST3 { displayName = "LMG"; // Name visible in the menu icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa"; // Icon displayed next to the name (private, corporal, sergeant, lieutenant, captain, major, colonel, general) role = "Assault"; // Loadout definition, uses same entries as CfgVehicles classes weapons[] = { "arifle_MX_SW_F", "hgun_P07_F", "Binocular" }; magazines[] = { "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "100Rnd_65x39_caseless_mag", "100Rnd_65x39_caseless_mag", "100Rnd_65x39_caseless_mag", "100Rnd_65x39_caseless_mag_Tracer", "100Rnd_65x39_caseless_mag_Tracer", "MiniGrenade", "MiniGrenade", "MiniGrenade", "MiniGrenade", "SmokeShell", "SmokeShell", "SmokeShell", "SmokeShell" }; items[] = { "FirstAidKit", "FirstAidKit" }; linkedItems[] = { "V_PlateCarrier2_rgr", "H_HelmetSpecB", "G_Combat", "optic_Holosight", "acc_pointer_IR", "ItemMap", "ItemCompass", "ItemWatch", "ItemRadio", "ItemGPS", "NVGoggles" }; uniformClass = "U_B_CombatUniform_mcam"; //backpack = ""; }; }; WEST3 does not work while the others do (I also have WEST4 that doesn't work but I didn't feel the need to include it) It put the items randomly, First Aid Kits in the Vest while excluding magazines since it tries to add them to the uniform when there is not enough space. Is there a way for me to use this function while also having the ability to choose where I want the items to be put? Instead of having the game trying to put the objects in place. (I like it organized so I usually go Medics + Secondary Ammo in Uniform and Grenades + Primary Ammo in the Vest) Thank you for your time, Zeeb.
ร—