PDA

View Full Version : ARMA 3 script thread



Bailing_Out
10-28-2016, 05:37 PM
Since I've started to try to make a map worth a crap I've had to look for scripts because some of the modules in the editor don't work for me and some of them need script written in the attributes when you open the module.

This script here below in the spoiler is saved in the mission folder and the file is named init.sqf . I think you can add other things to the init.sqf because when i got the script it only made one safe zone so I just copied and pasted, change the name of the marker in the paste and it worked.

This one will make two safe zones where the enemy can attack the main base or other safe zone but they will do no damage to anything or kill anyone. This one 500 meters by 325 by 50 meter high. I made it that high so you could shoot at planes that flyover and do damage to them as long as you are outside the safe zone when you fire. I may move it down to 25 meters.

You go to makers in the editor select either a rectangle or ellipse, it doesn't matter you can change it to the other. You name it something like baseareamarker1 and the other with a 2 at the end. The script finds that marker, centers on the center of it and makes a safe zone.

_trigger_safeZone = createTrigger ["EmptyDetector", (getMarkerPos "baseAreaMarker1")];
_trigger_safeZone setTriggerArea [500, 325, 50, false];
_trigger_safeZone setTriggerActivation ["ANY", "PRESENT", true];
_trigger_safeZone setTriggerStatements
[
"
thisTrigger setVariable ['thisListPrev', +(thisTrigger getVariable ['thisList', []])];
thisTrigger setVariable ['thisList', +thisList];
this && player in thisList && count thisList >= count (thisTrigger getVariable 'thisListPrev')
",
"
{
_x allowDamage false;
} forEach thisList;
",
"
comment 'thisListPrev < thisList';

{
_x allowDamage true;
} forEach ((thisTrigger getVariable ['thisListPrev', []]) - (thisTrigger getVariable ['thisList', []])); comment 'For all leaving units';
"
];

_trigger_safeZone = createTrigger ["EmptyDetector", (getMarkerPos "baseAreaMarker2")];
_trigger_safeZone setTriggerArea [500, 325, 50, false];
_trigger_safeZone setTriggerActivation ["ANY", "PRESENT", true];
_trigger_safeZone setTriggerStatements
[
"
thisTrigger setVariable ['thisListPrev', +(thisTrigger getVariable ['thisList', []])];
thisTrigger setVariable ['thisList', +thisList];
this && player in thisList && count thisList >= count (thisTrigger getVariable 'thisListPrev')
",
"
{
_x allowDamage false;
} forEach thisList;
",
"
comment 'thisListPrev < thisList';

{
_x allowDamage true;
} forEach ((thisTrigger getVariable ['thisListPrev', []]) - (thisTrigger getVariable ['thisList', []])); comment 'For all leaving units';
"
];

Thanks to Jshock and Heeeere's johnny! for doing this almost 2 years ago.

Bailing_Out
11-03-2016, 12:31 AM
I've looked all over and found scripts to cause a vehicle or other stuff to respawn just like you want it to but only if that thing spawns on round start. If you have it spawn later due to being triggered by a sector being captured or some other event it will spawn once only. When I use one of the custom scripts to try to make it do it, it shows an error, still plays, still spawns the vehicle later, still only once.I am assuming that it is because I had the vehicle set to spawn later and the custom script is trying to spawn it on round start.

Bailing_Out
11-03-2016, 02:19 AM
Okay that can't work right now because everything spawns/is created on round start. You can hide it but when blown up after being unhidden by the trigger it won't respawn. If the trigger that unhides it is triggered again it should respawn, say you lose a sector and then regain that sector later. That works for me.

Bailing_Out
11-08-2016, 02:03 AM
When I write this stuff it may be old hat to some.

Cutting and pasting then renaming is much of what you do once you have most of the modules and stuff that you want. Wanted a reinforcement trigger for when either side has lost flag/sector nearest to them, they get extra tanks and planes. Cut an pasted the mortar spawn triggers and the hide/show modules, renamed them, changed the sector involved and shazam it works tanks pop up, thing is I gotta figure out to change it. I only really want it to work when one side has all 3 sectors, haven't figured that out yet.

You end up with triggers and modules all over the place while editing. "WTF is that" is what sometimes think while doing it. Then I click it and than I still have to figure it out.

Bailing_Out
11-11-2016, 02:00 AM
The Russian anti tank gun, the sight doesn't move up and down, only left and right and I've found no way to fix that so I will have only German AT guns on my map. "Comrade, we've had to steal nazi AT guns since our sights are screwed up". The guns look mobile but with just me they don't move, maybe it takes two.

The mortars have a aiming computer, I don't know if that is an Iron Front thing or an ARMA3 thing. Since I've not set them up completely level someone would still need someone else spotting/adjusting the shot. I can't find how to put mortar ammo in the ammo truck cause I can't find the ammo for them. They start with 8 and thats what you get.

Maybe doing a map in ARMA is too easy once you learn how to do at least the simple stuff. I spend mucho time adding more and more stuff, I keep going "oh yeah I want to have it do this too". I don't know if anyone will ever play it but it feels good to have made a battle ON ONE OF THE ****ING GAMES I'VE BEEN PLAYING FOR YEARS!!! It damn sure helps the map is already made LOL. I never could do an FH2 map or battle. FH1 was basically over with for most people when I first started trying to.

I think tomorrow I will finish it. Maybe.

Bailing_Out
11-17-2016, 12:05 AM
Crap something is wrong with the safe zone, any vehicle that spawns in it can't be killed even after leaving.

Bailing_Out
11-24-2016, 10:48 AM
Ok so none of the safe zones worked like I wanted, the one above made the vehicles indestructible. The last one which I didn't bother to post only worked after a vehicle went out and then came back in. Why? Because while you spawn in later so the script has run and you are safe. The vehicles on the other hand are put on the map before any custom script runs so they are not safe.

The game editor has a protection zone you can lay down but its hard coded to be 25 meters round. It runs before anything spawns or something. So it works. At first I was plopping them down one at a time like a moron and then finally I accidentally selected 15 of them when I only wanted to move one. OH Hell I thought, I can make a blob of 20 or 40 and then copy and paste, make the base safe zone as big as I want. Plus since its part of the game already it has no anti hack problems.

So first battle is almost done.

Bailing_Out
11-26-2016, 04:31 AM
Almost,,, except once I fixed that I found 20 other things I hadn't done yet. Bailing Out is a moron.

Bailing_Out
12-01-2016, 02:07 AM
To anyone who who has either tried or wants to try to make a custom loadout in IronFront Litle, multiplayer.

I am making them for my battles but I found out if you have to do it a bothersome way. Leave the uniform as is the first time in the virtual arsenal loadout editor, which you go to when you right click on the unit on the map after you've placed them. I always start with unequipped soldier, it is the only way I've managed to keep thing in the backpack or vest.

Do not change any part of his uniform, add some nades to his vest or whatever you can fit, save it as whatever you want to name it, my last one was "Ger Lite Rifleman". Export it, just do it, don't ask.

You right click him again and play as him, he has all his stuff and YOU CAN ACCESS IT!! For some reason if you change the uni in any way then you have to go CTRL+G to give him access to his nades. Now you go back and replace that recruit uni, save, export click Ok.

I've done it so I know he still has his stuff and access, then go an replace the helmet and other stuff. It is no use loading anything like mines or AT rockets onto them without doing that save an export thing with just the unequipped soldier. Leave the uni alone the first time through. Don't change the vest, don't add a backpack until you do the save, name it, click ok, export and click ok again.

I wondered, I cursed and I smoked some cigars and thought. Then it just happened/worked by accident like usual.

Bailing_Out
12-02-2016, 03:49 PM
Ok, I could make them spawn with it the first time but after hitting respawn they spawned in as unequipped soldier, just a rifle and some K98 mags. Its an improvement but not all the way there yet.

Bailing_Out
12-05-2016, 08:23 AM
Apparently to not have to do a bunch script/text you have to put down a Zeus game master module, link it to a unit, that unit needs to have a name in the variable name field and that name is given to the module as its owner.

Then you play it on multiplayer. After getting into the game you play as that unit, in my case as abc, call the module with Y, Then place a unit, place a Zeus arsenal on the unit, edit its loadout and save it. Now all I have to do is find a away to have it in the respawn screen loadout select but that is coming and they can still be accessed as is. Unless you go back to the lobby you can't change loadouts as it is though. You can only do it through the role selection there in the lobby.

Bailing_Out
12-08-2016, 08:21 PM
https://configs.arma3.ru/

The class names are all there, click the mod. I'm going to use to make my own shop in HoverGuy's Simple Weapon Shop System. I can set the price to 0 and it will be a custom loadout system if it will accept the names of IFL weapons, it will not allow the weapons in one addon or mod right now.

Bailing_Out
12-09-2016, 09:04 AM
I finished Village Of The Damned FINALLY!!

http://steamcommunity.com/sharedfiles/filedetails/?id=814879687

Bailing_Out
12-17-2016, 06:57 PM
Been working with VAS, have it working kinda although some things go missing in gear selection and I haven't figured out why. Plus you cannot fully load the panzerschreck backpack, you load 2 into it and can't load more. Also haven't got all the stuff for the Soviets. Did get all the modern stuff out of it cause the guy who made it made it easy to do. As soon as you input stuff to allow, it automatically does not allow any thing else without filling out/editing the part of the script which would disallow certain things.

It could have partially broken in the last ARMA 3 update since it uses some ARMA stuff and is not stand alone.

Bailing_Out
01-13-2017, 02:34 AM
My repair rearm set up. The only ones I got that will work. One for East/Soviet, one for West/Germans. When I tried make them exactly the same in the new battle they just throw errors with no explanation. This is only for morons like me.

Anyway, you take these and put them in the compositions folder. ARMA 3/ other profiles/your name/compositions.

http://https://www.dropbox.com/sh/t0mz1cpiluk8w8r/AACL0tiyjU6MI88fL1cjF6dta?dl=0

Okay I edited this to just put the entire compositions folder in there at dropbox

Bailing_Out
01-13-2017, 01:15 PM
I gotta find some other place to upload to. I did have a place but I can't remember where it is.

Anyway, you can't change those modules or triggers except for position, roatation and size, the marker can be changed but it doesn't do anything except mark. I have tried to make those modules be only active if you take a sector but then they just quit working. They work as they are.

Bailing_Out
01-13-2017, 01:44 PM
This is better I think. Drop box link to the whole composition folder.

A couple of those I wouldn't bother with but right now I can't say which because dropbox didn't copy the file it cut them so now I have to download my own damn files back.

https://www.dropbox.com/sh/t0mz1cpiluk8w8r/AACL0tiyjU6MI88fL1cjF6dta?dl=0

2WD*|Lorden
01-13-2017, 09:41 PM
Bailing, you should jump on Teamspeak and speak with me and Archimonday, we've been working on Arma3 mods/missions on our end also.

Bailing_Out
01-18-2017, 07:29 PM
Bailing, you should jump on Teamspeak and speak with me and Archimonday, we've been working on Arma3 mods/missions on our end also.

I have had internet and then not had it for a few days now. You will see I am on the website but right after that it goes out. Hell the old landline phone is doing the the same thing. You have to have the minimum phone service to have the internet in case you wonder. I have been inside boxes I am not supposed to inside of and can't find anything wrong. Redneck engineers "A BOX, A BOX, LET ME GET INSIDE IT AN SEE WHAT I CAN SEE!'. I went so far as to go to the local phone maintenance building, after getting nowhere with the people in India, no phone company people there but I found a contractor who had the local numbers of the local guys. Not supposed to give me those numbers but he did. So I expect the guy I called to be here today or tomorrow to fix it. I told him "I aint tellin you who gave me this number". the problem is outside or its their modem, I eliminated everything else.

Edit Ok it is suddenly working very fast now, I feel like he went to the internet exchange thing, wherever that is and found what was wrong there.

I wish Ariana Grande was working on the problem, she is the hardest working 23 year old girl in the world.

Edit, still going off and on, really fast when its on.

Bailing_Out
01-19-2017, 12:41 AM
While I have internet I want to say this.

It says ARMA 3 Mod Team beside my name. I do not really script much. I make battles, I figure out how to hook modules together, most times this has already been figured out, sometimes I do something different. I do the best I can but I'm older an this stuff is not something I grew up with. Got a computer in 99. Took it apart on the living room floor cause I had never seen how one was made. Never could figure out how to do much with battlefield 42 or 2. Mills, plants and factories is what I've done for a living. I do odd things that sometimes work though and I hope this helps. None of this can be be made to work by hitting it with a chunk of metal, I've done plenty of that in my life, patience is not one of my virtues says my wife and she is right but I'm learning patience, some and learning about this, some. In factories, mills and plants they want something to work then, not later, that hasn't made me more patient.

[WaW]CA|Wir3tap
01-19-2017, 09:21 AM
Mod team can included, scripters, mission editors, map makers etc.

Bailing_Out
01-26-2017, 02:10 AM
So I borrowed some stuff off a few people. I had this working until I noticed my guy has no helmet and no backpack. You gotta go third person or hit inventory to notice. I had the loadout in the menu, the different sides got their stuff only, with the spawn choice, worked great, figured I could just make one after another. So I go and I add the helmet and backpack but that causes and error in the description.ext file, which hasn't changed at all. Only the loadout.hpp file changed. I gots to find out the format for the helmet and backpack in hpp. Also messed up the loadout.hpp trying to fix it but I can put that back. I just aint got time now, got to go to work. Will post the small texts to see if you guys might see the error of my ways.

[WaW]CA|Wir3tap
01-26-2017, 07:51 AM
Bailing if you need any scripts or are looking for one, let me know post over in the Script section and I'll see A. If I can find one, or B. get one done for ya.

Bailing_Out
01-28-2017, 10:53 AM
My first battle, Village of the Damned got updated. I took out a spawn point I was using while editing but had forgot to delete. I may add Geist to it later.

Bailing_Out
01-28-2017, 02:11 PM
Ok I got a backpack on him but I still can't get the helmet

Here it is in the spoiler



class WEST1
{
displayName = "German Lite Inf 1"; // Name visible in the menu

// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"LIB_K98"
};
magazines[] = {
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_5Rnd_792x57",
"LIB_shg24",
"LIB_shg24",
"LIB_nb39",
"LIB_nb39"
};


items[] = {
"FirstAidKit",
"FirstAidKit"
};

linkedItems[] = {
"V_LIB_GER_VestKar98",
"ItemMap",
"ItemCompass"
};

backpack[] = {
"B_LIB_GER_A_frame"
};

uniformClass = "U_LIB_GER_Soldier_camo_00v00pSch3K98"

};




Just adding the helmet like I did the backpack doesn't seem to work. I've only made 2 units for test since I see no need to make a bunch until I get 1 or 2 working. He doesn't need the backpack, all his stuff fits in uniform and vest but I will want to add more to others.

Bailing_Out
02-01-2017, 01:28 PM
I got the helmet in, I didn't know the helmet became a linked item in a dot hpp file. I can now do loadouts any damn way I like.

Bailing_Out
09-19-2017, 04:16 PM
Most of you probably know this who read in here but I've found that triggers that might try to fire at round start actually run better if it doesn't do it right away and if you make the activation game logic and simply make the type present. It will still use the condition or conditions in the expressions below that but it will wait a second or 2. I had problems with my spawn points based on sectors working until I did this.

What it would do at round start is it would say it couldn't find ellipse or rectangle, whichever shape I chose for a respawn marker, if the spawn points were active immediately instead of a second or 2 later as I have it now.

Bailing_Out
10-08-2017, 01:33 AM
I've seemed to have hit a max of 7 or 8 spawn positions when the round starts. Don't think its a limit officially but at round start that seems to be all the game can handle.

Bailing_Out
10-13-2017, 12:51 PM
Ok I finally have fixed it completely. I can make all the spawns work at round start by using timeout and adding a few seconds to when it starts instead of countdown. Countdown I guess starts trying to make them at round start and I see them for a second and then they disappear or they never appear at all.

I never saw it till this morning, I blew up a fountain, the water remains right there, you can hide behind it, you will walk slowly through it, and you cannot crawl through it, the game makes you get up and walk since its not deep enough to swim.

Bailing_Out
10-29-2017, 06:11 AM
Yeah I fixed that /\, KINDA, you have to go to the lobby to change roles, but I aint fixed what I really want to fix which is controlling vehicle spawns. I want them to be dependent on who owns the sector, their **** (the ones owning the sector) should spawn and not the other sides ****. I have spent hours and hours looking on how to control the vehiclespawn module and now I am going through a scripting lesson which I am probably too old for and which will likely not go into using IF, Then, While or the other statements in the context of of using them in the expression line of the module. The scenario I am making is too big to do what they keep telling me to do, which is basically writing my own module for each one and I caint do that anyway completely yet and may never be able to do. All my **** will be location dependent, which is what the modules are great at.

I'm just an old Battlefield 42 player, which I couldn't make a map or scenario for. I got ideas, the scenario I am making/made right now would have been great for FH1 or 2 and I've made most of it but these damn If, When or While statements are hard to do if you didn't grow up with it. Plugging them into a module is even harder. I can kinda do the stand alone/make your own module thing but doing as many as is needed is too much.

Bailing_Out
10-30-2017, 01:51 AM
I'm doing this right now.

First way in the description ext file.

class CfgRespawnInventory
{
class WEST1
{
displayName = "Officer"; // Name visible in the menu
role = "Officer";

// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"LIB_MP40",
"LIB_M1908",
"LIB_Binocular_GER"
};
magazines[] = {
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19",
"LIB_32Rnd_9x19"
};
items[] = {
"FirstAidKit",
"FirstAidKit"
};
linkedItems[] = {
"V_LIB_GER_FieldOfficer",
"H_LIB_GER_OfficerCap",
"ItemMap",
"ItemCompass",
"ItemWatch",
"ItemRadio"
};
uniformClass = "U_LIB_GER_Officer_camo";
vest = "V_LIB_GER_FieldOfficer";
backpack = "B_LIB_GER_A_frame_zeltbahn";
};

Second way.

class WEST2
{
displayName = "Medic"; // Name visible in the menu
role = "medic";

//comment "Remove existing items";
removeAllWeapons _unit;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;

//comment "Add containers";
this forceAddUniform "U_LIB_GER_Soldier_camo";
this addItemToUniform "FirstAidKit";
for "_i" from 1 to 10 do {this addItemToUniform "LIB_5Rnd_792x57";};
this addVest "V_LIB_GER_VestKar98";
for "_i" from 1 to 9 do {this addItemToVest "FirstAidKit";};
this addItemToVest "LIB_5Rnd_792x57";
this addBackpack "B_LIB_GER_Rucksack_Vide";
this addItemToBackpack "Medikit";
for "_i" from 1 to 3 do {this addItemToBackpack "FirstAidKit";};
this addHeadgear "H_LIB_GER_HelmetCamo";

//comment "Add weapons";
this addWeapon "LIB_K98";

//comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
};

The game has problems with the second way if its in the same file as the first way.

Bailing_Out
11-03-2017, 04:56 AM
I went another way with it, I get exactly what I want, with selectable roles, the right loadout aside from some stuff not fitting but it throws an error. I put functionary clothes on a US soldier and he had them even after I took them off of him in the editor, it executed the scripted loadout not the loadout I left him with in the editor. I'm thinking of just leaving the error an saying screw it.

EDIT: I did something, wish I knew what and the error went away.

Bailing_Out
11-03-2017, 06:21 AM
I couldn't get the toolkit into the backpack until I added it to that particular unit in the init sqf. It was in there but the game threw an error so I took it out of init sqf.

Weirdly though the unit kept the toolkit through multiple saves so I killed the editor, killed the server and exited the game. Came back, still in his backpack. I had tried to add that thing 7 different ways in scripts, its still in the script but only doing that loaded it.

Half my problems come from using independent, guerrilla and resistance in the right place. Init sqf won't really recognize independent or guerrilla, throws an error but you can use them in the description ext and the loadouts worked, there was just the error because init sqf didn't like it.

The other half of my errors is I will be editing the wrong damn file in Atom because I got two windows of it open so I can borrow stuff from another file. Then I wonder why nothings changed when I play/test the scenario.

Bailing_Out
11-03-2017, 11:26 PM
I finally got loadouts like I want them and they work (without errors) now I want to figure out how to make the vehicle respawn modules only work when when that side has the sector and of course the other sides work only when they own it.

I'm gonna post and example of the loadout structure later, many know how to do it but some don't and the examples that are usually posted don't go past one loadout, figuring thats enough but morons like me need to see the structure of how it is structured with multiple loadouts. Mine is simple, 3 files, but long, copy and paste helps a lot though and with Atom you can change a buttload all at once.

I think the reason that one soldier kept the toolkit (mentioned in and earlier post) after I put it in the init sqf and then took it out of the init sqf after it caused an error but still worked is because it got written into the mission sqm by the game. Thats the only file that writes itself.