#arma3_scripting
1 messages · Page 326 of 1
This could help:
https://community.bistudio.com/wiki/magazinesAmmo
And here is a way to get all weapons and its magazines from all turrets. just read the notes:
https://community.bistudio.com/wiki/weaponsTurret
Looking for help, making Arma traders: Want to make multiple traders w/chance to spawn, lets say i have 5 possible created traders, each with 20% chance to spawn, how do i make the server load only 1 of the 5
thanks @tough abyss
@sly sun I think you can even set the chance directly in the Editor.
Yes, but if each has %20, i dont want 3 loaded, only 1
I've searched for dynamic AI spawns and lots thru google, cant find the right stuff :\
Does that make sense on what im trying to do?
You have 5 units and only want one of them to spawn
Yes, sounds simple lol
Please don't copy-paste the same question in multiple channels. Also that has nothing to do with #arma3_config
thought it read config/EDITING
#arma3_scenario would probably be most fitting. But please don't double-post questions
So now i shouldn't ask in the correct place
Cools
Sorry the channels are kinda i'll defined
Should better think first before asking. We are people here and not google.
I'll check some things for you. And you will probably have to script anyway
Channels also have descriptions at the top.
if you have an array of all shop objects you can just delete random entries until you have the desired amount
Ah, you learn something new everyday, sorry
I'm trying to find the idc of a display. eh = (findDisplay 46) displayAddEventHandler["MouseButtonClick",{hint format["%1",_this];}]; doesn't seem to hint anything.
Of what display?
Arsenal.
Particularly the Arsenal Load button, want to replace it for new functionality
Just look in the config. RscDisplayArsenal
Oh, gotcha. Thanks. I had been looking for it there but to no avail, I will look again
Found it, not worries.
Button Load is IDC 44147 and RscDisplayArsenal Display IDD is -1
Yep.
I'm quite sure the display is stored in some variable
@sly sun Use "Probability of Presence" in Eden. Give every trader a variable. And inside the presence condition check isNil "trader1" && isNil "trader2" and so on.
If the probability triggers more than once the condition will detect if one of the other traders was already spawned.
@still forum Ins't -1 supposed to signify a random value to be assigned when opened? I need to wait until the arsenal is open to close the dialog.
-1 is also a normal IDD you can search for. But it's generally used when you don't need any IDD.
If several displays with IDD -1 are open using findDisplay -1 probably only returns the last opened. or the first opened or a random one or whatever ^^
Oh okay, thanks. I'll see what this'll do here.
@still forum So i thought this was working, but trader's 4/5 still appear with isNil "trader1" && isNil "trader2" && isNil "trader3"
Doesnt seem to be checking all the conditions
trader 4 should have
isNil "trader1" && isNil "trader2" && isNil "trader3" && isNil "trader5"
w00t?
= + [0.90,0.90,0.90,0.85]; + is not needed here
_color1 set [3, (_color select 3) * _alpha]; _color is undefined?
check the values of the colors before you call set
That they swap doesn't make sense
Also why do you copy _color but don't copy _nameColor
_alpha is undefined
@still forum Even with each trader having their own isNil respective to all the others, i get multiple spawning
Well in the pastebin _alpha is undefined.
If it's 1 as you say then it can't just be 0...
@sly sun Don't know another way then.
Ok, im gonna move to mission makers and see if anyone is watching that channel
Thanks for tryin 😄
You are not copying the array you put into _nameColor
anything else could set that to 0
If you check the variables before you call set is everything alright there?
hey folks, I'd like to turn off the street lamps on tanoa but it seems the default commands don't work. the problem is, I don't know the classnames of the new street lamps, you guys may help me out how to get them?
Well. You modify the global variable. What do you expect? Do you expect it to not get modified?
??
Yeah, thats correct.
What did you expect?!
- Both are "[0.68,0.90,0.36,0.85]"
No clue where your Problem is
abc = [1,2,3];
_cba = abc; //[1,2,3]
I doubt it. Sounds like you change the Array somewhere.
x = y is an assignment yes. but if y is an array then x will be a reference to that array instead of a copy
Which is why you use + to copy arrays
☝
Which you already do for _color but for some reason don't for _nameColor
if Y is a globalVar, not array.
no. I meant it as I said it.
y is a global variable of type array yeah.
abc = "abc";
_cba = abc; //ABC
abc = "123"
_cba == "123"
iirc
no.
*startingArma*
That would return false
By reference only works for arrays
Probably done because arrays are expensive to copy. Relative to strings
abc = [1,2,3];
_cba = abc; //[1,2,3]
systemChat str _cba;
abc = [3,2,1];
systemChat str _cba; //[1,2,3]
Should work without +
+it checks each time newly, when it's beeing called.
@jade abyss Your example is not modifying the array inside abc/_cba
you are resetting abc to a new array
@hasty violet Second one
It is stored inside a magic secret variable that only a handful of people know
what?
yeah
Sorry 😄 That may have seemed a little too unserious
private _team = assignedTeam _x;
_nameColor = + switch (_team) do
_nameColor = + switch (assignedTeam _x) do
Both work -.-
but second one is more performant and more compact
Also no one said one of these wouldn't work
Sounded like it.
+Dedmen - Today at 1:20 AM x = y is an assignment yes. but if y is an array then x will be a reference to that array instead of a copy
Would be wrong then oO
but if y is an array then x will be a reference to that array instead of a copy
Thats not the case oO
ABC = [1,2,3];
_var = ABC;
//_var == [1,2,3]
ABC set [0,5];
//ABC == [5,2,3] and _var == [5,2,3]
checking again, more or less the same as i did before, but it didn't update _var
What did you do before? Your last example was using a string instead of an array
And your other example didn't modify the array
yes
abc = [1,2,3];
_cba = abc; //[1,2,3]
systemChat str _cba;
abc = [3,2,1];
systemChat str _cba; //[1,2,3]```
That one
So unless you "re-set" the GlobalVar -> It's refing to the latest one.
yeah. You have two arrays
arr1 is [1,2,3]
arr2 is [3,2,1]
abc = [1,2,3]; //now abc points to arr1
_cba = abc; // now _cba also points to arr1
abc = [3,2,1]; //not ac points to arr2 but _cba didn't change so it still points to arr1
nvm, all fine.
if you use for example
abc set [0,3]
abc pointed to arr1 so you modified arr1.
And _cba also points to arr1 so it was also modified
i forgot, that with X = [] a you create a "new" array, not modify the existing one.
I don't suppose anyone's worked out how to remove "vehicles" from the UAV control list? If I place the carrier defense turrets they fill up the list of UAV's the player can control. I really don't want the player in charge of the carrier guns.
Part of me wishes BI had used a module system similar to the support modules when it came to UAV's, but I guess that would cause more issues
Oh wow ok so using that I assume I can have specific UAV's controllable only by certain units? Eg anyone can pick up a UAV controller but only the specif person can control say the greyhawk?
And if I name the player units and replace the player with the unit name it will stop that specific player correct?
Does anyone know of a way to return the class that a controls inherits from, ctrlClassname will return the controls classname but not any it inherits from
You can't do that unless you know the CONFIG path of the control. In which case it works like every other config.
Classname is not enough.
@hasty violet did u try to not check against 0? maybe checkVisibility returns a small value if the checked unit is hidden by another unit. just a suggestion. Also a check with a higher value than 0 is better if unit is hidden by smoke.
you could just test which value is fitting ur needs by outputting the returned value of checkVisibility via hint or systemChat while looking at the hidden unit.
#include "\a3\functions_f\Params\paramGuerFriendly.hpp"
Hi chaps, it seems this causes a game crash stating it cannot find the file when I include the above in my description.ext.
I'm trying to use some of the Bohemia functions in a custom zeus mission.
Oh ignore me - Param templates currently don't work with PBO missions manually copied to MPMissions folder. Unpacked missions, Steam missions and missions which are part of an addon works correctly. turns out...
What? You can't #include if you have a PBO in MPMissions?
Why does the preprocessor care about that?
Arma amazes me every few weeks
its probably to do when they changed the security with #include
no more 'outside' files
but missions that dont live in a pbo arent in the right location to #include from the main arma folder now
You mean -filePatching? That doesn't apply in this case
And the problem doesn't happen if the mission is unpacked. Only if it's in a PBO
no, it only works for missions packed as an addon in a pbo.
you can pack a mission as a 'normal' mission pbo and it wont work
you'll have to make a special mission addon for it to work
But you can #include from scripts just fine. But not from description.ext.
Arma is weird...
yep
i suspect because the .ext is parsed way earlier, engineland goes wierd
maybe it works if you just use a pbo program that actually precompiles the mission
I don't know if description.ext would get binarized. I don't think so..
so i have this simple little RscTitle, and i want to add a *.paa image to it. How would i do this? i was thinking either like this: ```sqf
class Symbol: RscPicture
{
idc = 1200;
text = "#(argb,8,8,3)color(1,1,1,1)";
x = 0.025625 * safezoneW + safezoneX;
y = 0.181 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.077 * safezoneH;
image = "myPic.paa";
};
or like this :sqf
class Symbol: RscPicture
{
idc = 1200;
text = "<img size= '1' image='myPic.paa'/>";
x = 0.025625 * safezoneW + safezoneX;
y = 0.181 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.077 * safezoneH;
};```
you need to have file path in text
ok so like this sqf text = "myPic.paa"; ro like this ```sqf
text = "<img size= '1' image='myPic.paa'/>";
Just file path, bottom one is structured text
ok awesome, thanks alot
@meager granite Im assuming, you are one of the people that scripting the game mode KOTH. With your earplugs feature, you have it bound to F1, usually F1 will bring up the AI control menu. If you know, how did you disable that AI control menu?
keyHandler
@limpid pewter You can also just remove the AI menu keybind in the Keybinding settings
but for all players? dedmen
btw this is what i have atm ```sqf
(findDisplay 46) displayAddEventHandler ["KeyDown", {if (_this select 1 == 59) then {[] spawn mld_fnc_epMain;};}];
http://grueslayer.webs.com/Keystate.png
if(!isNil "MyFancyKeyHandler")then{(findDisplay 46) displayRemoveEventHandler["KeyDown",MyFancyKeyHandler];};
MyFancyKeyHandler = (findDisplay 46) displayAddEventHandler ["KeyDown","call DS_fnc_Keyhandler;"];
DS_fnc_Keyhandler =
{
params["_ctrl","_button","_BtnShift","_BtnCtrl","_BtnAlt"];
private _ButtonDisabled = false;
private _BD = {_ButtonDisabled = true;};
if (_button == 59) then{systemchat "F1 Pressed and Key Disabled"; call _BD;};
if (_button == 60) then{systemchat "F2 Pressed and Key Disabled"; call _BD;};
_ButtonDisabled
};```
In this case call _BD; disables the normal Function of that Button.
Nope. The return of _ButtonDisabled disables the normal Function
so where is _ButtonDisabled defined?
private _ButtonDisabled = false;
oh oopps
Nope. The return of _ButtonDisabled disables the normal Function```
called by `call _BD` ...
Wich sets _ButtonDisabled to true
But why call a function rather than just exitWith true
ok so what is the significance of _buttonDisabled. When that is returned how does it effect the EH
?
_ButtonDisabled
Guess why i named it like that^^
if you return true. The button is disabled
if you return false the game button also triggers
True (disabled) / False (not disabled, StandardFunction will also be executed)
Reasons.
Magic
Call it what you want.
Can Execute this action, when pressing this button? -> True/False to the engine. Nothing else.
The engine basically asks you "Did you handle that Button or do we also need to ask others if they are responsible for that button press"
If you return true the Engine knows that button was handled and doesn't continue to ask others
^ Best explanation 😛 thanks dedmen and Dscha( to clarify, no sarcasm meant)
```cpp (or "sqf" for Scripts)
YourCode
```
(makes it easier to read for others)
After the last arma update, my trigger no longer works. can someone help me? class Item42 { dataType="Trigger"; position[]={2143.2209,3.172629e+036,3455.395}; class Attributes { condition="this && (local player) && (vehicle player in thisList)"; onActivation="hint parseText format[""<t align='center' size='2.0'>! Safezone !</t><br/>¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯<br/>""];"; sizeA=150; sizeB=150; repeatable=1; activationBy="ANY"; }; id=142; type="EmptyDetectorAreaR50"; };
I'm not 100% sure but doesn't the player variable as such always refer to the local player? Why the extra condition (local player)
The trigger comes only when I come with open map in the trigger. But when I go normally he comes only 1 sec
Sorry for the english
He goes already but he should show about 1 min a text now he comes only 1 sec
In my tests some time ago under certain unknown conditions player is not local as demonstarated by KK. Yes Maybe set all three repeatable timers in trigger to the same value.
I have a question for you guys. What is best (performance wise), and what are the difference between these two cases:
if (isServer) then {
_vehicle animateSource ["animate_something", 1];
};
and
remoteExec [someAnimationScript];
RE -> Sends over the Command
animateSource -> Animates the Object itself, without the need of sending it over the net (only animState will be transported)
So i would go with animateSource
ok thanks
They do two different things. So the performance question can't really be asked
but you can use RE to activate animations on all clients cant you?
yeah sure. just wondered which was best. now I know
Animations are send over the net automaticaly.
ok. just wanted to know what was most efficient
AnimSource, in this case.
@hasty violet well, you are right. We wrote a whole geom. function to make this work properly.
hey, is there a way to change the speed of a specific animation throught scripting?
I am using setAnimSpeedCoef for walking, running animations. but i want to change the ladder climbing animation
oh ok
I take back my comment. I looked up that command and it should do what you want.
nah, it only affects walking, running and reload animations, i want to speed up the ladder climbing animation
but thanks anyway
yeah i agree
I love it when my doors don't work anymore
@empty blade oh yes, especially in winter. Buggers get stuck
nah I think it's the walls which the hidges are in expanding due to the hot weather sir
Shiieet.
Does anyone have any go-to side UI dialog "info" panels that they like to use across multiple missions? The BIS_fnc_guiEditor is really tedious for me (probably due to me always forgetting how to copy to clipboard and save the appropriate stuff in the correct files) so I quickly lose motivation every time I approach that part of polishing my missions.
@modern sigil do you mean items like the gps.display and such?
@subtle ore I was thinking maybe an alternative to the hint panel, but for short, quick notifications that I can show and then hide after a few seconds. So sort of like BIS_fnc_showNotification but for brief phrases and short sentences whereas the built-in notifications dialog is specifically for only a word or two along with a picture.
If I place a chopper with crew(AI) and it get seriously damaged, the crews get out of the chopper. How to prevent crews from getting out of the chopper and just stay in the chopper, even though the chopper is seriously damaged?
allowCrewInImmobile might get you somewhere
https://community.bistudio.com/wiki/allowCrewInImmobile See also the Note from KK
Wow.😄 thanks guys, @still forum @indigo snow
Yeah I was about to say that earlier -- I think that the behavior is part of the danger FSM. If I'm right about that, then you'd have to rewrite or replace the FSM. KK's note just says to disable it altogether while they're in vehicles.
@indigo snow @still forum the crews still get out of the chopper. see my video clip. https://youtu.be/o6eCJjjf29w
@quasi rover i believe that the command only applies to ground vehicles
Regardless if in flight or not, etc
hey, so i have this ```sqf
drawIcon3D ["resources\pictures\AFlag.paa",[0.525,0.545,0.576,1],getPos aflag_marker,3,3,45];
btw, i have used ```sqf
hint str (getPos aflag_marker);
@subtle ore thanks.
@limpid pewter Are you using a texture in a mission or addon?
hello everybody
https://i.hizliresim.com/dGkRjL.png What is the cause of this problem?
Using windows is the problem.
Also, #server_admins or #server_windows is probably the better channel @rancid pecan
okey sorry
@zenith totem Which mods were you running? @still forum The linux server used to be one of the biggest headaches when arma 3 came out. Is it any better now?
@peak plover cough I'm not the one needing support
Just a useful, quick SQF thing I thought would be good to share:
//*** When a unit dies, strip all of its equipment so that nothing can be looted!
addMissionEventHandler [
"EntityKilled",
{
params ["_killed", "_killer", "_instigator", "_useEffects"];
if (_killed isKindOf "Man") then {
_killed setUnitLoadout [[],[],[],[(uniform _killed),[]],[(vest _killed),[]],[],(headgear _killed),(goggles _killed),[],["","","","","",""]];
};
}
];
@modern sigil or even better, move the gear to a weapon holder
That reminds me of a problem I was trying to get around
I originally had getUnitLoadout when the local player was killed, but sometimes they'd already dropped their weapon by that point
I suppose handleDamage would be the only reliable method to ensure I get the loadout correctly before the unit drops the weapon
@zenith totem sorry jaffa, didn't see your message until now. I am using a texture in a folder within my mission folder
@zenith totem yeah handle damage can be processed in same frame as kill event
where is the correct place to add this -> https://community.bistudio.com/wiki/allowCuratorLogicIgnoreAreas
@late gull Just like the parameters detail to you, the curatorObj is the curator module you have designated to a player. Then a boolean true or false
And, it must be executed on the server
ty
Is there anyway to attach an object to a player's body via memory point that will follow the leaning of the player? Like making a weapon stick to a backpack?
Is it possible to have an FiredNear EH only ran by the server, so that the server could send the information to the database to log it? Instead of using remoteExec from the client
addEventhandler is local
You can try to add it on the Server on that Unit, could work (not sure, tbh)
well the thing is I want to log things from FiredMan or FiredNear to the database. but don't want to plug the network traffic, i don't really like the idea of remoteExec from client with log details everytime a client fires
Make it a Var on the Client, when he disconnects -> Send it over to the Server
e.g. _Unit setVariable ["FiredNeardVar",Status,true];
isn't there FiredMP handler?
MPHit there is
If there was only something like Intercept with a Networking Plugin. So you wouldn't have to worry about network traffic...
if I knew C++
The world could be so nice. But right now we only have SQF and over 10 year old netcode
I appreciate intercept, but I didn't see it used on any mission. Maybe im just blind
Yeah. Mission directly probably not. But stuff like Database logging and Mods in general.
Are you sure that remoteExec load is that bad that you can't take it?
Try it out maybe it's not that bad
or collect the Information on the client and send it out on Intervals
Yeah the second thing is more likely for me to try out.
Have a var, pushback an array with EH info, and send it every x minute
@jade abyss thanks, that's what i've been using so far however it doesn't follow the the players positioning as seen here:
https://youtu.be/jrLlMfviRV0
¯_(ツ)_/¯
Haha no worries.
is there anyway to see the full list of commands in the function viewer? some are missing such as setflagowner
I want to see what happens for the commands. I thought when I was seeing "getArea" it was the command, but perhaps it's BIS_fnc_getArea that I am seeing the details for
if you are looking in the function viewer that is indeed what you are looking at, BIS_fnc_getArea
ok thanks bunches
is it possible to flash a bright light during the day? I can use flare, but only works at night atm
hey, does anyone know of a way to display an image of a weapon on a GUI? Are there built in pictures of the weapons? or would i have to add in my own picture resources?
what about rendering a 2D image of the weapons model or something?
@limpid pewter In a gamemode I made I did it through RscTitles, and updated the UI control like this:
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
_control ctrlSetStructuredText parseText format ["<t shadow='0' size='4'><img image='%1'/></t>", _picture];
ahh awesome ,so there is an image of each weapon in the config?
Yes
cool 😄 thanks
@hallow spear https://community.bistudio.com/wiki/setLightDayLight
You also can use 3d ui elements @limpid pewter killzonekid also had a tutorial about it
Yeah thats was a second option, but what shadow Ranger said worked a treat thanks 😃
If you only use vanilla it should always, yes
yeah, all vanilla
does someone know about the Land_ATM_01_malden_F, isn't that a interactable object - other like houses and stuff?
@waxen jacinth What do you mean by interactable? In terms of an ATM?
nah in terms of..no clue how i can explain it - basically i want do make a interactable object out of it by using the classname for it. but for some reasons, no script recognize it as an object
example: NOT WORKING WITH "Land_ATM_01_malden_F" ```_number = 0;
_Container = nearestObjects [player, ["Land_ATM_01_malden_F"], 500];
{
_number = _number + 1;
markername = format ["%1%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;WORKING with "Land_i_Shop_02_b_blue_F"_number = 0;
_Container = nearestObjects [player, ["Land_i_Shop_02_b_blue_F"], 5000];
{
_number = _number + 1;
markername = format ["%1%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;```
that's not the example for my interaction script, just something i tried to have all positions displayed but even that doesn't work,.
@waxen jacinth
_number = 0;
_Container = nearestObjects [player, ["Land_ATM_01_malden_F"], 500];
_Container = nearestTerrainObjects [player, ["HIDE"], 500];
_Container = _Container apply {["atm", (str _x)] call BIS_fnc_inString};
{
_number = _number + 1;
_markername = format ["%1_%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;
@warm gorge Thanks tho, didn't worked either. Is it possible the atms placed around are just more like cosmetics`?
I mean, if i put in any other class like a house, scripts work like charm
oops I posted wrong code
_number = 0;
_Container = nearestTerrainObjects [player, ["HIDE"], 5000];
_Container = _Container select {["atm", (str _x)] call BIS_fnc_inString};
{
_number = _number + 1;
_markername = format ["%1_%2", typeOf _x, _number];
_marker = createMarkerLocal [_markername, position _x];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorGreen";
} forEach _Container;
@waxen jacinth That should work
Does anyone here have some scripts or tips on how to make an script that adds money to players for kills of AI or Players? (This is for a dedicated server)
@warm gorge Thanks pal, that's working. Is it possible they use an other class name for it, then the one are in the editor? How could i basically get the classnames of those?
@remote flame there are some missionsystem released, wich have that option - you could take a look at how they doing it, to maybe get some ideas for your own script
Have a look at what the nearestTerrainObjects returns, and you can judge what you need to change on that in the select filter
If I wanted to add a list of UIDs to Zeus.. Would I listed it in the owner as ["xxxx","yyyy","zzzzzz"]
Trying to add Zeus into EPOCH. Since the unit changes when you select a slot... Giving Zeus by the UID, would resolve this. Just having a hard time passing the UID through the owner column.
Thanks everyone for the help I will look in to it
@warm gorge Thanks, worked like intented. 😘
@tough abyss The script work but I have to modify it to my needs, so thanks 😃
@tough abyss Dude It works!!! I fucking love you man 😍
is there a way of making a RscPicture a button without creating another button class to go over that picture?
ok so in the RscPicture class, i put onButtonClick = blah blah;
onMouseButtonClick
https://community.bistudio.com/wiki/ctrlEnable
awesome, so if i wanted a picture to act as a button the whole time the menu is open, i would enable the ctrl upon menu initialisation and then use that onMouseButtonClick in the class to execute something?
yup
as tipp: use a single function to create the dialog
if you need to add some elements that require refreshment, create a spawn that will stay open for the lifetime of the UI using a while loop
and put all things that might change during UI runtime in there
npnp
playerSide is incorrect if you group units to different sides in the editor. side group player is recommended
if im using vehicle setVariable ["Varnam", units player]; and the player logs out, will the getVariable ["Varname", []]; return an empty array?
it will be the result of "units player" at the tiem the command was executed
what would be a way to check if the said unit in the array is still online?
depending on what you have set in your description.ext
isPlayer or isNull
as when the object will "fallback" to AI when player DCs, it will no longer return true on isPlayer
and in case you set those to then disappear, the object will automatically set to objNull
which can be detected via isNull
thanks will try isNull
Is this the chat i should talk about addons or somewhere else
Specifically signatures
As long as there is no one here that wants to do scripty stuff. Sure. Go ahead
Can you explain the difference between a .bikey and .bisign
.bikey is your public key.
.biprivkey is your private key.
and .bisign is the signature of the file that belongs to that.
the bisign is created by "hashing" the file and your privatekey.
and Arma can then use your public key together with the .bisign and your file to confirm that it was signed with your private key
My mod has a bisign but no bikey
the .bikey get's created together with the .biprivkey
If you created the bisign you also had your private key handy. And the bikey should be right next to the private key
the .bikey belongs in Arma 3\keys\file.bikey
when your bisign is in Arma 3\@mod\addons\file.bisign
If you are packing your Mod in a zip just put it next to the addons folder
PAL is so meh.. NTSC is the real thing
NICE MEME
Is there a command to return all the objects within a group?
I can't find it.
Nevermind, BIS_fnc_groupVehicles seems to be what I'm looking for.
waitUntil {_adminState = admin owner player; sleep 5; (_adminState == 2)};
Is this a valid way of waiting until a player has logged into admin?
Looks good to me
alrighty time to give a it a goooo
going to keep the context low, because it'll just sidetrack the discussion, but does anyone know of a way of scaling the images coming through htmlLoad on the SQF side?
Normally you'd just go with resizing the control, but in html control's case that'll just crop the image instead of resizing it
Hi, can I import a music into my CfgSounds in description.ext ?
with a path ? Or can i easily turn on the music on the player ?
Aaaah so this is how you return your admin state locally _adminState = call BIS_fnc_admin;
What waitUntil command can be used before a script executes on a player so that when they are finished loading and they see the world and their gun, the script runs?
waitUntil {!isNull player}; - never mind
I was wondering how do you use the custom controls keybindings in a mod or script. Like how do I write an event handler for if the keybinding is pressed. I've done normal keys before but not custom controls.
basically just check if _button is the same as the keybind you want
on a keyDown displayAddEventHandler
but how do I get _button of Custom Control 12
custom control 12?
Yes, in controls theres a category called Custom Controls
ah in that can you wanna check actionKeys
uhmmm
if (_button in (actionKeys "user1")) then { true; };
ya this looks like it
thanks
https://community.bistudio.com/wiki/inputAction/actions this was the key i needed
now I just need to figure out how to compare actionKeys to a DikCode
i.e. that _button
[1:25 AM] Adanteh: if (_button in (actionKeys "user1")) then { true; };
i wonder
What are you thinking?
... that's how you do it
I just used this if (inputAction "user12" > 0) then {
because there is no way I know of to get _button the way it suggests
and I only need to know what it's pressed anyway
Just use CBA Hotkeys. One line of script and everything just works
ugh. Okey then.
I got it working anyway
just one problem
it only draws icon 3d when in zeus camera
🤷
How are you drawing it? Using a Draw3D eventhandler?
hastebin?
Not necessarly.
Okey. Then hastebin. 😄
Also keep this in Mind https://feedback.bistudio.com/T123355 if you care about performance
And for the record it always displayed only in zeus, it just wasn't a problem until someone asked for a non-zeus verison
curatorCamera distance _x
You should hint or systemChat that to make sure it produces valid outputs
wait.
Solved it already ^^
non-zeus obviously doesn't have a curatorCamera
you can use ATLToASL (positionCameraToWorld [0,0,0]) to always get the current position of the Camera.
This pos is ASL. But you can change that to whatever you need
Works the same in zeus/first/third-person or spectator
even splendid cam?
yep
how dandy
Only bad thing is it only works for the local player and not for remote players. But as you only want Camera position you don't care about that
ya I only need local
Guys, im trying to hide a house in malden but the radius ive set for the script only works if it's at 10 which also deletes objects in the building which i dont want it to do, so could i please have some insight onto how to apply the init of the logic to only hide the house and not other objects:
Here is what i'm trying to do that wont work:
0 = this spawn {
sleep 5;
{
_x hideObject true;
} foreach (nearestTerrainObjects [_this,[],10] && == TypeOf in ["Land_i_House_Big_01_V3_F"]);
};
Everything after and including the && is what im trying 😛
Awsome atleast i tried tho right? lol
lol
What kind of abomination is that code above?
0 = this spawn {
sleep 5;
{
_x hideObject true;
} foreach (nearestTerrainObjects [_this,[],10] select {(typeOf _x) in ["Land_i_House_Big_01_V3_F"]});
};
Try that
_markername="MARKER_NAME"; _terrainobjects=nearestTerrainObjects [(getMarkerPos _markername), [], (getmarkersize _markername)select 0]; {hideObjectGlobal _x} foreach _terrainobjects;
```sqf
CODE
```
Your code is logically correct but not syntactically (Weird word. Syntax is completly wrong is what I meant)
Thank you @still forum it was @chrome mason that suggested i try this -.-
Bad Monkey! 😄
Hey @still forum , can i reverse this effect to watch/edit the radius
1sec
_location=[[LOCATION]];
_radius=25;
_terrainobjects = nearestTerrainObjects [_location, [], _radius];
{hideObjectGlobal _x} foreach _terrainobjects;
what "effect" is there to "reverse"?
you mean unhide the object?
Scripting? Uhm.. About a year before Arma 3 alpha was released.
Don't know how long that has been now
Any major tips you wanna tell me before i build my entire map
And have to restart it becasue something
i jacked in the start
Learn how to use Google and the search feature on the BI wiki
Yea, i've been there a lot. I've been building my map for about a week
and im worried about # obejcts and shit lol
i'll find out the hard way i guess
Oh boy what am i being dragged into
meh i've never dealt with world logic before so 😛
😄 No worries. It's already over ^^
wut? I didn do nutting
#dontMentionUnecessarily
Can someone help me? I'd like to spawn lightning on a position, and I know of the function, but the page this biki entry points me to for parameters isn't really helping me. https://community.bistudio.com/wiki/BIS_fnc_moduleLightning
Or maybe I'm missing what they're telling me.
I also can't find it in function viewer?
Ah. There it is. Function viewer gives me the same information.
Is there a way to retexture the look of the Arma 3 inventory? I want to make a mod that retextures it to match aspects in my mission.
Not sure because I'm pretty sure that's all stuff with diolagues
Also, has anyone else experienced issues where if your mod breaks you need to restart your computer because the mod it launched with is in your memory even after it crashes for some reason
All I do is restart Arma and that's fixed. I don't think it requires pc restart
I needed to rename the mod folder for it to work
Also, anyone know how I can have a script run everytime I open the zeus interface, I know CBA has stuff but I need something with no dependencies
@willow rover breaking point does it
@plucky beacon maybe displayAddEventHandler, but idk tho (findDisplay 46) displayAddEventHandler ["keyDown", "_this call functionName_keyDown"];
you can change the 46 display to the zeus one
but i have no idea if this is right ;p
local
@tough abyss you can always try to get sure with the wiki:
https://community.bistudio.com/wiki/playMusic
In the upper left corner u ll find a symbol for its locality.
private _vehicle = cursorObject;
private _pos = ASLToATL (getPosASL _vehicle);
_vehicle allowDamage false;
_vehicle setPosATL [_pos select 0, _pos select 1, (_pos select 2) + 0.5];
_vehicle setVectorUp [0, 0, 1];
_vehicle allowDamage true;
Am I doing something wrong here? For some reason this unflip vehicle script isn't working properly all the time.
Nah its definitely not that, like it moves slightly but if the vehicle is at a certain angle it like doesnt unflip it properly, for some odd reason
I might try "_vehicle setVectorUp surfaceNormal (getPos _vehicle);" to see if it makes any difference
well i didn't knew what the issue was, so it is rotating but in a bad way
Its hard to tell, but I think so
hmm
how about this
private _vehicle = cursorObject;
_vehicle setPos (getPosATL _vehicle);
Yeah I tried that I think, lifted it up quite a bit in the air
Yeah I might just do it like that
HI there! Is it possible to have two cutrsc without removing the previous image? THank you! 😃
i think as along as the layer is different it should work
It is a diifferent layer, i want to add a cold breathe effect, but it always remove the other one...
(It is supposed to be a smooth transition)
Oh, found a solution, i had to call bis cutrsc layer function 😃
can cba initPost be used as a class eventhandeler ?
["CAManBase", "initPost", {systemChat str _this + " has just been created"}] call CBA_fnc_addClassEventHandler;```
hey can anyone see any problem with this? ```sqf
["B",bFlagCapped] remoteExec ["mld_fnc_scoreHudPointsUpdate",-2];
the function works when called on the client, but it isn't when spawned using the above line of code
You can try 0 instead of -2. Are you running this in editor?
yes, i am using the same command format as above in another server function, and it works fine. Only difference being that i am using the client ID instead of -2
so do you think that runnning it in editor could be the issue?
if you run it with 0 and it works then yeah..
What does the function look like when normally used?
ahh awsome, the 0 thing is working
it looks like this normally, when run on the client (by looks like i assume you mean, how it looks like when called). ```sqf
["A",2] spawn mld_fnc_scoreHudPointsUpdate;
or something similar
either way, it all works fine now with the 0 thing, i will just have to use -2 when i run it on the actually dedi
Sweet potatoes!
ctrlSetEventHandler ["ButtonClick", "call fnc"]; is there a function for opening something like a hyperlink, redirecting to browser, when buttonclick? or any ideas how i can do it?
thanks
callExtension could do anything you want
If you could add extensions to missions (which arma would load), it would be dangerous to join a server
Ouh yeah. I always forget that there are non-dependency thingies 😄
Yeah, I forget there are people who play vanilla as well. Dis gust thing
Anway, could there be like a extension that would allow pretty much anything mission side?
One extension to do anything?
Like extended eventhandelers
Intercept ^^
If you use workshop Mods you could just add a dependency to that extension Mod.
I don't know why people always want dependency-less Missions.
I understand that for several Gigabyte big Mods. But not for the couple KB for CBA or a small extension
Yeah, now with arma 3 launcher and workshop it's a little like in gmod, you choose a server and it downloads the mods needed.
Im dissallowing the mod Gcam except for one specific admin/picturetaker in my missions. Would this work?
if(isClass(configFile>>"CfgPatches">>"gcam") && (_uid == 76561198068167250)) then {} else {endMission "END2";};```
Trial and error 😄
anyone got a good idea how to know if a certain weapon slot is selected? just wondering if there is a event based way i am missing before i do it the frequent check way
currentWeapon
(currentWeapon player) isEqualTo (primaryWeapon player) //primary slot selected
uid is string @torn jungle
@still forum Because it's harder to start or grow a community on servers that requires mods, even if they're tiny mods.
hey, anyone know how to get entries from a description or config from the server before preInit?
@peak plover thx but i knwo the condition. i was wondering if there are some known hacks to do it event based
@sage belfry Why before preInit? They can't change
@polar folio CBA has a Player eventhandler
I think it's CBA_events_weaponEvent get's triggered everytime the current weapon changes
@still forum I need the server ip and an chosen port, you know for what
you won't find that in config or description
parse startParameters using GetCommandLineA on Windows. (Serverside)
Ohh.. you want it clientside you mean?
yes, clientsided
one sec
yea i'm looking to do it myself without CBA though. any ideas how it is done in CBA? i might just go with anim EHs and read some properties from the config classes of the anim
I'd say detect it serverside at preInit. And then remoteExec a script with JIP enabled and pass ip/port along
oh so it's just a condition check on each frame?
Yes
hm. that is what i wanted to avoid if possible. but it's no big deal. thx for the info guys
That statement is wrong 😄 sooo.. wrong.
oh yea. not saying it's bad. i jsut have my own system for that kind of stuff in place. was looking for some more engine based thing. more curiosity than necessity
I tried a while ago with basically empty loops, but this was in VR and perfect conditions. In real gamepaly when more is going on it's probobly smaller
AnimDone
afterwards just do the checks
might can cause trouble with switchMove commands
yer i figured that's the best way. or atleast easiest. better than crazy ideas like adding EHs to the ammo/weapon HUD 😄
indeed
at least you try to avoid CBA
no one will admit but it takes a few FPS due to some dump ways they do stuff
#Intercept CBA Plugin :3
i wish there were EHs for all of these https://community.bistudio.com/wiki/Arma_3_Actions
or a way to properly hide scroll actions while keepign them active to use that shortcut hack
would indeed be better @still forum
Everything takes a few FPS. Many people don't know that even adding attachments will decrease fps. That's why AI should not have any
Yeah, wish we could just toggle action menu actions in controls if we assing keys to them
Is there a way to remove them? I don't need to scroll down and have gear up/down there if I bind it on G
wasn't there some action menu streamlining stuff done that allows that? not sure if the gear function was included in that though. also can't remember how it worked exactly. probably some toggle option somewhere, if an action is bound to a key
Oh shit, that's really cool. Thanks @tough abyss, I never noticed that.
Is it possible to have custom text on signs without adding pictures to your mission?
Anyone here know how to make it possibole to drop random supply drops on random locations (Dedicated Server)
well, you are basicly asking if someone would write a script for you
Well I am asking if anyone have some tips or know a command that I can use
there is no "command" for that. tips i can give you: look at some missions that have random loot drops, and see how they are done
try writing a script that would spawn a crate infront of you with random loot you want
Ok, will do
Question:
I know that TFR will sometimes not give compatible radios to all players in a server (especially if they JIP). The lazy way to fix this is to just place an Ammo box full of TFR radios... but there must clearly be a more convenient way, scripting-wise at least, to sort that stuff out ahead of time so that you don't have to fuck around with the radios for a while at the start of a mission. What way is that?
I've tried reviewing the TFR scripting functions on the Github's wiki page but I feel like I've had inconsistent results by testing them out on my own in the editor. Testing on a dedicated server has a lot of overhead time in between iterations, so I figure it'd save time to just ask here and see if there's maybe a tutorial or something out there that I'm just not seeing.
Is there a BIS_fnc anywhere that will iterate through all contents of a container (and any containers in it), etc, into a string?
and back again?
I'm coming up on having to write one, but this sounds like a problem someone else would have tackled before
Saw that, but is weapon specific, can't find the inverse, also in test doesn't pull down if it has anything loaded, the ammunition, or the attachments
@lean tiger specific type of weapon?
{if(_x isKindOf['Rifle',configFile >> "CfgWeapons"];} forEach _myLaserGunArray;
sorry, I mean, that only gets weapons in the vehicle
it's specific to weapons*
wouldn't get ammunition, uniforms, etc
yes getWeaponCargo is specific to weapons
It's just itching me there has to be a "storage dump to string // array" function
and inverse
load from string, etc
Nata, why need a function when you have getWeaponCargo
@modern sigil Try TFAR 1.0 😉
I believe I am 😦
getWeaponCargo getItemCargo getMagazineCargo @lean tiger
Afaik there is no already done script that combines all these into one script
I haven't tried itemCargo yet
but it's coming across to me it wouldn't recursively search container (uniform/backpack) contents either
😦
maybe I'll be the first
greater context:
wrote a SQL Server database connector last year, now that I'm getting some time back, working on a persistent / MSO-esque scenario
would love to just dump container contents to DB on the reg
and reload it on init
So let me ask this, what is the getter cargo commandsd not doing for you?
when I was testing it last year (which I concede, has been some time) it didn't pull down weapon attachments or loaded magazine type, or remaining magazine count
also I used weaponCargo, not getWeaponCargo
get- is ARMA2 and appends a count to the end instead of each instance getting its own index
Yeah. There is definetly no script ready for that. That's quite complicated territory.
so i'm a beginner with sqf
I've tried this out:
player addEventHandler ["onPlayerKilled", "systemChat Player Dead;"];
But it doesn't output anything 🤔
When I kill myself
you're running as MP? That the scenario isn't ending when you die, right?
player addEventHandler ["onPlayerKilled", "systemChat 'Player Dead';"];
everything is correct.
You just need to pass a string to systemChat
also you can
player addEventHandler ["onPlayerKilled", {systemChat "Player Dead";}];
yeah, ignore me, been out of the saddle for too long
I also think you need to remove the on from onPlayerKilled
https://community.bistudio.com/wiki/addEventHandler
there literally is an example there for killed
player addEventHandler ["killed", {systemChat "Player Dead";}];
Also: @still forum -- I think this might actually have been totally done before, the Survive-Adapt-Win campaign would rip the storage out of whatever vehicle you were driving and save it into the campaign storage
just recalled that 😃
Okay it works with killed
Thanks!
player addEventHandler ["killed", {systemChat format ["Player Dead: Killed by %1", _this select 1];}];
Campaign saves is something different though. The engine save-game system ofcause can save that
I mean it's added to the weapon pool
@iron stream Be aware that doing it that way will only display the chat entry for yourself.
Yeah
Maybe thats what you want 😉
I'm only testing ^^
It's quite easy to understand it
player addAction ["System Chat Pos", {systemChat format ["%1, %2, %3", player getPos select 0, player getPos select 1, player getPos select 2]}, nil, 6];
Now I'm getting missing ] somewhere here
also, for readability you can also do sqf (getPos player) params ["_posX", "_poxY", "_posZ"];
THen those variables will be defined and privatized for you
That is before the addaction, and then u would use those variables instead.
(variable to get stuff from) params [array of returns]; ?
Well, you sort an array
Wouldn't that save the player's position only once and not every time I use the action?
You can do it inside the addAction
And it's not the array of returns, it's each element at the index order
Or create a function
That would probably be cleaner
Are those even called functions in SQF?
Well, kinda
You would just call code
But the code would be defined in the file
I see no need for it here though
But if you want to do that you would do _myFnc = {code...};
call _myFnc;
in your case I guess it would be [getPos player] call _myFnc;
how do I return values with a function?
Just leave it at the end of execution
For example _string = "";
_string
but there is really no need for a function here, you would have to sort out multiple times then, sort out the returns etc
ok
This is how I would do it personally ```sqf
player addAction ["System Chat Pos", {
(getPos player) params [
["_posX", 0, [0]],
["_posY", 0, [0]],
["_posZ", 0, [0]]
];
systemChat format ["%1, %2, %3", _posX, _posY, _posZ]
}, nil, 6];```
why not just format ["%1", _pos] ?
Ye that as well ^^
that works?
I believe str is faster though
not much but yeah.
ok gtg eat thanks for the help lads!
So who wants to help give me a rundown on userconfig files for addons
:D
https://community.bistudio.com/wiki/userconfig it's just a bunch of static variables right? But do addons have description.ext?
Addons to have description.ext. But #include works everywhere.
for userconfig files you need to enable -filePatching. And be careful not to #include a userconfig inside a script file because that would allow anyone to execute any script inside your Addon
Hmmm
#include'ing userconfigs is generally discouraged. Because if that file is missing your game will crash
I want to make my mod configurable though 🤷
CBA settings
No dependencies for a Mod?
Yes
Alright that's my answer
It's only a client side mod
Does workshop support userconfig files?
My phone can barely load google homepage from here atm
And as userconfig requires you to enable filePatching anyway. You also need to allow filePatching serverside.
And at that point you could also just use CBA client and serverside.
@hasty violet Not an option. It's clientside only.
It doesn't have to be mid game it probably can't be honestly, everything initalizes post init
I'll probably just try what enhanced movement did
Does anybody have the complete list of events in SQF?
Bookmark the first Link.
Done
So I'm just testing out stuff, but how do I remove the Deployed state of a weapon (aka bipod activated)?
I know I have to add an event handler on the player for WeaponDeployed first
action, probably
@Erlite#2215 Made my gut wrench a little, but sure I guess.
Give it some time... 🤣
So i have this in my initPlayerLocal.sqf sqf ctrlTitle = controlNull; ctrlCapPoint = controlNull; ctrlBar = controlNull; to initialise the controls. Then in a function used to update some of the controls, i have this ```sqf
if ((isNull ctrlTitle) or (isNull ctrlCapPoint) or (isNull ctrlBar)) then {
ctrlTitle = (uiNamespace getVariable "captureProgress") displayCtrl 1100;
ctrlCapPoint = (uiNamespace getVariable "captureProgress") displayCtrl 1101;
ctrlBar = (uiNamespace getVariable "captureProgress") displayCtrl 4020;
};
can anyone see a reason as to why this might be the case?
ok so it is updated in the function that is called every 0.5 seconds
sorry spawned
basically it is spawned once for each player in a triggger, it then starts a while do loop while that player is in the area of that trigger (locally). That loop then updates the controls,
the controls are a progress bar (to display the capture progression) and the title and capPoint are both structured texts, taht are only update once the capture point is captured.
nevermind, i am just going to use a if (isNil ) as well as a if (isNull) that way it will work in any condition.
If they're undefined means uiNamespace getVariable "captureProgress" is undefined
And you run your code before you start your display or assign it to uiNamespace's "captureProgress"
You can either fix that or change to uiNamespace getVariable ["captureProgress", displayNull]
The _pos array returned by onMapSingleClick is [X,Y,Z], right?
How do you make so that when an player is near an object the player gets money? (Multiplayer)
@meager granite So i should just defined the controls at in initPlayerLocal.sqf? Will that fix it?
only asking, because you were saying, run your code at start, why not just run it in the initPlayerLocal script?
if i define them in there, and give them the control ID, then they should stay defined for the whole mission, is that right?
@remote flame Use the nearestObjects (https://community.bistudio.com/wiki/nearestObjects) command, it will return an array of all objects in specified radius. Then use the foreach command and check if the objects are player. Then for the objects that are players run a script that will give them "money"(money isn't a system inplace in arma already, so i assume you already have made a money system). Hope this helps
It helps alot, Yes I have a money system. thank you I will try this 😃 @limpid pewter
cool, i helped someone for oncce 😃
Is there a way to use onMapSingleClick for multiple clicks?
make a simple counter, so if they click, wait for a second click, and then only if both are clicked, then do soemthing
Hello, anyone knows why it would return 0 after I kill a unit?
_pe_pl_kills = score PE_PL;
hint format["%1",_pe_pl_kills];
what you have put there looks fine
I don't get it ><
what the heck
I killed 2 units inside a vehicle and it counted them
so it works then?
No lol
It counted only the vehicle kill
apperantly when you kill a vehicle it gives you 2 points
make sure pe_pl is the var name of the unit also, that;s the only reason i can see that it wouldn't work is if the unit isn't defined correctly
It is
no annoying little spaces after the var name? triple check
nono
It adds the points
but only if I kill vehicles
I killed 3 vehicles and now the hint says "6"
yeah idk, man i probably shouldn't have responded to start with, see if someone else can help you
Anyone please?
@limpid pewter can you elaborate further?
Like this? ```SQF
["pointsEH", "onMapSingleClick", {
private _i = 0;
if (_i == 0) then {
_point1 = _pos;
else {
_point2 = _pos;
};
}] call BIS_fnc_addStackedEventHandler;
oh lol, i thought you were talking about my issue haaha, i spent like 4 mins writing an explaination of my issues haha XD
No, sorry 😕
nah so i was saying (not sure if exactly what you wanted) to run a script in the EH that would baisically wait for the script to be run a second time (to create a double click effect) and once the script had been run twice in quick succesion then run what ever code you wanted the EH to run
I don't need a double click effect. I need to click on two points on the map, than I do some stuff with them.
oh ok
so you want to essentially click on one point on the map, log that position, then click on another?
is that correct or am i way off?
Yes, click on two sperate positions and log both.
well then in kinda the same way, you should run code that will check if the code had been run once before. If not, then log that pos as number 1, if it has run before, then log that pos as number 2
that sorta thing
gimme like 3 mins and i will show example
Ok, I'll wait.
simple, but it shows the concept im explaining i guess 😃
in that case ```sqf
check = 0;
mapPosArray = []; // mapPosArray [pos1,pos2]
NEV_fnc_logTwoMapPos {
if (check == 0) then {
mapPosArray set [0,_pos];
};
if (check == 1) then {
mapPosArray set [1,_pos];
};
If (check > 1) then {
check = 0;
};
check = check +1;
};
["pointsEH", "onMapSingleClick", {
call NEV_fnc_logTwoMapPos;
}] call BIS_fnc_addStackedEventHandler;```
👍
There you go, streamlined hehe ```sqf
mapPosArray = []; // mapPosArray [pos1,pos2]
["pointsEH", "onMapSingleClick", {
if ((count mapPosArray) == 0) then {
mapPosArray set [0,_pos];
};
if ((count mapPosArray) == 1) then {
mapPosArray set [1,_pos];
};
If ((count mapPosArray) > 1) then {
mapPosArray = [];
};
}] call BIS_fnc_addStackedEventHandler;```
@tough abyss
instead of having an extra check variable, you can simply count the size of mapPosArray
Hi all, any ideas why attachTo with a static object not work.
I am trying to attach the static model of the Pillar of Dawn from Operation Trebuchet to a jet so I can see it move in the sky.
However it just remains static and the jet flys away
this attachTo [star1];
star1 being the jet
haha that would be awesome 😄
^ if you still can't figure out how to attach it to the jet, just run a loop that will act on the jet and the static object. The loop will constantly check the possistion of the jet (btw i would recommend a xian instead) and setPos the postion of the Pillar of daw
As usually, very clunky around about way of doing it, but it would work ( will be quite laggy tho)
in the description "Just a test to see how the object move script would work", so i assume yes they're using something similar to what i suggested (since he said object move script).
maybe ask them on their TS "Join us on Teamspeak for questions or if you are interested in joining:
185.62.205.33:10013"
also have you looked at the BIS forum link that was in the description
But that script will only work from marker to marker, if you wanted to be able to control the ship then what i suggested would be best
Yea trying that script out, need to adjust the altitude though as its flying across the ground a Z=0
haha yeah, that wouldn't be so great 😃
hmmm seems there is no Z index for markers 😦
At least in the editor when I try to change it
correct, so you would have to do```sqf
_markerPos pushBack Zvar;
that would add the height
I am thinking I might modify the script to ignore z index of marker and just use the objects Z index at mission start?
that would work, except for when there are mountains XD
you would need to pick a high enough altitude to avoid all obsticles
It will be high enough opefully 400 metres
yeah should be
Hmmm complaining that I am using an array instead of string but the docs for setMarkerPos say array is a valid parameter
_atl = (getPosASL _obj) select 2;
_markerPos1 = getMarkerPos _mkr1;
_markerPos1 setMarkerPos [_markerPos1 select 0, _markerPos1 select 1, _atl];
_markerPos1 setMarkerPos [_markerPos1 select 0, _markerPos1 select 1 ?
what is _markerPos1
_markerPos1 needs to be string name of the marker
Completely refactored the script haha, seems stupid to use markers, getting it to accept generic objects now
Almost working it just seems to be jerking a bit, I think its something to do with the terrain
Think I might need to use setPosAGL?
Woohoo
seems to be jerking a bit yeah thats gonna happen with static objects
asl fixes that
Sorry ging to pastebin it , didnt want to spam the channel
yeah thats a good thing
Thanks all for the help
all g
How does one add an event handler to a player when they connect to the server?
@iron stream initPlayerLocal
Hello there, I'm looking to detect if some units are dead ```_endGameThread = [] spawn {
waituntil {
if {(!alive arty_1) and (!alive arty_2) and (!alive arty_3)} exitWith { CODE };
sleep 3;
false
};
};```
Doesn't work, I've got a "expected BOOL" error. Any ideas ?
@iron stream it's an event script. make it in the root of your mission folder initPlayerLocal.sqf
oh ok
@solemn steppe your waitUntil needs to return a boolean not a piece of code.
Does anyone know if you have an "undefined variable in expression" what to do? have tried everything but it dosent work
share some context?
A lot of stuff leads to that 😮
commonly typo's or locality issues
@remote flame means the variable you are trying to use doesn't have a value. Doesn't always mean you are using a variable either
@lean tiger locality issues would be seen ingame and would break the script without error usually.
Ok, I am trying to call SHK_pos but it only gives me "undefined variable in expression shk_pos"
Since you just schooled me, would you know any command to get the type of a variable? Looking to recursively pull all distinct values out of a mixed tree in an array
@remote flame the function needs to exist somewhere. if you are calling it like this: call shk_pos check your description.ext for a CfgFunctions entry. If it doesn't exist call it from the directory like so: call compile preProcessFile "scripts\shk_pos" with SHK_pos it returns a value, it doesn't generate markers or anything of that sort.
@lean tiger typeName I believe.
fuck me, thanks Midnight
@remote flame yep sure thing
@lean tiger yeah the wiki is hard to find things in sometime, glad you found a solution
were you who I was speaking with yesterday about the full inventory dump?
I'm on an interesting path to that
@lean tiger Yep I was, what's the progress look like?
Tried calling it from init but still same error.
private ["_mapCenter"];
_mapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
[_mapCenter, random 4000, random 360, false] call shk_pos;
That is the code trying to call it
@remote flame which variable is coming up undefined?
shk_pos
Okay, let me point you back where we started. Does your description.ext have a CfgFunctions entry for shk pos? If not, you will need to execute it from the directory
ex: [_mapCenter,random 4000,random 360,false] call compile preProcessFile "scripts\shk_pos.sqf";
I will try thx
Midnight -- mix of everyContainer and weaponsItemsCargo
everyContainer replies with the class name then the instance id of every uniform/vest/etc in a container
so if you just make a generic function, you can recursively get through the whole tree
problem is weaponsItemsCargo passes the magazine and its ammo count as well as an array
@lean tiger Cool, so a very interesting way of keeping track of everything. Is it executed specificially or does it account for all vehicles?
I haven't implemented it yet
Fixing my DB connector 😦
then I'll just have the server dump it to DB every 60 seconds or so
then listen to all players in an area, mine through their stuff as well
Every 60 seconds? What if there aren't any players on the server? Isn't that a waste of DB entries?
@subtle ore I am doing exactly as it tells me in the shk_pos_init.sqf:
Usage:
Preprocess the file in init.sqf:
call compile preprocessfile "SHK_pos\shk_pos_init.sqf";
Actually getting the position:
pos = [parameters] call SHK_pos;
But still undefiend variable
@remote flame Because it has no idea what shk_pos is until you preProcess it
of course it is, but you're talking to a database goon who loves stats 😃
if there aren't any players in the area, then it doesn't fire
not foolproof, other scripts could inject/take items and it wouldn't catch that
but yeah
could probably also route it through a stored procedure to diff it, then not insert on no change
go on
So my script for my stores is making it not work took away call compile preprocessfile "scripts\shop\storehandler.sqf"; and it worked with shk_pos
dont know how to have them both if they are not working well together
How can you fix such thing?
ok I will do that thx
It works now... @lean tiger @subtle ore
I just deleted the preprocess in init and replaced it with a copy and it worked
But now when I got you pros here can you find something wrong with this code?
cash=10000;
level=1;
addmissioneventhandler [
"entitykilled",
{
params ["_killed","_killer","_instigator"];
if (player isEqualTo _instigator) then {
if (((side _killed) getFriend playerSide) < 0.6) then {
cash=cash+100;
cutText ["Kill +100$","PLAIN DOWN",2];
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
};
};
}];
It is supposed to add money for kills of AI or Players
not familiar with getFriend, thought that was all basically a bit
not a sliding scale
looks good from here
Because it dosent give any money
nope
Do you know a fix?
truly, its been a year since I did this actively, and I work with a fuckton of other stuff
but I'm pretty sure cash = cash + 100 is local to the function
throw a hintSilent cash; after that line
see if it returns 100 or the new sum
if it doesn't fire, period, your IFs need tweaking
heck if I know, I don't know your scenario file structure 😉
init.sqf is all that matters, then its locality splits
_pe_pl_kills = score PE_PL;
hint format["%1",_pe_pl_kills];
_pe_pl_kills = getPlayerScore PE_PL;
hint format["%1",_pe_pl_kills];
Both return 0 when I kill a player but gives me points when I kill vehicles
Anyone knows why?
@tough abyss Because it's an array of return values not just one return for getPlayerScores
Yes of course
what I'm saying is that you should try and select the first, and see where it fails at retrieving the scores
Because it you had said it retrieves the vehicle scores
yep
_pe_pl_kills = getPlayerScores PE_PL select 0;
hint format["%1",_pe_pl_kills];
gives 0 when I kill 1 infantry
_pe_pl_kills = getPlayerScores PE_PL select 1;
hint format["%1",_pe_pl_kills];
gives 1 when I kill 1 vehicle
do you use ACE?
I do
try without and check if there's a difference
yeah when using ACE medical kills don't get registered properly
at least that's what we saw in ALiVE
that's the/our "fix"
and you probably have to set the score manually
o/.. just a small question.. i triy to create a eventhandler with CuratorObjectPlaced... how can i get the placed object?
i tried already
_x addEventHandler ["CuratorObjectPlaced", {[_this] call fn_update_civ_zeus;}
@scarlet temple _this is an array, not the object placed.
selection 1 of that array _this select 1 is the object
anyone know why switch weapon isnt working in cam ?
player switchMove "FXStandDip";
player action ["SwitchWeapon", player, player, 100];
waitUntil {currentWeapon player == ""};
player playMove "Stand";
0 cutFadeOut 5;
//Open the Menu if its not already open Kapp
if(isNull (findDisplay 95446))then{
createDialog "LoginMenu";
};
life_shop_cam = "CAMERA" camCreate getPos player;
_pos = [[-744.98,14992.2,0.00177002], 10, 50, 3, 0, 20, 0] call BIS_fnc_findSafePos;
player setPos _pos;
player setDir 226.173;
showCinemaBorder false;
life_shop_cam cameraEffect ["Internal", "Back"];
life_shop_cam camSetTarget (player modelToWorld [0.65, 0.5, 1]);
life_shop_cam camSetPos (player modelToWorld [1, 4, 2]);
life_shop_cam camSetFOV .50;
life_shop_cam camSetFocus [50, 0];
life_shop_cam camCommit 0;
life_cMenu_lock = false;
player still has weapon out and
if I manually use ```
player action ["SwitchWeapon", player, player, 100];
I think i got it just had to put a small sleep in
Anyone know how to give money to the player that reach an objective first?
_missionDone = false;
while {!(_missionDone)} do {
{
if ((_x distance art) < 10) then {
cash=cash+2500;
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
hint "Award for your efforts 2500$";
};
_missionDone = true;
};
}foreach playableUnits;
sleep 0.5;
@ivory vector player action ["SwitchWeapon", player, player, 100];
Why 100?
Isn't that the weaponindex?
If you use an out of bounds index, you put your weapon on the back.
Maybe some weapon reaches 100 here though. ~250 would be safer.
I don't think that would not explain why it works manually
@remote flame why is _missionDone = true; outside the if scope?
private _missionDone = false;