INF Patches mission code

Chat about PC/Games & Other technical problems
Bangie
Sergeant
Sergeant
Posts: 111
Joined: Mon Jul 17, 2017 1:56 pm
Arma 3 Game Name: Bangie
Location: England

INF Patches mission code

Post by Bangie » Sun Dec 23, 2018 2:18 am

I've been wanting/trying to do this for months but over the last few days I put my mind to it and after many iterations I finally have a version I am happy with.

With this code INF patches will now automatically apply insignia upon mission start.

For normal units:

//Unit init

null = this execVM "inf_insig.sqf";

//inf_insig.sqf

_uid = getPlayerUID _this;

switch (_uid) do
{
case "76561197995337740":
{
[_this,"alpha_1"] call BIS_fnc_setUnitInsignia;
};

case "76561198089423855":
{
[_this,"alpha_2"] call BIS_fnc_setUnitInsignia;
};

case "76561198011854521":
{
[_this,"alpha_3"] call BIS_fnc_setUnitInsignia;
};

case "76561198104898866":
{
[_this,"alpha_4"] call BIS_fnc_setUnitInsignia;
};

case "76561197997287214":
{
[_this,"bravo_1"] call BIS_fnc_setUnitInsignia;
};

case "76561198034419493":
{
[_this,"bravo_2"] call BIS_fnc_setUnitInsignia;
};

case "76561198012294761":
{
[_this,"bravo_3"] call BIS_fnc_setUnitInsignia;
};

case "76561198074259613":
{
[_this,"bravo_4"] call BIS_fnc_setUnitInsignia;
};

case "76561198007926226":
{
[_this,"bravo_5"] call BIS_fnc_setUnitInsignia;
};

case "76561198042933851":
{
[_this,"bravo_6"] call BIS_fnc_setUnitInsignia;
};
};


For medic units

//Unit init

null = this execVM "inf_insig_med.sqf";

//inf_insig_med.sqf

_uid = getPlayerUID _this;

switch (_uid) do
{
case "76561197995337740":
{
[_this,"alpha_1_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198089423855":
{
[_this,"alpha_2_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198011854521":
{
[_this,"alpha_3_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198104898866":
{
[_this,"alpha_4_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561197997287214":
{
[_this,"bravo_1_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198034419493":
{
[_this,"bravo_2_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198012294761":
{
[_this,"bravo_3_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198074259613":
{
[_this,"bravo_4_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198007926226":
{
[_this,"bravo_5_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198042933851":
{
[_this,"bravo_6_medic"] call BIS_fnc_setUnitInsignia;
};
};


The 'unit init' needs to be applied to every playable unit in the mission and the '.sqf's will have to be created in the mission folder.

This code will only work upon mission start so is primarily for one life missions. I would love to get this working with respawn but I have hit a brick wall; it requires the use of event handlers and such feats are beyond my
present understanding. I will continue to work on getting this implemented.

Amos is not currently listed. I will add him as soon as his UID is in the squad.xml.

I hope you guys like this, I'm pretty chuffed.

-Bangie

Bangie
Sergeant
Sergeant
Posts: 111
Joined: Mon Jul 17, 2017 1:56 pm
Arma 3 Game Name: Bangie
Location: England

Re: INF Patches mission code

Post by Bangie » Tue Dec 25, 2018 7:31 pm

Well as Christmas days go I've had busier but I don't think any have been more successful. I have managed to get the code working with respawn.

Normal units

//Unit init

nul = this execVM "inf_insig.sqf";

this addEventHandler
[
"respawn",
{
nul = [] execVM "inf_insig.sqf";
}
];


//inf_insig.sqf

_uid = getplayerUID player;

switch (_uid) do
{
case "76561197995337740":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_1"] call BIS_fnc_setUnitInsignia;
};

case "76561198089423855":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_2"] call BIS_fnc_setUnitInsignia;
};

case "76561198011854521":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_3"] call BIS_fnc_setUnitInsignia;
};

case "76561198104898866":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_4"] call BIS_fnc_setUnitInsignia;
};

case "76561197997287214":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_1"] call BIS_fnc_setUnitInsignia;
};

case "76561198034419493":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_2"] call BIS_fnc_setUnitInsignia;
};

case "76561198012294761":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_3"] call BIS_fnc_setUnitInsignia;
};

case "76561198074259613":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_4"] call BIS_fnc_setUnitInsignia;
};

case "76561198007926226":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_5"] call BIS_fnc_setUnitInsignia;
};

case "76561198042933851":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_6"] call BIS_fnc_setUnitInsignia;
};
};

Medic units

//Unit init

nul = this execVM "inf_insig_med.sqf";

this addEventHandler
[
"respawn",
{
nul = [] execVM "inf_insig_med.sqf";
}
];

//inf_insig_med

_uid = getplayerUID player;

switch (_uid) do
{
case "76561197995337740":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_1_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198089423855":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_2_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198011854521":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_3_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198104898866":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"alpha_4_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561197997287214":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_1_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198034419493":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_2_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198012294761":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_3_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198074259613":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_4_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198007926226":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_5_medic"] call BIS_fnc_setUnitInsignia;
};

case "76561198042933851":
{
[player,""] call BIS_fnc_setUnitInsignia;
[player,"bravo_6_medic"] call BIS_fnc_setUnitInsignia;
};
};


As much as I know this stuff is boring to most people this has been an extremely valuable learning experience for me. Although the benefits to gameplay will be minor it will add a level of polish somewhat unique to future INF missions.

Again, Amos is not currently listed but it is an extremely simple process to add new players; so as soon as his UID is available I will slot him in.

User avatar
Mearcat
Staff Sargeant
Staff Sargeant
Posts: 131
Joined: Wed Jan 25, 2017 10:04 pm
Location: Stalking you

Re: INF Patches mission code

Post by Mearcat » Thu Dec 27, 2018 2:17 pm

Great work Bangie. Nice little addition to add to missions etc.
Cannot be bargaining with, blackmailed, bullied, manipulated or ruled over.
Liberate te ex inferis, Voca vestri Hits!
High velocity Tungsten solves any terrorist problem

Image

User avatar
rhyswilliams999
Master Sargeant
Master Sargeant
Posts: 247
Joined: Mon Jan 23, 2017 9:45 pm
Arma 3 Game Name: INF_Rhys
Location: Fife
Contact:

Re: INF Patches mission code

Post by rhyswilliams999 » Fri Dec 28, 2018 5:37 am

Me and bangie amanaged to get it integrated into bootcamp, and also works on dedicated servers
Image

User avatar
Hawkeye
General
General
Posts: 416
Joined: Wed Jan 25, 2017 10:15 pm
Arma 3 Game Name: INF_H@wKEYE
Location: UK/Northumberland
Contact:

Re: INF Patches mission code

Post by Hawkeye » Fri Dec 28, 2018 10:08 pm

So it’s been tested as last night it didn’t work correctly!!
Image

Bangie
Sergeant
Sergeant
Posts: 111
Joined: Mon Jul 17, 2017 1:56 pm
Arma 3 Game Name: Bangie
Location: England

Re: INF Patches mission code

Post by Bangie » Sat Dec 29, 2018 8:09 pm

The test on Thursday was not applicable as the mission as a whole was being tested. It needs to be tested in sterile environments in order to prove whether it does or does not work. When we tested it on BootCamp it worked without issue.

User avatar
Hawkeye
General
General
Posts: 416
Joined: Wed Jan 25, 2017 10:15 pm
Arma 3 Game Name: INF_H@wKEYE
Location: UK/Northumberland
Contact:

Re: INF Patches mission code

Post by Hawkeye » Sat Dec 29, 2018 8:13 pm

Surely the script should work whether its in a mission or bootcamp, its that the point? Im just saying as it defo wasnt working correctly within the mission.
Image

Bangie
Sergeant
Sergeant
Posts: 111
Joined: Mon Jul 17, 2017 1:56 pm
Arma 3 Game Name: Bangie
Location: England

Re: INF Patches mission code

Post by Bangie » Sat Dec 29, 2018 8:18 pm

It was not working the other night, correct. But that was being hosted on my machine, where we initialized the mission when not everyone was ready, with a player not running the mod and in a version that I implemented five minutes before actually hosting the mission. There are many possible reasons as to why it did not work perfectly. I will take a look at it of course but it is impossible to say what caused the patches not to show. Do remember that on the first load it worked perfectly and it was only on subsequent loads in which errors were seen.

User avatar
Hawkeye
General
General
Posts: 416
Joined: Wed Jan 25, 2017 10:15 pm
Arma 3 Game Name: INF_H@wKEYE
Location: UK/Northumberland
Contact:

Re: INF Patches mission code

Post by Hawkeye » Sat Dec 29, 2018 8:28 pm

Fair comment, we will see how it performs on bootcamp, this will need a full test like making sure it still shows etc after a death or rejoin.
Image

User avatar
Hawkeye
General
General
Posts: 416
Joined: Wed Jan 25, 2017 10:15 pm
Arma 3 Game Name: INF_H@wKEYE
Location: UK/Northumberland
Contact:

Re: INF Patches mission code

Post by Hawkeye » Sat Dec 29, 2018 8:31 pm

Oh btw, this topic is in the wrong forum, it should be in the INF workshop forum. Before i move it over i just want to be sure that because you have displayed our player id's, is that a security risk to us if none members can see that, can they cause damage in anyway?
Image

Post Reply