cragtek
Member-
Content Count
4 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout cragtek
-
Rank
Rookie
-
Firstly, let me say how brilliant a resource this forum has been to me while getting back into scripting. Secondly, I have a couple of quick scripting questions: 1. I've been trying very hard to remove weapons/ammo from vehicles in Arma2 with no luck yet. I want to create a basic observation helicopter which does not allow the player to fire on his opponent. Setting the ammo amount in the unit box is fine to begin with, but when the chopper respawns it has full ammo again. I can't find a scripting command that works to actually remedy this. Is it possible? 2. How would I make it so that a sound played from somewhere within a marker radius at random intervals, of say, 1-5 minutes apart? I want to create directional sound coming from within some woods to spook the player. If anyone can answer these questions I owe you a debt of gratutude!
-
2 player "flag fight"... how?!
cragtek replied to cragtek's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Aha! Thanks! Will give that a go. Didn't even see that! ---------- Post added at 01:00 PM ---------- Previous post was at 11:32 AM ---------- Update: Worked a treat, thanks! You saved me a lot of messing around there! -
2 player "flag fight"... how?!
cragtek posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OK, so many moons ago I created a 2 player map which adopted the "flag fight" format, a variant on Capture the Flag. Instead of there being TWO flags (an east and a west), there is just ONE. The objective is for both players to race to the flag, collect it and dump it at a drop off point. When this happens, the player's score is incremented. I can't find any similar missions to this currently available in ArmA2 and can't work out how to adapt a standard CTF map to this format. What's throwing me is the fact that there is just one flag and one drop-off point. Sadly, my old missions have been lost. Here's a concept diagram just to give you an idea of what I'm going for: Please can anyone help me? I don't know where to start! (PS. I am familiar with triggers and scripting etc, so don't require much background there - but as I'm rusty, I can't work out a method for this situation. I don't require help with respawning.) -
Vehicle respawn script
cragtek replied to dale0404's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello, just spotted this and realised I might be able to help! I've been using KaRRiLLioN's wonderful vehicle respawning script for years and have found it to be the most elegant and easy-to-implement solution to use. I've just updated it to feature all the latest classnames to save everyone the pain! Simply copy this code into a file called vrs.sqs and place it in your mission directory. In the init field for each vehicle you wish to respawn, place the line [this] exec "vrs.sqs" Simple as that. Now when the vehicle is broken, it will respawn after a short period close to where it was originally placed. Tada! ;;BEGIN vrs.sqs ;;By KaRRiLLion ;;Modified by cragtek (2009) to function in ArmaII ;; ;;IMPORTANT: ADD A GAMELOGIC NAMED Server ;;to the mission to prevent multispawn ?!(local Server): Goto "end" _vcl = _this select 0 _respawndelay = 5 _dir=Getdir _vcl _position=Getpos _vcl _Vehicles=[] _aircraft=["A10","AH1Z","AV8B","AV8B2","BIS_Steerable_Parachute","C130J","Chukar","CruiseMissile1","CruiseMissile2","F35B","Ka52","Ka52Black","MH60S","MQ9PredatorB","MV22","Mi17_CDF","Mi17_Civilian","Mi17_Ins","Mi17_medevac_CDF","Mi17_medevac_Ins","Mi17_medevac_RU","Mi17_rockets_RU","Mi24_D","Mi24_P","Mi24_V","ParachuteBigEast","ParachuteBigWest","ParachuteC","ParachuteEast","ParachuteG","ParachuteMediumEast","ParachuteMediumWest","ParachuteWest","Pchela1T","Su25_CDF","Su25_Ins","Su34","Su39","UH1Y"] _tracked=["2S6M_Tunguska","AAV","BMP2_Ambul_CDF","BMP2_Ambul_INS","BMP2_CDF","BMP2_Gue","BMP2_HQ_CDF","BMP2_HQ_INS","BMP2_INS","BMP3","M1A1","M1A2_TUSK_MG","MLRS","T34","T72_CDF","T72_Gue","T72_INS","T72_RU","T90","ZSU_CDF","ZSU_INS"] _boats=["Fishing_Boat","PBX","RHIB","RHIB2Turret","SeaFox","Smallboat_1","Smallboat_2","Zodiac"] _wheeled=["BRDM2_ATGM_CDF","BRDM2_ATGM_INS","BRDM2_CDF","BRDM2_Gue","BRDM2_HQ_Gue","BRDM2_INS","BTR90","BTR90_HQ","GAZ_Vodnik","GAZ_Vodnik_HMG","GAZ_Vodnik_MedEvac","GRAD_CDF","GRAD_INS","GRAD_RU","HMMWV","HMMWV_Ambulance","HMMWV_Armored","HMMWV_Avenger","HMMWV_M2","HMMWV_MK19","HMMWV_TOW","Ikarus","Kamaz","KamazOpen","KamazReammo","KamazRefuel","KamazRepair","LAV25","LAV25_HQ","Lada1","Lada2","LadaLM","M1030","MMT_Civ","MMT_USMC","MTVR","MtvrReammo","MtvrRefuel","MtvrRepair","Skoda","SkodaBlue","SkodaGreen","SkodaRed","TT650_Civ","TT650_Gue","TT650_Ins","TowingTractor","UAZ_AGS30_CDF","UAZ_AGS30_INS","UAZ_AGS30_RU","UAZ_CDF","UAZ_INS","UAZ_MG_CDF","UAZ_MG_INS","UAZ_RU","UAZ_SPG9_INS","UralCivil","UralCivil2","UralOpen_CDF","UralOpen_INS","UralReammo_CDF","UralReammo_INS","UralRefuel_CDF","UralRefuel_INS","UralRepair_CDF","UralRepair_INS","Ural_CDF","Ural_INS","Ural_ZU23_CDF","Ural_ZU23_Gue","Ural_ZU23_INS","V3S_Civ","V3S_Gue","VWGolf","car_hatchback","car_sedan","datsun1_civil_1_open","datsun1_civil_2_covered","datsun1_civil_3_open","hilux1_civil_1_open","hilux1_civil_2_covered","hilux1_civil_3_open","tractor"] _Vehicles=_aircraft+_tracked+_boats+_wheeled _i = 0 #Loop ? (_i > (Count _Vehicles)) : Goto "Skip" _VehicleType = _Vehicles Select _i _VehicleTypeDoesMatch = ((_VehicleType CountType _this) == 1) ? _VehicleTypeDoesMatch : _type = _VehicleType ? _VehicleTypeDoesMatch : Goto "Skip" _i = _i + 1 Goto "Loop" #Skip #start ~1 @!(Canmove _vcl) ~_respawndelay deleteVehicle _vcl _vcl = _type createVehicle _position _vcl setdir _dir Goto "start" #end Exit ;;END vrs.sqs :) Cragtek.