Lost Kits function within framework

Post Reply
lawman
Posts: 49
Joined: Sun Oct 23, 2016 7:21 pm
Contact:

Lost Kits function within framework

Post by lawman »

I'm trying to understand the process by which kits are assigned to units using the framework, but got
stuck 'following the breadcrumbs'.

As far as I can see, the first thing executed is from the .init of the unit:

Code: Select all

["",this] call f_fnc_assignGear;
Only i can't seem to find the function anywhere in the framework.
No file i've examined contains the function f_fnc_assignGear, although there is a file f\assignGear

the way that that is written I would expect it to be a variable stored within a file somewhere, but the only reference to it I can find
is contained within remoteExec.hpp, in which nothing much actually happens:

Code: Select all

class f_fnc_assignGear { allowedTargets=0; };				// f_assignGear_AI.sqf

Thanks
Spud
Posts: 89
Joined: Sun Apr 17, 2016 7:46 pm
Contact:

Re: Lost Kits function within framework

Post by Spud »

You don't need to touch the f folder.
You need the "mission/loadout" folder.
Place your loadout.sqf file from the scripts folder in the loadout folder and in the "assignedLoadouts.sqf"

Code: Select all

if (_side == "west") then {
	#include "LOADOUTFILEHERE.sqf";
};
Replace 'LOADOUTFILEHERE' with the name of the loadout file

Edit the loadout file to make it your own
lawman
Posts: 49
Joined: Sun Oct 23, 2016 7:21 pm
Contact:

Re: Lost Kits function within framework

Post by lawman »

Spud wrote: Wed Dec 06, 2017 8:50 pm You don't need to touch the f folder.
You need the "mission/loadout" folder.
Place your loadout.sqf file from the scripts folder in the loadout folder and in the "assignedLoadouts.sqf"
You missed the part where I learn something.

I understand that part...what I'm getting at is how is assignedLoadouts.sqf called?
I can see it referenced in the file fn_assignGear.sqf, but that then begs the question how is fn_assignGear.sqf called?
Because, correct me if I'm wrong, but ["",this] call f_fnc_assignGear would not result in fn_assignGear being processed.

Or if it does, i'm not understanding how.

Thanks
MURRAY122
Posts: 171
Joined: Mon Apr 18, 2016 12:06 pm
Contact:

Re: Lost Kits function within framework

Post by MURRAY122 »

From my understanding...
Called from the players init.

Code: Select all

["",this] call f_fnc_assignGear; 
which passes to

Code: Select all

f\assignGear\fn_assignGear.sqf
Which has (on line 138)

Code: Select all

#include "..\..\mission\loadout\assignedLoadouts.sqf";
If somethings in
assignedLoadouts.sqf
it will load the units with that gear, if not the
fn_assignGear.sqf
gives them default gear

hope this helps.
Spud
Posts: 89
Joined: Sun Apr 17, 2016 7:46 pm
Contact:

Re: Lost Kits function within framework

Post by Spud »

Line 138 in "f/assignGear.sqf"

Code: Select all

#include "..\..\mission\loadout\assignedLoadouts.sqf";
User avatar
2600K
Posts: 173
Joined: Sun Jan 17, 2016 5:21 pm
Contact:

Re: Lost Kits function within framework

Post by 2600K »

https://community.bistudio.com/wiki/Fun ... a_Function

f\common\functions.hpp registers all the core functions including assignGear. Some are set to automatically run at game start (to save calling them in the init.sqf).

That complies the code and allows it to run against the unit when called.
lawman wrote: Wed Dec 06, 2017 8:11 pm I'm trying to understand the process by which kits are assigned to units using the framework, but got
stuck 'following the breadcrumbs'.

As far as I can see, the first thing executed is from the .init of the unit:

Code: Select all

["",this] call f_fnc_assignGear;
Only i can't seem to find the function anywhere in the framework.
No file i've examined contains the function f_fnc_assignGear, although there is a file f\assignGear

the way that that is written I would expect it to be a variable stored within a file somewhere, but the only reference to it I can find
is contained within remoteExec.hpp, in which nothing much actually happens
lawman
Posts: 49
Joined: Sun Oct 23, 2016 7:21 pm
Contact:

Re: Lost Kits function within framework

Post by lawman »

2600K wrote: Thu Dec 07, 2017 8:07 am https://community.bistudio.com/wiki/Fun ... a_Function

f\common\functions.hpp registers all the core functions including assignGear. Some are set to automatically run at game start (to save calling them in the init.sqf).

That complies the code and allows it to run against the unit when called.

Perfect, thank you 26!
This is what I wasn't understanding.

I'd seen it before but not really known what I was searching for when trying to learn about it.
Good to finally know how to do it
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest