#arma3_scripting
1 messages ยท Page 356 of 1
no no, not for that script. just meant the only place i do anything is in that. never do scripts myself.
pretty sure you can do it with some help. all you need is the will. i'm going by what you tryin to achieve not saying you can script anything right away
what im hoping to do is have a team hold an embassy, have riot/uprising outside, and then later on when things heat up, a car bomb and it goes from there. just so u know what im trying to do
Yeah that's totally possible.
What are you using to create the civilians?
Are you using cup mods?
rhs and project opfor
Okay. "playMove" and "switchMove" will play rtm animations on a unit from the animation viewer
doMove will have a unit move to a position
And createVehicle can be used for explosions
yeah have been looking into the animations. but havent seen any rock throwing.
the explosion will be easy just using zeus, its just the rock throw part
no, havent placed them down yet, just messing around in a template until i get anything working
You should script this, zeus isn't going to replicate your concept very well
you should start with some editor tests. AI can be unexpected
Hmmm, tricky bastard ๐ค
place a player as blufor
and place a civ and give him the stone grenades. then place an opfor guy and group the civ to him. now set "probability of presence" to 0% inside the attributes window of the opfor dude
if you are lucky you will get a hostile civ that will throw stones at you
havent tried that yet! will do right away!
might need to make him feel like a bad ass with some AI commands. like allowfleeing and stuff
Have to have the unit throw the roc
what's the class name of the stone grenade magazine? di you look it up already?
"HandGrenade_Stone" iirc
๐
Can't stop the dos
one day im gonna break this keyboard
should break your fingers instead
car1 dosStop car2 will stop both cars obviously
๐
i knwo the feeling though. i'm the sloppiest of slops in terms of typing
@subtle ore yeah the HandGrenade_Stone
^see?
Brutal
im right to assume i cant get the stones not to make the blow up sound right?
Those aren't really stones. They are grenades without the splash damage.
yeah but needed a stone. thanks for the help guys!
Ahh, he already posted.
@little eagle imaginary stones
Those aren't really stones. They are grenades without the splash damage.
Yes, they just named them stones. I think I made it clear already that I don't believe in names.
Jokes ensue commy
Hey now Commy. You're jokes are cruel.
๐ ๐ ๐ ๐ ๐
Two right hands
They don't have left hand icons unfortunately
๐๐ฟ ๐คฆ๐ฟ๐๐ฟ
๐ค :๐ < :+1:
๐๐ฟ ๐
What does the aubergine mean? People keep posting it.
Australian natives?
Aubergine is eggplant
Yes.
aboriginal is australian native
I see
As much as I've researched, my studies have showed that the aubergine usually represents a solid shaft
So it's a dick.
I think
Stop sending me dicks, thanks.
*๐ฌ *
๐
๐ ๐ ๐
๐ ๐ฝ ๐
๐
๐ฌ โ โค
hello, i am trying to create a dialog via script with the following code: ```// Create dialog
_display = findDisplay 46;
// Create controls
_ctrlResources = _display ctrlCreate ["RscText", 645];
_ctrlResources ctrlSetPosition [0.644375 * safezoneW + safezoneX,0.027 * safezoneH + safezoneY,0.0464063 * safezoneW,0.022 * safezoneH];
_ctrlResources ctrlSetBackgroundColor [-1,-1,-1,-1];
ctrlSetText [_ctrlResources, "Resources"];
_ctrlResources ctrlSetTextColor [1,1,1,1];
_ctrlResources ctrlSetFontHeight -1;
_ctrlResources ctrlCommit 0;```
but for some reason it doesn't do anything or does not show up..
i know i set the position correctly, because when i add the control with only a background set to [1,1,1,1] i see a white block in my screen...
can somebody please take a look at my code and tell me what i am doing wrong?
so you are saying the ctrlSetText is failing? or what?
slightly confusing because you are implying it is creating and palcing the control proven by setting its background color. so doesn
't sound like "it doesn't do anything"
Yeah i think it is not showing the text
did you try the other syntax?
_ctrl ctrlSetText _txt
i also think you are using the syntax wrong. afaik it requires the idc as input and not the control itself
so you mixed both syntax into a crippled hybrid that painfully whispers "kill me!"
i think...could be wrong. i never use these types of syntax
what does the "weapow aim" at AI features do?
so what it do?
what is this error?
youre missing a required mod
but ares is activated
@sleek nova Do yourself a favor and do it with the description.ext
That has nothing to do with config vs sqf.
i just want a little icon in the top right corner of my screen that shows the amount of resources available
i tried it this morning but then as it says on the wiki: Displays created with both createDisplay and createDialog will take control of the mouse pointer and will close when user presses Esc. that is exactly my problem
Make the control a base class in the description.ext (== mission config) and then use ctrlCreate with your classname.
okay thank you i will try that
Also, without mods this is really annoying to make, because this game is weird with the mission display #46
Vanilla?
Is this supposed to work in a savegame too?
no
// description.ext
class Extended_DisplayLoad_EventHandlers {
class RscDisplayMission {
MyMission_initCounter = "call compile preprocessFileLineNumbers 'initCounter.sqf'"
};
};
// initCounter.sqf
params ["_display"];
private _control = _display ctrlCreate ["RscText", -1];
_control ctrlSetText "splendid";
_control ctrlSetTextColor [0.1,1.0,0.1,1.0];
_control ctrlSetPosition [
safezoneX + safezoneW - 0.2,
safezoneY + 0.0 * safezoneH,
safezoneW * 0.1,
safezoneH * 0.3
];
_control ctrlCommit 0;
MyMission_Counter = [_control];
To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";
If you care about the savegame, then you have to reapply the text with a MissionLoad eventhandler.
i want to set text with a pubvareventhandler everytime the resources change
Sure, why not.
okay thanks i'll give that a go ๐
lol that works ๐
i was just about to cry in my sleep...
lol
Written in 5 minutes, mate. Step up your game.
Is there a way to find a number from another array in the same position as a string in another using forEach?
_forEachIndex
find select example???
Array1 = ["Thing1", "Thing2"];
Array2 = [50, 75];
Thing1 should have 50 and Thing2 should have 75
_str = Array1 select _forEachIndex;
format ["%1 %2", _str, _x];
} forEach Array2;```
Array2 select (Array1 find "Thing2") // 50
Or just use a namespace instead of an array with setVariable, getVariable.
Oh, 75, not 50
I need to have an array of class names as a list and I was going to use the second array for the resource cost of those classes
Mods, vanilla?
It needs to be sort of dynamic with no set number of classnames. Vanilla
So I suppose I could create the variables with a forEach statement
// init
MyMission_Costs = createLocation ["Name", [0,0,0], 0, 0];
MyMission_Costs setVariable ["Thing1", 50];
MyMission_Costs setVariable ["Thing2", 75];
// mid mission
MyMission_Costs getVariable "Thing2" // 75
what is the location for?
It's the container for the costs. Just like an array, but you can access the contents with a hash / string and not just a index/number.
And I could create dynamic setVariables for each thing in an array using forEach
LOCATION type is just the cheapest one, because it has no simulation and you can have millions before the map fps start to drop.
Ah
Sure.
How long have you been doing this? I literally wouldn't have even though to do it that way
Instead of set, you use setvariable, insetad of select, you use getVariable.
How long have you been doing this?
I bought A2 26 december 2011 and mod A3 since Alpha.
I assume you also have past programming experience as well?
I am of the opinion that the best possible solutions for most things don't get used enough, so I post the weird stuff here. : P
No, I hate these hackers.
well my experience in any type of programming begins and ends with A3 missions and modding lol
My grandparents bought me a game boy in the 90s and because I'm a dirty cheater, I used these adapter thingies to change the memory addresses of my games when I was like 10. So I am predisposed(?) to this shit.
WEST_Inf_List = [
"B_Soldier_lite_F",
"B_Soldier_F"
];
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];
{
WEST_Inf_Cost setVariable [_x, 50];
} forEach WEST_Inf_List;
So this would set each unit to have a cost of 50.
Would using two arrays (one for classnames, one for cost) still be inefficient? The goal is to have it be dynamic so anyone can just change or add new classnames and set their costs
// edit these
WEST_Inf_List = [
"B_Soldier_lite_F",
"B_Soldier_F"
];
WEST_Cost_List = [
50,
75
];
// don't you dare touch these
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];
{
WEST_Inf_Cost setVariable [_x, WEST_Cost_List select _forEachIndex];
} forEach WEST_Inf_List;
like this?
It looks like that would work, if the _forEachIndex commands works like that. Still don't quite understand but I will test it
I would personally make a pairs array for easier editing. [ [name,value], [name,value] ... [name,value] ]
I suppose that would work as well
If you start putting in more than say 5 things
again, didn't even occur to me
I can agree with this.
that makes it so much more organized
You don't even need the sub arrays tbqh.
instead of losing count trying to line up the classname with the correct index
{
LOCATION setvariable_x;
} foreach pairsArray;```
// edit these
WEST_Inf_List = [
"B_Soldier_lite_F", 50,
"B_Soldier_F", 75
];
// don't you dare touch these
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];
for "_a" from 0 to (count WEST_Inf_List - 1) step 2 do {
WEST_Inf_Cost setVariable [_a, _a + 1];
};
Why is step highlighted red -__-'
Already a syntax error, tsk
// Recruitable units available to team BLUFOR - Classname, Cost
WEST_Inf_List = [
["B_Soldier_lite_F",50],
["B_Soldier_F",75]
];
// Don't edit below this comment
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];
{
WEST_Inf_Cost setVariable [(_x select 0), (_x select 1)];
} forEach WEST_Inf_List;
Like this?
Fixed the comma.
Lots of people make mistakes adjusting the commas with arrays, idk which version would be more "idiot proof"
Whatever works for you
Then do that and also change
WEST_Inf_Cost setVariable [(_x select 0), (_x select 1)];
to
WEST_Inf_Cost setVariable _x;
Yup. cptnnick suggested that.
I couldn't figure out what he meant to be honest
You might also wanna think about adding the third boolean flag for sending accross network
And yea my bad i hate typing select syntax on phone
Well, you can't do it with a LOCATION.
Ah really?
No, LOCATION only accepts the 2 element version.
Syntax:
varspace setVariable [name, value]
Parameters:
varspace: Namespace, Object, Group, Team_Member, Task, Location, Control, Display - variable space in which variable can be set
Syntax:
varspace setVariable [name, value, public]
Parameters:
varspace: missionNamespace, Object or Group - variable space in which variable can be set
[name, value, public]: Array
LOCATION are strictly local, which is part of what makes them so nice for this.
If you need a global one, createSimpleObject with "Building" as class is the best you can do.
Can i subscribe to the commy hacks wiki, i forget these specifics from time to time.
This but with vanilla you have to use Name / Building
Oh, @runic surge , change
createLocation ["WEST_Inf_Cost"
to
createLocation ["Name"
To avoid an RPT entry complaining about using an invalid location class name
is name the name of the location or type of location
Type / classname.
Like B_Soldier_F
It's one without text and image for maximum fps on the map.
Because some people want 10000 of them, looking at you ACRE
^^
{
private _unitList = WEST_Inf_Cost getVariable _x;
private _unitType = _unitList select 0;
private _unitCost = _unitList select 1;
private _unitDisp = getText (configFile >> "CfgVehicles" >> _unitType >> "displayName");
private _UnitPict = getText (configFile >> "CfgVehicles" >> _unitType >> "portrait");
private _unitStr = format ["Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2", _unitType,_unitCost];
private _unitAdd = _pLocal createDiaryRecord ["Procure Assets", [_unitStr]];
} forEach _sInfList;
I have this in the local player initialization function. _sInfList is just SIDE_Inf_List so if player is blufor it becomes WEST_Inf_List
I don't see any issues here, but I usually don't so that doesn't mean much
What was the fix for call compiling resistance
I'm getting GUER instead of resistance
That is how the side is displayed though.
for condition it only works with resistance
if I do
(WEST_Inf_Cost getVariable _x) params ["_unitType", "_unitCost"];
shouldn't _unitType return a string of the unit's classname? I get an error that says it got a number
Oh, wait.
{
private _unitType = _x;
private _unitCost = WEST_Inf_Cost getVariable _x;
...
} forEach _sInfList;
_sInfList is a bunch of classnames, right?
it is WEST_Inf_Cost but for the player it is run for's side
which reminds me, I need to change that in the forEach expression as well
so if a player is opfor, it would be EAST_Inf_Cost
Can't you use one namespace for all costs?
Doubt they share classes between sides.
And even then, it'd be fair if they cost the same.
I just want to keep it separate for organizational purposes
also the sides might be asymmetrical
True, but don't all sides have their own ammo boxes, static weapons etc. even if they are just retextures?
yeah
I just prefer it this way honestly
also I still get an error, this time it says type array
You could make it like this:
WEST_Inf_Cost = bla bla bla
EAST_Inf_Cost = bla bla bla
INDEP_Inf_Cost = bla bla bla
MYSIDE_Inf_Cost = [WEST_Inf_Cost , EAST_Inf_Cost, INDEP_Inf_Cost] select ([west, east, resistance] find playerSide);
dumb brackets
private _pSide = format ["%1_balance", side _pLocal];
private _pFlag = format ["%1_flag", side _pLocal];
private _pInfList = format ["%1_Inf_List", side _pLocal];
private _total = missionNameSpace getVariable [_pSide,0];
private _sFlag = missionNameSpace getVariable [_pFlag,0];
private _sInfList = missionNameSpace getVariable [_pInfList,0];
so this is unnecessary
Yeah. You'd also run into the GUER problem with independent/resistance.
oh, lol OK
CIV has 3
well CIV isn't a military force so they don't need 4 letters
_unitCost returns as an array
not sure why that is happening everything looks right
for some reason
west,east work, resistance does not
1:44:30 """east"""
1:44:30 "true"
1:44:38 """resistance"""
1:44:38 "true"
isEqualType sideEmpty
Current issue: it can save west/east to an array, but not resistance
post code
Goes across 2 scripts
why didn't BI just stick with GUER for independents
Also contains ugly code, you'd regret looking
would have saved a lot of trouble
yesh
Can't be worse than XEH before I rewrote it.
HAHA
is there a way to get all entries or at least the number of entries a listbox has?
lbSize
I would _listBox setVariable when creating the entries
yea jsut found it. thx though
it's not a listbox i'm creating myself. but good idea generally
Ayy literally had to compile it in the same file it's used in because apparently #noserilization is cool
_task params ["_target","_group","_description",["_destination",[]],["_type","default"],["_state","CREATED"]];
_conditions params [["_condAdd",{true}],["_condWin",{false}],["_condLose",{false}]];
_code params [["_codeAdd",{}],["_codeWin",{}],["_codeLose",{}]];
if (_destination isEqualType objNull && {isNull _destination}) then {_destination = []};
if (_destination isEqualType [] && {(_destination param [0]) isEqualType objNull}) then {
_destination = [];
};
// Search current vars for this taskVar
private _searchResult = _mission_tasks_currentVars select {(_x param [0]) isEqualTo _taskVar};
// Task main handler
call {
// If task state is none or it was not in search results
if (_currentState isEqualTo 'none' || {(_searchResult isEqualTo [])}) exitWith {
if (call _condAdd) then {
if !(_description isEqualType []) then {
_description = [_description];
};
private _taskTarget = _target;
str _taskTarget call debug_fnc_log;
if (_taskTarget isEqualType "") then {
_taskTarget = call compile _taskTarget;
};
str (_taskTarget isEqualType sideEmpty) call debug_fnc_log;
private _taskID = [
_taskTarget, //target
_group, //name
_description, //description
_destination, //destination
_state, //state
0, //priority
true, //show notification
_type, //image type
true //share
] call BIS_fnc_taskCreate;
Just use my gist to serialize it.
It must be good code when the lines begin with 28 spaces.
those r not spaces ๐
It's in a count
That's the part that was erroring
and exploding
line?
_target was told "Undefined variable"
I added the stuff between debug_fnc_log; to fix
That was in the file previous to this
moved it here so it works now
Because the target comes from a textbox it's a string
west, east, player etc. worked. But group player, resistance, civilian would error
Now they all are gucci
Do it like this: https://gist.github.com/commy2/eb5f344f1845e047ae4d6c748d221250
I don't understand
y?
It would work with resistance. And no, not with groups.
independent and resistance are aliases. The game can't tell the difference.
yeah, but what if I type in resistance, find is going to return -1
[independent] find resistance // 0
I told you five times now that they are aliases^^
Damn I need more โ
It's like:
1/2
and
2/4
anyone used say3D and had it play sounds twice?
Same thing
@ionic orchid yeah. Ran script globally when 1 player on server
if you are using the mp variant
1/โ2
vs.
โ2/2
That's too much
I'm just running it locally via 3den
sin x
vs
cos (ฯ/2 - x)
[player, "an_m_e_1"] spawn {
params ["_sourceObj", "_soundName"];
_spawnPosition = getPosASL _sourceObj;
_obj= "Land_HelipadEmpty_F" createVehicleLocal _spawnPosition;
playSound _soundName;
sleep 5;
deleteVehicle _obj;
};
being the script I'm running
private _unitStr = format ["Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2 <br /><img image=""%3""/>", _unitDisp,_unitCost,_unitPict];
private _unitAdd = _pLocal createDiaryRecord ["Procure Assets", [missionNameSpace getVariable [_unitStr,0]]];
I can see the "Procure Assets" subject in the map, but when I click it it just shows a blank diary record with no text in it. The expression part works fine, I tested it earlier and it displays fine and executes the hint command normally. It says 1 element provided, 2 expected. I tried just putting the _unitStr variable in the array after "Procure Assets" but that didn't work either. I also tried with just _unitStr and having the format in an array
ugh...
umm
nerd!
I don't see why that would play the sound twice
Unless it's running twice
it might be something to do with the bitrate conversion I've done to the files...
@runic surge missionNameSpace getVariable what?
44k stereo -> 22k mono = plays twice
44k stereo = plays once
wth... :/
@peak plover it didn't work with just _unitStr so I just pasted that in to see what would happen
dat's wrong
even though it is supposed to be a string
It's looking for a variable that's called Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2 <br /><img image=""%3""/>
Yeah I realized that shortly after I ran the code
not sure what I was trying to accomplish there
private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", _UnitStr];
private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", [_UnitStr]];
neither of these work either
haha yeah, if I use "Stereo Track to Mono" in Audacity, the audio will play twice in Arma
both when saving directly to .ogg and when .wav->.wss with the tool
that's nuts
do "test" hintC [_unitStr];
where?
after you make the string
have the expression blank?
see if string works
oh I got it
@peak plover https://i.imgur.com/oSS1ZXq.png
seems to work
maybe the image is messing it up
or it needs single quotes
img does not close
player createDiarySubject ["roster","Team Roster"];
player createDiaryRecord ["roster", ["Team Roster","<execute expression='[] spawn briefing_fnc_roster'>Click here or press J to open roster</execute><br/>"]];
this one works on my machine
Looks like your image was not closing?
something is wrong with the way I am getting the image path I think
private _UnitPict = getText (configFile >> "CfgVehicles" >> _unitType >> "portrait");
private _UnitStr = format ["Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2", _UnitDisp,_UnitCost];
private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", _UnitStr];
This works, aside from the title text of the diary record being blank
I will figure out the image part later
_unitStr has to be an array
Unlikely.
That warlords gamemode the BI emploey made had something similar
Check it out for inspiration
I did
I don't even know what to look at
that is kind of the idea I am going for here though
the warlords function uses the same format method
I will see if I can't replicate that part
Got it
private _UnitStr = format ["Recruit " + "<execute expression=""hint 'test'"">%1</execute>, " + "Cost: %2", _UnitDisp,_UnitCost];
private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", ["Infantry", _UnitStr]];
not unless you write a custom framework for it
comparing the mouse position with an array of created icons
Just curious did you benchmark
if ( toUpper(_substring) isEqualTo toUpper(_stringToCheck) )
is faster than
If (_substring == _stringToCheck)
more double-audio weirdness
maybe it's just an audio length problem - I added some silence to the end of a short clip that repeats and the problem stopped
how do i remove the magazine loaded in a weapon? simply doing removeMagazine isnt working/
private _items = primaryWeaponItems _unit;
_unit addWeapon primaryWeapon _unit;
removeAllPrimaryWeaponItems _unit;
{
_unit addPrimaryWeaponItem _x;
} forEach _items;
https://i.imgur.com/rgZLTJ6.png
Is this what my command should look like? The third variable is supposed to the the player
is says generic error in expression sometimes and missing a closing bracket other times
nul = [type,cost,caller] call BTH_fnc_RecruitUnit
that is the syntax for my function
it seems that for some reason the player doesn't work
private _unitCode = format ['nul = [%1,%2,%3] call BTH_fnc_RecruitUnit',_unitType,_unitCost,_pLocal];
"Debug" hintC [_unitCode];
private _unitDisp = getText (configFile >> "CfgVehicles" >> _unitType >> "displayName");
private _unitStr = format ["Recruit " + "<execute expression='%3'>%1</execute>, " + "Cost: %2", _unitDisp,_unitCost,_unitCode];
private _unitAdd = _pLocal createDiaryRecord ["Procure Assets", ["Infantry", _unitStr]];
BTH_fnc_RecruitUnit:
// Script run to purchase units from the map menu
// nul = [type,cost,caller] call BTH_fnc_RecruitUnit
// type: Classname - Type of unit to create
// cost:--- Number - Resource cost of unit
// caller:- Object - Player that recruited the unit
// Example: nul = ["B_Soldier_F",50] call BTH_fnc_RecruitUnit;
params [
['_unitType',"",[""]],
['_unitCost',[0]],
['_pLocal',objNull,[objNull]]
];
private _p_balance = [WEST_balance , EAST_balance, GUER_balance] select ([west, east, resistance] find side _pLocal);
private _u_spawn = [BLU_FLAG , RED_FLAG, GRN_FLAG] select ([west, east, resistance] find side _pLocal);
if (_p_balance < _unitCost) exitWith {hint "You cannot afford that unit!"};
private _soldier = _unitType createVehicle (getMarkerPos _u_spawn);
nul = [_soldier] call BTH_fnc_UnitSetup;
sleep 0.1;
nul = [_unitCost,_soldier,false] call BTH_fnc_HandleBalance;
why do you donul = every time you call something? also by putting _pLocal in the params by formatting it the param itself isnt an object.
thanks commy, thought there may have been a command for it but that will have to do ๐
@robust hollow so is there a way to pass it as an object?
use the netid instead
private _unitCode = format ['nul = [%1,%2,%3] call BTH_fnc_RecruitUnit',_unitType,_unitCost,str netid _pLocal];```
```sqf
['_pLocal','',['']]
];
_pLocal = objectfromnetid _plocal;
what? netID is made for MP...
its the network ID, netID itself isnt made for SP but there is a function varient that makes it work for sp apparently
private _unitCode = format ['nul = [%1,%2,%3] call BTH_fnc_RecruitUnit', _unitType, _unitCost, str (_pLocal call BIS_fnc_netId)];
['_pLocal',"",[""]]
];
_pLocal = _pLocal call BIS_fnc_objectFromNetId;
@robust hollow this works (as far as I can tell so far, the actual function loads properly and I get no errors)
in case you were curious about the SP compatibility
๐
show the error
Does calling the advanced hint function display to all players in MP, or just the person who activated it?
I have them called via an addaction that runs a tiny sqf that just calls the hint in question.
always check out the wiki and look out for small eL pictures
they say if the effect is local or global
hints have an local effect
so you would have to remoteexec it so other players see them
Locality is my kryptonite :/ So that is true even for addAction events?
addAction is also local but can take global attributes
these are your friends or enemies
Yeah. The script works, so far as I know, for loading people up.
The script adds a weapon, then has the weapon's advhint pop up.
the pictures are next to the version it was implemented
if you want the hint to show up to everyone, remote exec it
Actually, I want it to show up only to the person who uses the action.
So if someone returns to a stockpile, it doesn't spam everyone.
oh, so you just want to addAction to every player?
which is attached to an object?
guess you made the mission on the editor, so give the boxes some variables eg. box1 = this
and then in the init file or initplayerlocal or whatever script fires on the players
add addAction with the box1 as an object
Not entirely sure I followed, to be honest :/ Would that change the function from just having the addAction in the boxe's init field?
Ah :p
so much easier, sorry it's the morning :D
but if it's present on the editor init field
it should show up for every player
if it doesn't, then either the SQF code failed, or you wrote arguments for the action that dont return true
S'alright, I shouldn't be coding this late anyways ๐ Got a friend to pop in and test my script, so I'll be able to objectively understand how badly I screwed up.
Tested online, functioned as hoped - Player joined, loaded the kit from the box, got the popup, all without me (hosting) seeing anything.
Well, besides teleporting gear, but that was expected.
Whether it is possible to write down in wiki, that b = array a, link to array a. If you change the array b, then the array a changes. I think this will be useful information. To copy an array b = + array a.
a = [0,1,2];
b = a;
c = +a;
c set [1, -2];
b set [0, -1];
a pushBack 3;
hint str a; //[-1, 1, 2, 3]
hint str b; //[-1, 1, 2, 3]
hint str c; //[0,-2,2]
hey, i try to get pitch/bank angles of an object in world space but i can't figure out how to correctly rotate my vector, can anyone help me
Welcome to euler angles, i gotnsome stuff laying around but as always you might end up upside down
Y = vectorDir vv;
Z = vectorUp vv;
X = vectorNormalized(Y vectorCrossProduct Z);
N = Z vectorCrossProduct [0,0,1];
_xrot = atan((Z select 1)/(Z select 2));
_yrot = atan(-(Z select 0)/sqrt(1-((Z select 0)^2)));
_zrot = atan((Y select 0)/(X select 0));
_yrot = atan(-(Z select 0)/sqrt(1-((Z select 0)^2));
_zrot = atan((Y select 0)/(X select 7
0));
Where vv is an object.
Meh. From quaternion to euler angles is trivial, the inverse not
thanks guy, it gives me a better start point
i still get confused when it comes to vectors
sinยฒx+cosยฒx=1
This was pulled straight from a paper on how to derive the angles
Im only now taking the uni course explaining it all :P
The paper should apply the Pythaogrean identities to make it look prettier.
Its NASA
There is this function I've used in the past.
https://pastebin.com/B5NGV3Dd
To rotate a vector:
- convert to polar
- add rotation
- convert polar to cartesian
> add rotation is exactly the non trivial part or you run the chance of ending upside down
Sure and to covert back you take sine/cosine
And suddenly quadrants interect
cos(0) = cos(pi)
Confused with sin
^^
In lecture :P
(About this subject)
I promise you its non trivial if you don't already "know" the solution
Trigonometry is the best invention since sliced bread.
No vector math is since now you dont have to care about angles or anything anymore but eh
Trigonometry is one of the more interesting math subjects.
Need to convince BI to add a matrix type
Trigonometry is something you can reinvent within an afternoon.
If you know angles, transforming is semi trivial. If you know the transformation, figuring out the angles is not, to conclude.
This channel continues to amaze me
so, i wanna to use a DoStop to a AI unit that step on the trigger area, how i set it up?
So whats making it hard for you is that triggers arent meant to target incoming / outgoing units. You could simply do a continous loop that keeps setting doStop on thisList, but then theyd never move again
Do they have a waypoint in the trigger area? It might be better to use waypoint completion code
cant just be that?
i dont wanna the vehicle to move once it hit it anymore
i need this because enemy vehicles once finish move they start to go around and get on the road blocking it
and the stupid AI in convoy cant figure it out how to get out of the way
The vehicles never ever need to move anymore?
yes
Then just and always true, that does dostop on everything in thisList
he is just supouse to pop up and shoot the convoy
He might need to move into a better shootinf position, for example.
But yea, always true trigger that does dostop on each element of thislist
so how do i set it up?
Condition: true, on act: {doStop _x} forEach thisList and set it to "anything present"
for some reason the trigger is activating when there is nothing in it
cant i just make it soo the unit that hit it frist stop there?
nice, this is what i want
is there a way to remove the vehicle inventory option?
Not that i know
Is there any obvious reason as to why this wouldn't work? If I add the player initialization script to the switch unit function, I see the hints, but the player doesn't change. If I aim at no friendly units, I get an error since nobody is found, so the code is running properly as far as I can tell
_pLocal addAction [
"<t color='#53BE5F'>Control Unit</t>",
{
private _viewPos = screenToWorld [0.5,0.5];
private _list = nearestObjects [_viewPos, ["Man"], 20];
private _soldier = _list select 0;
[(_this select 3),_soldier] call BTH_fnc_SwitchToUnit;
},
_pLocal, -1, false, true, "", "true", 1.5
];
params [
['_caller',objNull,[objNull]],
['_soldier',objNull,[objNull]]
];
if (side _caller != side _soldier) exitWith {hint "You cannot control a unit that isn't on your side or dead!";};
removeAllActions _caller;
removeAllActions _soldier;
addSwitchableUnit _soldier;
sleep 0.1;
selectPlayer _soldier;
I tried using nearestObject and nearEntities as well
@astral tendon
clearWeaponCargoGlobal _vehicle;
clearMagazineCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
_soldier has to be local to the client.
is there a way to work around that?
I thought you could control any unit that was playable
Is the soldier editor placed?
no it is spawned in
Spawn it in by the client that wants to switch to it.
addSwitchableUnit does nothing (in MP)
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd is there any way that I could have this script take the selection param?
and also to make the UI not dissappear if the action is longer than 10 seconds
someone can add a note not to use the time higher than 10 because the action will vanish from the screen (its still executed tho)
my guess to the selection issue is to copy the function over and add it, but no idea what to do with the UI disappearing
How can I return an array of all configs of headgear. It seems headgear and weaopns are all together in CfgWeapons, and I cant figure out a way to return only headgear.
type or simulation entry inside the config class
@warm gorge configclasses (configFile >> "CfgWeapons") select {getText (_x >> "type") == "typename"}
Something along those lines
That probably wont work but something similar
At phone atm so a bit hard
"getNumber (_x >> 'scope') >= 1" configClasses (configFile >> "CfgWeapons") apply {configName _x} select {_x call BIS_fnc_itemType select 1 == "Headgear"}
Awesome got it working thanks guys
@simple solstice This will remove the inventory option when near a vehicle?
can i get some help with that pls:
//Unit init:
null = [this, HC1] execVM "AIOwner.sqf"
//AIOwner.sqf:
waitUntil { !isNil "HC1" };
if (!isServer) exitWith {};
_unit = _this select 0;
_hc= _this select 1;
_grp = group _unit;
_hdIc = owner _hc;
_grp setGroupOwner _hdIc;
//error:
20:47:37 Error in expression <ct 1;
_grp = group _unit;
_hdIc = owner _hc;
_grp setGroupOwner _hdIc;
>
20:47:37 Error position: <_hc;
_grp setGroupOwner _hdIc;
>
20:47:37 Error Undefined variable in expression: _hc
or can anyone share a better/updated script to load AI to HC pls
that init script might run before HC1 is initialized since it runs in the init box
so you waitUntil { !isNil "HC1" }; but you already passed a nil in the passed array
_hc is undefined ...
ok so, i can just send unit and after waitUntil { !isNil "HC1" }; assign _hc = "HC1" ?
Or just replace _hc with HC1 ?
i know is undefined, but not the reason untill @indigo snow answer :p
It is undefined, because it is never defined, not because of the waitUnti loop ...
see the second line, commy
so i can just use HC1, will try
ok, thanks, seems like working now like this:
waitUntil { !isNil "HC1" };
if (!isServer) exitWith {};
_unit = _this select 0;
_grp = group _unit;
_hdIc = owner HC1;
_grp setGroupOwner _hdIc;
Or not, so there is my next question, how i can know if is really working?
i saw a thing like that -> https://forums.bistudio.com/forums/topic/184485-werthles-headless-module/
but i wont use it, i'm trying to understand how HC works and i prefer do it by myself
HC is just any old client, just without a player and a screen
units / groups / objects are local to a client which will do calculations for them
moving AI from server to HC gives server moer time for calculations by having the HC do those calculations
yes thanks, i do understand that, but how i know if the unit is owned by HC? i'm doing test with this in game console server exec:
_unit = cursorTarget;
_group = group _unit;
_owner = groupOwner _group;
diag_log format["Owner: %1", _owner];
but the id is always 0, and btw, what means this number? the info about HC is too poor and old
When called from client, it always returns 0
ohh, dont mind if use server exec? :S
server doesnt have a cursortarget...
xD great
well my fast solution is giving to the unit some var name, show the owner before change and show after, this will give me a clue if works or not
make sure to pubvar the variable
ehm...
waitUntil { !isNil "HC1" };
if (!isServer) exitWith {};
_unit = _this select 0;
_unitOwner = owner _unit;
diag_log format["Unit Owner BEFORE: %1", _unitOwner];
_grp = group _unit;
_hdIc = owner HC1;
_grp setGroupOwner _hdIc;
_unitOwner = owner _unit;
diag_log format["Unit Owner AFTER: %1", _unitOwner];
"Unit Owner BEFORE: 2" "Unit Owner AFTER: 2"
๐ข ๐ซ
the command also returns a bool iirc
you might wanna check if it actually failed or not
youre aware owner is also a server only command btw?
_hdIc = owner HC1; is gonna return 0 on clients
you saw the "!isServer" right?
i'm getting confusse, even more xD
Figured out my looping audio problem from last night
class CfgSounds
{
sounds[] = {
test_0132a, test_0132b, test_0132c
};
class test_0132a
{
name = "test_0132a";
sound[] = {"test\0132.ogg", 1, 1};
titles[] = {}; //Plays once
};
class test_0132b
{
name = "test_0132b";
sound[] = {"test\0132.ogg", 1, 1};
titles[] = {1, ""}; //Loops for 1 second
};
class test_0132c
{
name = "test_0132c";
sound[] = {"test\0132.ogg", 1, 1};
titles[] = {5, ""}; //Loops for 5 seconds
};
};
what does unladen weight do? make vehicle lighter if i lower it?
that mean i can fly a choper better?
it is weight of the unladen variety
I have also been wondering that
never tried messing with it, because I have no idea what it does or how it works
if i give a doMove command to a helicopter how he will behave? like what altitude he will fly or he will try to land or hold and still?
is there a way to make a locally spawned unit global? Or vice versa?
I have a script that lets a player recruit units locally but the units that spawn don't work with some features
namely a version of the remote control function
well, i test it, and he does go for the marker but he does not hover OVER the map marker just near it
well, there is also a way to give a doMove like command that also set the helicopter direction?
@tough abyss that doesn't help me
Aside from the part where you used createUnit
i dont tink its gonna do what i want
I'm stupid enough to not realize I have used createVehicle this entire time
created creepy statue people
that would probably be why the returned string for them is a model name
haha
yeah that was totally the problem this entire time
I suppose going out of my way to completely rewrite a bunch of functions to try and fix this issue wasn't entirely a waste of time though
thanks for the help anyway, though
Well on the bright side my mission currently allows the player to walk up to a box, gather any desired amount of money, buy a unit, take control of that unit, shoot their original body in the head, and fail the mission while still being able to walk around
๐
is there a way to make AI not react when see a enemy and keep following the freaking doMove i give?
none of that works
its change how they move but they still feaking out when they see a enemy and go everywere
Don't think you can change that then.
well, i "fixed" that by puting a AI Civilian to drive the helicopter
and now the enemy ignores him and the bluefor gunner
you can use disableAI to prevent NPCs targeting things (which will make them ignore them)
i.e. this disableAI "AUTOTARGET"
this disableAI "AUTOCOMBAT"
autocombat controls if the unit will automatically switch to combat mode when attacked or alerted to an enemy presence
Do you mean you set it to "Careless" in the attributes? Because that's a Behaviour, not outright disabling a section of its AI, and there is a difference.
put this in the AI unit's init: this disableAI "TARGET"; this disableAI "AUTOTARGET"; this disableAI "AUTOCOMBAT"
(I forget if you can disable multiple AI sections in one command)
yeah, he still wants the AI to be able to move
I'm just not sure if you can do this disableAI "MOVE","TARGET" or something like that, it'd be easier
you could also try setting the pilot of the heli to captive
{this disableAI _x} forEach ["MOVE","TARGET","AUTOTARGET"];
that might work
interesting, I'll try that next time I'm disabling bits
do i need to put those in commands? mark on "disable AI sethings" wont work?
Put exactly that code - the first bit I gave you, not the stuff I was discussing with Rylan - into the unit's init field. I don't know what else you're doing (it sounds like you're using an editor mod I don't know) - this is a safe, vanilla, way of doing it.
I work without mods to avoid dependencies. I've never seen that set of checkboxes before in my life.
so it is possible that this thing is broken all along
It looks like that's just a GUI for calling disableAI, but I don't really trust it. Just put the code in the init and see what it does.
the thing is, i created 100 AI units using those checkbox
That probably isn't going to cause any problems
@astral tendon create a gamelogic and put {{this disableAI _x} forEach ["Thing","Otherthing"];} forEach synchronisedUnits this and you can sync any units you want to have those features disabled to that logic
that syntax might not actually work
one sec, let me fix
actually idk maybe it will
^replace Thing and Otherthing with the AI features you'd like to disable, such as AUTOCOMBAT
using the synchronisedUnits command with gamelogics makes things much easier for adding code to many units in the editor
actually it is synchronizedObjects
I'm trying to wrap my head around locality, I'm working on a basic bootcamp map for my friends (full of memes and action, of course). While I've got the function to use advanced hints for loading up weapons, and the occasional signpost, I'm trying to get it to function for an area trigger.
The problem I'm having is who to execute it on - I want it to only operate on the player passing through the trigger area:
0 = [] spawn {
[["infantryMovement", "Basicspeed"]] remoteexeccall ["BIS_fnc_advHint", THISTHINGHERE];
};
I've tried the obvious (Player, object, player in thislist, etc), but it's throwing errors :/
Just running it by number (0, 2) works fine, as expected.
It helps if you read or post the error.
if (isPlayer player1) then {
player1 moveOut car3;
};
what is wrong with this?
[] spawn {sleep 5};
if (!isPlayer player1) then {
player1 moveInGunner car1;
};
this one works
nevermind, fixed it
if (isPlayer player1) then {
moveOut player1;
};
waitUntil {position(_ammoBox select 2) < 1};
shouldn't this work?
It tells me "Generic error in expression"
which is obviously very helpful information
I have tried with the parentheses in several configurations as well, same error
it also says generic error in expression on the sleep command
which should work fine
(position _ammoBox) select 2 < 1```
or:
```sqf
(getPosATL _ammoBox select 2) < 1```
First one should also work. In your Script, you selected (_ammoBox select 2), wich means: select 2 from _ammobox
Then the Prob is somewhere else
seems to be an issue with scheduled scripting or something
sleep command causes an error if that isn't commented
Of course
that comes after the waitUntil
check where the # is (-showScriptErrors msg), then check there
on the sleep command it is #sleep 0.4; and the waitUntil it is waitUntil {(getPosATL _ammoBox select 2) #< 1};
Then it's probably not spawned
I have never had this issue using call before though
unless I just haven't used sleep or wait commands in those functions
You do know, that there is difference between sheduled and unsheduled "scripts"?
Yep
It's always the simple shit that gets me
Yep
I guess I'm just a simple person
Yep
maybe I should just stick with terrain making
Yep
You seem very agreeable
Yep
I mean, if you say you are a "simple person", i tend to agree, since you know yourself better.
Simple people tend to lack self-awareness
the complete (for now) version of the supply drop function: https://pastebin.com/HdGK8Xjf
sides resistance, independent, and guer don't work for green team in my scripts
seems to return civilian for some reason
if I hint the player side in game it returns GUER
the fuck man
if the format strings would just return the same name as the actual side name this shit wouldn't be a problem
setting the default side makes it work, but I feel like this solution is less than ideal
the default side in param I mean
SomaliansGroup doMove (getMarkerPos "raidmk1");
SomaliansGroup is a group
doMove works for groups?
or there is a equivalent?
move also make they brake fromations?
thislist move (getMarkerPos "raidmk1");
this trigger is supouse to make evreyone from the trigger area to the marker possition "raidmk1"
what i did wrong?
Syntax:
group move position
Parameters:
group: Object or Group
position: Array - format Position (for Position3D --> PositionATL needs to be used.)
thislist is an array, not a group or object.
Hello, I'm having a massive problem with a module and a dedicated server -.-
I have a module that is synced to player units
On mission start it runs an event handler on each of the units
the problem is for some reason it isn't getting the synced units
The mod/module works fine in locally hosted multiplayer
I have abolsutely no idea what could be causing this
Are the players ingame when the mission starts?
no
so it's a jip issue then
So the way I have it setup is I have a module down in the editor yeah?
the module is set to globablly execute
it runs on clients as well
It doesn't detect the synced units on the clients either
for some reason
Is there a good way to put a configfile directory into an array? Or a string?
configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam"
Like this one, for example
it returns a CONFIG type value
you can handle it like any others
_myCfgs = [];
_someConfigYouFoundInAnAlley = configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam";
_myCfgs pushBack _someConfigYouFoundInAnAlley;
I am trying to do it without assigning them with variable names
its just any old value
push them in there directly
_myArray pushBack configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam";
the back of an array is the last value
WEST_Inf_List = [
["B_soldier_UAV_06_medical_F", 75],
["B_soldier_UAV_06_F", 75],
["B_soldier_UAV_F", 75],
["B_helicrew_F", 50],
["B_Helipilot_F", 50],
["B_Fighter_Pilot_F", 50],
["B_Pilot_F", 50],
["B_crew_F", 50],
["B_engineer_F", 100],
["B_Soldier_TL_F", 150],
...
];
I am trying to do something similar to this
but with groups
does pushBACK add it to the front or the back..
Dude?... What? ๐
yea i wasnt sure how to answer that one directly. anyway. Rylan where do you need the config value to be in your new array?
The way I see it it either pushes the other values back or adds it to the back
like a new pairs one? or something else
It needs to have the basic structure of group type, number
_array pushBack [configvalue, number]
So you have configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam" and only want "BUS_InfTeam" as a string?
I need the whole thing in order to use the function to spawn the group I think
If I could just put the group classname there that would be very easy, maybe that could work, but spawning it later on would become an issue
you mean you need
_cfg = configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam";
You need what's inside _cfg in an array?
yes
if you just need _cfg in an array. Just add _cfg to an array.
Like @indigo snow posted above
I am building a list of basic groups, but I want it in such a way that groups could be added or removed from the array
I will do t hat
Dynamically removed? Removing a group by name?
No, just an init script where someone could change the groups for their own variant of the mission, or for easier editing later on
WEST_Grp_List = [];
WEST_Grp_List pushBack [configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam", 600];
I have doubts that this would work
What I don't know about is just pasting the entire config file path into the array
pushBack is probably unnecessary
I don't know what type of value would be passed through params either
would it be param [0,configFile,[configFile]];
configNull would be a better choice for default var
And yea if youre typing by hand you dont need pushback at all
ok thanks
well, here's the function that uses the array: https://pastebin.com/7UKbtYCy
off to test
heh, yeah
forgot about that
forgot about this one too: https://pastebin.com/HdGK8Xjf
Should spawn the idap drone over your head, dropping a cooked grenade
Lol
๐
I will probably just have parameters for the faction name and have the actual group names be in the array
WEST_Faction = BLU_F;
only a missing ]. Just add it ?
What's the problem currently?
it isn't exactly clear on where it is missing
it says in the actual config.bin
so I don't know if that format would work
can you pastebin what you have right now?
Rylan that config.bin is just your config value represented as text
The error is in the array you made.
correct.
passing a config entry by string it will not work
It can work if you do some string operations on it
which is why having the faction name and group name passed as individual variables to be reinserted into the config path in the group spawning function seems like an easy solution
What is _p_Grp_List ?
the array for the players side
you could just put a WEST_Grp_List select %1 select 0 inside the format. where %1 is _forEachIndex.
blufor would be WEST_Grp_List
If you know which side was choosen. You can just put the global variable name into the format
_p_Grp_List is run in the player init to detect the player's side and add the right units and groups to that players menu
so it gets the correct global variable for his side
make a variable which contains the name of the global variable as a string
private _p_Grp_List = [WEST_Grp_List, EAST_Grp_List, GUER_Grp_List] select ([west, east, resistance] find _pSide);
Yeah
Do another
private _p_Grp_List_Name = ["WEST_Grp_List", "EAST_Grp_List", "GUER_Grp_List"] select ([west, east, resistance] find _pSide);
Then replace
private _grpCode = format ["[%1,%2,%3] call BTH_fnc_RecruitGroup", _grpType, _grpCost, str _pSide];
by
private _grpCode = format ["[%1 select %2 select 0,%3,%4] call BTH_fnc_RecruitGroup", _p_Grp_List_Name, _forEachIndex, _grpCost, str _pSide];
you can try to diag_log the string to check if it's correct
Diag_log the shit out of it xD
I would rather just do the thing with the faction names
maybe I will do that tomorrow
for now I will just get it working and go to sleep
that didn't do anything either
going to figure that shit out tomorrow
Good night @runic surge
good night gentlemen
It's midday here.
it's 3:33AM here
Lol. That's the problem with coding xD.
Does pushback add it to the back of the array?
The way I see it it either pushes the other values back or adds it to the back
That's genius. I like the way you think.
Does anyone know if initServer.sqf actually has any arguments? I see some people use if (!(_this select 0)) exitWith {}; but can't actually find any information that says this actually returns anything
Initserver doesnt, others do
diag_log [_this];
and test it yourself?
Good point
i'm trying to develop a start script that prevents player movement, shooting, etc. until the server stabilizes and admin unlocks. does anyone have a good way of doing this? i've looked at using ACE_captives_fnc_setSurrendered and disableUserInput but surrender prevents loadouts from loading and disabling the input has it's own issues if players are actively pusing buttons.
player enableSimulation false ?
ooOOoo, i'll give that a shot
Or have respect between players xD.
believe me, if i could i would, my other players are children (figuratively, not literally)
i think this will work @still forum . thank you!
and it allows me to zues still! game on!
well when i say game on that is...
Noob question: does the new Dynamic Simulation support offloading units to HC?
Those are 2 completely things
different* I only noticed that when I read that message for the third time ๐
I keep on getting this error message when trying to create a marker using BIS' createMarkerLocal function.
0:51:26 "::New Arma:: AI Spawn Point: [7285.12,8017.34]"
0:51:26 Bad conversion: array
0:51:26 Error in expression <awn Point: %1",_arrayValue];
_marker = createMarkerLocal["UberPickupLocation", >
0:51:26 Error position: <createMarkerLocal["UberPickupLocation", >
0:51:26 Error 0 elements provided, 3 expected
0:51:26 File core\custom\civ\fn_getTaxiMission.sqf [life_fnc_getTaxiMission], line 81
What is behind the 0 elements provided, 3 expected error, and does anyone have a solution to it?
Full Script:
private ["_array","_arrayValue","_ai","_nearestRoad","_masterArray", "_markerPos", "_target","_marker"];
_array = LIFE_SETTINGS(getArray,"taxiArray");
_arrayValue =_array call BIS_fnc_selectRandom; //fetches the array and selects random map location
diag_log format ["::New Arma:: AI Spawn Point: %1",_arrayValue];
_marker = createMarkerLocal["UberPickupLocation", _arrayValue];
"UberPickupLocation" setMarkerColorLocal "ColorBlack";
taxiArray:taxiArray[] = {"[7285.12,8017.34]","[7033.36,7121.48]","[8244.99,3141.4]","[9659.66,3341.04]","[5909.76,3603.36]","[5353.25,2734.99]","[3116.74,6286.78]","[5545.37,6998.3]","[8265.21,10043.7],[5557.69,11193.7]"};
is there a way to force AI to run to a map marker possition intead of doing shot stops?
i already turn of their stamina limit
@worldly urchin diag_log _arrayValue?
taxiArray[] is wrong.
Arrays use curly brackets in config, not [ ]
And the quote marks don't belong there either.
@worldly urchin Show us the code between the diag_log and createMarkerLocal
I'll rephrase my last question: does Dynamic Simulation work with remote units?
Or does the server need to control the units utilizing DS?
Last I heard it didn't work at all, so...
Any ideas why setWaves might not work? I've got Manual Override enabled in the mission, but the command just isn't working for me. All the other weather commands are though
What is behind the 0 elements provided, 3 expected error
The command expects an array, but you supplied something undefined, an empty array or not an array, like e.g. a string.
and does anyone have a solution to it?
Giving the command an array with 3 elements.
setWaves has local effects (doesn't synch) and forceWeatherChange and simulWeatherSync have no effect on it.
Ohh damnit really? So I need to execute it on all players then I assume
Yes, it's different from setRain.
Alright cheers
@JasperRab i suspect the array still has "" surrounding it, those wouldnt get logged that way
Interesting finds. Its a shame weather has been an issue in arma for so long but is still yet to be resolved
is there i way by scipt turn off ammo count?
kinda
this addEventHandler ["fired", {
params ["_vehicle"];
if (local _vehicle) then {
_vehicle setVehicleAmmo 1;
};
}];
Ammo count control is what i think they are talking about
showHud also can disable different individual elements
Not the ammo count ctrl
I can't remember the display but
(_display displayCtrl 52003) ctrlShow false;
It's a different controlsgroup for every weapon and vehicle potentially sadly.
actually thats wrong, sorry
private _ammoCount = (ctrlText (_display displayCtrl 184));
but yea it has a habit of changing
๐ค
Change weapon, or change vehicle -> new controls group is used.
So unless you know you can rely on the RscUnit info (which basically means no mods and manually checking the configs for each one of them) then no can do really
I was doing some stuff with it a while ago that worked quite well between weapons, vehicles and so on though. Haven't checked in the last year or so, but it was okay
Some of the RscUnit things don't put their display in ui namespace and you can't use findDisplay with displays (only dialogs).
I like it.
never ended up using it
nop, ammo counter still working
Still not working or dissapearing?
But yeah in general RscUnitInfo is a little bitch, because it has a habit of changing a lot with mods, so compatability can be annoying
Could just ignore RscUnitInfo and make this ui it's own thing.
STILL working, i want to remove it
You can't. Didn't you read what we wrote?
Doesn't ACE do it? Or is that broken for some things then?
Disables it completely with optional setting and all that stuff.
But idk if it breaks with some mods.
ACE does it yes, they have a ui module for all that stuff. Not sure where functionality lies though
What is the best practice for displays anyways? Manual config or gui editor export?
depends on how advanced you need
https://www.youtube.com/watch?v=3F4GUBvubHc working on this now, haven't touched GUI editor in years because you'd just have to replace everything anyway
@austere granite Base level information display
if you dont plan on resizing things, adding/removing controls, GUI editor works fine
There's also some non-arma tool to make them i believe, not sure about the name
I use paper personally.
I'd still recommend doing it yourself, just because it's cleaner
Yeah i will just do it myself. If i find that it doesn't work out so well initially i will go 3rd party
just start with something like ```cpp
#define pixelScale 0.5
#define GRID_W (pixelW * pixelGrid * pixelScale)
#define GRID_H (pixelH * pixelGrid * pixelScale)
#define CENTER_X ((getResolution select 2) * 0.5 * pixelW)
#define CENTER_Y ((getResolution select 3) * 0.5 * pixelH)
#define __GUI_GRIDX(var1) ((GRID_W * 4) * var1)
#define __GUI_GRIDY(var1) ((GRID_H * 4) * var1)
so you have a grid to work off
Yes, setting up and choosing a good grid is step 1.
Another good thing to keep in mind is using controlGroups
Gotcha. That makes sense, thank you both. This gives me some ideas on where to start
... i started liking UIs
because in arma it basically means trying to come up with ways to do something that should be completely normal
it's like swimming upstream
Hey, that's the fun part right?
A3 at least added a lot of very useful UI commands though
things like controlsGroupCtrl and the likes removed most of the need for crazy MACROs in configs and allow you doing things dynamically
For some reason I'm having an issue with CtrlDelete currently though, still gotta figure out waddap, but it crashes my game ๐
Does anyone see what is wrong with this. I can't think and for some reason rather than returning the function with that name.... is calls the code (Even though there is no call anywhere in here....)
params [["_code", {}, [{}, ""]]];
if (_code isEqualType {}) exitWith { _code };
if !(_code isEqualType "") exitWith { { false } };
if (_code isEqualType "") then {
diag_log str ["[#MB] Parsing: ", _code];
};
private _function = uiNamespace getVariable _code;
if (!(isNil _function) && { _function isEqualType {} }) exitWith {
_function
};
_code = compile _code;
_code;
mehhhhhhhhhhh nvm
see it
isNil "_function" ๐
yes ๐
I'd recommend giving getVariable a default value
some missing quotation
so, i put the vehicle to combat mode, why the hell he keeps going to the freakng road?
Is there any way to convert from string to group(eg from "B A4") or is it impossible without assigning said group to a global variable first and using that instead?
Thank you, i will still have to make a seperate function, but it will make it easier anyway
Hi there guys, so i have a small question, i want to know if my syntax is ok, what i want is a certain trigger to activate when 1 of 3 persons is in it so that it activates another task, this is the code i used for it to detect if they are inside the trigger:
narco1 in thisList || narco2 in thisList || narco3 in thisList;
looks okey
Hmm for some reason the trigger wont be called and the other task wont appear
@golden storm is your Activation (Trigger) setup?
I solved it, i had it syncd to the mission itself,
mission?
just pop a hint everytime when u use a trigger, then sync etc
But i do have another issue i want some markers to show up when said trigger activates, i used this:
Condition: triggerActivated trg_alfa;
On Act.: "marker_1a" setMarkerAlpha 1; "marker_1b" setMarkerAlpha 1;"marker_2a" setMarkerAlpha 1;"marker_2b" setMarkerAlpha 1;
or does it have to be on a scale of 0 - 100? as in percent?
Yeah i read it so supposedly it should be working but it is not :/
does the code in onAct ever execute?
your condition is another trigger being activated? Why don't you just put the code into that other trigger?
{isNull gunner _x}
how i can change it to pasanger seat?
i could not find it in wiki
emptyPositions "cargo" is what/
what does that command return
a number
so you can just "If <number>"
when does an object get "isNull"?
wondering right now if it is possible at all
For your interpreter thingie right?
never would ask such weird questions in any other case ๐
yea figured, just wondering
just remembered that i need to check for objNull
I don't think i've ever run into that sorta scenario
yea obviously objNull
if you do testvar = <someobject>
then deleteVehicle testvar
problem with that is: if it is possible that an object turns null, i need to know when and adjust for that case
testvar will be objNull
y
but then the object doesnt exist anymore
that would be one case ....
so 'an existing object?'
deleteVehicle would do objNull
now next step is to figure out how to map this in my tool ๐
and ... add the checks to all commands already handling objects
probably going to be a simple "isNull" variable
any other idea?
i just wanna a trigger to ativate when some one get into the passager seat
So what is the thing you're doing and why not intercept?
not in this channel @Adanteh#0761
#arma3_tools if you want to know more about the project
@austere granite gah ... discord broken again
so, for the trigger there is a way to ativate it if there is something in the passanger seat?