Jump to content
Sign in to follow this  
demonized

Preset Weapon selections by player UID [script]

Recommended Posts

Almost there.... Almost there.

Stay on Target... STAY ON TARGET....

WHOO HOOO BACKPACKS FULL. YOU ROCK.

BUT one tiny, tiny thing is still not quite right.

The script is not getting the ACE move weapon to back SLOT.

If I was to put it in my characters Init

It would look like this.

[p5, "SMAW"] call ACE_fnc_PutWeaponOnBack;

That would put an SMAW on my back.

So what ever I have there, does not get grabbed by the cool tool you created Demonized.

ATM nothing is grabbed from the ON BACK slot.

One weird thing is that I have a second back pack in that BACK slot when I load to test.

So some how it is duplicating and filling that slot\spot.

On another note that confused me in the text.

In your Preset_weapons./sqf, it says

// presets for player Ridge Blaze

_Player_UID = ["1111111"]; // place the player UID numbers here without using ""

But you have to use them. So there might be a language issue or just old written word.

Once I read the excellent 1.3 readme I saw an example and it cleared up the ambiguity I had about to use or not to use the "".

1: locate this line:

_Player_UID = ["6666666"];

and switch numbers "1111111" out with the id of the player.

I figured out how you got the Warrior to activate the loadouts again for the three characters. Pretty Sweet going to put that in an ammo truck the player will want to take care of. I just changed the path in the warrior to the path to my preset_weapons.sqf that I have configured.

VERY VERY AWESOME

Thanks again Demonized.

Edited by Styxx42

Share this post


Link to post
Share on other sites

Thank you for your feedback :)

All reported issues found and dealt with, Targets destroyed!! Moving on. :cool:

fix posted on 1st page in important fix for ACE users.

The script is not getting the ACE move weapon to back SLOT.

If I was to put it in my characters Init

It would look like this.

[p5, "SMAW"] call ACE_fnc_PutWeaponOnBack;

That would put an SMAW on my back.

ATM nothing is grabbed from the ON BACK slot.

i placed the backpack on back in my testings, since it well, seemed logical at that time :) i kept my rifle in main slot, and my launcher in secondary main slot.

Is this done in another way for ACE users, maybe you can have multiple launchers?

Maybe i need to add a check for weapnonback function aswell, i only took into account the backpack so that will be updated.

Did you try SinglePlayer demo mission and selected the ACE backpack action on one of the units?

Let me know if thats not the way you would equip that guy.

One thing i couldnt figure out was to actually put stuff in the backpack witout using the ACE function, but it was late/early so that may explain it. X)

will look into this.

Edit: if placing launcher on back the launcher will not be included in the preset, since it does not check for weapons on back only backpacks.

And it always puts the backpack on back in v 1.3.

I will release a small update that will clear this up, for now only have backpacks on back when creating the preset and then manually switch around when you have used the action.

The complexity of ACE gets some time to get used to.

I have updated first post with this info until resolved.

One weird thing is that I have a second back pack in that BACK slot when I load to test.

So some how it is duplicating and filling that slot\spot.

this is maybe related to the above or it is simply a locality issue where you get 1 backpack for both server and client, will investigate this.

On another note that confused me in the text.

In your Preset_weapons./sqf, it says

// presets for player Ridge Blaze
_Player_UID = ["1111111"]; // place the player UID numbers here without using "" 

But you have to use them. So there might be a language issue or just old written word.

Once I read the excellent 1.3 readme I saw an example and it cleared up the ambiguity I had about to use or not to use the "".

yes old note, i had it there before i added the multiple players way to check instead of just one single player, will delete that for next release.

STILL haven't figured out how you got the Warrior to spawn the loadouts again for the three characters. But it is late and I will hammer away at it tomorrow. I think it has to do with the Names you gave each of them. Just don't have the grey matter available to figure it out.

for single player the specific actions are given to whoever is in _unit_list

for multiplayer the specific actions are given to whoever is in _Player_UID

For both SP and MP the actions are placed on whatever subject the script is run on, and given to the ones in either list or uid.

_unit_list is an array only in the script in the demo folder, wich is the one that should be used for Single player only, but will work in MP aswell, but then only by unit names ofc, and will probably have issues with respawns if not name is set correctly again at respawn.

it is replaced with _Player_UID wich is and array and the check for it in the loadouts folder script.

the actions themselves are placed on whatever is calling the script:

_null = [player,"start"] execVM "demo_files\preset_weapons_demo.sqf";

here the player has the actions on his body, replace player with any unit/object and the actions will be on that, but still only available to whoever is in playeruid array or unit list array.

---------- Post added at 08:03 AM ---------- Previous post was at 06:21 AM ----------

ok, fixed weapon on back issue when it was not a backpack, that is working now.

Updated first post with important info for ACE users.

Add 2 lines to the getMyPresets.sqf in demo_files folder.

Once i get more info collected on the multiple backpacks issue ill post a new version, but i hope it was only because of the weapon on back issue.

For now backpack will always be put on back no matter what was there when preset was made, but whatever was on back will be moved to secondary weapon slot, so only issue is that you must switch it to back again when using the action to equip.

Next version will the keep weapon that is on the back on the back after its equipped via action no matter if its backpack or not.

---------- Post added at 08:23 AM ---------- Previous post was at 08:03 AM ----------

fixed ACE double backpacks issue.

Add 3 lines to preset_equip.sqf in loadouts folder.

1st post updated with fix. will look over the script for any optimisations or tweaks and post a version with fixes included later today sometime.

Edited by Demonized
fix update

Share this post


Link to post
Share on other sites

Wow you are busy Demonized.

Awesome.

Can't wait. ::Glances in Spazo's direction" to test it.......;)

Will try all that stuff out tonight.

This thing is a real work of art for a group that plays a varied amount of missions.

It made me look at my weapons of choice and rethink them as well.

I used to be an M14 EBR man. Gone back to the 7.62 SCAR(BLK(thank your Robert Hammer) with Doctor and Laser and grenade launcher.

I will update you as soon as we do a thorougho test.

Thanks again Demonized.

Styxx :computer:

Question. What does fex mean? I have seen you use that word a few times?

I googled it and the urban slang is for POOP.

Edited by Styxx42
language

Share this post


Link to post
Share on other sites
I will update you as soon as we do a thorougho test.

great, much appriciated.

Question. What does fex mean? I have seen you use that word a few times?

I googled it and the urban slang is for POOP.

Lol i just realised you were right, its slang maybe, short for for example.

at least i thought so until now HAhaha. :)

maybe better i start with using f.ex instead.

Share this post


Link to post
Share on other sites

updated to v 1.4, now supports correct weapononback and multiple weapons with ACE.

I hope X)

No known issues at this point, extensive testing have been done in editor.

But it should be fully MP ready now.

Share this post


Link to post
Share on other sites

JESUS! I didn't even have time to implement 1.3 before 1.4 was released!! ;)

I've grabbed 1.4 and will hopefully have it on our server tonight and I'll post back!

Great work Demonized!

Share this post


Link to post
Share on other sites
JESUS! I didn't even have time to implement 1.3 before 1.4 was released!! ;)

I've grabbed 1.4 and will hopefully have it on our server tonight and I'll post back!

Great work Demonized!

Well with all the bitching and finger pointing I figured I best get testing and reporting back to Demonized...:eek:

LOL. Ah that made me laugh. just kidding.

BTW Demonized.

My testing is on a dedicated server. So I can report that all my testing is on my dedicated Win XP64 Arma II Combined Arms ACE2 running patch1.59

Just tested, WHOOOO HOOO.

That is it.

Preliminary testing has it PERFECT.

Going to try swapping slots and having three weapons and see, but for Weapon, equipment, Backpack and Launcher, it captured them all.

Great job Demonized.

Edited by Styxx42
Tested and worked perfectly.

Share this post


Link to post
Share on other sites

Ok, now I'm confused. I read and reread the readme but am still confused as to the new implementation of the "run via object" script...

----ORIGINAL POST-----

First off, I need to change the line in my init.sqf from...

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";

to

_null = [weps_select,"start"] execVM "loadouts\preset_weapons.sqf"; (weps_select is the name of the weapon rack we're using)

then I need to place the "_con..." line into .... what? I tried the init line but get an error (invalid number in expression)...

I'm a noob, sry. :(

----EDITED POST------

OK, I just re-looked at your mission.sqm and think my first post is totally screwed up. So I don't need to add ANYTHING to my init.sqf file? I can take out all text relating to the Preset Wepons script? Just add...

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";

to "weps_select" 's init line in my mission.sqm? Where would I place the "_con..." script to set the activation distance?

Edited by Spazo
still confused

Share this post


Link to post
Share on other sites
Well with all the bitching and finger pointing I figured I best get testing and reporting back to Demonized...:eek:

LOL. Ah that made me laugh. just kidding.

haha

BTW Demonized.

My testing is on a dedicated server. So I can report that all my testing is on my dedicated Win XP64 Arma II Combined Arms ACE2 running patch1.59

Just tested, WHOOOO HOOO.

That is it.

Preliminary testing has it PERFECT.

Going to try swapping slots and having three weapons and see, but for Weapon, equipment, Backpack and Launcher, it captured them all.

Great job Demonized.

In the demo files i added a 4th action for the first player only for ACE, that has 1 rifle on back, 1 launcher in secondary, 1 rifle in main, and 1 pistol.

Awsome news, thank you for your report. and :yay::yay::yay:

So I don't need to add ANYTHING to my init.sqf file? I can take out all text relating to the Preset Wepons script? Just add...

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";

to "weps_select" 's init line in my mission.sqm? Where would I place the "_con..." script to set the activation distance?

Yes, maybe i should have specified it more clearly, the use of lines in init.sqf was just to make it easy, placing it on all wanted units.

The only thing needed in init.sqf is the backpack line.

Preset_loadOuts_backPacks = compile preprocessFile "loadouts\backpacks.sqf";

You can activate the presets on any unit by just placing

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";

in that units initline.

in each players preset in preset_weapons.sqf you find this:

	if ("start" in _this) then {
	_con = format["(getPlayerUID _this) in %1",_Player_UID];
	// add the 3 actions, change "my default inf loadout" to "whatever i want" wich will be the name you see ingame when selecting this action.

now for distance checks added to id checks change _con line to:

_con = format["(getPlayerUID _this) in %1 AND (_this distance _target) < 2",_Player_UID];

basically anything inside " " is the condition that must be true to view the actions.

here we now have a condition that activating players must be in _Player_UID of that preset, and be less than 2 meter from the object, wich is your weapon rack, you can of have more or less distance.

do not bother with names as _this is automatically the one that is trying to see the actions and will only allow any player with the id for that preset, and _target is automatically whatever the actions are on, in your case its the weapon rack.

simply setup all your preset loadouts for all players and when you are done place this line in how many, and whatever you want to have the actions on.

place this in initline of the weapon rack:

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";

And again, thank you Styxx42 and Spazo for your interest, feedback and testing, without you it would never have reached this stage.

Edited by Demonized

Share this post


Link to post
Share on other sites

Played last night for 4 hours

Couple things that happened on our server.

Using the non JIP init.sqf option to initialized this.

"I am Ready" dublicates in each players mouse wheel option based on the number of active players at mission launch.

So we had 4 players there was 4 I am ready.

If you selected your loadout then choose I am ready and walk up to another player that has not finished their I am ready option, you get your weapon selections again until you move away from them.(as if you are activating a trigger on the warrior(which works AWESOME BTW)

Other then those small issue the script is IMO a work of brilliance.

My fellow players where RAVING about it.

If you need more information on my setup to help trouble shoot just say the word.

(FYI in this test mission I have enabled the Get my presets) incase that is causing an issue.

Question. Is it possible to use the UID to swap out character models? Meaning, could you run some script from this sort of thing to change your character in game?

Share this post


Link to post
Share on other sites

ok, thank you Styxx42, your reports is very valuable.

will look into this, maybe its related to the Get my presets, unsure, shouldnt be...

Edit: if players were using the same preset, meaning you used multiple ids for a preset, then ive spotted the error, and will fix it.

Edit: will try to fix it, it appears to be a locality issue, since all in same UID array gets acess to the action.

Workaround: do not use multiple UID in _Player_UID, but copy and paste each preset for each UID and set one id / preset.

"I am Ready" issue, not sure, but will look into this, probably related to the above, but it beheaved differently so still scanning for bugs.

Need food, some cofee, and then ill tackle the issue later today.

for changing models, yes, its possible. ill see if i can make a change in the presets, to take models as well.

that would be nice if that worked.

---------- Post added at 05:12 PM ---------- Previous post was at 04:18 PM ----------

i found a working change model created by kju at dev heaven, i sent him a email asking for permission to use his or help in creating my own.

will update to v 1.5 when changemodel script is ready to be implemented.

---------- Post added at 05:27 PM ---------- Previous post was at 05:12 PM ----------

changebody will ofcourse be optional, not forced by script.

Edited by Demonized

Share this post


Link to post
Share on other sites

That's a cool idea on being able to change character models!

Ok, just made the changes and found out two things.

1)In order to use an object as the place to choose your loadouts, you CANNOT have anything (except for the backpack line) in the init.sqf uncommented. Just the "_null = [this,"start"] execVM "loadouts\preset_weapons.sqf";" goes into the object's init.

2) Nothing needs to be added to the player's init with the "use object to select" method and the above line being placed in the object's init line.

I'll get it up on the dedicated and make sure it works for everyone tonight. Thanks for your continued work!

Edit - When I had the line in the init uncommented, I also had the multiple "I am ready" options but it was just me in the server. I didn't count (should have) but I wonder if there are as many "I am ready" 's as there are players defined in the preset_weapons.sqf?

Edited by Spazo
"I am ready" observation

Share this post


Link to post
Share on other sites

hi Spazo, thanx for report, yes you will get x amount of duplicate actions on same object for x amount of scripts run on that object.

only difference with player and object is that the script takes the player running it and adds the actions to the player, so that needs to be run on all player units.

will not create duplicates, unless using multiple players for 1 preset as reported by Styxx42 above.

for object it takes the object and places actions on that, and any player can acess whatever presets are defined by their playerUID only.

To make it short, run script only on where you want actions to be accessed from, who gets what is defined inside script no matter.

---------- Post added at 07:23 PM ---------- Previous post was at 05:39 PM ----------

got the change body option working in editor!! got group and leader things sorted, having trouble with getting init dynamically as there seems not to be any command like getVehicleInit or similar.

So at this point only name and group and leader is restored, not initline. working on a few possible solutions, but seems to me that this have to be hardcoded, (typed in by mission maker for each player).

also think i got any vehicle positions, so actions can be used from inside any vehicle as well, f.ex: inside a c130 otw to drop zone.

But there seems to be an issue with turrets, but ill workaround that.

And how this will work in MP is hopefully good :)

---------- Post added at 08:10 PM ---------- Previous post was at 07:23 PM ----------

ok got it working with "enemy" bodies as well.

Share this post


Link to post
Share on other sites
That's a cool idea on being able to change character models!

Edit - When I had the line in the init uncommented, I also had the multiple "I am ready" options but it was just me in the server. I didn't count (should have) but I wonder if there are as many "I am ready" 's as there are players defined in the preset_weapons.sqf?

Dam Skippy Spaze that would ROCK if you could swap player models out for the one you always play. One of my BIG issue with the game is that you are NEVER the same person in mission unless you edit them all to hell.

If Demonized could make it work it would mean work up front configuring and then unpbo, drop in loadout folder, and edit INIT.SQF and add one of the three lines in plus the backpack init.

Confirming one thing and clarifying.

I was not using multiple UID's for a single set of loadouts.

Each had their own loadout.

Tested just now.

I can confirm that on my server when using the init.sqf line to initialize,

{_null = [_x,"start"] execVM "loadouts\preset_weapons.sqf"} foreach playableUnits;

that you get one I AM READY for EVERY single iteration of the UID loadouts in my preset_weapons.sqf I have detailed(a different set of loadouts for each UID. Meaning I have 6 UIDs configured with three loadouts each. I am the only one on the server at the moment and I get 6 I am ready. I only have to click it once to get rid of my weapon selections but I still have the other 5 I am ready. It is defiantly related to the number of individually configured UID loadouts in the preset_weapons.sqf. Bout as much TROUBLE shooting as I can do.. Sort of. IT HURTS RIGHT THERE DOCTOR. :)

Simple solution for putting it in a vehicle or tent or what ever you want..

Put this in the init field after you configured your preset_weapons.sqf

_null = [this,"start"] execVM "loadouts\preset_weapons.sqf"

Walk up to the vehicle and BLAMO, good to go.

I have put it in the MHQ in Domination lingor.

LOVE IT.

Just a tiny bit of testing on my Dedicated server.

Still works fast, and flawless for loadouts. These are just cosmetic issue truth be told.

You can click on the I AM READY and it goes away and does not come back.

I could see an issue where you have 20 players that it would be a hassle.

Share this post


Link to post
Share on other sites

nice report, will update instructions on not using:

{_null = [_x,"start"] execVM "loadouts\preset_weapons.sqf"} foreach playableUnits;

This was almost expected, but very nice to get it confirmed.

Still learning alot about locality and JIP.

for the body change, ive run into a strange issue, after switching body, you cannot get weapons same way anymore, but getting magazines works fine.

Still looking for the error, getting confused as to what causes this.

Need a break and will tackle the body thing again with fresh eyes.

---------- Post added at 02:46 PM ---------- Previous post was at 02:41 PM ----------

"I am Ready" dublicates in each players mouse wheel option based on the number of active players at mission launch.

So we had 4 players there was 4 I am ready.

If you selected your loadout then choose I am ready and walk up to another player that has not finished their I am ready option, you get your weapon selections again until you move away from them.(as if you are activating a trigger on the warrior(which works AWESOME BTW)

fixed, temp workaround when placing actions directly on player unit is posted in issues on first post.

proper automatic workaround will be included in next release.

Edited by Demonized

Share this post


Link to post
Share on other sites

error with body and weapons was using a russian unit with a backpack preset, wich does not work in vanilla, just realised it when i tried to equip the ACE loadout without backpaack in vanilla..

Aww man, this has really bugged me....

going better now.. :)

Share this post


Link to post
Share on other sites
error with body and weapons was using a russian unit with a backpack preset, wich does not work in vanilla, just realised it when i tried to equip the ACE loadout without backpaack in vanilla..

Aww man, this has really bugged me....

going better now.. :)

Keep us updated, it is good to know you have not run out of steam.

This really is a fantastic work of art.

Just had 5 guys on the server tonight.

Man, the work you have done is awesome.

Thanks so much Demonized.

Share this post


Link to post
Share on other sites

released bug fix 1.41, and released experimental v 1.5 with body model change included.

All tested and working fine in SP and MP editor.

More details in first post.

Share this post


Link to post
Share on other sites

NM, i clicked the correct link this time...

Really nice script bro :)

Edited by Katipo66

Share this post


Link to post
Share on other sites

thank you Katipo66 :)

download link for v 1.41 was not working, fixed now.

1st post updated.

Share this post


Link to post
Share on other sites

2 users dedicated server

4 different bodies, 4 different loadouts.

Worked flawless. AWESOME.......

AWESOME.....

The thing that takes the longest is getting the user to repick their weapons but I THINK. that I can take the old load out code and add the ,body portion at the end and it works.

Have to verify with more then one other person.

Was a busy family weekend for all parties. Sorry for the lack of thorough testing. Will get to it this week for sure.

So far it is awesome. I have two different guises.

One a Merc one a USMC.

LOVE it.

Share this post


Link to post
Share on other sites

AWSOME!!! i have been waiting for this info, great news so far.

Sorry for the lack of thorough testing

No problem mate, all testing and feedback is very much appreciated but never a necessity, purely your free will.

Though all your feedback is what have brought this to the level it currently is ;)

that I can take the old load out code and add the ,body portion at the end and it works.

yes you can, add this to the end of the old loadout (inside the last ]), to add body to old loadout.

,"body","class_name"

you will get something like this:

_armament1 = [["BAF_LRR_scoped"],["5Rnd_86x70_L115A1","5Rnd_86x70_L115A1"],"body","BAF_Soldier_Sniper_MTP"];

or if in doubt, just equip yourself with their old loadout and rerun the getmypresets part in the demo with the choosen body named as body, their custom face etc will be determined by the playerUID of the action user not the one who sets up the preset inititally.

will continue work on working with other revive scripts and respawns, and the synched modules.

Remember to post any modules, respawn scripts etc you want to wrok with this and i will try and get it compatible, im sure most if not all is compatible if i write them to be ;)

for now i will focus on the ingame wounded, medic modules, after i will take the ACE one, then get norrins revive script working with it.

Edited by Demonized
added if in doubt.

Share this post


Link to post
Share on other sites

update on v 1.51 progress:

3 firstaid modules:

("FirstAidSystem", "AlternativeInjurySimulation", "BattleFieldClearance")

working with changebody in v 1.5 in SP editor.

Share this post


Link to post
Share on other sites
update on v 1.51 progress:

3 firstaid modules:

("FirstAidSystem", "AlternativeInjurySimulation", "BattleFieldClearance")

working with changebody in v 1.5 in SP editor.

That is great Demonized.

Last night I updated and tested all 7 players.

Fricken AWESOME. have I said that Before? WOW!

Worked great for loading and model switching.

Tried with a hope and a halflings heart to add 1.5 to Ace Insurgency.

and sadly as you say as soon as respawn kicks it totally messes up and puts us to the default BootHill zone way out in IDAHO.

Okay saw that you wanted bug report.

http://forums.bistudio.com/showthread.php?t=116096&highlight=insurgency+ACE

Added 1.5 with init line added to the healing tent.

Added two lines to init.sqf

launch mission.

All players picked and were off in seconds.(which was good because we where under fire with in 10 seconds of starting the mission because of mission placement.) this feature to pick and go saves so much time I bet alot of people don't even realize how long they spend staying into the ACE magic box picking equipment.

But once we expired, and respawned, a duplicate of our original body was placed on map and we where spawned to Boothill(I am pretty sure that is where we were)

Scrapped 1.5 and went back to 1.4 for weapon loadout and played all night.

So the sooner the better for the revive with ACE and Norrins.

Thanks again demonized.

All I did was revert back to 1.41 and MAN for a few guys on the server this saves a TON of time getting kitted and into the action.

THANKS AGAIN.

Edited by Styxx42
Error report added.

Share this post


Link to post
Share on other sites

the way i did the respawn was that i never could delete the old body for some reason.

so i hide the body as captive invicible and invincible at [0,0,0].

now when dead i switch you back to original body(while screen is black) place you at respawn_west etc depending on side, create the new body(the one you died with, and same choosen kit) and switch to it and then place the org body back again at [0,0,0] hidden, captive and invulnarable, then repeat again when dead.

insurgency probably uses a teleport function of dead units etc, i will get in contact with its creator to see how this can be resolved.

Thank you again for feedback.

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  

×