#arma3_scripting
1 messages ยท Page 341 of 1
probably
tan is not with the hypotenuse. And that is 1.
yea youre right
So you'd need two cathetuses (sp?)
uhm im not sure how to translate that
Dunno either.
๐
๐
so asin(surfaceNormal _pos select 2)
... should work out without needing extra brackets right?
Yes.
select always makes me nervous in cases like this
select is fine. The problem is, that the binary + has a higher precedence than all other binary commands
So worry about +, not select.
also just reading up a bit, @pulsar anchor , ([0,0,0] vectorDistance _u) wouldt calculate ||_u||, that is, the length of _u. youd need vectorMagnitude
or does it
not sure, actually
Seems to be about the same ๐
ah right its the trivial case
It's the same, but unnecessarily complicated.
yes
just make a good drawing when dealing with vectors, always
makes it like 300 times easier
Any freelancing scripters looking for work?
Mb thanks my dude
^ tbh
I only ever use select for arrays etc nowadays
That came out wrong
Selecting by booleans, commands etc
Need your help here. I am working out some defines to use atomic operations on an object. Currently, I have this
#define READ (if (!isNil "object_all") then {waitUntil {isNil "object_all"}})
#define WRITE (object_all = true)
#define END_WRITE (object_all = nil)
where object_all is only used for this. The way this is used to write
READ;
WRITE;
write, read operation
END_WRITE;
and to read
READ;
read operation
Does this make sense?
Can you do code liek that with define ? Will that code work outside of .sqf?
I am using these in TFAR
#define MUTEX_INIT(name) name = false
#define MUTEX_LOCK(name) waitUntil {if (!name) exitWith {name = true; true};false;}
#define MUTEX_UNLOCK(name) name = false
What do you mean by "outside of .sqf" @peak plover
description/config.cpp
Can you execute SQF code in a config?
this is SQF only, so, do not worry about it ๐
No...
Soo.. The answer is?
@thick sage I can recommend using true/false instead of true/nil. Because the check for true might be a little faster (Never checked) and is more readable (which doesn't matter inside a macro)
@peak plover because it is used tons of times in my code, and I do not need to call a function for each of these.
Hmm, fair point. I've actually just made a function which is 2 lines and has a 10 line comment
Waste of kb, tbh
one of which is a params? ๐
๐
@still forum interesting. Well, I do use waitUntil within an if, which might be a bit faster than an if (never checked). But premature optimization in either cases IMO ๐
// lbSetCurSel triggers the LBSelChanged event. Sometimes we don't want that.
// This is a mutex to exit the eventhandler code.
#define LOCK GVAR(lock) = true
#define UNLOCK GVAR(lock) = nil
#define EXIT_LOCKED if (!isNil QGVAR(lock)) exitWith {}
Mine.
That is not a mutex though
Yeah. It's what I needed for my thing thou
well.. maybe a try_lock only mutex
How much is macro worth in sqf?
#350
in any case, thanks @still forum and @little eagle for your input, much appreciated!
My mutex looks a little weird with the if inside the waituntil. Now that I look at it.
But I hade a reason to build it like that some day.
probably to also do the assignment?
another question. Has anyone been able to implement a decorator in SQF. E.g. like in Python where you can just write
@bla
def get_x()
https://en.wikipedia.org/wiki/Decorator_pattern
Essentially, add a wrapper to a function whose input and output remain the same (but it does something different)
that looks way too high level for sqf
You'd do that with an if ๐
not really. For example, say you have the function X, and you want to implement a caching mechanism, where you store its result after the first call. In python, you define a function that sets up how you cache the result, and them use
@cache
def X():
...
cache is a reusable component for every function, and you have not changed the function's code to achive what you wanted. (an example)
yea not in sqf
you might be able to approximate parts of it in other ways
e.g. a global variable that can be computed by a function:
private _myVar = missionNamespace getVariable ["myGlobalVar",call fncThatReturnsMyGlobalVar];```
or something
This way you would always execute the function.
The array is evaluated before the getVariable.
ah of course. well some isNil parts after it, then
would defeat the whole point really
so i think the conclusion is no?
[_this] params [["_button",true,[true,false]]];
Why does this give me a script error (type array expected bool)
what is [_this]
Looks wrong.
also that accepted types array is uh wrong
Why use false and true as examples for valid types?
true and false are both bools
^
one's enough? will that conflict?
what?
it defines allowed my variable types, not allowed values. both true and false are booleans. but that probably wouldnt case the error
from
onButtonClick = "call menus_fnc_menusClose; false";
to
[_this] params [["_button",true,[true,false]]];
There is nothing before the call
why do [_this]
itll be [[nil]]
and [nil] isnt a boolean, its an array
maybe not nil but
without [_this]
type control expected boolean
Yes, you expect a boolean. For some reason you wrote two...
What are you trying to do?
well yea you only allowed boolean types
I want
onButtonClick = "call menus_fnc_menusClose; false";
toi default to true
That's a string?
uh, change the false to true?
Is that an issue?
The attached button action is performed. When returned value is true, button's display remains opened.
but I did not _this call menus_fnc_menusClose; false";
That has nothing to do with param or _this
_this sneaks it's way into call menus_fnc_menusClose; false";
The unary call does not overwrite the _this variable. It's carried over.
It's also not set to private.
setting it private will help? doesn't that just mean it can't go back?
like what do you actually want to do with the params bit?
it sounds like you dont want to use _this at all
[] call blah_fnc_blah
That's what I was trying to avoid
Why?
call {
private "_this";
call blah_fnc_blah;
};
The only alternative I can think of.
I thought private worked the other way around. It's fine I can use false/true
Thanks anyway
Still doesn't explain [true, false] as expected types. :/
I figured, [] means array so I just use true,false so they are both included 100%
That is not how it works.
You provide an example of a type
false and true are identical
@little eagle What was that? dialism? diathelism?
commy2 said Today at 10:23 PM
that's false cues inception noise
not in this contect
Well yeah they're both booleans.
dialetheism
_this = 0;
systemChat str ["A", _this];
_this call {
_this = 1;
};
systemChat str ["B", _this];
call {
_this = 2;
};
systemChat str ["C", _this];
call {
private _this = 3;
};
systemChat str ["D", _this];
0, 0, 2, 2
what??
@peak plover: that was also my reaction at first, but reading through it again - it makes sense.
It does
unary call != binary call
essentially
And while _this carries over into the scope of the unary call, it is not a magic variable there that is set to private automatically.
Guys, super interesting issue I am getting:
When I do
X setVariable["a", 1, True]
y = X getVariable["a", []]
sometimes y is different from 1
in dedicated
has anyone crossed this problem?
JIPs?
yes, and this is server side, called during init.sqf
What is x?
a LOGIC object
created via (createGroup sideLogic) createUnit ["LOGIC",[0, 0, 0] , [], 0, ""];
what is "y" if it is different?
The object or the setvariable might notve synched over network properly
notice that code runs on the same machine, the dedicated server
Repro?
I will try to provide a minimal code to repdocue the issue. was just to check if this ever happened to anyone.
interestingly, I cannot reproduce it with the same code in SP or non-dedicated MP, only in Dedicated.
Ohhh... I see..
Maybe it is not being set and it has to first sync back to itself ยฏ_(ใ)_/ยฏ
could just use a local variable and transmit that instead ๐
(and reuse after the setVariable)
I want to implement this dynamic blur effect for the spyglass in my mod (and animate it so it slides forward and back as you focus) -- any ideas how this is done? ( i pm'd him at arma forum but he doesnt seem to be active there anymore) https://www.youtube.com/watch?v=gJx0t-cHKTk
heh that's pretty cool
pretty neat
@desert sentinel it probably has something to do with https://community.bistudio.com/wiki/Post_process_effects#DynamicBlur
Question, I'm making a custom game for PvP, I've set up a trigger to set off an alarm after 5 minutes of OPFOR Present, how do I make it say "OPFOR is capturing (location name)" ?
same goes for Blufor\
Triggers fire their on activation code on all clients, so you can call a functiom from there, check the players side, and display the appropriate message
Would it make more sense to make two triggers? Seized by OPFOR, and Seized by BLUFOR?
How would I add check player sides and the message to display?
Thanks
Now just need to figure out how to change the marker colors when a different team takes them
if that's even possible
question
Why is the trigger not counting down 5 minutes?
It's set to countdown timer value 5 mins
if (side player == west) then ["<t color='#0000ff' size = '.8'>Warning!<br />Stop doing what you are doing</t>",-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText; if (side player == east) then ["<t color='#ff0000' size = '.8'>Warning!<br />Red has captured Warehouses</t>",-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText;
I'm also getting element erros
do I need to do a line break?
woop I should add that to condition
or should I put that in on activation?
for all you modders and scripters, Dev-Heaven is going down https://medium.com/withsix/shutting-down-dev-heaven-f8d59cbe1b28 . Which means to get Mikero's tools you have to find a different source. Maverick Applications has the free versions of Mikero's tools here https://armaservices.maverick-applications.com/Products/MikerosDosTools/ . Haven't verified to see if the links are not malicious but seems legit.
yea mikero sells through maverick so its safe. u can also get mikero support via the maverick support tickets.
Selling mods / scripts... HAHAH
๐ค
When has money ever moved scripts / modding ahead and benefitted the majority? It always causes more issues and trouble...
Anyway, I cannot find the control for text box (like debug console)
as in a text box in general or the one with the auto complete thing?
Just a normal one
well this is the debug console:
{
style = 16;
autocomplete = "scripting";
shadow = 0;
font = "EtelkaMonospacePro";
idc = 12284;
x = "0.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
y = "1.7 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "21 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "7 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx = "0.7 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};```
is that what u mean?
@peak plover, @empty harbor doesn't sell mods and scripts, he sells tools, and i think most people agree they're worth the money
@rancid ruin +1 good stuff from him
maverick applications sells altis life products (scripts)
Is it possible to create a module mid mission through scripts? or are modules an editor only thing?
seems like they're editor only, but you can find the functions a module uses with the function viewer, and then call those functions manually to produce similar results
np, hope it works out
@kindred lichen Yes
You can create moduels all the time
What are you trying to create?
_module = _group createUnit ["ModuleTimeMultiplier_F", [0,0,0],[],0.5,"NONE"];
_module setVariable ["TimeMultiplier", mission_time_accel];
``` there is probobly a command for whatever you are trying to do. as well there is a command to change time multiplier
modules are units? wut?
yea
wuuuuuuuuuut
What did you think? that they are made out of magic ? ๐
Well, I'm specifically trying to find a way to allow multiple zombie waypoints for the zombies and demons mod.,
That would confuse the zombies
currently the zeds go towards the last placed module in the editor.
Moving the module via SetPos doesn't seem to affect where they run to.
Hmm
So, looking at it in the config I think might be my best bet, I'm sure it just sets some kind of global variable on init that tells them where to go when idle, so If I open it up, and look maybe I can re-write that variablee.
[_zombie, _waypointPos] remoteExecCall ["fnc_RyanZombies_DoMoveLocalized"];
They also go and follow units
[WPObject] call RyanZM_fnc_rzfunctionwaypoint
Found that too. It'll make it so zombies go to that object by default
I'm guessing the waypoint modules are basically just
[this] call RyanZM_fnc_rzfunctionwaypoint;
That's exactly what I've been looking for for a LONG time
Z&D is not designed to work that way
been using this mod for like 3 years now.
And I can finally have the zombies "attack" different places during the same mission.
what kind of missions do you make with that mod @kindred lichen ? i was thinking about making a wave defense zombie killing mission like killing floor one day for a laugh
I usually make longer story missions.
are the zombies better than the ones from arma 2 dayz? they were the last ones i experienced
@rancid ruin I just posted in the video channel a video of us playing through one of my zombie missions
cool i will have a look
have a few others on my youtube channel as well
Chaps, the following
{side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 0)
works in an IF statement, however, does not in a waitUntil?
should work the same
assuming all variables are still defined (_mkr)
youre also missing a ( at the start in the copy paste above
I want to return all items of lb(listbox). Is it possible? can't find a command for it
I guess I have to create an array and save all items I add there myself
sigh alright, trying for a long time now:
I want to achieve this:
http://i.imgur.com/Ir0YtOa.png
or in the end
http://www.grabin.at/uploads/tx_imagecycle/November_01.jpg
I got this:
fnc_WineAttach = {
_pos = player modelToWorldVisual offset;
_pos set [2,0];
Obj setposATL _pos;
Obj setVectordir ([(surfaceNormal _pos),90] call BIS_fnc_rotateVector2D);
Obj setVectorup ((surfaceNormal _pos));
};
Obj = createSimpleObject["a3\structures_f_argo\industrial\agriculture\vineyardfence_01_f.p3d",[0,0,0]];
offset = [0,7,0];
["1","onEachFrame",{call fnc_WineAttach}] call BIS_fnc_addStackedEventHandler;
But vectordir and vectorup are influencing each other so the fence pitch bank and dir is not right.
With only one of those commands it works properly.
PS: Yes I know about setVectordirandup, but there is no difference.
PSS: Yes, I also know about missioneventhandler oneachframe ๐
can you explain a bit more what you actually want? align the vineyard fences along the slope?
yes
so you have solved the setVectorUp (which is surfaceNormal) but you need the vector that points along the slope?
(vectorDir)
because vectorDir should be (normal x [0,0,1]) x normal, where x is the vector cross product
Not sure. The problem is the combination of vectorUp and vectorDir. If I only use one of both it works (half).
I will try
private _vectorUp = surfaceNormal _pos;
private _vectorDir = (_vectorUp vectorCrossProduct [0,0,1]) vectorCrossProduct _vectorUp;
OBJECT setVectorDirAndUp [_vectorDir,_vectorUp];
the difficulty is it might sometimes point up the slope, instead of down the slope, so if that matters you need to do some extra checks
e.g.
if ((_vectorDir select 2) > 0) then {
_vectorDir = _vectorDir vectorMultiply -1;
};
So after testing one roatation around of the vulcano of Tanoa it seems to work ๐ big thanks.
np! read up on cross products if you dont understand the magic
Wow. You just answered what I was searching for TFAR for several weeks :D
I wish I had vectors in school..
you got vectors i got answers
@pulsar anchor you might get some bizzarro behaviour when the terrain is exactly flat, wont happen apart from the VR map tho, i guess
the following might be slightly faster if i did my cross products right:
private _vectorUp = surfaceNormal _pos;
_vectorUp params ["_nx","_ny","_nz"];
private _vectorDir = [-_nx*_nz, -_ny*_nz, _ny*_ny - _nx*_nx];
Hey guys, I'm working on adapting my chess mod to allow players to control the pieces using a hidden dialog, onButtonClick and worldToScreen / modelToWorld to map out the grid on the screen as per @little eagle 's suggestion.
https://youtu.be/-h1JPjRCePI?list=PLmCESSEABUXCf1fBRzGz5jByQobAiNc9W
I'm pretty sure there's probably a mathematical way to figure out in all directions where the user has clicked and thus get the correct square from all angles, that's why I'm asking anyone in here who's better at math than me.
The problem now is that it's all based on switch cases, each one dividing the square into half and thus narrowing down the location, third iteration gets the final square.
Integrating directions into this (comparing e.g. client direction vs chessboard direction) would result in a mess imo.
its possible but pretty math heavy
If you can get the on screen coordinates you can use screenToWorld to get the matching world position. Then you could do a lineIntersects to get the coordinates on the surface of the chess board and then deduce the field from that
Atleast I think lineIntersectSurfaces returns the relative coordinates of the board.. Might be wrong there
@indigo snow Yeah, that's what I thought, I'm not reakky that good at it, but if you could even point me in a direction I'd search further.
what dedmen said above it a good start to get coordinates w.r.t. the model
@still forum to use lineIntersectSurfaces, I would have to name all square selections, right?
you dont need selections since you get the ASL position of the intersect
you can translate those back to model coordinates
and go from there
Hmm, I'll give that a try. It'll surely be better than this mess of cases.
if you have the modelspace coordinate, you can move into a 2d system where you ignore the Z coordinate
and then its a question of strategically rounding the coordinates to get you results
You could also.. create a camera right above the chess field in the right orientation and move the players view into it
then you always have correct alignment
i like the 3d ness of it, tho
Well the camera doesn't have to be above
its not too hard just a bit of work figuring out the offsets
It just has to always be in the same location relative to the board
Then I'd still have to use the hacky way to integrate both directions.
the only issue is that screenToWorld is bad with sky background but that wouldnt be an issue in this case
for "_x" from 0 to 8 do {
_val = _x;
for "_x" from 0 to 8 do {
_entry = worldToScreen (_curTarget modelToWorld [(-_cornerVal+(_x*0.123)),(_cornerVal - (_val*0.123)),_heightPos]);
_positions pushBack _entry;
};
};
squint
^Is how I get all positions of each square, and works perfectly.
why is worldToScreen not highlighting as a command ๐ฎ
So you have a working way already... What did you need again?
This is based on the X/Y map
move into the modelspace of the board
so changing directions changes the X/Y map
I'm gonna give the suggestions a try anyway, thanks guys!
check out BIS_fnc_getIntersectionsUnderCursor
then grab the intersection with the chessboard, grab the ASL coord from that, worldToModel that into the modelspace of the chessboard
in the modelspace, just ignore the Z coord and you have correct x,y coords for the board
Hmm noted, am gonna try it all out anyway ๐
yea just noting that if you manage to move into the modelspace of the object, you dont have to worry about rotation at all anymore
What exactly do you mean by that?
the modelspace of the objects already corrects for rotation
Oh, yeah.
e.g. imagine the surface of the chessboard is just a XY graph
youll get those XY coords
Like, _positions should be the same every time, that's what you mean?
In the above piece of code I mean.
maybe, havent looked at the snippet too much
Because that's the case indeed, the problem is me trying to figure out where the user clicked.
Checking BIS_fnc_getIntersectionsUnderCursor
// BIS_fnc_getIntersectionsUnderCursor, Author: Nelson Duarte
params
[
["_mouseX", 0.0, [0.0]],
["_mouseY", 0.0, [0.0]],
["_ignoredObject1", objNull, [objNull]],
["_ignoredObject2", objNull, [objNull]],
["_sortMode", true, [true]],
["_maxResults", 1, [0]],
["_primaryLOD", "VIEW", [""]],
["_secondaryLOD", "FIRE", [""]]
];
private ["_locationStart", "_locationEnd"];
_locationStart = AGLToASL positionCameraToWorld [0,0,0];
_locationEnd = AGLToASL screenToWorld [_mouseX, _mouseY];
// Do collision test
lineIntersectsSurfaces [_locationStart, _locationEnd, _ignoredObject1, _ignoredObject2, _sortMode, _maxResults];
private ["_locationStart", "_locationEnd"];
_locationStart = AGLToASL positionCameraToWorld [0,0,0];
_locationEnd = AGLToASL screenToWorld [_mouseX, _mouseY];
Ahhh my eyes!! They burn!
Control setVariable reliable?
do you have issues with it?
I've never used it. Wouldn't the variables go missing once control is closed?
Probably. yes
since you generally either create or delete them, sure
sure
@still forum: it's a BIS function, what did you expect?
Perfection! I always expect that
its already got pretty params
I've learned a long time ago to only expect lazy code from BIS.
theres a very good chance this was written months before the keyword was introduced ๐
possibly years
i'm struggling to tune my vehicle's speed curve, is there a function/command to display current gear and/or rpm?
would remoteExec ["myFunction",player]; cause any traffic (i am player)
I want to do remoteExec ["myFnc", _unit], where the unit can be player itself
I'd guess no. But not sure
if I do remoteExec and the target is server. will clients get any traffic?
I'd guess no. But not sure. Would be really dumb though
I don't know how remotExec works
I assume it adds the info to a packet, but can packets be directed to somone specially. I feel like they will be sent to everyone and then checked if it is for them
Not sent to everyone then checked
can packets be directed to someone special?
I can go looking, but does anyone know how BI does the cutscenes where they disable controls but head movement and put the top/bottom borders on? (More interested in the disable stuff, other is easy)
You can have a client or object as target, @peak plover
@tough abyss, not sure but attachTo maybe?
Attach to invisible helper object
I'll have to open the campaign missions and see how they do it. I just want them to ride in a helicopter.
And not touch any of the buttons ๐
lock vehicle @tough abyss
Yeah, I'm just worried that If I do a bunch of remoteExec on all clients when it's unnessesary it's gonna cause network issues
I need a function that will remoteExec if not local
I probably need to function it because there's a lot that will use that
Just really wondering if that's worth it. I guess it could help not doing that all the time, and I reckon most of this traffic will be during postInit
It might cause problems there as there's plenty of data moving around that time anyway
I'd guess BI was so intelligent to make it so that local remoteExec doesn't go over network
I've been suprised both ways
Hey, anyone having issues with the text in-game being pushed down after the update with chinese language?
yes its a bug thatll be fixed
Any workarounds for the timebeing?
If you are a modder use a different font
Thanks!
what do you mean by local namespace ? _ variables?
yea
because I want to use a string to retrive the variable name
_local getVariable ['_loclvar',true];
impossible?
I think I can just use missionNamespace instead if it is
no you cant
okay. Hmmm
could use compile I guess
then you have no default value still
if isNil
im more wondering how the hell you might lose your local variables
But I think it might not work
if isNil "_var" then { _var = true}; ?
im 100% sure you can just make a better decision somewhere else and not run into this odd problem
[_var1, _var2, ...] params [["_var1",true] ,["_var2",true], ...] might be the most elegant way to solve this?
What would happen if I do name player on the srver?
player is nil
๐ฆ
I'll do a condition for if it's a server
Thanks
crap... new issue
nvm
i was complicating this remotexec stuff
Anyone have a tutorial or a more advanced documentation on RscControlsGroup? The official one lacks pretty much anything useful.
Hi, I was taking a look at doFsm wiki page, but I didn't understand how to format the command properly.. I was wondering how could I refer to a custom fsm using a path
same as everywhere else
"x/my_mod/some/path/to/something.fsm"
relative probably works as well
Weird,tried that and the fsm hasn't been loaded
From what I understand my controls should be inside the Control's Group. I positioned it at the bottom right of the screen, but my controls haven't moved. They're still in the top left.
What X and Y are you using for the controls inside the control group?
class menus_main_controlGroup: menus_template_group
{
idc = 4100; // Control identification (without it, the control won't be displayed)
x = GUI_GRID_X + (20 * GUI_GRID_W);
y = GUI_GRID_Y + (2 * GUI_GRID_H);
w = 19 * GUI_GRID_W;
h = 21 * GUI_GRID_H;
class controls
{
class menus_main_background: menus_template_background
{
idc = 4101;
x = 0 + (0 * GUI_CTRL_W);
y = 0 + (0 * GUI_CTRL_H);
w = 18 * GUI_CTRL_W;
h = 1 * GUI_CTRL_H;
text = "Mission Menu";
};
class menus_main_background2: menus_template_background
{
idc = 4102;
x = 0 + (0 * GUI_CTRL_W);
y = 0 + (1 * GUI_CTRL_H);
w = 18 * GUI_CTRL_W;
h = 20 * GUI_CTRL_H;
colorBackground[] = {0.3,0.3,0.3,1};
};
};
0 for both.
So, you move the control group around and the controls don't follow?
How did you create the controls inside the group?
Same way you did, in the controls {} class.
Can you post your code
sheep = createAgent ["Sheep_Random_F", position player, [], 0, "CAN_COLLIDE"];
sheep setVariable ["BIS_fnc_animalBehaviour_disable", true];
sheep doFSM ["test.fsm", position player, player];
What's wrong in this code? The fsm is not getting executed
doFSM tells the sheep to execute that FSM when it's done with it's current one I think
Which will be when it's dead probably
@tough abyss i'm trying to execute moveTo low level command,execfsm is not suitable
if I pass an argument (e.g. _this) with remoteExec, how would I address the object in the RC'd script?
[_this] remoteExec ["myfunc",_target];
you almost always would want to do _this remoteExec [...]
private _unit_menu_items = [_unit,"unit_menu_items",[]] call seed_fnc_getVarsTarget;
I hope this is correct ๐
its syntactically correct
@tough abyss it will be in _this.
tried sqf _object = _this; if (_object isKindOf "ModuleVehicleRespawnPositionWest_F") then { diag_log "A spawn point was placed!"; //respawn_insert = call Requiem_fnc_spawn_insert; } else { if (_object isKindOf _vehicle) then { diag_log "A vehicle was placed!"; } else { if (_object isKindOf _construction) then { diag_log "A construction was placed!"; }; }; }; nil but nothing appearing so I thought it didn't know what _this was
There will be no magic variable for it
Whats your remoteExecute line?
Replay fast and i wont comment on your indentation
_x addEventHandler ["CuratorObjectPlaced", { _this remoteExec ["Requiem_fnc_object_queue_insert", 2]; }];
you may comment whatever you wish to comment on
_this will be the array the EH provides
Its probably an array containing at least the object
ah so _object = _this select 0?
Look up the EH
Itll tell you
Also every instance of _this select n is surpassed by the params command
curator: object, entity: object
wouldn't the placed object also be an array with information about the object??
just for future scripting
It says its an object type in the eh description
Not an array containing other stuff
Besides you can get all that info from the object itself. Location etc
Thanks for the confirmation
okay so the information of the object can be retrieved from _object. Wouldn't that make it an array of information (technically)?
No
Its an object-type variable
There are commands that accept object-type variables and return information about that object
okay if I use getPos _object it'll grab the right object
not a similar one somewhere else on the map
Itll grab the position of the placed object since thats the one thats inside the variable
alright thanks for the confirmation ๐
that'd be rather intense for code review ๐
1 is type Number, 'a' is type String, etc
The curator module is always local to the same machine the assigned curator is, no?
@still forum so how one can use that command if the underlying fsm is not getting any priority?
It should be, commy
And Dardo, those commands arent exactly in very common usage, i wouldnt be surprised if theyre mostly unusable.
Dunno Never use FSMs
execFSM works for sure
Not broken, just not very fit for use. E.g. not being able to doFSM a new FSM before the current one ends.
Yeah but using execfsm moveTo command won't work
I mean its for state management, it certainly has its uses
Yes. But no.
From what ive read yes and no
it is unscheduled for statements and scheduled for conditions i think
it is executed before scheduled and counts to the 3ms scheduled time
It should still be scheduled
no it's not @jovial nebula
might be the other way around though. Not sure. But I don't think so
Damn, so if my FSM takes 3ms every frame, other scripts will never run?
I guess so..
Someone should try that
Though... I guess atleast one script is executed.. for atleast one instruction
Spawn lots of ai with danger.fsm active :P
or you can just Use vcom
in any case, I'm pretty skeptical of FSM ... SQF works fine for 99% of what people are using FSM for
this
I think something in the script is botching it up
diag_log everything
1 sqf loop that handles all the ai is so much better than fsm per ai squad/unit
how did that thing disappear
never mind
I swear to God I fixed that thing yesterday and it worked fine
Rip everything out, replace with diag_log, build back up
Enable the showscripterrors flag
Etc etc
if a curator places a respawn module, what module would that be? For intercepting purposes (determining the placed object was a respawn point)
I doubt my current tactic will actually work
hmmm alright
20:40:52 Error in expression <{ params ["_curator","_object"]; };
if (_object isKindOf "ModuleVehicleRespawnPo>
20:40:52 Error position: <_object isKindOf "ModuleVehicleRespawnPo>
20:40:52 Error Undefined variable in expression: _object```
with the _object defined as
_this call { params ["_curator","_object"]; };
//-------------------------------------- Class names of Vehicles
_vehicles = ["Air", "Armored", "Autonomous", "Car", "Ship", "Static", "Support"];
//-------------------------------------- Class names of Construction
_cup = [];
_signs = ["cwa_signs", "Signs"];
_other = ["Flag", "Fortification", "Furniture", "Garbage", "Helpers", "Intel", "Items", "Lamps", "Market", "MedicalBed", "Military", "Military_With_Side", "Objects", "Objects_Airport", "Objects_Sports", "Objects_VR",
"Ruins", "Shelters", "Small items", "Structures", "Structures_Airport", "Structures_Commercial", "Structures_Cultural", "Structures_Fences", "Structures_Industrial", "Structures_Infrastructure", "Structures_Military",
"Structures_Slums", "Structures_Sports", "Structures_Town", "Structures_Transport", "Structures_Village", "Structures_VR", "Structures_Walls", "Wreck", "Wreck_sub", "Wrecks"];
_construction = [_cup, _signs, _other];
_allowedobject = [_vehicles, _construction];
_this call { params ["_curator","_object"]; };
if (_object isKindOf "ModuleVehicleRespawnPositionWest_F") then
{
diag_log "A spawn point was placed!";
//respawn_insert = call Requiem_fnc_spawn_insert;
}
else {
if (_object isKindOf _vehicle) then {
diag_log "A vehicle was placed!";
}
else {
if (_object isKindOf _construction) then {
diag_log "A construction was placed!";
};
};
};
nil```
DUDE
WTF
You don't understand what a private variable means. And you have no Idea how params works
that's how the example on the wiki put it
Params works inside the curent scope, not like that
_this call { params ["_curator","_object"]; };
_this call {
params ["_var"];
You can use _var here
};
But not here
what would it be refererd to then outside the scope?
just move the params to the outside scope. Isntead of creating one for them
_this call { params ["_curator","_object"]; }; -> params ["_curator","_object"];
Youre in too deep a bit man, take a few small steps back
/* ----------------------------------------------------------------------------
Function: menus_fnc_ctrlHider
Description:
Toggles the controls on/off
Force hide/show possible with 2nd element
Parameters:
0: _display - Display which contains the contorls
1: _controls - Array of control idd-s
Returns:
nothing
Examples:
// 4105 will be forced hidden
[_display,[[4105,true],4106]] call menus_fnc_ctrlHider;
Author:
nigel
---------------------------------------------------------------------------- */
// Code begins
// Serialization must be disabled because controls / displays are saved as variables
disableSerialization;
_this params ["_display",["_ctrls",[]]];
correct
what about
/* ----------------------------------------------------------------------------
Function: menus_fnc_displayCloser
Description:
Closes the displays if they are open based on the idd
Parameters:
0: _displays - Array of display idd-s
Returns:
nothing
Examples:
[303000,304000] call menus_fnc_displayCloser;
Author:
nigel
---------------------------------------------------------------------------- */
// Code begins
// Serialization must be disabled because controls / displays are saved as variables
disableSerialization;
[_this] params [["_displays",[]]];
If that saves 2ms, then something is wrong
2ms is way to low.. I'd say 100 at least.
it's required becaues default value in this case
depending on how fast of a typer you are
Nice one!
๐ฉ !
10 server FPS increase
ofcourse!
You actually can't push the server FPS below 50 with scheduled scripts.
Yes iI can
maybe we have ArmA 4 by that time
I CAN
except if you do unscheduled stuff. Like configClasses call or similear
lineintersect / nearestTerrainObjects 24/7
@peak plover You need a single call that takes >10ms
lineIntersect won't do that. nearestTerrainObject might..
@tough abyss The anti scheduled thingy is not because of performance stuffz.
nearestTerrainObject took me a few seconds on malden with 5k distance. maybe it's faster on servers 'tho
If you need stuff to be executed now instead of in 10 minutes. then you need unscheduled.
yep
stuffz
Also don't wanna get into that debate now
I feel like they both are good and have their uses
I was anti waitUntil before, but I've changed to like while now
You should always choose the right tool for the job.
Exactly
If you need unscheduled then you do.
and true is a script command that get's executed everytime... Which is dumb
Good point
true/false really should be constants like numbers and strings
But if I would use _x from 0 to 1 step 0.
I would put an IF in so I could quit if need be
Just make a macro
LOOP {code}
Then no one will complain that the for loop looks ugly and takes up more space
What is LOOP?
as I said.. a macro
A macro for the for loop
define LOOP
@tough abyss , yes but that's same as evaluation while conditoon 'tho
Can you define me your LOOP
What's inside of it?
Or if you prefer while
#define LOOP while {true}
I have a weird issue. I have found all classes and put them in an array to check the type of object using sqf if ({_object isKindOf _x} count _vehicles > 0) then { diag_log "A vehicle was placed!"; }; but for vehicles it does nothing, for buildings it says a vehicle was placed
_vehicles = ["Air", "Armored", "Autonomous", "Car", "Ship", "Static", "Support"];```
Try manually into which class your building fits
sounds more like what's in _object isn't what you're expecting to be there
also Armored doesn't sound like a class that exists in CfgVehicles
Change diag_log "A vehicle was placed!"; to diag_log ["A vehicle was placed!",_object];
This sounds like the editor categories tbh
Question, which one is faster? count (array select {_x isEqualTo ""}) > 1 or {_x isEqualTo ""} count array > 1
@still forum since when does diag_log take an array ๐ฎ
diag_log takes ANY
Actually not needed
since ever
@halcyon crypt it can take anything
Then it will even be printed if its undefined
Woops, didn't scroll down
jeeezz all that wasted time on typing formats ๐
@rotund cypress The simpler one
The second one then? @still forum
The simpler and more readable one.
@indigo snow I used the CfgVehicleClasses in the config viewer and those came out of it
Which one do you mean?
Judge yourself
The most readable one I would say is count
without select
But that might just be me
@tough abyss yea those arent the right ones
@rotund cypress Trust your inner feelings
However I would think just count on its own is one command and not two commands so would be a faster operation
@indigo snow where should I be looking then to identify the objects?
RPT
The baseclasses in cfgVehicles itself @tough abyss
Oh okey
@tough abyss I told you a dozen times.
Place vehicle in Eden. Right click. View in config browser
Always used to use select without thinking about checking with count only
and check what the base classes are
also count was made for exactly that purpose
So thinking that using it for exactly what it was made for is a bad thing... Is not that... you know
I mean the "count array" variant
However one was without select and the other werent
@indigo snow parents: ["RHS_UH1Y_FFAR","RHS_UH1Y","RHS_UH1Y_US_base","RHS_UH1Y_base","RHS_UH1_Base","Heli_light_03_base_F","Helicopter_Base_F","Helicopter","Air","AllVehicles","All"]
Man it's hard to define what command exactly ๐
which one do I use
๐
I just need the difference between buildings and vehicle
check cnonfig browser for its category
If thats the only thing you might be better off checking its simulation type property
it might not be the same as armas default vehicle if mod
Buildings should all fall under the House class iirc
@tough abyss "Air"
well yea that's what I used
Or "AllVehicles" might work too
but it said it wasn't known in the _vehicles array
check a building to see what classes it has
ah I found why it classifies as vehicle
["House_F","House","HouseBase","NonStrategic","Building","Static","All"]
whereas I thought "Static" would be static weapons
They might be under static, too ;)
surprise surprise ["AT_01_base_F","StaticMGWeapon","StaticWeapon","LandVehicle","Land","AllVehicles","All"]
for the static AT
diag_logged all Vehicles, returned any
You misunderstood
He used it as command, dedmen
there would be multiple
Not as config entry
dedmen*
I'm sure he didn't do that again. He already did that and I told him that doesn't work.
You cant do diag_log allVehicles
I didn't xD
What then
See! No one can be that dumb
will use "Static" for buildings, for now
is it possible to insert a line break in a diag_log entry? Forgot the keyword for the kind of text to google it
endl ?
diag_log only accepts string like output, so no \n or <br/> afaik
that's very useful to extensive logging, thanks!
_old = [["eh","ayy","dude"],["eh","ayy","dude"]];
_new = _old select {_x pushback "lol";true}```
Will my _new have a "lol" in every element now?
We need a online debug console that can check expressions like that ๐
what about
_old = [["eh","ayy","dude"],["eh","ayy","dude"]];
_new = _old select {_x = ["eh","lol"];true};
Ohh yes pls
learn to apply
@peak plover no
Tbh, would be very possible @still forum
apply does what I think you're trying to do.
Would take a bit of time however
because you don't modify a reference. you overwrite the variable
The reference is a pointer inside the array tho
Ah i understand
You create a new copy
So it doesnt work
= is overwriting the variable inside _x. You want to modify it instead of overwriting
Ye my bad
_menu_items_current_new = _menu_items select {
private _item = _x;
_item params ["_itemName","_function",["_conditions",[{true},{false}]],["_admin",false]];
_conditions params [["_conditionDisplay",{true}],["_conditionRemove",{false}]];
// Call so we can exitWith
call {
// if condition to remove is true exitWith
if (call _conditionRemove) exitWith {
// If item is a mission item, remove it from mission items
if (_item in _mission_menu_items) then {
[[_itemName],[""]] call menus_fnc_removeItem;
};
// If item is player item remove it from player items
if (_item in _unit_menu_items) then {
[[_itemName],[player]] call menus_fnc_removeItem;
};
// exitWith false so it's not added back to the list
false
};
// if displaying condition is true
if (call _conditionDisplay) then {
// Check if item is already in item list (displayed) and exit if so
if (_item in _menu_items_current) exitWith {
true
};
// If _admin is true select adminlist, else mission list
private _addToList = [_list,_adminList] select _admin;
// Add the item to the chosen list
private _index = _addToList lbAdd _itemName;
// Set the data (function for dialog) for the item we just added
_addToList lbSetData [_index, _function];
_x pushback
} else { // if we are not to display the item
// if item is not currently displayed exitwith false so it's not added to the list
if !(_item in _menu_items_current) exitWith {false};
// Remove item from list
_control lbDelete
};
};
};
missionNamespace setVariable ["menu_items_current",_menu_items_current_new];
I'm stuck on what to return for _menu_items_current_new. it should be something along the lines of [["_itemName",_index]];
Apply looks nice
resize โค
hey all
does someone knows is there is kind of garbage collector for unreferenced arrays?
it is deleted as soon as the last reference is lost
nice, thanks
ok, its time to push some new releases)
have not launched arma for almost 6 months
Will there need to be a thing such as garbage collacter for scripts/variables/arrays?
No.
That's what I thought...
I ended up using resize 1 and pushback
private _existsArray = _menu_items_current select {(_x select 0) isEqualTo _itemName};
private _itemExists = [false,true] select (_exists isEqualTo []);
I feel like this is wrong 'tho
This line:
private _itemExists = [false,true] select (_exists isEqualTo []);
could be written as:
private _itemExists = _exists isEqualTo [];
Just realized it basically says if you're true, return true ๐
overthinking that one there
Yeah. It's a rare form of that oh so common. if () then {true} else {false}.
I'm trying to script a trigger to countdown 5 minutes, activate saying "(East/West) has captured (Zone)"
I've gotten this far
if (side player == west) then ["<t color='#0000ff' size = '.8'>Warning!<br />Blue Team has captured Warehouses</t>",-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText;
if (side player == east) then ["<t color='#ff0000' size = '.8'>Warning!<br />Red has captured Warehouses</t>",-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText;
Do I put this in activation or Condition?
well better yet because i realized theres a fuckin sector control module, how do I make blufor AI pop up and defend the zone?
And also add a respawn position to it
there is an aI module in the same editor category as the sector module
Ok
cause I'm doing show / hide object modify
what category was it?
Theres only sector, sector dummy, respawn position, vehicle position
actually
other - > Spawn AI : Sector Tactic
don't sync it, it'll automatically index the AI and have them attack the sectors
ah thanks
Is there a way of setting custom spawns to it?
I'm making an Arma 3 version of halo warzone, so when the zone gets captured by Blue team, blue marines spawn, etc for Red team
Ah cool. Yes your Spawn AI module does just that
You can select the faction
What I was attempting with the show / hide was the blue team guys show when BLUFOR capture
but that didn't work out
hiding the sector or the units? I don't think show / hide would work with units but I could be wrong
Theres also no faction for the unit's I'm using, well they're made with OPTRE units arsenaled with their respective gear
I recommend you spawn them in script. the ai module for sector control will still work
bis_fnc_spawnGroup works vey nicely with such
you can set the direction, skill range, rank range, etc.
Let's see how much I fuck that up lol.
There are plenty of these AI spawn scripts
Oh no, definitely not.
Ok
are you familiar with making sqf files?
Basically I want Blue team to spawn with blue team, red team with red team, and yes I am
Easy enough, just grab a respawn markers position where you want it, and based on respawn tickets you can do something like this:
if(count ([west] call bis_fnc_respawnTickets) > 0) then {
for "X" from 0 to random 10 do {{_x doMove (getPos sector_1);} forEach units([getMarkerPos "respawn_west",WEST,5] call bis_fnc_spawnGroup; };
};
Not sure if that works or not
but it's worth a shot
Ok
I wouldn't want to use the ticket system
only reason why is because the AI are there just to guard
so if it's a 2 v 2 fight, theres AI to fight back and defend a capture position
It's kind of cool to see the three factions fight it out
where in that script do I put the cfgGroups
Well this is the goal: Independent control the areas first
the CfgGroups contains config entries. I was reffering to the usage of bis_fnc_spawnGroup with it
I didn't set tickets because I want game match to be all sectors controlled
either blue team or red team capture once green team is taken out
then the respective AI take over to defend against the opposite team
So a one time capture?
That's easily done, just destroy the module when you're done with it
so it's a pretty big area
indeed
lol cfgGroups isn't in the config viewer. Tolda ya I'd fuck it up quick
Yes it is....?
Ah got it
that's a CfgVehicles entry. The CfgGroups covers a certain squad size and unit collection
Could I create my own cfgGroup?
unless of course you're manually creating these units and adding them to a group, which seems a little redundant if you are going to have a similarly sized squad as it is
CfgGroups are all config entries
to create a group however
createGroup
createGroup east; createGroup west; etc.
Ok lets go find this!
welp
Theres no CFGgroup for the Warzone red or Warzone Blue guys
I can't find the createGroup area. Least I'm learning how to do so
Ok, where do I put that command?
I got the name for the independents at least, they aren't a arsenaled unit
ok
Incorrect syntax hold on
Blue_group = createGroup west;
[myHaloDude] joinSilent _group
Ok so it's Blue_group now, how do I designate the AI to be Blue)group
[dirtyblues] joinBlue_group = createGroup west;
That's in the Sqf
What do I put in the inits of the AI?
Here. Letme construct a working example for you here.
ok
params["_unit"];
[_unit] joinSilent (createGroup(side _unit));
Then in the units init
[this] call compile "yourScriptName.sqf"
ok
I got the top one in the sqf
the bottom one is going into the units Init now
the _unit will be the group name yes?
well the otherside of the _unit
like DirtyBlues_unit
Nope, _unit references the passed unit in the script when it is called
Hence when you pass the unit in the units init with the this reference in [this] call compile "script.sqf"
ok
In the spawn ai module they are automatically assigned groups
Not sure which method you are trying to use here
ok
I got this going:
SpawnAI : Spawnpoint
SpawnAI : Sector Tactic
and a Spawn AI
How would I make that new group spawn when BLUFOR capture the area
@coarse olive you can get the side from a sector and check when the side capture changes. Sector getVariable "owner"
ok
I'll tackle it tomorrow with a clear head. I got mixed up with everything
thanks though!
@peak plover I say that everything is deleted once the last reference is lost as a reply to "is there some kind of garbage collector". And the next message after that is you asking if we need a garbage collector..
It's
call compile preprocessFileLineNumbers "script.sqf"
You missed the preprocessFileLineNumbers.
or could just use execVM
;^)
slight surprise here, the even handler CuratorObjectPlaced passes a curator and entity perfectly fine, but the CuratorObjectDeleted passes <NULL-object>
for the entity
On the server?
yea
It doesn't
It passes the object. But when the message arrives it was already deleted
ah shit.. any way to save the object somewhere so it can be used even after it's been deleted?
which would need to be client side
hmm that would require the event handler to be assigned to the object when it is created, if I am reading this correctly
some time after creation and before getting deleted
would this succeed in that? sqf { _x addEventHandler ["CuratorObjectPlaced", { _this remoteExec ["Requiem_fnc_object_queue_insert", 2]; _this addEventHandler ["Deleted", { _this remoteExec ["Requiem_fnc_object_queue_delete", 2]; }];};]; _x addEventHandler ["CuratorObjectEdited", { _this remoteExec ["Requiem_fnc_object_queue_update", 2]; }]; _x addEventHandler ["CuratorMarkerPlaced", { _this remoteExec ["Requiem_fnc_marker_queue_insert", 2]; _this addEventHandler ["Deleted", { _this remoteExec ["Requiem_fnc_marker_queue_delete", 2]; }];};]; _x addEventHandler ["CuratorMarkerEdited", { _this remoteExec ["Requiem_fnc_marker_queue_update", 2]; }]; } forEach AllCurators; diag_log "Curators initiated";
(in init.sqf)
Dude
Did you miss what we were trying to solve?
The problem was that after the CuratorObjectDeleted eventhandler remoteExecs on the server, the object was already deleted. So your solution is to
Add the Deleted eventhandler that when it remoteExecs on the server, the object was already deleted.
doesn't it do that just before the object is deleted?
You apparently didn't understand the problem
CuratorObjectDeleted also executes before the object is deleted
hmm okay thanks
so I could add to the curator event handler a client side script to grab the data and then send that to server? IIRC Exile has no data acquisition situated on the client mod?
Or you register the Deleted eventhandler on the server. As I recommended before
And yes you could also grab the data clientside and send it to the server. Which I also recommended
the deleted event handler would work server side? IIRC the curator version already didn't fire server side
but I'll see if it works out ๐
have you checked the wiki? it tells you
It is something completly different.
okay so as global, it can be deleted client and handler fired server. How would one add the event handler to the specific object or write a script that adds it to every object in the mission?
throws ๐ช around the room
@tough abyss You already have a script get executed as soon as a object is placed
the event handler I meant, not remoteExec
I said "You already have a script get executed as soon as a object is placed"
and in there I should apply the event handler?
ยฏ_(ใ)_/ยฏ
How does one do that stick figure? (mobile)
./shrug
Oeehhhh thanks
so in that insert EH I extract the object. To that object I assign the event handler. Do I use call for the delete script or paste the delete script code into the event handler scope??
(currently trying out a call)
which.... didn't work
tried direct with code
params ["_curator","_object"];
//-------------------------------------- Assign deletion event handler
_object addEventHandler ["Deleted", { diag_log ["Object was deleted: ", _object]; }];```
with results ```sqf
14:00:44 ["The vehicle ",25159a6a040# 638423: cup_m270.p3d,"was placed!"]
14:00:45 ["Object was deleted: ",any]```
so the object was already deleted when executing the code
or doesn't know what the object was
w00t.
must be confusing something
inside the eventhandler it should still exist... The eventhandler fires just before object was deleted.. atleast it should
yea that's what I thought
but _object is not null either
you need to extract that from the passed _this first
params does that, doesn't it?
oooh inside the EH okay
yea that code executes in its own separate scope
now would it possible to call a functio before the _object is deleted? Instead of full code inside an event handler scope
you can call a function from inside there?
EHs are unscheduled so you have as long as youd like
okay must've done something wrong in the function itself then
just wacth out with things that execute scheduled or are remoteExecuted
not using RC, as it's all happening server anyway ๐
_object addEventHandler ["Deleted", { params ["_curator","_object"]; diag_log ["Object was deleted: ", _object]; }];```
still yields ```sqf
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]
14:13:39 ["Object was deleted: ",any]```
or use it as sqf _this call { params ["_curator","_object"]; };
DUDE
READ
Why would _this inside a Deleted eh contain a _curator ?
Right. No reason and it doesn't.
eh yea forgot it's not curator related
I'm hungry
You're not you when you're hungry.
nibbles on the cookie
Any idea why after I hide a control (such as a listbox) with ctrlEnable and ctrlShow, and then re-enable it, I cant click on the lists anymore as though its still disabled?
^ to add on to this, RscEdit seems to work fine again but the list boxes and structured text with controls group doesnt work
Is this your control or someone else's? Im pretty sure unless the command is broken or you are using incorrect syntax everything should be fine.
@subtle ore Its my own. Basically ive got a few buttons at the top, which can be used to switch between different menus. And im using a method of just hiding and disabling controls to show different ones, but this is the issue im having.
This is how i'm re-enabling them:
private _toShow = [1501,1502,1401,1100,1101,2300,2301,1801,1802,1803,1804];
{
private _control = _dialog displayCtrl _x;
_control ctrlEnable true;
_control ctrlShow true;
} forEach _toShow;
Is _dialog defined?
Yes. It makes the controls visible completely fine. Like the visibility stuff works fine, the only issue is I cant actually interact with some of the controls
Which makes me wonder if they are ever re enabled in the first place
They definitely are. I can show the full code if it makes it easier to spot the issue
If you feel it is necessary, sure.
This script is called when these top buttons are clicked. Currently it just has 2 buttons, one to show the main menu controls, the other for the logs control.
@subtle ore Found the issue. Turns out it was the RscFrames I had around the other controls that was causing issue. Sounds like some sort of focus issue. I guess ill have to remove the frames, even know I wanted frames around the list boxes ๐ฆ
hi, i was wondering if anyone could help me with an issue im having with object placement. Im making a multiplayer mission where i want players to be able to place charges down and then later using an action, blow it up.
Currently i am using remoteExec to run this on the server ```sqf
_index = _c4 pushBack ("DemoCharge_Remote_Ammo_Scripted" createVehicle _objPos);
(_c4 select _index) setPosASL _objPos;
why remoteExec createVehicle and setPosASL?
do all that on the server and then if you need others to access the array, use publicVariable
Yeah, createVehicle is global, and setPosASL has a global effect too
ok, so the player needs to call the function because i want it so they have control over when it is placed.
yeah, that wat i thought ranger, but for some reason, it works for one person yet the charge is in a complety different affect for everyone else
Well id start off by not remoteExecuting it, and see if you still have the issue, let us know if you do
that's the way i had it initally, but then i thought maybe running it on the server may help
pretty much i had the same code, but run locally on the client pc
That should be all you need to do, run it locally on the client
Hey all, is there any way to hide a task's destination? Say I have it so the task shows up when you're within 1km of the objective. How would I get it to disappear when you're outside of the 1km? Obviously I'd use a trigger for that, but I'm not sure on the task destination removal thing.
@warm gorge ok ranger thanks, maybe it is an issue with position formating then (ASL to ATL or whatever)
What format is _objPos?
@spice kayak what about this https://community.bistudio.com/wiki/BIS_fnc_taskSetAlwaysVisible
That would just disable the fading
@limpid pewter When working with positions and making them work nicely over water and land, I like to use ASLToATL so like
_vehicle setPosATL (ASLToATL (getPosASL player));
``` for example
yeah maybe, i shall try. But i still don't understand why i works fine for the person who placed it, but for everyone else it is floating like 5 meters in the air :\
Trial and Error i guess ๐
Not sure, id also create the vehicle at [0,0,0] and then set its position rather than both. Faster if you spawn it at [0,0,0] as if you dont it does all this funky positioning stuff
_index = _c4 pushBack ("DemoCharge_Remote_Ammo_Scripted" createVehicle [0,0,0]);
(_c4 select _index) setPosASL _objPos;
ahh awesome, great tip
Sorry, @digital pulsar - I had figured out my issue, but got stuck into another one - thanks though!
Got it!
I see the onLBDblClick event returns the IDC and Data of the double clicked entry. I'm trying to create a dialog on double click and call a script that'll update the list in said dialog. How can I send the return of the onLBDblClick to my next dialog?
onLBDblClick = { createDialog ""phone_messages"" };
"phone_messages" needs to somehow receive the return of onLBDblClick.
Pretty sure a dialog alone can't take the return
Is this config? Why the curly brackets? Looks suspiciously wrong.
Yeah that's in a HPP. When I create my new dialog (without using closeDialog on the previous one) can I still access the data in a list that was in the first dialog even if I can't see it?
It's wrong whether or not it's used in a hpp.
So, sadly I've hit a wall again, with an issue that I really don't think should be an issue.
Anyone mind if I put the multi-lined code here? I'm just having issues getting a Task Destination Module to go somewhere via an sqf file, but it just isn't, no matter what I try.
Well, I hope so!
while{alive vSmuggleTruck1} do {
if (triggerActivated trkSmuggleTruck1) then {
systemchat "Something!";
modTrack1Pos setPos (getPos vSmuggleTruck1); //This is not working
vTrack1 = "Detected!";
} else {
systemChat "Nothing!";
vTrack1 = "Not Detected!";
};
sleep 60;
vTrackTimer = 60;
};
};```