-
Content Count
470 -
Joined
-
Last visited
-
Medals
Posts posted by infiltrator_2k
-
-
Wouldn't a seek & destroy waypoint synced to a trigger that fires when BLUFOR is present work?I've already tried that. I hoping there's a way of awakening an AI's vehicle to seek and destroy upon receiving enemy fire or a spotter's information to the position of a local position of enemy. It doesn't seem practical or resource friendly to have you're mission littered with triggers continuously polling for conditions. An event handler would be preferred.
-
I can get the AI vehicles to free roam using a single seek and destroy waypoint, but this will obviously this will impact on performance if you have multiple vehicles roaming around your mission. My question is what's the best method of having the AI vehicles roaming when an enemy is within a certain distance? Is there a module or script to accomplish this? If I group the vehicle to a group it usually run them over killing the units :/
BTW, for those of you who are also learning to script/edit, a vehicle will stick to using the road when setting waypoint behaviour to 'safe'. It significantly reduces the amount of waypoints needed and the vehicles travel incredible smoothly.
-
Not sure what you're getting at, but if you want to use it as a condition within a trigger use:Condition:
{alive _x && (side _x) == east} count allUnits == 0OnAct:
hint "no east units is alive";
Thank you Iceman, it works a treat. Now I can spawn reinforcements when a desired number of enemy AI have been killed, oppose to when certain trigger areas have been cleared of AI.
I know I need to focus more time in scripting, it's just with my job and family time is limited. Saying that I know I have to read Mr. Murray's guide as you've already recommended.
---------- Post added at 18:28 ---------- Previous post was at 17:26 ----------
Yeah. What I've posted above should be a clear example of that.---------- Post added at 08:01 ---------- Previous post was at 07:59 ----------
So ...
if ({alive _x && (side _x) == east} count allUnits == 0) then { hint "no east units is alive"; };Is essentially the same as:
Trigger Condition:
{alive _x && (side _x) == east} count allUnits == 0Trigger OnAct:
hint "no east units is alive";
I took that long to post my 2nd post I had 2 replies (one from yourself) whilst composing it LoL... Cheers chap ;)
-
I'm trying to find out a way of triggering a spawn script when a specified number of units have been killed. I found this code and it works when I set the "==" variable to whatever number I want to activate the trigger, but the code seems to include both the condition and activation. Is this because of the "if" and "then"? If so how do I edit the code to utilise both the condition and initialisation? Also is there a way of using percentages as well as numbers for counting the amount of units alive?if ( ({(side _x) == east} count allUnits) == 0 ) then { hint "no east units is alive"; };So frustrated, I've spent a couple of hours trying to figure this out. Is "if" equivalent to the condition that would usually be added to a script rather than the trigger condition and "then" the equivalent to the trigger's initialization? I need some help here guys. I could just add a simple trigger in a completed task that's free from a trigger's enemy, but then I wouldn't be learning anything :/
In my trigger's init field a simple nul = execVM 'myscript.sqf'; that trigger's my script, it's just the condition I need to set.
-
I'm trying to find out a way of triggering a spawn script when a specified number of units have been killed. I found this code and it works when I set the "==" variable to whatever number I want to activate the trigger, but the code seems to include both the condition and activation. Is this because of the "if" and "then"? If so how do I edit the code to utilise both the condition and initialisation? Also is there a way of using percentages as well as numbers for counting the amount of units alive?
if ( ({(side _x) == east} count allUnits) == 0 ) then { hint "no east units is alive"; }; -
According to biki, "this" in setWaypointStatements refers to the group leader, not the vehicle, therefore "(vehicle this)" is used to obtain leader's vehicle so it can be deleted with all of its crew (which includes the leader).But you're right, there is a typo - I accidentally forgot to remove "deleteVehicle (vehicle this)" command which tries to delete helicopter after it was already deleted. Here's a fixed version:
_wp5 setWaypointStatements["true", "{deleteVehicle _x} forEach crew (vehicle this) + [(vehicle this)];"];There is no need in separate deleteVehicle command for helicopter since "+ [(vehicle this)]" adds it to the array of units that will be deleted in forEach cycle. But you can keep "deleteVehicle (vehicle this)" and remove "+ [(vehicle this)]" if you wish, it shouldn't make any difference. :)
Cheers, that makes sense. I'm glad it was a typo because it threw me and I thought I'm never going to get my head around SQF. There's no doubt about it, learning to script is a steep learning curve. I've just started reading Mr Murray's guide so hopefully I'll be able to learn something from it.
-
As far as I know the setWaypointStatements command might also help you delete helicopter when it reaches waypoint. Try something like this:_wp5 setWaypointStatements["true", "{deleteVehicle _x} forEach crew (vehicle this) + [(vehicle this)]; deleteVehicle (vehicle this)"];Dunno about markers though. I think it's impossible, otherwise markers would simply duplicate triggers functionality.
Works a treat thanks. The algorithm looks more complicated to action a simple command than it should be though :/ I mean, the vehicle is mention a whooping 5 times in a single line. I understand the crew must be deleted before the vehicle, but why is it necessary to mention "vehicle this" 3 times? or is it a typo?
-
I've edited and used this script to spawn the helo and drop off troops, however, for performance reasons when the chopper's dropped off the troops I want him to fly off to marker5 and when reaching the next it I'd like the "deleteVehicle" command to delete it.
I'd rather utilise reaching the marker as a trigger to keep things tidy, but what code do I add to accomplish this? I've had a look around although I can't seem to find anything other than people running commands through actual inserted waypoints and not markers.
_crew1 = []; _airframe1 = []; _mygroup = []; if (isServer) then { _crew1 = creategroup EAST; _airframe1 = [getMarkerPos "marker1", 180, "O_Heli_Light_02_F", _crew1] call BIS_fnc_spawnVehicle; _wp2 = _crew1 addWaypoint [(getmarkerpos "marker2"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "LIMITED"; _wp3 = _crew1 addWaypoint [(getmarkerpos "marker3"), 0]; _wp3 setWaypointType "MOVE"; _wp3 setWaypointSpeed "LIMITED"; _wp4 = _crew1 addWaypoint [(getmarkerpos "marker4"), 0]; _wp4 setWaypointType "TR UNLOAD"; _wp4 setWaypointSpeed "LIMITED"; _wp4 setwaypointstatements ["this land 'land'"]; _wp5 = _crew1 addWaypoint [(getmarkerpos "marker5"), 0]; _wp5 setWaypointType "MOVE"; _wp5 setWaypointSpeed "LIMITED"; _mygroup = [getmarkerpos "marker1", EAST, ["O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; _wp1a = _mygroup addWaypoint [getmarkerpos "marker3", 0]; sleep .5; _mygroup = _mygroup; { _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup; }; -
Is it really working with this line , what are the *** for?_mygroup = [getmarkerpos "marker1", WEST, ["B_soldier_AR_F","B_soldier_AR_F","B_so***ldier_AR_F","B_soldier_AR_F"],[],[],[],[***],[],180] call BIS_fnc_spawnGroup;
replaced with the following line and it woks for me
_mygroup=[getmarkerpos "marker1", WEST, ["B_soldier_AR_F", "B_soldier_AR_F","B_soldier_AR_F","B_soldier_AR_F"],[],[],[],[]] call BIS_fnc_spawnGroup;
Ahh... Chris warned people of this. It's a bug that's caused by copying/pasting from Youtube. Although he reported Youtube adding a hyphen. I just recopied and pasted and this time it adden the hyphen i.e. "[-]". Good spotting ;)
-
get rid of the if isserver start and endThanks it's now working, or at least spawning and cycling the waypoints. But why did I have to remove it? A similar script worked with the "if isserver" present?
-
I copied this script from Chris' tutorials where a helo spawns - drops troops off. Before I edited it for my requirements I thought I'd better just make sure it works as written in its original form. However, I can't even get the helo to spawn. Can anyone see anything obvious in this script? I've tested 2 other similar scripts which work, is just seems to be this particular one that doesn't work. I've checked for typos but can't see anything :/
_crew1 = []; _airframe1 = []; _mygroup = []; if (isServer) then { _crew1 = creategroup WEST; _airframe1 = [getMarkerPos "marker1", 140, "B_Heli_Transport_01_F", _crew1] call BIS_fnc_spawnVehicle; _wp1 = _crew1 addWaypoint [(getmarkerpos "marker2"), 0]; _wp1 setWaypointType "TR UNLOAD"; _wp1 setWaypointSpeed "LIMITED"; _wp1 setwaypointstatements ["this land 'land'"]; _wp2 = _crew1 addWaypoint [(getmarkerpos "marker3"), 0]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "LIMITED"; _wp3 = _crew1 addWaypoint [(getmarkerpos "marker1"), 0]; _wp3 setWaypointType "CYCLE"; _wp3 setWaypointSpeed "LIMITED"; _mygroup = [getmarkerpos "marker1", WEST, ["B_soldier_AR_F","B_soldier_AR_F","B_so***ldier_AR_F","B_soldier_AR_F"],[],[],[],[***],[],180] call BIS_fnc_spawnGroup; _wp1a = _mygroup addWaypoint [getmarkerpos "marker3", 0]; sleep .5; _mygroup = _mygroup; { _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup; };Cheers
Ian
-
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3is the Arma 3 list. Arma 2 commands came over, but there are some new systems with new logic. The old commands are kept though. (eg. see the mess at weather changes)
And yes, you need to delete crew first with deleteVehicle. I've been using this command since forever (Arma 2) I don't even remember deleteUnit.
{ moveOut _x; deleteVehicle _x; }foreach (crew _vehicle); deleteVehicle _vehicle;So basically all the commands in the Arma 3 commands list will do everything that the commands in Arma 2's list will do, and old Arma 2 commands are now considered surplus/obsolete (albeit still valid) as their actions can be accomplished with the new commands that came with Arma 3?
It's not deletevehicle_x but just deletevehicle.The _x is just a placeholder for the ForEach loop, which will cycle through all the indexes of an array. This array in your case is
crew vehiclename + [vehiclename] which is the same as -> [driver vehiclename,gunner vehiclename,vehiclename] for example.
so:
{deleteVehicle _x} forEach crew vehicleName + [vehicleName];if the vehicle has a driver and a gunner ie, the above is the same as:
deletevehicle (driver vehiclename); deletevehicle (gunner vehiclename); deletevehicle vehiclename;
just way shorter, especially the bigger the crew is.
Gotcha! Thanks for explaining that ;) Already I can hear Iceman77 screaming "read Mr. Murray's bloody guide!" LoL... I am going to look beyond its age I promise ;)
-
I'm a little confused about what scripting commands to use and where to find them on Biki. I mean, I want to delete some vehicles and the crew on my mission and I Goggled this from an Armaholic's Arma 2 OA forum:
{deleteUnit _x} forEach (unit fx1); deleteUnit fx1; {deleteUnit _x} forEach (unit fx2);Then I read to delete a vehicle you have to delete the crew first i.e.
{deleteVehicle _x;}forEach crew heli;deleteVehicle heli;However, when I've gone to Biki I cannot find this 'deleteVehicle_x' command :/ More to the point, what commands do I use? Are Arma 1 and Arma 2 commands good to use with Arma 3? Is >>THIS<< a comprehensive list of all the commands from all the series? if so what happened to the deleteUnit_x command? Is it that BIS sometimes remove commands in order to replace them with more efficient ones?
-
Just interested guys about what made you want to learn to script and what you hope to achieve from scripting, i.e., is it just a past time, or is it more than that? Do you create to upload for example? Do you find scripting therapeutic and/or rewarding etc..
We scripters are evidently a different breed as you have Armaholics who just want to game playing custom made missions who don't like spending hours in the editor, and then there's Armaholics such as ourselves who are quite the opposite and spend more time in the editor than playing the game. I would describe myself as incredibly creative with a vivid imagination.
How about you?
-
Even if Mr.Murray's guide does have some sqs, the guide is very valid and is a must for novice editors. Alot of new scripters disregard the guide because it's dated. Yet alot of the questions they ask here, are answered in the guide already... Plus all of the other valueable knowledge in the guide that they are over looking. Anyhow, I certainly wouldn't tell you something that would steer you in the wrong direction. Mr.Murray's editing guide is a win :)I looked through it tonight and agree it looks date, and as soon as you see SQS mentioned it's a big turn off. I will have a good go at going through it though - albeit skipping the SQS parts.
-
Here's some more great resources: http://www.armaholic.com/forums.php?m=posts&q=6751Two I would personally start with (in order). Mr.Murray's guide will never get old for novice mission makers and Mikie's (3) tutorials serves as a great step forward and focuses more on writing functions and various code more effeciently. Using local variables etc etc.
Nice one ;) The reason I like Chris' video tutorials is because he isn't pretentious and arrogant unlike another person's video tutorials I can think of :/ This one guy moaned about not having time to go into things and seemed to want to make the viewers profusely grateful that he had found the time to upload his clickity-clicky half baked rushed crappy video tutorial that left me more confused than before I watched it. I personally get great satisfaction from teaching people, and unless people enjoy teaching others they're better not to upload their tutorials, especially if they're hard to follow and if they ignorantly assume that the viewers are at around their competency level. It begs the question why they even want to upload tutorials in the beginning? To show people how quickly they can move their mouse perhaps.
However, that guy Chris explains what is what and what does what and what goes where etc.. whilst speaking and explaining clearly and going at a pace that doesn't require the viewer to having to keep hitting the rewind button. His time and effort is hugely appreciated by noobs like me I can assure you ;)
I downloaded Mr. Murray's tutorial but I've not yet read it. Does he not teach SQS too? which of course would confuse issues if he does.
-
Hi!Im new here and learning, but it's best what i can
I create two unit and name them unit1 and unit2. Empty mortar call mortar1 just .Then i create waypoint and but in on act: this = execVM "getinmortar.sqf"
getinmortar.sqf
unit1 SetUnitPos "middle"; sleep 2; unit1 moveingunner Mortar1; unit2 SetUnitPos "middle"; sleep 2; unit2 moveincargo Mortar1;
i hope that helps
---------- Post added at 01:34 ---------- Previous post was at 00:59 ----------
remove "moveInGunner" command
There is eject command for this
{_x action ["EJECT",Mortar1]; sleep 2;} foreach [unit1, unit2];
---------- Post added at 01:41 ---------- Previous post was at 01:34 ----------
I think mounting static weapon systems is better solution, than attachTo things to unit
Every mission that has mortars need an empty MK6 mortar, a mortar team where the gunner (as above command does) mounts the MK6 mortar, the assistant and team leader kneels besides the gunner and mortar - but, when an enemy closes in at a distance where the mortar is ineffective (too close), the mortar team disbands and go into normal combat mode like the rest of the AI. When however the threat subsides (the enemy leave the trigger area) the mortar team return to their initial positions.
It is after all what soldiers would so in real life ;)
-
The mortar is considered a vehicle and you'll be able to use moveincargo(?) and moveingunner to put units into the mortar. Don't use attachTo to attach living units to objects. Ever. They'll die. And other stuff happens. And it's useless.Thanks. "moveInGunner" works. However, the mortar gunner still stays mounted to the mortar when an enemy is close (next to gunner). I think I need to figure this out with a type of remove "moveInGunner" command.
-
Place a opfor pilot and on his init have as follows, {_x moveindriver plane} foreach units group this; now place an empty buzzard set to flying and name it plane, start mission and he will be flying it,just need to set waypoints etc for pilot good luck.Another option is to place an empty Buzzard (in formation) on the runway with a pilot nearby, highlight the pilot, select waypoints and click on the Buzzard and select the "get in" waypoint. Now add another waypoint (linked) to where you'd like the Buzzard to fly to. I usually select the "seek and destroy" waypoint on where I'd like the Buzzard to attack. The pilot will now get into the Buzzard and take-off to where ever you placed its waypoint and action. If you selected the "seek and destroy" it will circle the location and target/attack enemies.
-
I'm trying to put together a realistic mortar team where an 'empty' mortar is placed down and at the beginning of the mission a mortar team takes positions on and around the actual mortar. I've used the SetUnitPos "middle"; to make the team leader and assistant gunner to kneel beside the mortar position, but what command do I use to attach the MK6 gunner to the actual empty mortar? Also, is their a way of detaching the gunner from the mortar when his position is over run as well as cancelling out the SetUnitPos "middle"; for the assistant gunner and team leader?
Cheers
-
I don't know if these >video tutorials< have been shared before, but I found these videos to be such a good resource and starting block for budding scripters like myself. Through one video alone he's explained everything I wanted to know about the basics of spawning units.
P.S. If the guy (Chris) has helped you with his tutorial videos please don't forget to leave a comment and give him the thumbs up ;)
-
There are people lurking here with way more programming knowledge than me :d: , ask me about windows API or .NET and ill generally be at a loss. I mainly consider myself a hobbyist game scripter at heart, way to many years messing around in game engines.When starting out just concentrate on clean and clear, dont worry if its 500 lines of dribble as long as it does what its meant to and you can read it when you go back to it in a months time.
Finesse and optimization come later. You will regularly notice these times when you go back to look at old code and say to yourself 'What the !%*& was i thinking there, I could of done that in 10 lines'.
Dont be afraid to set yourself small task to get familiar with syntax, does not even have to be ARMA related. Start with an array of [1,2,3,4,5,6,7,8,9] and just do simple things like ordering them highest to lowest using only basic syntax and commands (e.g dont use BIS fnc's) or placing helper arrows down in the editor and moving them around via small scripts in the debug console.. Hell i spend more time sat with just a player in a map and doing stuff from the debug console than i do anything else.
ATM I'm just analysing the mortar script you rewrote and cross referencing what's been written with Biki. It's definitely not a script for newbies :)
-
Hmm where did it all start HERE is the earliest memory i have with Compaq Basic, quickly followed by IBM XT and GWBasic (man those things were built like tanks) that my father would borrow from work.I was lucky enough that my father was also on the board of the local education committee so every school break our house would acquire a PC or BBC, purely to keep them safe during the school break you understand ;) .
From there my first ever computer was a ZX Spectrum for christmas where i, over several years, went from learning how to make a ZX Basic invaders game to Z80 assembly language and some C. Even made my own IDE for it taking my cruedly written assembly and poking it into memory, are they were the days ;) .
Since then ive been to college and done a course in C/C++, modded for numerous games using LUA LISP C C++ QuakeC :D (big ID fan)(and several other game specific API's) messed around with javascript and PHP for some basic website designs. Although funnily enough ive never touched java or python which seem to be a stable for alot of people i talk to.
As for ARMA i have played the series since OFP but after taking one look at sqs i though @!~# that and never touched it again till IronFront.
Having spent the last 8 years with my head burried in the DOOM3 SDK and scripting language, with the imminent release of ARMA3 and with much moaning and hinting from a friend that he wanted my help I started my foray into ARMA scripting at the begining of ALPHA.
As for where to start, get a nice decent format to your code and stick as close to it as possible, something you find easy to read, good clean readable well documented code , I really cant stress how important this part is. Trying to learn from messy code or going back to code youve recently written to help you remember, does you absolutely no good if you cant read it or tell at a glance what it was meant to be doing.
HERE is a good starting point. Follow all the further reading links.
Think the others have covered most things , a link to ARMA 3 Command List is a must.
Start small, take regular breaks and I don't mean script in the morning take a 3 hour beak, but as other have mentioned, If you find yourself hitting a wall dont be affraid to take a week or month out then come back its amazing what sinks in.
A Decent text editor with syntax highlighting and even some kind of auto code completion is a great help.
Most of all have fun, if it aint fun whats the point.
And of course not to forget this forum, their are some great members here always willing to help out even if it is the 1000th helicopter reinforcement thread :D props to the guys here.
Then when you have surpassed us all dont forget to come back and share your knowledge.
Great advice Larrow. I'm astonished at your wealth of experience at coding. I think it's fair to say you've been coding a while :) From people's posts I've discovered that poorly coded scripts will still run (albeit poorly), so attention must be focused on making clean and clear scripting. I suppose you could liken scripting to writing literature in the sense that a sentence could contain dribble that takes 500 words to describe something that should have taken 50 letters in a single line.
So cleaning up a script would be a screenwriter's equivalent to what's known as 'trimming the fat' from the screenplay. I've studied writing screenplays in the past, so if I apply the same principles I'm sure I should do fine with some help a long the way.
Your point of learning from well written code is a good one and makes sense. It could after all take you a long time to discover having made that mistake. If I can give any fellow budding scripter a point from where to start it will be definitely be by starting from HERE
I think I'm going to start small by putting a few command lines in a player's initialization and activation fields. I've created a mission that's taken me many hours to create on and off, and the only thing it's lacking is small but important tasks - tasks that add depth to a mission, and something that's more than just killing the enemy, i.e. retrieving documents from a downed aircraft lying in the deepest part of the ocean that requires you to kit out for the task etc...
-
It seems everyone has their own unique method of learning and there are no formal rules other than analyse other scripts and write your own, and if the script fails, find out what made it fail and correct it whilst learning from your mistakes and things will inevitably and naturally progress from there.
With the above in mind BIS' Wiki is of course a valuable resource for any budding scripter as it has all the commands indexed - what they're used for and more importantly examples of how they are applied.

Best Method To Freely Roam Vehicles
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
The dismissed waypoint works fine with infantry. But with vehicles they get to the waypoint and just sit there waiting to be destroyed.