#arma3_scripting
1 messages Β· Page 353 of 1
goes fix stuff dedmen commented on
it just breaks
Is there // in your code?
nope I just checked that. Thats always broken it
Code that 100% was working prior to LoW update
That was fixed now btw. You can now use // in debug console.. Atleast you are supposed to
dedmen 7 days ago
what does the 1 : mean?
In 50 years it will support #include
i think mainly it means i can't count to 0
you can link the comment.
That number usually indicates which element the returned value is in if you return an array
You neither return array. Nor do you have more than 1 element
hmm it is working now. Musta buggered something
This would make them more dense in the center
_position = _position getPos [_radius * sqrt random 1, random 360];
Dedmen, i've just seen that people list their parameters with their position and copied it.
like:
Parameter(s):
0 : ARRAY - Position
1 : SCALAR - Spawnradius
2 : SCALAR - Count
i didn't necessarily think much about it.
yes. because i chained like 5? functions in a row to solve a problem and changed all 5 of them 9000 times.
b-but i'll fix it right away.
Counting is so easy, but informaticians fucked it up anyway.
well at one point there was an element 0
i just decided to not need it and deleted it
I would like to declare dedmen evil?
Ohmy god the watch boxes stop checking when you are editing now. That' awesome
I just looked at my scripts he commented on, and they shouldn't work. But they do.
That' awesome
I hope this is sarcasm.
What? I love this, it's a lot better, does not spam my log anymore when I'm writing a command in there
No.. Stop checking while editing is awesome... But that they don't start checking when you stop editing is bullshit
π€¦ Worst thing that happened to Arma 3.
write
cursorObject <hit tab >
No issues....
i kinda like it tbh
<shift + tab> to go back to editing
It even continues where the cursor was
I literallly can't think of any reason the old one was better
You didn't have to press tab and you'd see live update of your code
ohh ok gotcha, for ex
allUnits select 6
Might be slightly faster when old watch, but pressing tab / shift-tab is not too much for me
It'd be a bigger issue if cursor would reset... but it does not
KK also fucked up BIS_fnc_isDebugConsoleAllowed and my hack to enable the debug console in the VA in SP doesn't work anymore.
KK is working for BIS? or am I getting this wrong
don't know what he really does for BIS but he wrote/optimized a lot of functions
An offsite contractor ?
He was
/*
Author:
Killzone_Kid
Description:
Returns true if debug console is allowed in current context
Parameter(s):
NONE
Returns:
BOOLEAN
*/
// == SP MODE ==
if (!isMultiplayer) exitWith
{
allDisplays find findDisplay 313 in [0, 1] // 3DEN preview
||
{allDisplays find findDisplay 26 in [0, 1]} // 2DEN
||
{(configFile >> "enableDebugConsole") call {isArray _this || {isNumber _this && {getNumber _this >= 1}}}} // allowed by mod
};
#logic
Nothing that can't be fixed tho
2DEN
Damn, the 3d editor is awesome
Forgot this was not a thing earlier
same with zeus, nice
@simple solstice http://killzonekid.com/farewell-my-arma-friends/
How can I check max load of a vehicle?
Inventory wise
Do I have to use getNumber
I also assume transportMaxWeapons has no effect/ not configured properly in amra 3?
getContainerMaxLoad π¦
π
Do I have to use getNumber
Yes
I also assume transportMaxWeapons has no effect/ not configured properly in amra 3?
Yes
Currently works only with uniform, vest and backpack classes.
getContainerMaxLoad doesn't work for anything other than backpacks, vests and uniforms.
π¦
Yup.
maximumLoad is nearly the same for everything...
What's a good way to automatically detect a couple of types of cargo i should add to certain vehicles, containers?
first aid kits
is it possible to access macros within a call compile "WARNING('blalba');" ?
These are commands send by an extension and I don't want to check for it's content cus it's trusted.
compile "#include '-' " doesn't work ... is there any other way to get the preprocessor working on a string?
You guys were looking for that Orange DLC effect when the instructor teleports right? The corrupted memory kinda look? @peak plover @tough abyss
That is in BIS_moveInstructor variable. It calls BIS_fnc_VRSpawnEffect which is what that is I guess
@solemn mason no.
If the string comes from an extension. Then do the preprocessing in the extension before you send it out
@solemn mason
Yes.
call compile 'WARNING("blalba");'
No commy. The string comes from an extension. as he said
well the command comes from a webpage and the extension only passes it throu and the macros are allready defined in game but I gues thats the only way.
//Force re-plan for AI
_gate hideObject true;
_gate hideObject false;
Interesting
I don't get it, but you do need your file to go through the Arma preprocessor for macros to be resolved.
Not possible with strings that come from an extension
preprocessFileLineNumbers or any framework that uses it.
#include "\z\ace\addons\main\script_macros.hpp"
call compile "WARNING('TEXT');";
doesn't work.
preprocessString in 10 years. No worries.
run as [] execVM "name.sqf";
#include "\z\ace\addons\main\script_macros.hpp"
call compile 'WARNING("TEXT");';
single
@solemn mason You retrieve the string from an extension right? not from a sqf file in a pbo that is there at game start?
yes it's by extension
But he said execVM
execVM uses the preprocessor
I would then pass the string to an func that compiles it
the execVM is only for fast testing in editor
@solemn mason If you enable filePatching. You can make the extension write the script to a file. and then execVM that file. That would work
π nasty
execVM or preprocessFile(LineNumbers) are required to resolve macros.
So you always need a file.
car2 doMove (["marker2","marker2_2"] apply {getMarkerPos _x});
what is wrong in this one?
ah well thats what I feared (thanks everyone)
doMove doesn't take an array..
there is a equivalent command?
No...
Telling someone to move to two positions at the same time.. doesn't make much sense
one that makes AI desobay group formantion and stop following?
remove the AI from the group
well, if i do that they will not go on convoy
Can we just undo the whole security thing KK did to the debug console, now that he's gone?
I'm sensing a "the guy who wrote this is gone, it's running everywhere" situation...
When using the debug console, is anyone else unable to see their most recent statements? Like, I can click previous to see all the ones from the other day, but any during this session aren't saved there. That was earlier though, currently not playing the game.
I heard that that feature is broken. Will be fixed in next CBA update
Oh, I didn't realize that was part of CBA.
I've not had any issues 'tho
Just so used to playing Arma with it, I don't think I've ever turned it off.
On that note, what mods do you guys consider as a must? Like, for me it's CBA, TFR and Shacktac HUD.
same issue
@spice kayak - my own π
TFAR FTW!
I've mistaken it for TFR as well...
Make sure to use the 1.0 beta tho :3
I remember the first time I ever used it a few years ago. I was blown away by hearing people around me and on the radio at the same time.
1.0 beta with dead can hear alive is sick
Task Force Radio
Task Force Arrowhead Radio
I guess people think that because the folder is named like that. But it was made by Task Force Arrowhead. Not by Task Force. It's Task Force Arrowhead's Radio mod. TFAR
It's the same thing, wrong name
just putting arrowhead into the folder name would've made it too long
But official naming is TFAR. And I'm the one making the decisions here! π
@spice kayak Press enter instead of clicking LOCAL EXEC. The enter button still saves it.
Ah, thank you.
Yeah, it's just that annoying limit of mod lenght with arma 3 launcher, which means it won't display mod list when looking at server
tfar is better than task force radio
The issue comes from them changing the idc of the LOCAL EXEC button from IDC_OK to a custom one.
So is this TFR, or TFAR? http://radio.task-force.ru/en/ Because when I google TFAR, I get that, which I believed to be TFR.
It is TFAR. Officially. But many people call it TFR inofficially
they are both the same thing
Oh, so here I was getting confused over nothing haha.
yeah
Also, I see @still forum in the credits!
Uhm...
credits, more like blame
Eeeehh, semantics.
Close enough :P
But yeah, I just meant that I saw your name at the bottom of the front page, under 'Many thanks to..' :D
I also did 98% of the work on TFAR 1.0. And I am responsible for every release since 0.9.12
That's pretty amazing, I honestly didn't know.
Yeah commy. I know. Will do soonTM
Yeah? But I have a blue name. You are a nobody.
You didn't write what I expected you to write
\o/
nice
Someone ask a #arma3_scripting question please so we get atleast a little bit on topic
Uhm, ughh
Anybody ever checked if double nesting the same array is possible
Let me just start designing a new mission that will be ridiculously annoying to make and I'll get back to you!
Directly adding arrays to themselves is not possible
_myAray = [];
_myAray pushBack _myAray;
Afaik that is possible yeah.. but... doesn't end well
PushBack has no check?
commy knows
It says something like error expected 89529529 elements , encountered 758937252
commberbatch knows all.
16:06:36 Recursive array
16:06:36 Error in expression <_myAray = []; _myAray pushBack _myAray;_myAray>
16:06:36 Error position: <pushBack _myAray;_myAray>
16:06:36 Error -432031512 elements provided, 1964269232 expected
Lol
You did it!
Wtf?!
Signed unsigned error btw
It also says Error recursive bla above these lines
Oh yeah, did anyone figure out what was behind that glimmer effect for the memory interactions from Laws of War yet?
I remember you guys talking about it before, and I do have the DLC, so if there is anything I could do on my end to access it, I'd love to take a look.
You can always do this:
_myAray = [];
_myAray pushBack + _myAray;
What if you nest the array first?
Example?
[] pushBack array
And then push that into the other array
On mobile right now so... Cannot Rly type code
Does nothing, because you have no array reference to that array.
pushback edits original
Just reports 0.
Gah... You Rly make me to
@spice kayak I thought I posted it here already. Check above. I mentioned Quiksilver and nigel BIS_fnc_VRSpawnEffect
Arr = [] ;
Arr pushBack [arr]
Probably recursion error again.
BIS_fns_VRSpawnEffect was the effect I was playing around with, not the memory glimmer effect.
pushbackback is no a command π
ayylmao
But that is the effect that's played when the Instructor is teleported.
Ohh, no no. I don't mean that effect.
I mean, the glimmering the object has before he interacts with it.
can you screenshot maybe?
Like, the shimmering / warping effect surrounding it.
I'll try and find someone's video containing it.
Is the effect similar to a mirage? I can help you with that
Like the heat coming off a metal surface
The debug console itself errors π€¦
What is that mission?
I mean, I'd love to try and create a cloak using it, though I feel there's probably thousands of different cloaking scripts out there. Just wanted some different tech behind my operators. I already have the EMP, wanted to try cloaking as an alternative.
It's the first or second mission from Laws of War, the new DLC.
@spice kayak
#define WETDISTORTION_0(INTENSITY)\
[\
1,\
INTENSITY, INTENSITY,\
4.10, 3.70, 2.50, 1.85,\
0.005, 0.005, 0.005, 0.005,\
0.5, 0.3, 10.0, 6.0\
]
#define WETDISTORTION_1(INTENSITY)\
[\
1,\
INTENSITY, INTENSITY,\
8, 8, 8, 8,\
0.005, 0.005, 0.005, 0.005,\
0.0, 0.0, 1.0, 1.0\
]
that looks like particle parameters
it is
BIS_PP_WetDistortion ppeffectadjust WETDISTORTION_0(_coef);
BIS_PP_WetDistortion ppeffectcommit 0;
yep
Oh, would not have guessed wetDistortion.
it's much like the "heat" particle
coming out of exausts
that also makes the air go weird like that
@still forum Where did you find that snippet?
In the mission scripts
The stalker mods use a similar way of doing their artifacts
Ah, right the campain mission files
campaign\functions\fn_memoryfragment
hacker
Yeah, trying to think of the best way to do cloaking for an MP enviroment.
Busted
R3EEEEEEEEEEEEEEEEE
I feel it might be a bit too much work though.
GET OUT DEDMEN
#define WETDISTORTION_0\
[\
1,\
0, 0,\
4.10, 3.70, 2.50, 1.85,\
0.005, 0.005, 0.005, 0.005,\
0.5, 0.3, 10.0, 6.0\
]
BIS_PP_WetDistortion = ppEffectCreate ["WetDistortion",300];
BIS_PP_WetDistortion ppeffectenable true;
BIS_PP_WetDistortion ppeffectadjust WETDISTORTION_0;
BIS_PP_WetDistortion ppeffectcommit 0;
I don't need to look into ebo's to export the script from a variable..
PPEffects have soooo many parameters to adjust, its the reason I never came around doing anything with them lol
..But it's easier
What does the F in functions_f_orange.ebo stand for actually?
Futura
Yeah, I'm still a little hesitant with ppEffects. They seem a little overwhelming for me right now.
And that switching when remembering like in the video seems to be a script replacing objects around you
In the video he has posted, the effect seems to be only around that sign, are those particles then?
ppeffect is the screen effect isnt it?
it is
Its post processing on your whole screen
Well, yeah, I was actually just thinking that's what ppEffect was.
What command is used to create particle effects
And I was asking because PP can't be put onto specific parts of your screen, not that dynamically
Probably something like createParticleSystemSystem, or something silly.
private _effect = createvehicle ["#particlesource",getposatl _object,[],0,"can_collide"];
_effect setParticleParams [
#ifdef DEBUG
["\A3\data_f\ParticleEffects\Universal\Universal",16,7,48,1],
#else
["\A3\data_f\ParticleEffects\Universal\Refract",1,0,1,0],
#endif
"",
"Billboard",
1,
0.2,
[0,0,0],
[0,0,0],
1,
1.275,
1,
0,
[_effectSize],
[[0,0,0,0.0],[0,0,0,0.5],[0,0,0,0.0]],
[1],
0.1,
0.05,
"",
"",
"",
0,
false,
0,
[]
];
_effect setParticleRandom [
0,
[0,0,0],
[0,0,0],
1,
0.1,
[0,0,0,0],
0,
0,
1,
0
];
_effect setDropInterval 0.01;
That should be it
I'd hate to figure out how to make good looking particle configurations yourself
I tried a couple times.. I just change random values till it looks somewhat like I want it
I wonder how BI does that.. I guess they'd have a tool that shows the particle.. with sliders to configure it or something
Must be
Would be cool if someone could put some time into making a tool for that for the community π
Some ingame editor
Sounds like something for @queen cargo π
Coding crack
Oh man, I'd love a took like that.
Also, here is the spagett code
private _effect = createvehicle ["#particlesource",getposatl _object,[],0,"can_collide"];
_effect setParticleParams [#ifdef DEBUG ["\A3\data_f\ParticleEffects\Universal\Universal",16,7,48,1], #else ["\A3\data_f\ParticleEffects\Universal\Refract",1,0,1,0], #endif "", "Billboard", 1, 0.2, [0,0,0], [0,0,0], 1, 1.275, 1, 0, [_effectSize], [[0,0,0,0.0],[0,0,0,0.5],[0,0,0,0.0]], [1], 0.1, 0.05, "", "", "", 0, false, 0, []];
_effect setParticleRandom [ 0, [0,0,0], [0,0,0], 1, 0.1, [0,0,0,0], 0, 0, 1, 0];
_effect setDropInterval 0.01;```
So spagett. So beautiful.
the #ifdef doesn't work in a oneliner
Yeah, I figured, but I still wanted it squished.
Also Luro.. That is very easy to reuse for your shield thingy..
_effectSize seems to be the size in meters. and _object is.. the object
Is there any time of the year where X39 actually leaves the house and doesn't work on 5 things at the same time?
Yeah.. He goes to work.. And works on Arma things there ^^
It's a ghost! No! It's a invisibility shield
That heat particle effect would look good on some vehicles
very cute effect
Actually, don't the jets and stuff already use that?
Yeah they do
@tame portal is there any time of the year where you don't suggest C# over any other language?
@simple solstice I'm the classic enemy of everyone else
And some mods like robert hammer / 3cb guns have heat haze as well. (not fps friendly btw)
I use a Windows Server
I like C#
I use ASP.NET
It's like everyones trying to kill me
don't worry I also use a windows server for arma
People only use Windows Servers because ArmA servers are usually up to date there and run better π
and they are much more easier to run
If I had to do same things on Linux... oh boy
Comes down to how long you've already worked with Linux based systems
Oh my, can you draw objects in the game? Like, a 3x3x3 slightly transparent sphere?
Yeah, that was a silly question. One can dream :(
I was thinking how cool it would be to combine that shimmering effect, with that of a semi-transparent dome, which would protect whoever inside of it, ala shield.
@spice kayak Draw3D?
There's drawIcon3D, and drawLine3D, but I believe their hud markers, aren't they?
I just love how they quickly replace objects and change the weather in milliseconds when they make the screen turn black
10/10 0 FPS in that second
Any of you smart people have a way of returning the true height of a structure? BoundingBoxReal is too rough
Yeah
Very neat
lineintersects from the sky, somonen was doing fastroping or sth, that's kinda what you need
Aw, so it turns out you can't see the particles when you're within the effect range.
Create the model as simple object in the air and do two raycasts with LIS. One from below and one from top.
I was thinking, instead of making a cloak out if it, I could have that shimmer effect happen just when the EMP goes off, but being inside of a particle effect that big doesn't really work out too well.
Thanks guys, helpful as always π
Aren't they just the cutest?
What happens when an object is not a cube and a center raycast doesn't necessarily finds the highest position
That's what I'm thinking, but I'm concered about performance
Store the results for each building type.
I'm only doing walls btw. Some walls are very thin so a LIS might miss if its pointed from the top
Is there a way to return all walls from the game?
I'm currently detecting walls using
if ( ([ (getModelInfo _structure) select 1, ""] select (isNull _structure)) find "\walls\" != -1 ) then {code}
which looks ugly
I wouldn't mind storing the hieghts for each wall
_highestZ = 0;
for "_i1" from 0 to 100 step 1 do {
for "_i2" from 0 to 100 step 1 do {
/* do raycast */
if (_newZ > _highestZ) then {
_highestZ = _newZ;
};
};
};
Hey I havenΒ΄t made anything with sqf for months now and I have forgotten how to make a pause into a scrip. You know that for example there is a hint at the beginning and after that you have to wait some time until the script goes on. Can someone help me out?
sleep 5;
?
but sleep needs something like execVM doesnΒ΄t it?
Nvm... I can return almost all the walls if I just search for "wall" in Eden editor !
Well, for a script to be able to suspend, you have to work in scheduled environment,
It's called SQF, not SQL
oh sorry
SQL is for databases
yeah I know that it is called SQF I just typed the wrong IΒ΄m sorry
addItemCargoGlobal
seems to work with weapons,clips,items,linkItems,backpacks,clothes etc.
This is awesome!
But why does it
Use addWeaponCargoGlobal with the mine detector and try to pick it up
weapon one does not say that it works with other things... lemme try
@little eagle I assume the items glitch out of they arent added with their appropiate commands?
cursorTarget addWeaponCargoGlobal ["MineDetector", 1];
Try it.
Magic trick of the day.
What is the typical class name for all guns on the ground? When AI enemy is killed, they dropped their guns on the ground and the body is deleted, but gun is not deleted in our mission AO. so I want to delete the guns for new mission, like this:
{deleteVehicle _x;} foreach (_objmark nearObjects ["AllVehicles", _rad]);
GroundWeaponHolderSimulated
thx commy2 π
thx again π
waitUntil {({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)};
Is there a way to have the waitUntil need to be true for a period of time?
I've thought of a few ways but they're messy
well you can call the same script again
|| MyTag_switch
MyTag_switch = true
?
I think he wants to run the script after waitUntil for a period of time
if !(condition) then {
_time = time + 10;
};
if (time > _time) exitWith {
systemChat "i've been active for 10 seconds and i've had it";
};
sleep?
that only delays checking the conditions
I'll have a peek a tthat @peak plover. @little eagle you mean to add the || as part of the waitUntil?
Yes, as part of the condition.
why don't just use uiSleep or sleep if you want to wait a bit after waitUntil is true?
He wants to ignore the condition and have it be always true.
Uh
No its like, with that waitUntil it waits until theres an INDI in the markerArea and that theres also not a BLUFOR in it. I want to to have those conditions be true for say 5 seconds, before its complete
Ah, he wants the blue unit to be alive for at least 5 seconds in the area.
ohh
Well not necesarrily alive, but just present
but yea alive or it wouldn't be picked up
so after that
Two nested waitUntil
waitUntil {({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1)
&&
({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)
&&
waitUntil {sleep 5}};
surely its not something like that?
waitUntil {
waitUntil {unit_in_area};
sleep 5;
unit_in_area
};
waitUntil {({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)};
_time = time;
waitUntil {time - _time > 5 && unitPresent};
@little eagle would that work? it wont
yup, yours is what is good
I hate nested loops like that too
As in what you've just given me Commy you hate? I'm basically trying to emulate what a trigger would, but I don't want to create triggers
waitUntil {
waitUntil {({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)};
sleep 5;
({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)
};
is what i've ended up with, about to see if it does what I need
lgtm
Thats still not really it Katekarin. Thats like, okay theres dudes in there, lets wait 5 seconds and check again, its not going to ensure the units are in there for 5 seconds
waitUntil {({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)};
sleep 5;
if (unitPresent) then {...
Why would he leave and return in 5 seconds though?
I want to use 60 seconds
just using 5 seconds as an example
or 5 seconds would occur if the unit was on the edge of the mmarker
Omg
slipped in and out
I only want to execute once what happens after the waitUntil is why
hmm, is this something like a progress for capturing a point?
private _time = 0;
waitUntil {
if !(unit_in_area) then {
_time = time;
};
time > _time + 60
};
That looks perfect infact commy
#logic
private _time = 0;
while{true} do
{
uiSleep 1;
_time = _time + 1;
if !(unit_in_area) exitWith {};
if (_time >= 60) exitWith {};
};
if !(unit_in_area) exitWith {};
...
would that work? :p
you can add some kind of progress bar with that
*throws cookies at everyone*
Idk, I like mine the most : P
πͺ π
you can add a countdown to mine π
You can do that to mine too. You already have 60 - progress in _time.
won't discuss with someone who made CBA and ACE π
@still forum i hate chocolate chip, got any oatmeal raisin?
What are you a monster?
also thanks @little eagle
uh @little eagle - I think its causing my game to crash
try me
@daring pawn cookie monster? Not necessarily
π
Yea @little eagle it 100% crashes the client
Yea i'll have a looksie @simple solstice
Please post what you wrote. There is no way this crashes.
be sure to replace : with ; in my code if you want to try it ;p
waitUntil {
if !(({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)) then {
_time = time;
};
time > _time + 60
};
I don't see it.
Don't see why it crashes a game?
Yeah.
I mean if you're near a copy of arma, you can try it. I'm on self hosted MP at the minute, its crashed my game a few times now
Exception code: C0000005 ACCESS_VIOLATION at 0198FE74 If its relevant
Although probably not
it's not
Did you forget to put the:
private _time = 0;
part?
Nah its there
GridState = {
_mkr = param [0];
_gPos = _mkr call getGridPosMarker;
//waitUntil {(([_mkr,375,"count"] call NearestPlayers) < 1)};
private _time = 0;
waitUntil {
if !(({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)) then {
_time = time;
};
time > _time + 60
};
/* CODE */
};
Deadset, its odd. I tried adding a sleep incase it was just freaking out like if you have a while {true} {}; and something intensive, it still crashes.
0 spawn {
_mkr = "marker_0";
private _time = 0;
waitUntil {
if !(({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) < 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) >= 1)) then {
_time = time;
systemChat str 0.5;
};
systemChat str 0;
time > _time + 60
};
systemChat str 1;
};
I tested this and it works for me.
That count allUnit blah thing is ugly
hmm, could it be the fact you've used spawn? To run the function of mine above, i'm using remoteExec
Maybe thats the source of it causing the crash?
Otherwise though, in what I posted there, the full code that i'm using, again theres nothing there that should result in a crash surely?
remoteExec-Not-Call should make it be able to use sleep etc unless you used remoteExec ["call"];.
Is gridState defined on the server machine with the latest changes?
And you figured out that it crashed because it kicked you off I guess.
There is no reason what I posted would crash : /
Yea indeed.
Also having tried in editor, same thing causes my game to crash not server obviously
Its just odd
How big's the rest of the code?
Instead of using the spawn you have, can you try it the same as I have mine, and remoteExec it?
The rest?
_mkr setMarkerColor "ColorOPFOR";
missionNamespace setVariable [format["%1hadqrf", _Mkr], nil];
publicVariable format["%1hadqrf", _Mkr];
[_gPos] remoteExecCall ["gridFromDB",2];
[_mkr] remoteExecCall ["initZoneIND",2];
is the rest
when I had the old waitUntil I posted at the very start, no crashes occured. Even commented my stuff out to see if it was related. still crash.
commy_CreativeFunctionName = {
_mkr = "marker_0";
private _time = 0;
waitUntil {
if !(({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) < 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) >= 1)) then {
_time = time;
systemChat str 0.5;
};
systemChat str 0;
time > _time + 60
};
systemChat str 1;
};
remoteExec ["commy_CreativeFunctionName"];
No crash.
1.76 stable, CBA dev as mod.
Yup same. + more mods but 99.9% sure they'd not affect this situation
local variable in global space
Yeah, I'm thinking the same.
Check if you did
params ["noScore"];
So i've had it work now. Only difference is not being in the Zeus Interface !_! cool beans ArmA
using private array, because lazy
ah well, it works
hmm, Zeus affects my part?
Having Zeus open when it gets called, causes a crash for me
I am running an extension for zeus, running ares achilles, might be relevant to causing it
I retried with zeus and it worked fine. I had two loops of this running, one spawned one remoteExec'd.
Very likely then its the zeus mod i'm running, causing that when the function gets called
I've just called it on the dedi server, no crash and its functioned just fine
So that is indeed very odd
Ah well regardless, it works now, so I do appreciate that commy
Now make it pretty.
#define COUNT_IN_MARKER_SIDE(marker,side) ({side group _x == side} count (allUnits inAreaArray marker))
private _time = 0;
waitUntil {
if !(COUNT_IN_MARKER_SIDE(_mkr,independent) > 1 && COUNT_IN_MARKER_SIDE(_mkr,west) < 1) then {
_time = time;
};
time > _time + 60
};
Can you define inside a function or does it have to be outside it?
Anywhere in that .sqf file or in one that was #include'd
Alright, swell, cheers
If you use a function (not command) and want it to run in unscheduled environment.
so for displaying a message its perfectly fine to use it, right
Depends on how complicated it is. UI is a classic example of stuff that get's ruined by the sche-du-le-r.
you mean the sche-le-r-du right?
It's just an UI element popping in with a message
I try to protect safety zone and kick too much shooting player only in the zone, but all players get kicked to the lobby with this script.
There might be a problem in commnad line: "LOSER" remoteExecCall ["endMission", player];
how to fix it?
//init.sqf:
execVM "safeZone.sqf";
//safeZone.sqf:
#define SAFETY_ZONES [["Respawn_West", 120], ["air_spawn", 120]]
if (isDedicated) exitWith {};
waitUntil {!isNull player};
player setVariable ["num_fire", 0];
player addEventHandler ["FiredMan", {
_shooter = _this select 0;
_projectile = _this select 6;
_target = if (isplayer _shooter) then [{cursorTarget},{ assignedTarget _shooter}];
if ({_shooter distance getMarkerPos (_x select 0) < _x select 1} count SAFETY_ZONES > 0) then {
deleteVehicle _projectile;
private _num = (player getVariable "num_fire") + 1;
player setVariable ["num_fire", _num];
if (_num >= 30) then {
"LOSER" remoteExecCall ["endMission", player];
};
} else {
player setVariable ["num_fire", 0];
};
if ({_target distance getMarkerPos (_x select 0) < _x select 1} count SAFETY_ZONES > 0) then
{
deleteVehicle _projectile;
};
}];
it doesn't kicks player, it ends the mission
yeap, all players go to the lobby. that's problem.
why are you remoteExec'ing?
Btw you are remote execing where
(local player)
Which is true everywhere
wait...
that might not be true π€
@quasi rover wouldnt it be better to create a trigger on the zone, add allowDamage false when entered and allowDamage true when left?
isplayer _shooter
???
_shooter is always player
I want to kick too much shooting player to the lobby only, not servercommand #kick. π
The remoteExec is pointless
_target = if (isplayer _shooter) then [{cursorTarget},{ assignedTarget _shooter}];
?
shot = 0;
player addEventHandler ["FiredMan", {
if ({_shooter distance getMarkerPos (_x select 0) < _x select 1} count SAFETY_ZONES > 0) then {
shot = shot + 1;
if (shot >= 30) then {
"LOSER" call bis_fnc_endmission;
};
}];
Why end the mission?
forgot he even had it
LOL
and thats it.. if you want to kick players who shot over 30 times in the zone
you can't end the mission for one player only
Yea you can
you can.
you.. can?
Yes you can.
Wanna bet
4x combo
Wow... π³ too much mistake in my scirpt right?
you just overthought it
Just that one line.
@quasi rover i reccomend you to create a trigger that will handleDamage false to the object which enters it, then handleDamage true so people dont get hurt in the safe zon
local action, local effect my bad, sounded senseless
then you can use https://community.bistudio.com/wiki/inArea instead of distance to the marker
in the if
or distanceSqr atleast
I ran linux servers for ages, and i tried windows server ONCE and only for arma. Never again.
Same here π
thanks guys, I'll think again.π³ π
[car2D] join grpNull;
[car3D] join grpNull;
[car4D] join grpNull;
this sleep 1;
car2 doMove (getMarkerPos "Marker2");
car3 doMove (getMarkerPos "Marker3");
car4 doMove (getMarkerPos "Marker4");
this is a trigger
how do i use that sleep command?
The trigger runs in unscheduled environment. You can use suspension commands like sleep in scheduled environment only.
You need to switch to scheduled environment using spawn.
ye boi
π
[car2D] join grpNull;
[car3D] join grpNull;
[car4D] join grpNull;
[] spawn {sleep 1};
car2 doMove (getMarkerPos "Marker2");
car3 doMove (getMarkerPos "Marker3");
car4 doMove (getMarkerPos "Marker4");
now i have a problem
the AI does not move on the doMove order
the reason why i remove they from the group is that they keep formation and not obey the marker
0 spawn {
[car2D] join grpNull;
[car3D] join grpNull;
[car4D] join grpNull;
sleep 1;
car2 doMove (getMarkerPos "Marker2");
car3 doMove (getMarkerPos "Marker3");
car4 doMove (getMarkerPos "Marker4");
};
more like that
@astral tendon check if they are local to the server
how?
as you can see https://community.bistudio.com/wiki/doMove
it has an aL tag, which means the arguments (in this case the unit) needs to be local to the client issuing the command
but how do i know that?
you use the local command.
it returns true if the unit is local to the unit issuing the command
if (!local _unitName) then {
hint "remote";
};
like this?
i put that on the console?
yes
if you want to issue a command from a unit thats not local, use remoteExec and use the object you want to issue it on as the target
you can use createVehicleLocal to spawn a unit locally on your machine only
this is a coop set up
well, each unit is always controlled by one entity.
this might be the server, a player pc, or a headless client
you can't apply commands to a unit if it isn't local to machine you're executing your script on
well you can, but then you need remoteexec
no
if you are serious about arma
and want to do something with scripting
read this
AI units created after mission start via scripting will be local to the computer that issued the command
Lies. They will be local to the machine that owns the group.
urg
so there is other way around what i am doing?
its like this
my cars, move into a possition
they get there
hit a trigger
now 3 of they must go to 3 diferent markers on the map
how are the cars spawned? and whos the group leader?
disableAI
wait, that wont just turn they off?
you can disable parts of the AI
they still move to a marker over a doStop command?
if you issue it before doMove
like
Order the given unit(s) to move to the given position (without radio messages). After reaching his destination, the unit will immediately return to formation (if in a group); or order his group to form around his new position (if a group leader). Use doStop to stop units returning to formation.
cars doStop;
sleep 1;
cars doMove;
its from doMove
Why not move them into different groups when they have to split up
if i do that they screw up the convoy
im not really familiar with AI in Arma, so the only help I can provide is reading the descriptions and searching for commands ;/
just remember about locality.
if you want to remoteExec e.g. doMove on the cars its something like that
[car2, getMarkerPos "Marker2"] remoteExec ["doMove",car2];
it will run the script on the client thats local to the car2
but i need a doStop to all of they frist right?
i don't know this. check it yourself :/
Any modders here willing to share experiences? I'm looking to become a mod creator, I can combine some skills I've achieved in domain, maybe..
Just start doing stuff man
I don't know how to start
and what to use
I know to do modelling and stuff
If that helps me
Then make a box and look up a tutorial on how to get the box in game
@simple solstice that works
a box?
What do you mean?
Model a box
Make it a mod so it appears as an object in game
???
Profit
Theres a few tutorials around on how to make an addon for objects
But youre really in the wrong channel for that, that stuff is #arma3_model
Right, what about making making insignias?
Sure, look up how theyre done and recreate it
Maybe look at someone elses insignia mod
And how do I release the mod on steamwork shop?
Arma tools has a publishing tool
@astral tendon huh? which one π
[car2, getMarkerPos "Marker2"] remoteExec ["doMove",car2];
[car3, getMarkerPos "Marker3"] remoteExec ["doMove",car3];
[car4, getMarkerPos "Marker4"] remoteExec ["doMove",car4];
they out of formation and get into the markers
i did not put a dostop
this is inside of a trigger
[car2, getMarkerPos "Marker2","Marker3","Marker4"] remoteExec ["doMove",car2];
i wanna they to follow multiples markers
this is how i do it?
How would I go about spawning in a ammobox with specific items in it? I am trying to create something like this: You would walk up to a marking on the ground then get a scroll option to spawn in the box and then have some specific items in it.
Look up the addMagazineCargoGlobal command and its friends
I looked at that earlier but how would I do that if the box itself is not spawned yet but gets added by thesame script? Sorry if these are really stupid questions btw
Checking every week and still hoping that it'll happen https://feedback.bistudio.com/T83768 #someday
@cinder gyro you add the commands to the script that spawns the box
Is there an easy way to add a cooldown to addAction?
what do you mean? like, after using the action it disappears and then comes back later?
Yea
easiest way would be to remove it after it's used, then re-add it after a set period of time i guess
you probably figured that out already, but it should be easy to code
you could use the condition parameter combined with a setvariable on the object of the action to set a time stamp
how come i can't find a single proper SQF editor. is it so hard to combine my favourite syntax highlight color scheme, a 100% complete function autocomplete lib, linting and github integration into one program?
@waxen tide git integration is a little bit much to ask for, try Arma studio
well so far i haven't found anything that matches poseidon's autocomplete
will try, thanks
i'm very unhappy.
@waxen tide Personally, i use notepad. Syntax highlighting and automatic complete lib is overrated π
currently i'm using poseidon, and then i check the linting with atom.
i'm very unhappy.
Taking the easy way out i see π Not allowed my fried
variables are case sensitive?
does it have full autocomplete lists?
Code has another sqf parser plugin to highlight errors, which is why I stick with it
time to install more tools i guess.
i couldn't be bothered with visual studio or arma studio. if i can't drag a file into the program and look at it, its needlessly complicated to set up. π€
http://i.imgur.com/GFXWULe.png uhrg. who would want two slightly different blue colors to distinct keywords from vars? INSANITY!
autocomplete looks solid tho
code is different from studio, it doesn't have a 'solution' concept - it mostly just works with a folder structure, so you point it where you want your 'root' to be and all the files are just there
I like it a ton, I would probably use notepad++ if I wasn't already using it as the place to edit all the data
haha indeed
linter doesn't lint.
is there a way of listing all custom radio channels to see how many are free ?
Balls, thats made my job a bit harder xD, I was going to try and detect how many free customchannels there were. and set mine based on how many were free.
if I try and create a channel it will return "0" as the channel index wont it ?
Just create them on server on mission start. Then create an array with each channel that you create.
Then pull whatever channel you start adding to people out of the array, then insert it when you are done again.
As long as you do not create any channels, 9 will be free IIRC
Just work from that
Hey, anyone know if there's a way to change a players' stance via scripts? like force them to step out to the left or right, similar to ctrl+A / D?
if (isServer) then
{
private _index = 1;
for _i from 6 to 15 do {
_format = ["Phone_Channel_%1",_start];
private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _format, "%UNIT_NAME", []];
if (_channelID == 0) then {diag_log format ["Custom channel '%1' creation failed!", _channelName]};
_index = _index + 1;
};
};
``` something like that would work I guess.
Recommend you do this instead if !isServer exitWith {}
Unless you are always executing that function on server, then there is no need for check
its a server side pbo so it shouldnt be an issue.
Then no need for isServer check
all the code side of things are going to be compilefinal on the server
apart from the init.
@rotund cypress thanks, found something good enough.
Np
testing now π thanks Simzor.
working on a non modded calling system -_- done it with tfar. but vanilla its very limitting.
only 9 channels to play with, and with altislife, takes that down to 6
Just remove the channels already created, there is no need for them and I have absolutely no idea why Tonic would add custom channels...
I have no idea, xD just going to have to put something in place so people cant just fill the channels the entire server... put in a calltime/battery feature.
for _i from 0 to 9 step 1 do {
_format = format ["Phone_Channel_%1",_i];
private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _format, "%UNIT_NAME", []];
if (_channelID == 0) then {diag_log format ["Custom channel '%1' creation failed!", _channelName]};
if (_channelID != 0) then {diag_log format ["Custom channel '%1' creation successful!", _channelName]};
};
``` doesnt seem to producing any errors.
You are only doing that on step 1
Remove the step 1
Also "" must be surrounding _i
also make _format priivate as well
Yup just fixed that. my brain isnt working properly tonight.
umm. it decides to init twice now xD
is there a way to i set a passanget seat as a commander seat?
perfect!
python2, python3, all the same. i just ported the poseidon plugins to sublime 3.
i have just moved from posiden to Atom, i do miss the auto indention, and private generator though xD
can be so lazy with posiden...
So I'm trying to get players to do x action y number of times cumulatively, So just as a team, action x needs to be done y times. How do I properly keep track of that globally? is there like a way to sync variables across the server to all clients? Or a way for clients to call an action server side?
I think altis life has somthing..
// commy2 solution for voting (example: carrier deploy)
// abuse object as "namespace"
if (isServer) then {
missionNamespace setVariable ["asdfg_voteNamespace", createSimpleObject ["Building", [0,0,0]], true];
};
// client
asdfg_voteNamespace setVariable [str clientOwner, "yes", true];
To count the "yes" or whatever:
{asdfg_voteNamespace getVariable _x isEqualTo "yes"} count allVariables asdfg_voteNamespace
arma will sync vars you attach to the object automatically for you.
works fine! is also apparently performant.
Thanks,
Last question I think, Is there a way to use Count, but instead of true or false, have it add Values? Like { _x getVariable "points" } Count AllPlayers;
That script creates placeholder objects?
So like, everytime Action x happens you create an object that holds the value, and then just count the number of objects?
yeah dedmen commented on my github about that... also apply .. but i didn't wake up enough to understand it yet. the way i figure count evaluates the code in the {} and if that equals true it counts. you can use _x to get the current element inside the code just like foreach etc.
i'm just the night shift, the competent guys are asleep.
is there i way to change the identification of a player as a AI for other AIs?
private ["_unit","_anim"];
_unit = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_anim = [_this,1,"",[""]] call BIS_fnc_param;
_cancelOwner = [_this,2,false,[true]] call BIS_fnc_param;
if (isNull _unit || {(local _unit && _cancelOwner)}) exitWith {};
_unit switchMove _anim;
``` this is what alitislife uses for animations.
dont know if that helps atall.
Does anyone have some good documentation on the CBA fleximenu stuff?
There is a command in the BIKI that allows you to show colored text with different font sizes in the bottom of the player's screen. Searched for half an hour but i can't find the damn thing.
titletext?
titleText ["<t color='#ff0000' size='5'>RED ALERT!</t><br/>***********", "PLAIN DOWN", -1, true, true];```
yes. thanks. π³
there is a command to turn on and off the "stay on road"?
think that comes under AI behaviour
like depending on if they're set to "careless" or whatever
Anyone know if there's a way to check if a vehicle is created using createVehicleLocal specifically
that does not work
Using local isn't adaquete since the vehicle could be local to the player but "public"
there is a "stay on road" check box, but in one point of the map that they need to be off road this needs to be turn off
wait, i tink i find it
forceFollowRoad
@zenith totem If a vehicle was created using createVehicleLocal, the vehicle won't exist on other computers. The vehicle only exists on the computer it was created on.
if a vehicle is created using createvehiclelocal the vehicles netid will be '0:0'
i need to set up a trigger that 8 cars must be in it and it will only start of those 8 get in it
you guys can give me some help on it?
@zenith totem you can check if it exists on the server
count [onu1, onu2, onu3] == 0
this is the trigger condition
atually it did worked
wheeled
of couse it did not worked all the way
thats why i need the command to turn it off
this happen when he was doing a verry close conner
i made a trigger that turns it off
so he can do the coner
speed also matters
{isNull _unit _x} count [onu1, onu2] == 0
is this right for a trigger condition?
the trigger must activate when those 2 units get in
thanks man
Hello everyone π So, i've got a quick question, or so i think, so i made this mission in which you have to hunt down 3 Narcos, but they're in a party, the moment you get close (BLUFOR "present" activated trigger) they will try to start running to a helo and the pilot will get in first (so he gets the pilot seat) and then he'll fly them off to a point in the map that if the reach makes you lose the mission, thing is i made the init in the 3 Narcos this:
NarcoName disableAI "MOVE";
and then on the trigger i placed:
NarcoName enableAI "MOVE";
Y syncd the trigger to they waypoint of both, pilot and narcos so that when the player gets inside the trigger it activates, and they get inside the helo and then i placed a waypoint with this init:
((obj1 in helo1) || (!alive obj1), (obj2 in helo1) || (!alive obj2), (obj3 in helo1) || (!alive obj3))
and i also tried that with a "Waypoint activation" trigger, but the pilot will still fly off withouth the 3 guys
What did I do wrong?
/*
Header
*/
author = "Motorola";
onLoadName = "Tangle";
loadScreen="Pictures\ship.jpg";
onLoadMission = "The USS Hamilton meets an enemy carrier off the shore of Stratis. A confrontation is inevitable.";
/*
Classes
*/
class CfgSounds {
sounds[] = {};
class MOTO_alarm1
{
name = "alarm1";
sound[] = {"sounds\alarm1.ogg",1,1};
titles[] = {};
};
class MOTO_men
{
name = "men";
sound[] = {"sounds\men.ogg",1,1};
titles[] = {};
};
class MOTO_zone
{
name = "zone";
sound[] = {"sounds\zone.ogg",1,1};
titles[] = {};
};```
It says line 35 is missing '}'
you forgot } at the end for cfgSounds
π€¦
Yeah, but you were literally. Missing a bracket.
(onu1 in thisList && onu2 in thisList);
You have n } missing
yeah
I don't see the point in giving someone shit who's still learning.
I'm not giving you shit at all, nor is anyone else. But you gotta look over it first man.
hang him
I did what I thought I was supposed to do. It pointed me to line 35. The missing bracket wasn't even at line 35.
missing the closing bracket is a serious offense
It is. I'll accept the hanging.
Oneoh, are you the one who has been casting spells on people lately?
It said it was in line 35 because i think the engine counts the brackets in pairs, so what happened it counted pairs for all the brackets but since 1 once missing it "though" it would go at the very end hence why it says it was missing line 35 when you only have 34 lines π
Are you as a witch hunter, a witch?
don't let the guys in #ip_rights_violations see your author name is Motorola either, they will hang you again
so, with the (onu1 in thisList && onu2 in thisList); the vehicles are passing the trigger but its not activating
i need to do sometinng else?
Roque try: (onu1 && onu2 in thisList);
Or:
(onu1 && onu2) in thisList;
Guys could i get some love over here with my question? π¦
Well to begin with, make sure not to post in two different channels.
I wasn't sure where to put it actually
just add a second trigger checking for pilot inside helicopter synced with passenger guys
so when pilot gets inside heli, the guys waypoints will fire
The guys will try to get to the helo, so will the pilot, thing is i added a second trigger (first one is the one that fires their waypoints to get into the helo) that has the conditions or so i thought for the pilot waypoint (once he's in the pilot seat) to activate:
((obj1 in helo1) || (!alive obj1), (obj2 in helo1) || (!alive obj2), (obj3 in helo1) || (!alive obj3))
But apparently i did something wrong because it still doesn't check for the passengers and so the pilot just takes off as soon as he can and flies away withouth the other guys
Eh, do you guys know what up with this? _box addItemCargo ["G_40mm_HE", 80]; It doesnt spawn anything the the box
It works for some ammo added by a mod but not for this
how do i get rid of ""string"" -> "string"
call compile ""string"";
thanks
Nvm π€¦ I cant even read...
@astral tendon you sure you have setup the rest of the trigger right?
(onu1 inArea thisTrigger && onu2 inArea thisTrigger);
I dont use triggers, there are maybe better ways to do it
question
{isNull gunner _x} count [car1, car2, car3, car4] == 0
what does that 0 stand for?
So, using xeh, any advantages using the class instead of CBA_fnc_addClassEventHandler for a mission?
I'm intending to add auto-loadouts, so all vehicles, units will get proper gear
{isNull gunner _x} count [car1, car2, car3, car4] == 0
counts how many cars have a gunner in that array, if none of those cars have a gunner, returns true, else false @astral tendon
Does gunner return null if there is no gunner?
was just about to look
but what is that "== 0" ?
Don't know try
Use the watch boxes
Spawn in 2 vehicles, 1 win crew 1 without. Look at the vehicle and watch box code:
gunner cursorObject
what do you mean? == 0?
if count with that condition in array is equal to 0 it retuns true
else false
{isNull gunner _x} count [car1, car2, car3, car4] > 2
if there are more than 2 gunners
also, this is in a trigger
what about the reverse?
{isNull gunner _x} count [car1, car2, car3, car4,car5,car6] == 0
if i wanna limit of 4 gunners to the trigger starts
how should i put it?
@waxen tide there is a better way to remove additional ". just use str
{!isNull gunner _x} count [car1, car2, car3, car4,car5,car6] >= 4
if there are 4 or more than 4 gunners inside the array it will return true
@astral tendon
so that number in the end means the amout nessesary?
@copper raven does => work, doesn't it have to be >=
{!isNull gunner _x} count [car1, car2, car3, car4, car5, car6] =<4
like that it will trigger if there is less than 4 gunners?
yeah less than 4 or equal to 4
smaller than. smaller or equal. bigger or equal.
You don't really say equal or bigger. so >=
add more parenthesis
nice
Yeah, my issue now is trying to figure out how to make the bubble somewhat transparent, as I'm just using a pre-existing object in the game.
Yeah, this is what my first test looked like. Only spent a few minutes on this, but still. Derpy shield, activate! https://www.youtube.com/watch?v=SH0KiadLDSM
Tht's prety col
How would i go about displaying a picture in the middle of a screen of a player for lets say 5 seconds?
["<img image='PathToImageHere' />"-1,-1,4,1,0,789] spawn bis_fnc_dynamicText;
Something like that?
Yeah i tried that, however, im looking to have the picture take up the entire screen. This just creates a small image in the center.
@tough abyss Make it a RscTitle
you can use ctrlCreate
_ctrl = (findDisplay 46) ctrlCreate ["RscPicture", -1];
_ctrl ctrlSetPosition [safezoneX, safeZoneY, safeZoneW, safeZoneH];
_ctrl ctrlSetText "path\to\pitcutre.paa";
_ctrl ctrlCommit 0;
0 = _ctrl spawn {sleep 5; ctrlDelete _this};
damn
how do you wrap code again?
I'm losing my mind here
17:17:50 "[WEST,""WEST""]"
17:17:51 "[EAST,""EAST""]"
17:17:52 "[any,""GUER""]"
17:17:53 "[any,""CIV""]"
["WEST",[west,"WEST"],"Select west to be changed"],
["EAST",[east,"EAST"],"Select east to be changed"],
["GUER",[independent,"GUER"],"Select independent to be changed"],
["CIV",[civilian ,"CIV"],"Select civilian to be changed"]
Why on earth do west,east work but indep,civ dont?
Result of passing an agent with setVehicleVarName to a "side" command:
_agent = createAgent [typeOf player, position player, [], 0, "NONE"];
_agent setVehicleVarName "ai";
systemChat format ["Side: %1", side ai]
// Side: 00000000023AFA50
WHAT?!?!
wtf
@peak plover i think its resistance and civ
civ returns nothing in watch box
civilian returns CIV in watch box
I found out this bug after 4 HOURS of losing my mind.
I QUIT
its civilian, for indep its resistance, but dont know why civilian side isnt working
it's only caused by setVehicleVarname? i never seen or used that before
When used in a format statement (hint format["%1",resistance]), the string returned is "GUER".
Yeah but I don't need format
I need the side variable
west/east/resistance/civilian
Those are not trasnferred for some reason through my button
but west,east work
@badbenson#0154 "side _agent" works fine, returns west. "side ai" returns.... Idk
resistance,civilian,independent don't work
what do you need the setVhicleVarname for though? curious
Im doing "compile format [<create some agent>]", so I need setVar so I have something to reference my agent by
_agent = createAgent [typeOf player, position player, [], 0, "NONE"]; _agent setVehicleVarName "ai"; ai = _agent; systemChat format ["Side: %1", side ai];
```sqf
_agent = createAgent [typeOf player, position player, [], 0, "NONE"];
_agent setVehicleVarName "ai";
ai = _agent;
systemChat format ["Side: %1", side ai];
```
Like that @cloud thunder
I just sleep when I'm stuck on something, because every time I lay down to try and sleep, the issue keeps bugging me until I mentally fix it, which doesn't help when I don't remember the solution upon waking up.
ty
werid thing with that west,east working resistance not working...
I changed into string and do extra checks that convert and it works
tells me any 'tho π¦
no explenation
from ```sqf
["WEST",[west,"WEST"],"Select west to be changed"],
["EAST",[east,"EAST"],"Select east to be changed"],
["GUER",[independent,"GUER"],"Select independent to be changed"],
["CIV",[civilian ,"CIV"],"Select civilian to be changed"]
to
17:17:50 "[WEST,""WEST""]"
17:17:51 "[EAST,""EAST""]"
17:17:52 "[any,""GUER""]"
17:17:53 "[any,""CIV""]"
I'd still like to know why, even 'tho I found a fix workaround
What was the script again?
ctrlButton value = [west,"WEST"] etc...
then later grab the thing
wait
setVaraible
on control
then grab
Is there a call compile?
..maybe?
lol
call compile str west; // WEST
call compile str east; // EAST
call compile str independent; // any
call compile str civilian; // any
SIDE cannot be serialized.
what about west?
Well, WEST and EAST can.
I need more coffee to handle all of this...
I don't get it π¦
Other than they added indep/civ later and didn't go the same lengths
str west; // "WEST"
str east; // "EAST"
str independent; // "GUER"
str civilian; // "CIV"
call compile "WEST"
call compile "EAST"
call compile "INDEPENDENT"
call compile "CIVILIAN"
str _side is giving the "description" of the side, which annoyingly isn't the same as the command to return the side for indep/civ
str SIDE only matches the command name for WEST and EAST.
You'd need a small function to serialize SIDE type.
Not that hard.
don't forget about this still being a thing str resistance ; // "GUER"
private _fnc_serializeSide = {
#define SIDES [west, east, independent, civilian]
#define SIDES_STR ["WEST", "EAST", "INDEPENDENT", "CIVILIAN"]
params [["_side", sideUnknown, [west]]];
SIDES_STR param [SIDES find _side, "SIDEUNKNOWN"] // return
};
There are some more, but this should be enough for what you're doing.
Jigsor, resistance is just an alias for independent.
Exactly the same thing.
The game can't tell the difference between those two.
Like west and blufor, and east and opfor.
Sure, every time I speak it's about the current version of A3 unless stated otherwise.
Ok same here.. reguarding A3- https://community.bistudio.com/wiki/Side
its not obsolete
incase you want to make your script for public and cover all bases
the commands are different but the return is the same, so it doesnt matter
It isn't, but it doesn't matter which one you use. I like west more than blufor, but independent more than resistance for whatever reason.
Just personal preference.
incase you want to make your script for public and cover all bases
That you don't need to do, because two commands are identical and the game can't tell the difference as I wrote.
resistance is shorter. lol
Example:
[west, blufor] find blufor // 0
resistance reminds me of EE.
"resistance is voltage per current" or however these things are labeled in English.
/giphy resistance is futile
: (
haha