Jump to content
Sign in to follow this  
echo_2-7

Troop loadout

Recommended Posts

How can I rearm the Takistan Army soldiers with more Russian weapons by default, such as the AK-74/GP-25 for grenadier, AKM and AK-74 for Rifleman and AT, FAL for medic and AKSU-74 for officers?

Share this post


Link to post
Share on other sites

Short answer:

1) Learn a new programing language called "Scripting(?)".

2) Hope you have LOTS of friends that KNOW Scripting(?).

3) Spend hours and days talking to them about how to get what your trying to do to work.

4) search the forums and read till your eyes are crossed...then hopefully find somebody with a phone.

5) Try and test your "script" for days until it finally does work...if ever (my experience.).

6) Then when your done and its working...you'll be so sick of THAT scenario that you'll never play it. :D

You could try option #4 first...then find a nice BIG bottle of headache medicine, and complain to everybody you know about how pathetically hard it is to find the right place or answer to your problem. (My favorite option) :)

Hope that helps.

(If I'm wrong; please feel free to tell me where.)

Edited by Otterbear

Share this post


Link to post
Share on other sites

By default I think he means without having to script anything. That requires making an addon that redefines the default loadout. I'll just outline my scripting (not addon) approach to it, how I would try to solve it.

Make a scriptfile, and put it for now in your general script folder (not mission script folder).

During the startup phase of the mission, execute it without any parameters, but wait until player == player, in case one of them is supposed to be a player character. Check that script (init version) is complete before overriding it with any specific loadouts to suit the mission.

During a forEach all units that filters the correct faction, remove everything (incl items) and re-equip them based on their unit class in a switch do case statement. I would try to make some of the repeating stuff functions. Classnames can be found in a sticky at the top of this forum.

Now, here is the clue. After this script is done in this way (init), set a variable to signal this. And/or check what _this contains. If it is nothing, it does the init method in a forEach all units way. If it's a single unit, you execute it on this unit only. If it's an array of units, you execute it forEach those units. In other words, store the "who result" in an array you can use in a unified way. This way, you have a way to re-equip any scripted units as well, by calling the same script but providing it with different parameters. Problems will arise when other scripts (i.e. the SOM module) creates units, I don't think there is a good way to intercept those.

Sorry to break it to you, but what you ask is not a trivial task. It's not hard per se (but as always, harder than you first expect :D), it's just a lot of typing.

Now, I know this isn't a direct answer, more a guide to help you help yourself. I don't think anyone wants to spend too much time on a problem they don't experience themselves. Sorry for not being all that useful.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites
By default I think he means without having to script anything. That requires making an addon that redefines the default loadout. I'll just outline my scripting (not addon) approach to it, how I would try to solve it.

Make a scriptfile, and put it for now in your general script folder (not mission script folder).

During the startup phase of the mission, execute it without any parameters, but wait until player == player, in case one of them is supposed to be a player character. Check that script (init version) is complete before overriding it with any specific loadouts to suit the mission.

During a forEach all units that filters the correct faction, remove everything (incl items) and re-equip them based on their unit class in a switch do case statement. I would try to make some of the repeating stuff functions. Classnames can be found in a sticky at the top of this forum.

Now, here is the clue. After this script is done in this way (init), set a variable to signal this. And/or check what _this contains. If it is nothing, it does the init method in a forEach all units way. If it's a single unit, you execute it on this unit only. If it's an array of units, you execute it forEach those units. In other words, store the "who result" in an array you can use in a unified way. This way, you have a way to re-equip any scripted units as well, by calling the same script but providing it with different parameters. Problems will arise when other scripts (i.e. the SOM module) creates units, I don't think there is a good way to intercept those.

Sorry to break it to you, but what you ask is not a trivial task. It's not hard per se (but as always, harder than you first expect :D), it's just a lot of typing.

Now, I know this isn't a direct answer, more a guide to help you help yourself. I don't think anyone wants to spend too much time on a problem they don't experience themselves. Sorry for not being all that useful.

:eek:

The defense rests its case. :D

To be totally fair, if I knew scripting...that would have been a tremendous help. As it stands..for me...It's Pig-latin.

I am very grateful for the helpful assistance CarlGustaffa.

*What I'm trying to get across is that your explanation was very thorough and concise...as a former programmer in several languages; I can see what your getting at...but not being familiar with "scripting" language...I'm still at a loss. But thanks anyways...you tried.:bounce3:

Share this post


Link to post
Share on other sites

My programming experience is only 6502 assembly (probably not many around here that even knows what that was, err, is :p), and minor experience with other stuff. No c, c++ (trying to learn basics of c++ now though), java, lisp, scheme, or any of the proper high level languages. Doesn't mean that sqf was out of reach, although I'm by no means an expert of it (or good coding skills - when it gets the job done, I'm typically happy :p).

Biggest difference is that proper language function libraries are generally replaced by a huge set of keywords which may look intimidating. And that we don't have to worry about type declarations or allocations. If you have experience with other high level languages, getting into sqf scripting should be easy.

Solve the problem on a small scale, then expand as needed. Just jump into it, you can't expect other people to do something this massive for you. Write some code, then ask for help.

Share this post


Link to post
Share on other sites
My programming experience is only 6502 assembly (probably not many around here that even knows what that was, err, is :p), and minor experience with other stuff. No c, c++ (trying to learn basics of c++ now though), java, lisp, scheme, or any of the proper high level languages. Doesn't mean that sqf was out of reach, although I'm by no means an expert of it (or good coding skills - when it gets the job done, I'm typically happy :p).

Biggest difference is that proper language function libraries are generally replaced by a huge set of keywords which may look intimidating. And that we don't have to worry about type declarations or allocations. If you have experience with other high level languages, getting into sqf scripting should be easy.

Solve the problem on a small scale, then expand as needed. Just jump into it, you can't expect other people to do something this massive for you. Write some code, then ask for help.

Thanks CarlGustaffa;

So this scripting language is SQF? I guess I should have guessed by the .sqf extension. I just thought that was an extension they had decided to use.

If this is the actual language, then there should be a site or book on how its used. Then the long list of Special names and such that arma has provided would indeed be useful.

My experience:Some Assembly way back in the day (my 10MB HD was the size of a lawnmower - and SOUNDED like one.) :D

Some COBOL, Lot of DBMS, DOS, BASIC, HTML, even dabbled with C++.

To be honest, I had a hard time grasping C++ because it seems counter-intuitive. What I've spent years learning was a function call, turns into a procedure, ectra...

I am/was familiar with SQF years ago, but never needed it at the time, and therefore never even learned much. So, even though I'm not thrilled at the idea of teaching this Old Dog, new tricks...at least now I know what direction to be looking.

Thanks!

EDIT: It does look like a lot of functionality could be implemented by the use of more modules. I guess this is what the modders are doing. BIS seems to be on the right track by incorporating them into the editor. I hope it continues to expand. (I'm not comfortable adding new mods to my current set-up as this can cause conflicts, but knowing that these are incorporated(modules), that work within the original game, does make me more comfortable using them.)

PS: Do you know of anyplace that explains what all the different modules do? (vanilla, that is. I know that a whole lot of stuff can be done using scripts.)

Edited by Otterbear

Share this post


Link to post
Share on other sites

Fantastic!

Thanks so much, Günter Severloh!:yay:

I dont know why I couldn't find that thread for weeks now. :rolleyes:

Share this post


Link to post
Share on other sites
If I want to change the weapons, do I have to use Editor?

You could, but it will still be scripted init lines. I hate init lines except for quick experiments, so I would make a proper script to do it (for the mission, or as a global script you can call from any edited mission). For the addon approach, you don't have to use the editor at all, except verify things work.

Share this post


Link to post
Share on other sites
My programming experience is only 6502 assembly (probably not many around here that even knows what that was, err, is :p)

C-64! Been there....done that! Wrote an oscilloscope program for it using assembly lang.

Share this post


Link to post
Share on other sites

$0314, $0315, $fffe, $ffff ftw :D

Lol, can't believe I still remember those. Scary :D

Or $d020, $d021 (only remembered the decimal values though), or $d400-$d418 (my area ;)). Omg... Good times, good times :)

Share this post


Link to post
Share on other sites

Wow...you must have a memory like an elephant! I can't remember that far back. So besides the short term memory loss caused by Jamaican tobacco.....apparently there's some long term memory loss as well! LOL!

Share this post


Link to post
Share on other sites

Ok so if using the addon method, where are the files located? Are they inside pbo's?

Edited by Echo_2-7

Share this post


Link to post
Share on other sites
pdo file?

I lolled :D

Get a hold of allinone.cpp, and browse for what you're looking for (I wouldn't know, something that deals with unit loadout probably). Then check out how other tweak addons or replacement addons are made, and make your stuff in a similar fashion. You'll need a depbo utility and probably BITools2 as well.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Search the forum for that. Personally I use cpbo, only because that's what I got hold of first and kinda of just stuck with it. There might be better (loose term), but it does what I need it to do.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×