#arma3_scripting
1 messages · Page 517 of 1
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
if(canSuspend) then
{
offsetKeypress = 0;
waitUntil{!isNull (findDisplay 46)};
(findDisplay 46) displayAddEventHandler["KeyDown",
{
params["_display","_key","_shift","_ctrl","_alt"];
_obj = attachedObjects player # 0;
if(_shift) then
{
if(player call maas_fnc_isDragging) then
{
if(_key == DIK_EQUALS) then
{
_obj setDir (getDir _obj - getDir player - 10);
true
};
if(_key == DIK_MINUS) then
{
_obj setDir (getDir _obj - getDir player + 10);
true
};
};
};
if(_ctrl) then
{
if(player call maas_fnc_isDragging) then
{
_box = (attachedObjects player) # 0;
_pos = getPosASL player vectorAdd(getPosASL _box vectorDiff getPosASL player);
if(_key == DIK_EQUALS) then
{
offSetKeyPress = offSetKeyPress + 1;
detach _obj;
_obj attachTo[player,[0,2,offSetKeyPress],"Spine3"];
};
if(_key == DIK_MINUS) then
{
offSetKeyPress = offSetKeyPress - 1;
detach _obj;
_obj attachTo[player,[0,2,offsetKeyPress],"Spine3"];
};
};
};
false
}];
};
probably dont need to detach it first, though i dont imagine it making much difference.
Likely. Let me see
That's kind of janky the object is attached, fixed, there is no other way you can change its position. You need to use attachTo again. You don’t need to detach it though.
Doesn't make it any less janky 😛
It does, you attach it to new offset. If you detach it in between then yeah, but if you don’t you are simply adjusting offset
Yep.
Hey guys! I need to do a synced countdown. I guess that making the server calculate and publicVariable the current time to the players is the way to go, isn’t it?
The players would execute a script to display the time on screen but wouldn’t do any calculation
why not publicvariable the end time and everyone can count to it on their own?
counting isnt too hard 😃
Yeah, that’s what I’m currently doing but not all the players have the same time. I believe that’s because not everyone executes the counting at the same time?
Ike not everyone’s finish loading at the same time
wouldnt matter if the end time is synced. eg serverTime.
so on the server you would do
missionNameSpace setVariable ["myEndCountdownTick",serverTime + 60,true];
then clients would do something like
private _tick = missionNameSpace getvariable ["myEndCountdownTick",serverTime];
private _string = [_tick - serverTime,"MM:SS"] call BIS_fnc_secondsToString;
// display _string somehow
and that way everyone has a synced countdown, no matter when they started
obviously that client snippet would be in aloop until the countdown is done but u see what im going for
I see, thank you!
When does server time start counting? As soon as the mission starts or when the server is initialized?
Returns the time since last server restart
Thank you, I’m gonna try this approach
You can set https://community.bistudio.com/wiki/estimatedTimeLeft and read it with https://community.bistudio.com/wiki/estimatedEndServerTime
yes, I believe you guys got me into the right path. I'll try to make it work and come back if I get stuck again. Thank you 😃
[[],PlayerPlayCutStart] remoteExec ["spawn",allplayers];
This is a curscene, it does not play to all players, some times one or two playes do not see the cutscene, I dont know why this unreliability happens.
Also, this is on a dedicated server.
So, allplayers is unreliable?
if ur having issues then evidently yes it is.
-2 is the “right” way to target everyone but the server anyway
When you pass object as target like player for example, it will look for owner of the pc where object is local. But player joining the server is created on the server first before transferring ownership to user’s pc. So it is not that allplayers is unreliable it is this approach is. Why not do it the right way like Connor suggested, why reinvent the wheel?
So I know what is going on and avoid to do the same type of mistake depending on my next script.
Fair enough
is it possible forcibly making player's head turn to look at a position. Like enable free look and make player look at a position. All using scripts
@thorn saffron you can workaround by spawning a camera, switch view to it and turn it (if its about the view only)
no, I wanted to script a way for player to follow the locked on target when in the plane, like you have in almost all of the normal flight sims. New camera would not do as it would either be janky or the MFD HUD wouldn't work
I'm observing that setPos does not work globally (i.e., called from server) on units inside a vehicle. Does that make sense to anyone?
I can get it to work if setPos is called locally, but API docs claim this is global. Just wanted to see if anyone else has seen this. Thanks
Sorry this is on dedicated server
units inside a vehicle?
They are in a vehicle. You have to get them out first
setting position might be global yes. But the moving out of vehicle part might not be
I am having some "fun" with getSuppression at the moment. I appreciate that it doesn't work with remote units but I also have a bunch of warnings about troops that are local and are still returning null for the call. Other than ensuring it isn't a player/HC and that it is local what else am I missing? It isn't just a blip either happens throughout the entire mission.
And I am removing dudes that are dead too.
I'm thinking about AI driving, particularly in regards to convoys and would like to try and work out the state of the art as it currently is. I have been doing some research, trying vanilla convoy, devas' script, looking at how ALiVE implemented them, looking at VCOM driving AI (doesn't seem better than the AI, worse in a lot of cases, and too many can openers anyway).
The main problems I have noted with vanilla convoy are:
- some vehicles will just stop (a nudge script is fixing these a lot of the time after a while)
- obstacles can cause vehicles to take different routes from each other (not great for convoy aesthetics)
- bridges, sometimes vehicles will mess them up, sometimes not (nudge helps here)
- speed: need to limit it to an arbitrary low number to keep the convoy together (35kph is working okay)
I had an idea for using setDriveOnPath to try and force better cohesion and pathing. Has it been done? I'm thinking one could sample the lead vehicles position and then feed it into setDriveOnPath for follow vehicles to get good cohesion, then constantly update speed limit like devas' script attempts to do. Also I think one could generate hierarchical nav graph from roads and use A* + setDriveOnPath, plus some real time adjustment using look-ahead down the route to avoid collisions. Anyone have any thoughts or experience with this?
Do anyone know how to force to close ACE arsenal?
close the display
How?
What is hes code?
"How do find which display" you're gonna ask now.
https://community.bistudio.com/wiki/findDisplay
"But how to know what IDD" you're gonna ask then.
https://github.com/acemod/ACE3/blob/master/addons/arsenal/defines.hpp#L11
@ebon ridge No relevant experience to offer but that all sounds very sensible. Big fan of the idea of doing offline indexing of map data (i.e. road nodes) to save on in-game scripting (ideally a fallback script would always be available for maps which haven't been indexed).
@cursive whale Yeah I guess it is going to be slow to generate that graph!
no that was not a reference
this addAction["Firing position 6 Targets","popup.sqf",[[tar1_13,tar2_13,tar1_14,tar2_14,tar1_15,tar2_15], 0,1,true]];
this doesnt work in a dedicated server, how should i chance it?
How are we supposed to know why if we don't know what popup.sqf contains?
im just asking how i add that action so it works globally
i didnt realize you need to know the contents of the script
No, this refers to the unit in your inot field. Not all players
so will just replacing this with "player" work?
This action is already added globally if you put it in unit init
@still forum I assume this is to keep locality in check? Same args and everything?
I remember there was a way to set the source of damage to a specific player (FE: Create a scripted explosion that gives a "player x killed player x message"). Can anyone point me towards the method for that?
setShotParents probably
_BruceWayne setShotParents true;
@high marsh what talkin bout
scripts in init field are executed for each player
I'm not sure why this is the case.
Because this is how init works
but whhyyy.
because u fuq
oh.
don't ask such stopid question
I have worse questions to ask dedmen. Trust me.
do it then
where are all the zombies
🤔
Because you want unit to be inited the same everywhere on every client
Yes, that's what I was saying
not sure if this is the right place here, but i'll try anyway... with "cutrsc ["RscMissionEnd","plain"];" i'm showing the "mission completed" text on screen... is there anyway for me to edit said text "on the fly" / viascript?
or do i have to create a new rsc?
I would say no that rsc is not made dynamic
so yes you would have to create something that for example could read some dynamic value
well if i have to create my own rsc, then i don't have to make it dynamic. i just thought about reusing the existing one
tried putting that stuff in description.ext already, but then i'm getting problems with inheriting, which is quite annoying
I dont think you can just plop it down like that
you have to understand how it works
yes, that's the problem :p
i find it hard to find good info about it, because i'm not even sure what exactly i'm looking for
you have hard time finding info about them because not much is written about it
not written or is written?
this rsc stuff is so annoying
how the hell do i inherit from that. i'm sure it was possible to do in description.ext?
throws me error about missing duration, which ofc is not there.. but shouldn't it take it from the top class?
whats so special about that particular screen that you want to use it?
perhaps you must recreate it from scratch
that's it -- i don't want to recreate it from scratch :p
quite often in Arma,what you want and what you must do, do not mix
i want the mission end effect without actually ending the mission. i figured the easiest way to do would be to just rip the effect out of the function and do my own crap with it. turns out it isn't as easy as i thought.. as always
so far that has always been the case I've noticed
i mean, ripping the effect out is easy, but now replacing the text... ugh
but that reminds me of something
we can adjust the text via cfgdebriefing
so what if i go that far.. and then just cut out the mission end part of the script
i will try this
it won't end like that
and i can use a different "ending"
i mean, even right now you can define like.. 10 different endings and then chose from them
got a question, is it possible to make an attached unit rotate freely?
without the unit being in a turret or sth. just attach it to the vehicle and it turns and fires as normal.
I'm trying to have some events kick off when players attempt to open a locked door on a shack. The variable "shack" refers to the building in question.
inGameUISetEventHandler ["Action", ' _target = _this select 0; if (_target == shack) then { hint "locked..."; remoteExec ["shackActions",0,true]; } '];
This code works perfectly. The "shackActions" function gets called when someone tries to open the door, but does not get called for any other actions anybody does to any other object that isn't the shack, which is great. My problem is this; while it all works perfectly, players still get this error when using the door:
'|#| _target = _this select 0; if (_ta...' Error Type String, expected Bool
Any ideas on what's going on here? I've been beating my head against cryptic message for too long...
the action function is meant to return a bool i think. all the wiki examples do.
true blocks the action, false lets it run.
urs says its a string because remoteexec returns a string
inGameUISetEventHandler ["Action", '
_target = _this select 0;
if (_target == shack) then {
hint "locked...";
remoteExec ["shackActions",0,true];
};
false
'];
try false on the end like this
If EH function returns true, performed action is overridden.
Ah, I'll give it a go. I always forget about sqf's returning the last value ><
yep, that solved it. Thanks @robust hollow !
Side question, not so urgent since I am now working 100%.... I tried replacing _target = _this select 0; with params [_target];, but that failed because instead of being the target of the action, _target was set to "any". Any clue why that would be? It was just confusing me all the more...
ur using _target in the params array before _target is set.
you want: params ["_target"];
< thanks again, clearly I have not had enough coffee.
I am missing an example. How do i get the vehicles AND positions with inAreaArray? Currently i detect only the vehicles with this:
_landVehGar = vehicles inAreaArray landGarage select {_x isKindOf "LandVehicle"};
_landVehGar = vehicles inAreaArray landGarage select {_x isKindOf "LandVehicle"} apply {[_x,getPosASL _x]};
would be neat if that example would be on/in the wiki page @robust hollow and thanks for the help
it isnt really an example for inAreaArray. inAreaArray returns an array and/or position depending on what you give it, this is more an example on how to use apply.
oh. Yeah, but it states "and/or" in inAreaArray. Which implies for me i can geet both informations at the same time. Else i would get only one thing, which then must be "get positons or types/things in area"
Righty?
[player,getpos otherPlayer] inareaarray "somewhere"; // returns [player object, position of other player] (assuming they are both in the area)
it will return an object if you gave it an object to check, it will return a position if you gave it a position to check.
So, actually i can achieve the same result with apply and inareaarray?
you can achieve the result you're after with apply, yes.
Let me see if i write it correctly with the wikihelp
<sighs> i cant get it which i do use {} or [] or ()....
_landVehicleArray = [vehicles, positions] inAreaArray landGarage select {isKindOf "LandVehicle"};
the snippet i posted is what u want?? returns the vehicles that are in the area, selects the land vehicles and then puts them in an array with their position.
Yes, with the apply. But if you tell me it works the same as with inAreaArray only too, i want, of course, to work it out with that (as well). I am learning it all, and knowing as much as possible is key to everything, i guess.
checking a vehicle and then its position with inAreaArray is completely pointless. the vehicle is in the area, the position will be too but no sense in checking both because it is a waste of time.
Now i have different informations. Can i get both position and vehicles that are kindOf within the one line command or not? Am i forced to use apply?
the information is the same. if you give inAreaArray a list of objects and positions it will return the objects and positions that are in the area. You don't need to use apply however if you want to do it all in one line apply is what I'd recommend.
But does it work as well with "isKindOf" because i get an empty variable if i use my current version line of code.
I am highly unsure where to put () [] {} because everytime i script something its completely different, it seems, when i use different commands and/or functions.
test = [vehicles, positions] inAreaArray landGarage select {_x isKindOf "LandVehicle"};
try this one and see what happens
https://discordapp.com/channels/105462288051380224/105462984087728128/547176117660811274
It works like a charm but it does not solve the thing i want to know.
If something is possible with A and B, but i learn only B, how am i supposed to come up with a solution if B does not work sometime?
I am highly unsure where to put () [] {} because everytime i script something its completely different
[] and {} depend on the command, the wiki will tell you how to use them. () is for grouping statements. what else do u want to know?
I suggest you use entities command with type filter and plug resulting array into inareaarray
Doesnt help really. The main problem is that there is no full tutorial on scripting. If i am lucky i find the correct snipped somehow somewhere. But most explanations on the wiki are very rudimentary and often only with 1 thing/object in mind.
Every tutorial starts from scratch and end after a couple of videos -.-
I mean i got everything to work so far ^^ but its horrible the way i have to do it.
there is no full tutorial because how you use commands depends on what you're trying to achieve. the wiki tells you how to use them and anything you're unsure of you can ask.
Yeah, but i ask a lot and can work with the help here. But, i thought i could learn with the wiki and tutorials without annyoing people all the freaking time about every little thing like "Did i write this correct? Why is this not working"
I think i made a little progress in learning but a basic introduction to most things would be a good thing. Because with a better example than most on wiki are helping me more (most thing i learned from someone, not the wiki)
this channel is made for people to ask Did i write this correct? Why is this not working
Yeh, but i have the feeling i wont learn much if i get presented the solution. Sure, i go throught he solution and figure out why it works... But i came here an awful lot. I am feeling that somehow people could think like "You should already know this already ... tzk"
Everyone went through that, sqf has steep learning curve
Welcome to SQF
@tough abyss its an exponential learning curve. first 2 days you Learn a ton, after that you learn less and less and it gets frustrating fast lol
Any clue where im going wrong here?
waitUntil {sleep2; {alive _x}count _targets==0};```
Giving me an error saying missing ; have tried it multiple different ways but still returns the error
however when I have done it a different script it works
waitUntil {sleep 2; _targets findIf {alive _x} == -1};``` ?
Cant hurt to try it
Nope same thing
Its the line above thats causing the error I believe, I just dont know what it is
should send the error message
It is states the error is
waitUntil...'
Error Missing ;```
is that the exact error in the rpt? i feel like there would be more to it 🤔
The only other thing thats on the error message is the file directory for the SQF
whats the line before _targets
and Error Line 25
obj7 = player createSimpleTask ["Qualify on the Rifle Range"];
// Give Weapons and Move to Range
titleCut ["", "BLACK OUT", 1];
sleep 2;
removeAllWeapons player;
player addWeapon "UK3CB_BAF_NLAW_Launcher";
player addAction ["Get NLAW","NLAWRe.sqf"];
player setPos (getPos NLAWpos);
player setDir 210;
titleCut ["", "BLACK IN", 2];
sleep 2;
hint "Setting up the Range";
sleep 2;
hint "Prepare to Fire";
sleep 5;
hint "Use the NLAW To Distroy All The Armoured Targets";
sleep 4;
hint "Use the scope and find your target, press T to get the correct range before firing"
_targets=[NLAW1, NLAW2, NLAW3];
waitUntil {sleep1; {alive _x}count _targets==-1};
NLAWIns sideRadio "nice";
["TaskSucceeded",["","Qualify on the NLAW Range"]] call BIS_fnc_showNotification;
obj7 setTaskState "SUCCEEDED";
else {sniperINS sideRadio "testfail"; hint "You Failed the test. See the NLAW Range Master to try again.";};
nopop=FALSE;
// Remove Weapons
titleCut ["", "BLACK OUT", 1];
sleep 2;
removeAllWeapons player;
player removeAction ["Get NLAW","NLAWRe.sqf"];
titleCut ["", "BLACK IN", 2];```
Thats the Entire script
hint "Use the scope and find your target, press T to get the correct range before firing" // <-- no semicolon
_targets=[NLAW1, NLAW2, NLAW3];
waitUntil {sleep1; {alive _x}count _targets==-1};
// ^^ sleep1 will error
so remove sleep 1?
no you just add a space between sleep and 1
that count wont be true either because the lowest it can be is 0
Ah thought I had changed that back
also you have
else {sniperINS sideRadio "testfail";
but none of this is in an if statement so else makes no sense?
not that u need an if to use else but the point is thats not used correctly anyway
What would you suggest to change that?
what is it supposed to do?
also side note, ur using removeAction wrong at the bottom
So if the 3 Targets are destroyed, within a certain time it completes the task, if the 3 targets aren't destroyed it plays the other message
is this more what you're after?
https://gist.github.com/ConnorAU/3154f846fa3465f21ae4f2b1227752ff
take note of:
L9 - addAction index is assigned to variable so it can be removed later
L24-30 - waituntil waits until all targets are dead OR the time has run out
L32-39 - if statement doing what it needs to depending on if the targets are dead
L47 - action index variable is used to remove the action from L9
Looks like it might be, Ill give it a test in the morning 😃
Thanks for all your help
i am having a hard time finding something on the net that tells me how to spawn an ai mortar team in. i know how to make them fire just not how to spawn in the unit with script. can anyone help?
createGroup, createUnit ?
then moveInTurret
wait, or just do this
https://community.bistudio.com/wiki/createVehicleCrew
omg im dumb. thank you so much. @astral dawn
can somebody do a simple script modification for me?
depends what this modification is
@robust hollow change this revive script to allow revives with a medkit or first aid kit
only allows first aid kits rn
quick question, whats the best way of using ctrl create when allowing the dialog to be moved with movingEnable = 1;
(ctrlPosition _control) params ["_this_x", "_this_y"];
(missionNamespace getVariable ["lega_xphone_originalPosition", []]) params ["_original_background_x", "_original_background_y"];
(ctrlPosition (XPHONECTRL(1))) params ["_background_x", "_background_y"];
private _positions = [];
[
[_background_x, _original_background_x],
[_background_y, _original_background_y]
] apply {
_x params [
"_current", "_original"
];
diag_log _x;
private _difference = 0;
if !(_current isEqualTo _original) then {
_difference = _original - _current;
diag_log _difference;
};
_positions pushBack _difference;
};
if !(_positions isEqualTo []) then {
_control ctrlSetPosition [
(_this_x - (_positions select 0)),
(_this_y - (_positions select 1))
];
};
``` is what I have come up with, and seems to work, just whether there is a way without this little workaround
General Question here, but is it possible to set the position of a module through a scripting command?
module is logic it normally doesn't matter where it is at. You can set position like with any other unit, but what for?
2 questions here, How would I assign an objective with a notification through scripts?
Hint "My Objective.";
and also how would I be able to get a script to check if a player has gone through a trigger zone, Trying to do a Timed shoothouse style thing, I figure that diag_ticktime is the best way for it
Wouldnt that just give a hint? rather than using something like call BIS_fnc_showNotification that actually shows the propper notification?
Yeah i believe that would be a better way.
for the easier ways use 2 poles, start and end combined with while, ^ shoothouse
[west,["task2"],["Good luck finding this cookie","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate
``` from https://community.bistudio.com/wiki/BIS_fnc_taskCreate
The thing I have with this is the objectives or tasks rather are defined somewhere else as simple tasks somewhere else, its just assigning them that happens in the seperate scripts
I didnt understand any of that, but ok
Okay for example. the tasks are set up like this in the Briefing
Obj0 setSimpleTaskDescription["Task Description"];
Obj0 setSimpleTaskDestination (getMarkerPos "TASK1");
player setCurrentTask Obj0; ```
that repeats from Tasks 0 - 7 and at each task theres a seperate script
that they complete whatever task it is, and at the end of the script it says
player setCurrentTask Obj1;
Or whatever the correct number is for the next task, Now this works completely fine, it assigns the next task like it needs to
But I would like it to play the task assigned notification
Because I wasnt sure how to if im honest, it works for the completed tasks, I have used it for the completed tasks
obj1 setTaskState "SUCCEEDED";}
player setCurrentTask Obj2;```
But I dont know how to call the notification for the last line there
Would it be like ["TaskSucceeded",["","TASK NAME"]] call BIS_fnc_showNotification; obj1 setTaskState "SUCCEEDED";} player setCurrentTask Obj2; ["TaskAssigned",["","TASK NAME 2"]] call BIS_fnc_showNotification;
I thought that it was pretty clear from tasks framework page:
[west,["task2"],["Good luck finding this cookie","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate ;
["task2","CANCELED", true] call BIS_fnc_taskSetState;
shows notification when you change state
But if you are hellbent on using BIS_fnc_showNotification then sorry, can't help
alright, Thanks anyway
Hi guys. I have a question regarding mass on vehicles thats killed. In my case, I dont wanna use a wreck model, but performing some death animation when its killed. The vehicle seems to loose its mass when killed, because I can walk straight through it afterwards. I've also tried using setMass.
Is there a way around this? I'd like to avoid spawning some external object to create collision
PM: collision works for physX objects, but not for infantry
I got to the bottom of my getSuppression question which is basically why is it null for an AI unit. Turns out that units spawned in after mission start with scripting (not Zeus) return null until such time as they are shot at. So null is a normal return and to be expected as part of the functions (undocumented) signature currently. Might be a useful note on the community wiki because it is a bit of a gotcha. It is also potentially a bug.
@nocturne basalt it is not mass, it is likely that simulation is disabled in it
the functions (undocumented) signature huh?
So if unit is not supressed the return value of suppression is 0? What is wrong with it and why it needs to be documented? @tough abyss
A unit that is there at the beginning of the mission or spawned with Zeus will have an initial value of 0 and then vary 0-1 as expected. A unit spawned via scripting will have an initial value of null and once shot at will then vary from 0-1 as expected.
null you mean the command returns nothing as in nil?
Yep. According to the docs it should only do that on players. I suspected it might also do that on remote units as well but I just changed around to make it always local.
@tough abyss what do you mean simulation is disabled? does its simulation change once its killed somehow?
some objects after they got killed get their simulation disabled immediately or after some time, and become walk through
ah I c. maybe it has to do with saving resources.
I mean really the collision is responsible for walk through, but when engine disables simulation it normally includes collision too
hm yeah.. ordinary wrecks have collision, but they are simpler objects arent they...
hmmm any suggestion what I have to do here?
depends, you could spawn wrecks that are normal objects
worlks with PhysX
oh damn. seems I have to specify the object it can collide with. I would ofc let it collide with everything
Yeah just tested on the fallen fence, you need to replace it with simpleobject nothing works
hmm. well... at least physX collision and fire geometry works
can still use it as cover
Hello!
Hey guys, so I really wanna learn scripting, I've spent a few hours reading up on the wiki during quiet times at work 😛
For me to learn it, it would be writing the script and doing it within the editor. My question is, what is simple to make, but a good one in order to learn scripting, good practices and stuff
Any one knows if i can insert a Radar into a control in a dialog?
you can probably move original dialog if you can get reference but it most likely engine driven so probably no
what is simple to make start with making a script that throws all players on the server 100 meters up and then kills them
the world is your oyster
Ok, gonna give it a whirl! Thank you
A short question: I'm currently using
addMissionEventHandler ["EntityKilled", { [_this] remoteExec ["d_fnc_someFunction", 2]; }];
in my mission. But somehow, when I try to get the sides of the returned killer or the killed entity, its always read as "CIV".
(When I try a hint side player in the debug console ingame, it shows "WEST", the eventhandler will always return "CIV" for everything)
If doing the same thing with a "Killed" eventhandler on the same killed units, the sides are returned correctly.
Am I missing something here?
try getting the side of the killers group
im not sure why that would happen, but getting the group side instead seems to work for people.
[_this] remoteExec ["d_fnc_someFunction", 2]; why??? Use if (isServer) then {[_this] spawn d_fnc_someFunction}; instead
or if you add missionEH on the server only you dont even need to do that, just straight execution
Yes, you are absolutely right, thats how it was before I fiddled with my code for the last 2 hours trying to find the problem. And @robust hollow just fixed it for me. Thank you so much! ❤
Sometimes its just the little kinks in the scripting language of Arma ^^
Any suggestions on how to detect if briefing is over for a player in SP?
Player moves out of the briefing room which is inside a trigger?
as soon as thisList = 0 you know the player is done.
I was referring to the briefing map before the mission starts. Analogous to getClientState, but that doesn't work for SP.
Something like getClientState == "BRIEFING READ" but for SP
There might be a slicker version around but maybe a waituntil with a mix of ‚alive player‘ / ‚!isnull findDisplay 46 and ‚visiblemap‘
How can you check the terrain at a certain position, like how ACE's E-tools only let you build trenches on dirt?
How can I find the "script_component.hpp" on there? I don't want to be reliant on ACE
you go into the folder and open script_component.hpp?
Didn't see it
you do now though?
oh in the Functions folder ok
I'm trying to get the nearest Chemlight when dropped, and then delete it, but when I do
nearestObject [player,"Chemlight_green"]; it keeps returning <NULL-object>
dropped as in thrown or moved from inventory to ground?
inventory to ground
that wont work then because moving items to the ground puts them in a GroundWeaponHolder
Ohhh yeah, so I have to search the GroundWeaponHolder?
why not use the Put event to remove the item from the container?
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Put
I'm using the Put event already but couldn't figure out how to delete that specific item
I'm using the code you helped me with for a different thing the other day
_value = "Chemlight_green";//_this select 0;
{
_x addEventHandler ["Put", format["['%1',getPos(_this#0), _this select 2, _this select 0] execVM 'placeSeed.sqf';",_value]];
} forEach allPlayers;
wait, can I just delete the GroundWeaponHolder itself/
yea, but if there are any other items in the container they will be deleted too
Yeah, that's sort of a problem
I guess I can just delete that type of item, it's a placeholder anyway
it may be the way you have to go, i assumed there was a removeItemCargo command but apparently not 😦
Know how I could freeze a player in place while they do an animation? I found disableUserInput but I'm sure that's not local right?
attach them to another object. ambientAnim uses a game logic for that.
disableUserInput is local
ambientAnimation doesn't work on players does it?
idk, my point is it creates a game logic on the unit's position and attaches the unit to it so they dont move around. atleast i think thats why 🤷
no. Cannot be used to create objects of type "Logic", use createUnit command for that.
Used one of those invisible helipads because why not
Alright, I have a bunch of plants growing. Every X seconds the objects swap to the next growth phase model or whatever. Are a bunch of waitUntil {time > time + growthcycle }; going to destroy a server?
I figured it would be better to have the server check every X minutes/hours whatever and do the growth cycle on the appropriate plants
Trying to figure out the best way to do this
a few shouldnt hurt, though assuming growthcycle is always the same number, that waituntil will never be true.
it's not the same number, there are like 3 or 4 stages of growthcycle
concept works in single player just fine, I'm wondering how to make it viable for an Exile server or something like that
What I have is the plants run a script that has those waitUntils to swap the objects for the next one
To clarify a touch, unless growthcycle is negative that will never exit
_startGrowingTime = time;
_growthPeriod = 30;
_growCycle1 = _startGrowingTime + _growthPeriod;
_growCycle2 = _growCycle1 + _growthPeriod;
_growCycle3 = _growCycle2 + _growthPeriod;
_growCycle4 = _growCycle3 + _growthPeriod;
waitUntil {time > _growCycle1};
``` seems to be working
yea, thats not what the original snippet showed 😦
That’s not what you posted before
Oh my bad lol
Anyway, how horrible would it be to have like 100 instances of these plants growing on a server?
Is there a more efficient way to do it?
as in a hundred different spawns? would not advise that.
Yeah, I'm shooting for the worst case scenario
The script is just createVehicle then delete the old object repeated a few times per seed planted
you could store ur plants in an array with some other info like [[plant,next update time,current phase],[plant,next update time,current phase]] and cycle through that every so often. that way u only have one spawn
Like just one array for the whole server?
yea
if ur using cba you could use the perframe handler to wait x seconds before going to the next phase in the cycle
I'm not using CBA yet but no reason not to
is that better than doing waitUntils?
I'm assuming waitUntils run every second or frame
its unscheduled so if you like unscheduled scripts then yea its better.
waituntil runs on almost every frame
yeesh
depends how slow ur game is running
Oh, so they're low priority then?
thats the case for any spawned script though.
as in if you have 1000 spawned scripts and are playing on 5 fps its very likely some scripts could go a few frames without resuming.
Hello all, was looking to get all terrain objects of a specific type within a radius around the player and give them an addaction. Code with example would be greatly appretiated.
Right
this explains a bit more https://community.bistudio.com/wiki/Scheduler#Scheduled_Environment
@sudden yacht pretty sure you cant use addAction on terrain objects. next best scripted alternative might be to add the action to the player with a condition checking the target type or model.
@robust hollow how would i best use that with say nearest building command?
@tough abyss also read this if you're interested
https://ace3mod.com/wiki/development/arma-3-scheduler-and-our-practices.html
@robust hollow i can never seem to get the ace setdamage command to work correctly.
well i'd recommend reading the function to see what you're doing wrong. i have never used ace so am not familiar with how it works.
I'm a little unsure of how to set this up to iterate through every different plant's cycle
params ["_growthFactor"];
_growPos = getPos _seed;
_startGrowingTime = time;
_growthPeriod = 30 * _growthFactor;
_growCycle1 = _startGrowingTime + _growthPeriod;
_growCycle2 = _growCycle1 + _growthPeriod;
_growCycle3 = _growCycle2 + _growthPeriod;
_growCycle4 = _growCycle3 + _growthPeriod;
growing = true;
while {growing} do {
//_thisPlantArray = [_typedropped, _seedPos, currentgrowthcycle;
{
switch (_x select 0) do {
_objectArray = [];
//set plants to spawn for different seeds
case "Chemlight_green": {_objectArray = ["Land_Can_Rusty_F","Land_BakedBeans_F","Land_Can_Rusty_F","Land_FlowerPot_01_Flower_F"]; };
};
} forEach AllPlantedItems;
};
AllPlantedItems is an array of _thisPlantArray = [_typedropped, _seedPos, currentgrowthcycle];
you need a sleep in that while loop, also if this is mean to be for exile you should tag your variables to avoid conflicts with other mods.
This is the original way:
waitUntil {time > _growCycle1};
deleteVehicle _seed;
_seed = "Land_Can_Rusty_F" createVehicle _growPos;
_seed setPos _growPos;
just add a sleep X in there?
yea. if its a system where new seeds can be planted at any time then you will want a short sleep.
Right makes sense
But how do I orchestrate the individual growth cycles? It seems like if I use waitUntil, they're all going to wait for each other, or is that incorrect?
tag_growing = true;
while {tag_growing} do {
{
_x params ["_type","_pos","_tick","_stage"];
if (diag_tickTime >= _tick) then {
_x set [3,_stage + 1];
// do stuff
_x set [2,diag_tickTime + (5*_stage)]; // some value based off the growing _stage
// if this item is finished the last stage
if (_stage == 5) then {
tag_growingPlants set [_forEachIndex,0];
};
};
} forEach tag_growingPlants;
tag_growingPlants = tag_growingPlants - [0]; // delete completed elements
uisleep 1;
};
i mean something like this so you can perform actions for individual seeds based off their growing stage. you would have a separate function to add new seeds to the array.
you dont have to use that setup exactly, but thats the concept
Here's what I came up before I saw that ^
FARMAgrowing = true;
while {FARMAgrowing} do {
sleep 15 * _growthFactor; //set higher for servers
//_thisPlantArray = [_typedropped, _seedPos, currentgrowthcycle, timePlanted;
{
_growCycle = [_this select 3, _this select 3 + _growthPeriod, _this select 3 + (_growthPeriod * 2),_this select 3 + (_growthPeriod * 3),_this select 3 + (_growthPeriod * 4) ];
//set plants to spawn for different seeds
switch (_x select 0) do {
_objectArray = [];
case "Chemlight_green": {_objectArray = ["Land_Can_Rusty_F","Land_BakedBeans_F","Land_Can_Rusty_F","Land_FlowerPot_01_Flower_F"]; };
};
//cycle growth
_currentGrowthCycle = _x select 2;
if (_currentGrowthCycle == 4) exitWith {};
waitUntil {time > (_currentGrowthCycle select _X + 1};
deleteVehicle _x;
_currentGrowthCycle createVehicle _x select 1;
_x set [_x select 0, _x select 1, _x select 2 + 1, _x select 3];
} forEach AllPlantedItems;
};
yea, try again using my snippet because that will not work how you want it to
no, as you see in my example, it defines when the next stage should execute so you dont suspend your loop with waitUntil
So the only variables that need to be passed are the type and position then?
yea. your add function would really only need to be
tag_growingPlants pushback [_type,_pos,diag_tickTime,0];
If I'm packaging this as a mod, where do I want to store the big array of planted things?
somewhere in the mod?
Getting |#| createVehicle - 4 elements provided, 3 expected on this
AllPlantedItems = [];
publicVariable "AllPlantedItems";
params ["_growthFactor"];
_growthPeriod = 30 * _growthFactor;
FARMAgrowing = true;
while {FARMAgrowing} do {
{
_x params ["_type","_pos","_tick","_stage"];
if (diag_tickTime >= _tick) then {
_x set [3,_stage + 1];
_objectArray = [];
switch (_x select 0) do {
case "Chemlight_green": {_objectArray = ["Land_Can_Rusty_F","Land_BakedBeans_F","Land_Can_Rusty_F","Land_FlowerPot_01_Flower_F"]; };
};
deleteVehicle nearestObject [_pos,_objectArray select _stage];
(_objectArray select _stage) createVehicle _x select 1;
_x set [2,diag_tickTime + (_growthFactor * _stage)]; // some value based off the growing _stage
// if this item is finished the last stage
if (_stage == 5) then {
AllPlantedItems set [_forEachIndex,0];
};
};
} forEach AllPlantedItems;
AllPlantedItems = AllPlantedItems - [0]; // delete completed elements
uisleep 1;
};
I did notice my deleteVehicle should be select -1
tried this?
(_objectArray select _stage) createVehicle (_x select 1);
_x has 4 elements so that error would suggests its reading that line like this:
((_objectArray select _stage) createVehicle _x) select 1;
or better still, using the _pos var set in params
I'm getting "array, expected number" on _stage I believe:
deleteVehicle nearestObject [_pos,_objectArray select _stage];
(_objectArray select _stage + 1) createVehicle (_pos);
show complete error from logs
deleteVehicle nearestObject [_pos,_objectArray select >
1:21:27 Error position: <nearestObject [_pos,_objectArray select >
1:21:27 Error Type Array, expected Number
1:21:27 File C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\missions\_FARMA3.Malden\FARMA\plantGrow.sqf, line 22
1:21:32 Error in expression <ehicle nearestObject [_pos,_objectArray select _stage];
(_objectArray select _st>
1:21:32 Error position: <select _stage];
(_objectArray select _st>
1:21:32 Error Zero divisor
1:21:32 File C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\missions\_FARMA3.Malden\FARMA\plantGrow.sqf, line 22
Is it because _stage is never initially set to 0 or something?
if ur adding to the array like i showed you then it should be set to 0
deleteVehicle nearestObject wat?
Wait, no I set it to 0
Ah. I understand. Parenthesis would make it more readable
AllPlantedItems pushback [_typedropped,_seedPos,diag_tickTime,0];
So what's the deal then?
I have 4 objects in that array, plus the initial object (outside of the array)
_stage is selecting the 5th index (4) then ?
or true, could be the empty array
that middle section should be something more like this
private _objectArray = switch _type do {
case "Chemlight_green": {["Land_Can_Rusty_F","Land_BakedBeans_F","Land_Can_Rusty_F","Land_FlowerPot_01_Flower_F"]};
default {[]};
};
if (count _objectArray > 0) then {
deleteVehicle nearestObject[_pos,_objectArray select _stage];
private _nextObject = _objectArray param [_stage + 1,""];
if (_nextObject != "") then {
_nextObject createVehicle _pos;
};
};
_seed = ["Chemlight_green"];
...
if !(_typedropped in _seed) exitWith {};
...
AllPlantedItems pushback [_typedropped,_seedPos,diag_tickTime,0];
publicVariable "AllPlantedItems";
...
_objectArray = [];
switch (_x select 0) do {
case "Chemlight_green": {_objectArray = ["Land_Can_Rusty_F","Land_BakedBeans_F","Land_Can_Rusty_F","Land_FlowerPot_01_Flower_F"]; };
still giving me errors on line 22 delete nearestObject
1:34:17 Error in expression < _objectArray > 0) then {
deleteVehicle nearestObject[_pos,_objectArray select _>
1:34:17 Error position: <nearestObject[_pos,_objectArray select _>
1:34:17 Error Type Array, expected Number
1:34:17 File C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\missions\_FARMA3.Malden\FARMA\plantGrow.sqf, line 22
1:34:21 Error in expression <Vehicle nearestObject[_pos,_objectArray select _stage];
private _nextObject = _o>
1:34:21 Error position: <select _stage];
private _nextObject = _o>
1:34:21 Error Zero divisor
1:34:21 File C:\Users\Owner\Documents\Arma 3 - Other Profiles\Axebeard\missions\_FARMA3.Malden\FARMA\plantGrow.sqf, line 22
if (count _objectArray > 0) then {
private _currentObject = _objectArray param [_stage,""];
if (_currentObject != "") then {
deleteVehicle nearestObject[_pos,_currentObject];
private _nextObject = _objectArray param [_stage + 1,""];
if (_nextObject != "") then {
_nextObject createVehicle _pos;
};
};
};
🤷
@tough abyss https://community.bistudio.com/wiki/nearestObject
nearestObject takes [position:array, type:string] ?
yes?
he has the syntax fine, just selecting an index higher than the array length
what's the line to log a specific variable?
diag_log _variable;
Figure out the issue, the _stage is looping instantly basically
you probably want the initial stage to be -1 then
that didn't help
_x params ["_type","_pos","_tick","_stage"];
if (diag_tickTime >= _tick) then {
I think _tick needs to be _GrowthTime or whatever
the name of it doesnt matter. it just marks the time when the seed moves onto the next stage
it's just the initial time
hmm?
when planting the seed:
AllPlantedItems pushback [_typedropped,_seedPos,diag_tickTime,0];
yea. it is then updated at the end of every stage with the new tick for the next stage
I'm not seeing where that happens in there
AllPlantedItems = [];
publicVariable "AllPlantedItems";
//params ["_growthFactor"];
_growthFactor = 1;
_growthPeriod = 30 * _growthFactor;
FARMAgrowing = true;
while {FARMAgrowing} do {
{
_x params ["_type","_pos","_tick","_stage"];
if (diag_tickTime >= _tick) then {
_x set [3,_stage + 1];
private _objectArray = switch _type do {
case "Chemlight_green": {["Land_Can_Rusty_F","Land_BakedBeans_F","Land_Can_Rusty_F","Land_FlowerPot_01_Flower_F"]};
default {[]};
};
diag_log format ["%1 %2 %3 %4", _type, _pos, _tick, _stage];
if (count _objectArray > 0) then {
deleteVehicle nearestObject[_pos,(_objectArray select _stage)];
private _nextObject = _objectArray param [_stage + 1,""];
if (_nextObject != "") then {
_nextObject createVehicle _pos;
};
};
_x set [2,diag_tickTime + (_growthPeriod * _stage)]; // some value based off the growing _stage
// if this item is finished the last stage
if (_stage == 5) then {
AllPlantedItems set [_forEachIndex,0];
};
};
} forEach AllPlantedItems;
AllPlantedItems = AllPlantedItems - [0]; // delete completed elements
publicVariable "AllPlantedItems";
uisleep 1;
};
_x set [2,diag_tickTime + (_growthPeriod * _stage)];
I'm only see _tick once in there though
you will want to increase the sleep if you're broadcasting that array
yea, _tick is _x select 2.
Oh ok
it sets 2 for the next loop
Okay, so no errors, it's going through the stages but not changing the Vehicles
no deleting or creating
wait, why would I want to use diag_tickTime rather than time for this?
use whichever you prefer. i use diag_tickTime out of habit.
When simulation is interrupted, time freezes, but not diag_tickTime.
can I just swap diag_tickTime with time?
yea
this is the page that quote comes from
https://community.bistudio.com/wiki/sleep_vs_uiSleep
if you setAccTime 0 in the game, simulation is paused. uiSleep makes sure "IRL time" happened
Yeah, I don't want things happening while the game is paused...
speaking of which, swapping diag_tickTime with time seems to never update or something
@sudden yacht this question was already asked here and I gave code example, just look through the posts if you can be bothered
Is there any way to run a keydown eventhandler in the arma 3 main menu using a addon?
Add it to the menu display or control whichever works
I tried that but it doesn't seem to work
How did you try?
Did you use "onKeyDown"?
i used KeyDown
Lemmie try
thank you
anyone know if it's possible to address the commandbar (squad ai icons) as a GUI/IGUI control? been enumerating various displays and controls but starting to think it must be an 'engine special'
There are script command to duplicate its functionality @cursive whale
should've said, i'd like to be able to toggle its visibility
Tried showHUD?
hah, lol, so easy, thanks
@lean estuary works, not sure why you have problems
@tough abyss Can you give me your exact code if you dont mind please.
finddisplay 0 displayAddEventHandler ["keydown", {diag_log "works"; false}]
waitUntil{!isNull findDisplay 0};
?
there is no such thing like an event being triggered when a marker inner area is being entered by a unit eh?
trigger only
what about inArea?
hey, i want to make an selectable automated message p to p for life server, new to sc and open to any source and help, thx!
"selectable" ?
"list it to select"?
you can imagine it like an ordinary pm system but it'll just send auto message to selected person. i thought i was open enough 😄
i'm done with gui, just stuck in this part. maybe it's too easy for you guys but im a beginner and tryn' learn
@high marsh inArea might work but I had to recheck at every frame for markers while triggers have their own event callbacks
No? Why tf would you have to check every frame?
a while loop wouldn't even be every frame.
@signal swallow make function that will display a message when you call it with message as argument. remoteExec this function from sender’s computer passing receiver as target
listbox with allPlayers?
@frigid raven This would have little impact:
0 spawn
{
while{alive player} do
{
if(player inArea "MKR_ONE") then
{
/*
Code
*/
};
sleep 5;
};
};
Plus, triggers are ugly. 😃
....you don't need the precision of every frame.
Still I feel better if this code would run every 5sec rather then in a while loop
Addd suspension!
Plus, triggers are ugly Triggers are beautiful and your code will just eat CPU for no reason
Triggers are the ugly step child.
clogging scheduler with while true loops is the sign of noobness
Is there something obvious I'm missing here?
AllPlantedItems = [];
publicVariable "AllPlantedItems";
defaultPlantObject = "Land_Ketchup_01_F";
publicVariable "defaultPlantObject";
//params ["_growthFactor"];
_growthFactor = 1;
_growthPeriod = 10 * _growthFactor;
FARMAgrowing = true;
while {FARMAgrowing} do {
{
_x params ["_type","_pos","_tick","_stage"];
if (time >= _tick) then {
_x set [3,_stage + 1];
private _objectArray = switch _type do {
case "Chemlight_green": {["Land_Can_Rusty_F","Land_BakedBeans_F","Land_TinContainer_F","Land_FlowerPot_01_Flower_F"]};
default {[]};
};
diag_log format ["Growing %1 %2 %3 %4", _type, _pos, _tick, _stage];
if ((count _objectArray > 0) && (_stage > 0)) then {
_toDel = defaultPlantObject;
switch (_stage) do {
case 1: {_toDel = defaultPlantObject;};
case 2: {_toDel = _objectArray select 0;};
case 3: {_toDel = _objectArray select 1;};
case 4: {_toDel = _objectArray select 2;};
};
deleteVehicle nearestObject[_pos,_toDel];
private _nextObject = _objectArray param [_stage -1,""];
diag_log format ["replacing %1 with %2", _toDel, _nextObject];
_obj = _nextObject createVehicle _pos;
_obj setPos _pos;
if (_stage == 4) then {AllPlantedItems set [_forEachIndex,0];};
};
_x set [2, (time + _growthPeriod)]; // the next plant update
};
} forEach AllPlantedItems;
AllPlantedItems = AllPlantedItems - [0]; // delete completed elements
publicVariable "AllPlantedItems";
sleep 1;
};
Some of these things are getting the same _tick somehow
13:35:15 "Planting Chemlight_green [3075.15,6796.75,0] 14.956 0"
13:35:19 "Planting Chemlight_green [3075.15,6796.75,0] 25.338 1"
13:35:19 "replacing Land_Ketchup_01_F with Land_Can_Rusty_F"
13:35:19 "Planting Chemlight_green [3075.15,6796.75,0] 25.338 2"
13:35:19 "replacing Land_Can_Rusty_F with Land_BakedBeans_F"
13:35:24 "Planting Chemlight_green [3075.15,6796.75,0] 35.571 3"
13:35:24 "replacing Land_BakedBeans_F with Land_TinContainer_F"
13:35:24 "Planting Chemlight_green [3075.15,6796.75,0] 35.571 4"
13:35:24 "replacing Land_TinContainer_F with Land_FlowerPot_01_Flower_F"
You people are so full of hate
And running a check on every frame is any better?
It would be the same thing as adding suspension to the script for 5 seconds.
And running a check on every frame is any better? Depends on what you are checking
Yes of course, if it's something that's being rendered or drawn. But to check if the player is inside a marker? No.
the trigger is naturally designed just for that
Please don't mind if I won't join the discussion since I lack on experience here
and am way too handsome to get into an argument
The triggers are designed for area based activation and execution sure. But that doesn't make them elegant. I see nearly zero difference between the two, except one is cleaner and more accessible than the other.
SQF Script - > More accessible, I don't want to be reviewing some other mission just to be digging through dozens of random triggers
triggered
Apart from that your 5 second check is not guaranteed with spawned loop as it could be 5 min check easily
you can optimize your check depending on maximum speed of the unit that activates your 'area presense event' and the amount of error you are OK to get
5 min check if the scheduler is packed yes.
well if someone has put a ton of rubbish into scheduler then yes
Ever tried to use spawn to open parachute for falling player?
Being that, this could be a client script and seperate from other crap running on server. Then it should have nearly no effect on time
Can I convert private _onActivation = {hint "I am awesome code"} into a string somehow - bekorse the trigger statement function only accepts stupid strings as code (so not elegant)
so the idea is like this:
maximum speed of your unit is, let's say, 10 m/s. You query the check every 10 seconds. So the maximum possible error is... 100 meters. Probably ok for a kilometer-sized area, right?
then... you can increase/decrease poll frequency depending on the distance to the closest unit from the border... because if the closest one is 10km away then he won't be there for 1 minute?
singular or double quotes will escape the string
Sparker, you'll probably get now "Too many checks, too slow"
You can @frigid raven but you might need to remove {} later
I will use the cba's 'wait until and then run in unscheduled' and everyone will be happy xD
¯_(ツ)_/¯
Why would you leave the brackets if you can just compile the code as a string?
no it's not many checks really, 'get the minimum distance from center of area to any unit' iterates through all units so it's not bad
You don’t you get them if you str code
compiled code?
The code code
That's really raw
@astral dawn I still prefer the idea of a local check instead of going through each unit and keeping track the distance between.
yeah it's fine if it's only for players 👍
AI even then? >:-0
if every AI has his own computer? 🤔
Soon @astral dawn
Will I need a separate arma license for every AI unit?
It will buy its own licence
AI rights 2025?
Universal Declaration of Arma Bot Rights
We first teach them how to navigate walls. Then they get the right to vote.
Basic test would be a desert map with a single stone
AI pride 🏳️🌈
It's like the cat and a box test, cat will always want to occupy the box
or cat and cucumber
Hi guys. Im having a really weird problem with a script activated by the killed eventhandler. Its kinda hard to explain in words, so I made a short video. Hope someone knows whats going on here 😓
so you attach objects, then delete the base object?
yes
maybe try to detach first?
I can, but then the pieces fly off violently since it collides with the existing vehicles geo physx
maybe give it a push or torque with one of the physx commands as well?
hmm... disableCollisionWith should idsable collision with two physx objects (never tried)
if I let them detach by themselves they usually only reacts with eachother, and gives a more natural "fall apart" look
yeah I actiually tried that, but didnt help. the main vehicle is still there until I switch view :\
its like Schrödinger's cat in arma -_-
I have recently observed that wheels start rotating on a flipped APC if you shoot a gun near it 🙄 so I'm not surprised
haha thats weird
and... setPos commands? did you try them?
you mean just move the other parts around instead of attaching?
no i mean after detachment try to wreck setPosWorld (getPosWorld wreck)
just to check if its still there you mean? I know its there cause its still burning. and the pieces are not falling off
and its not a wreck either
not using a wreck lod for this
no, i mean the pieces. You detach the pieces and try to set their pos to their current pos to kick the physics calculations?
idk why it doesn't calculate physics until you switch view, maybe it just needs a kick or something like that
yeah ok I can try that. detach them and keep them from flying of by using setPos
the nice thing about using attach in this case is that you remove collision while they're attached
hmm wait, so you want them to fall apart or not?
yeah I do, but only after the vehicle is deleted
I dont want them to react with its physX
I want them to spawn in the exact place as the vehicle to make it look seamless
maybe you can show the code and someone can see some mistake there?
ok sec
oh!! I just found something. the same error doesnt happen if I kill it will some other vehicle
I like how it looks 👍
hmm allright
maybe you can try to setPosWorld, setVectorDirAndUp instead of attachTo and then deleteVehicle
you attach to [0, 0, 0] right? should be easy I think, means it needs no model space -> world space coordinate conversion
I would have to move the pieces outside the boundry of the vehicle then
@spark turret https://www.youtube.com/watch?v=ysCI37d2ax0
why would you? you don;t seem to do it here
_upper_body attachTo [_v, [0,0,0], "attach_upper_body"];
attached to a memorypoint
ah yes
@young current lmao Killer of worlds and frames. awesome
dunno its pretty simple command wise.
dont really see why it would kill frames
but remains to be seen
@nocturne basalt you need to create and position parts in killed event handler so that everything is in unscheduled
but I am?
class Eventhandlers: Eventhandlers {
killed = "_this execVM '\WHwalkers\warhound\scripts\killed_mars_pattern.sqf';";
};
Would help if you have memory point on each part of the original body that would indicate direction the parts face so that you can get vector towards it and use it when positioning parts
no you are not you are launching scheduled script
ah. would you use remoteExec instead? can you explain why?
I do have mempoints from the original vehicle
attach_upper_body
attach_hip
etc
remoteexec? don't think so unless you want somehow to handle it on the server only
attach_upper_body this is the point of attachement, the joint?
oh ok. sry Im not too experienced with scripting for multiplayer. I find it really hard. how would you launch it unschedueled?
yeah its the point of attachment
but you also need direction. I assume you are not going to have them standing still, but moving so when they get hit they can be oriented randomly this is why you need direction of parts
hm no they are oriented the correct way already. for some reason they get the oposite direction at first. that why I use _upper_body setDir 180;
they will move on their own, since they are reacting to eachothers physX lods
I dont think you understand what I mean
when you replace body with the sum of parts you want the parts to be at the same position and same orientation
position you have
yes
orientation you dont
hm but I do :\ they will spawn the same orientation the vehicle had when destroyed
when attaching something, they are by default attached in the same orientation as the vehicle are they not?
does your model move legs?
yeah it walks
so when it takes a step it raises leg?
what if it is destroyed at this moment when the leg is raised and under an angle how do you place your leg part at exactly the same orientation?
ah I dont worry about that.
they are just spawned in the position as if it was standing still
dont think its too noticable
here you see it works when killing it with another vehicle
it is standing still of course you wont notice
it is standing in default position
what if you kill the running one
i bet you will see some strange straighten up move like that switchMove does to reset animation
anyway dont let me stop you, it looks great
it will be covered up with smoke and explosive effects. I dont worry about it. its not the main issue here
what i said like switchMove ""
@young current suggested I use legs from a man class to achieve a ragdoll effect instead. I may go down that road later
Oh, I see, you think you can rig it like a man? maybe
not the mech itself, only the legs flying off
would make them look not so static on death
well the whole mech could in theory be a "man"
yeah I know 😛
yeah and fold like a ragdoll instead of flying off
You could still have dismemberment animation for larger hits
I dont wanna keep going deeper into the rabbithole
Im deep enough as it is
would never be able to get out xD
and Im planning on releasing this by the end of the month
What would have worked is if it would ragdoll when killed but then explode with secondary explosion and fly apart
and Im planning on releasing this by the end of the month Yeah do that I have an idea how to make it work the way you want to
it has to be secondary explosion
the first explosion is missile hit but then if it is moving you have to wait until the animation phase is the default position then make secondary explosion and take it apart
I was thinking of spawning a bomb there too, just to push it apart
but it seems the parts are glued on till I switch views
if it is stationary you could wait random amount of time and make secondary explosion to tear it apart
no sleep should be unscheduled
@nocturne basalt have you tested it in MP?
no not yet.. that woould be next after I solve this issue
you make it wait in scheduled
as it might be some sort of simulation issue with the view
it might not be an issue in MP where the simulation runs on the server
hm yeah maybe^^ gonna launch my local dedicated server and try it
phase is fine too
movetime is time of the animation goes from 0 to length of animation
right
but Im not using any animations in this script. would mean tranfering the state of the animation to the parts Im attaching?
could do that
no to catch when it is in default position
I can totally see it having separate dismemberment explosion independent of the missile hit explosion
that will only make it look better right? it will not fix my problem?
this way you can have several missiles hitting it before legs fly apart
your problem is no problem, you are doing something weird which you do not show us
well I showed you the script, and how I call it?
was thinking it could have something to do with what lod Im using when using the optics
but that dont explain why the same thing happens in 3rd person
try it in mp doesnt have to be dedicated just launch mp preview from eden
this will show if this is simulation pausing related
oh and while at it, while in preview execute this systemchat str diag_activeScripts
ok, so I found something really weird. if I change to the driver seat first and move the vehicle a little, then move back to the gunner seat. everything works fine
in SP, MP, and as client on a dedicated server
could it be that the simulation is not activated until some physX vehicle moves on the server?
if thats the case, I guess this isnt really a problem. previously I said it works when killed with another vehicle. maybe the engine needs to be on?
yeah physx vehicles have/had rest state, but this should not be happening, maybe you inherited from wrong class or didnt set some param
hm
dont think Im having a problem with my inheritance. its the same Im using for lots of other stuff, including the vehicle it worked with
Try asking about it in #arma3_config it might be related
ok ty
I remember a raised physx vehicle would be entering rest state and it would not fall down until you shoot it with rifle. but that was awhile ago and I have never seen this again, I guess BI tweaked something
no idea why this would happen to you. If you shoot the walker before entering, would it not freeze?
didnt work..
now it seems I have another issue.. when playing on a dedicated server, the killed script doesnt seem to trigger at all
I just realized.. Im not using the MPKilled eventhandler
is that called in the same way as killed?
killed = "_this execVM '\WHwalkers\warhound\scripts\killed_mars_pattern.sqf';";
like this:
mpkilled = "_this execVM '\WHwalkers\warhound\scripts\killed_mars_pattern.sqf';";
Is this the right syntax?
[
"AB_FARMA",
"SLIDER",
["Growth factor", "Multiplier for length of grow cycles"],
"FARMA",
[0.01, 5, 1, 2],
true,
{
params [_value];
{
_x addEventHandler ["Put",[_value,getPos(_this#0), _this select 2, _this select 0] execVM 'FARMA\placeSeed.sqf';];
} forEach allPlayers;
[_value]execVM "FARMA\plantGrow.sqf";
}
] call cba_settings_fnc_init;
no
{
params [_value];
{
_x addEventHandler ["Put",{[_value,getPos(_this#0), _this select 2, _this select 0] execVM "FARMA\placeSeed.sqf";}];
} forEach allPlayers;
[_value]execVM "FARMA\plantGrow.sqf";
}
you seriously need to start reading the wiki, it shows the syntax so you dont need to ask. ur addEventHandler code isnt in code or string.
_value cant be read from the event code like that
we have been through all this no more than a week ago
Yeah but when I went from using a string to a number it doesn't work with the original script you helped me with
that doesnt mean it can read _value now
This gives me "string not number" errors
true,
{
params ["_value"];
{
_x addEventHandler ["Put", format["['%1',getPos(_this#0), _this select 2, _this select 0] execVM 'FARMA\placeSeed.sqf';",_value]];
} forEach allPlayers;
[_value]execVM "FARMA\plantGrow.sqf";
}
] call cba_settings_fnc_init;
you still need to format the event code
yea, if ur value isnt a string remove the quotes '%1' -> %1. simple.
use filepatching and recompile functions maybe. personally if it doesnt need to be in a mod i will make it as a mission in the editor first
Yeah that's what I was doing until I started adding custom models, I read you HAVE to compile them as a mod or they won't show
you can create objects with createSimpleObject but they are fully static.
But I'd have to pack them into my mod first though, right?
I have no problem creating the object in game, it's the iterating through them in-game to see if they look right and all that's a slooooooow process
no. you just create the object using the filepath to the .p3d. this way even mission files can use custom static models (though it tends to lead to generic "you kicked from server" issues).
as far as testing goes it might be faster for u
iterating through them in-game to see if they look right and all that's a slooooooow process what, seeing them or the actual script being suspended for a while?
Having to restart the game I meant
mmhm, well like i said. filepatching is one option, another is to do ur scripts in the editor so you only need to reload the mission not ur game.
Okay, I didn't realize you could spawn the models in game if they weren't included in a mod. Guess that info I read was pretty old
I should probably be using createSimpleObject for these plants then, rather than createVehicle?
if theyre just static objects it would be more performance friendly
Ok, that's what I thought. Can they accept addActions or anything like that or no?
no
yea
@nocturne basalt I doubt it, mpeventhandlers are global, config event handlers are local
How do you know it doesnt fire at all?
Any idea why one (1) string isn't found in a container of ~50 localised ones? I'm creating several areas and tried doing:
//middle of stringtable.xml
<Container name="Station">
<Key ID="STR_Station_1">
<Original>Station 1</Original>
</Key>
<Key ID="STR_Station_2">
<Original>Station 2</Original>
</Key>
<Key ID="STR_Station_3">
<Original>Station 3</Original>
</Key>
etc
etc
Everything works other than "STR_Station_1" can't be localised :/ "STR_Station_2" returns "Station 2" and so on it's only station 1 that won't work. I'm using the same way to create the markers for all stations in a loop and station 1 is called third in that loop.
either ur script isnt actually using STR_Station_1 or the issue is elsewhere in the stringtable. that snippet is fine.
I'm 99% sure it's an issue somewhere in my spaghetti. Just thought if anyone else had this issue before and knew about common problems that'd cause it.
I'd assume most common problem is just a mistake in the stringtable.
Welp. Thanks for helping though 😃
idk how but it seems like the stringtable simply wouldn't update. Restarting the game wasn't enough. My hard drive hit a wall recently so that might be why but I tried a few things aaand chkdsk seems to have fixed it?
is there a way to get the ground texture at a pos?
kind of but not really. in CfgSurfaces it gives a partial filename for the texture of that surface, but not a full path.
getText(configFile >> "CfgSurfaces" >> _surface >> "files")
so not enough to get do a setObjectTextureGlobal with on an object with?
no
you could write up all the filepaths urself though
something like this
private _image = switch _surface do {
case "Surface1":{"path\to\image1.paa"};
case "Surface2":{"path\to\image2.paa"};
case "Surface3":{"path\to\image3.paa"};
default {""};
};```
where can I find the full paths though?
all the images are in arma's pbo files. if you have arma unpacked somewhere you can just search the folders for the partial filename.
gotcha
@tough abyss cause the pieces doesnt spawn, and my vehicle isnt deleted. can you show me an exampe on how to run this schedueled?
Put diag_log call in event handler and see if it logs something, script not doing what you expect it to do doesn’t mean EH is not firing
@frigid raven https://discordapp.com/channels/105462288051380224/105462984087728128/547879729697521682 you said addFrameHandler. That one DOES check every frame whether your script should run.
You could use waitAndExecute which only maybe checks whether your script should run, it's list is sorted after when the scripts should run next, and it stops iterating once it finds the first that shouldn't run yet.
@tough abyss I found something!
I was using this in my turret:
LODTurnedIn = 1100;
LODTurnedOut = 1100;
LODOpticsIn = 1000;
LODOpticsOut = 1000;
tried commenting that out and using the same setup as the slammer
LODTurnedIn = 1100;
LODOpticsIn = 0;
now it works!
gonna investigate further on why this happens
what values does vanilla config have for similar setup?
where is a mod dependency added?
More details? What do you mean?
I made a mod that uses CBA, but I'm not sure where to add the dependency. If I load the mod without it, the game crashes.
CfgPatches, requiredAddons entry.
That's #arma3_config not #arma3_scripting
that's enough to go off of, thanks
Apparently I already had it set to CBA, but it doesn't automatically ask me if I want to load CBA when I load my mod
Arma tells you at game start that a mod is missing
Arma launcher doesn't know what's inside your mod
Arma launcher only detects dependencies on workshop items
That's sort of what I assumed, ok
@tough abyss
the slammer has this:
LODTurnedIn = 1100;
LODOpticsIn = 0;
@slate palm #rules stop the spam/cross-posting.
Also no advertising here. Please delete that message
Never even streamed Arma.
@tough abyss the slammer has 1 pilot view and 2x cargo views ...
is that how tanks were done after the dlc?
I know literally 0.0001 about this shit. Did BI not provide a huge sample pack of vehicles and weapons and what not for modders to copy?
yeah but those are very outdated. using them dont work very well since the tank dlc
the debinarizer was made fir fixing shitty mods not ripping protected stuff
fixing shitty mods == ripping protected stuff.
but im sure most modders will give away their models if you ask nice and promise not to sell it as your own
i disagree. fixing an error in a config is something completely different that using models you dont have permission to use
afterall the mod stays the same.
you don't need a model debinarizer for a config patch
or whatever mistake you are fixing
i also dont think its illegal to use it for personal purpose. just dont upload it anywhere
#rules
3) Discussions about copy protection or copying, backing-up, hacking, cracking or reverse engineering of any of BI's products or the products of any other developer will not be tolerated and such discussions will be deleted immediately.
I'd suggest to stop now ^^
ok
Stories from dedmens PMs
Arma life developer
Developer: Please help me with performance problems, here is a captureFrame log.
Dedmen: Why are there 400 callExtension calls to extDB with the same function?
Developer: Here see code
if (_queryResult isEqualTo "[3]") then {
for "_i" from 0 to 1 step 0 do {
if !(_queryResult isEqualTo "[3]") exitWith {};
_queryResult = "extDB3" callExtension format ["4:%1", _key];
};
};
for step 0 loop in unscheduled.
Dedmen: This is absolutely retarded code, which idiot wrote that?
Developer: Altis Life Framework from Tonic: https://github.com/AsYetUntitled/Framework/blob/master/life_server/Functions/MySQL/fn_asyncCall.sqf
Dedmen: https://i.imgur.com/YAGpXPd.png
well from what i know there is no framework that is "legit" other then tonics unless i am out of touch(havent done a3l in 2 years)
Many horrors await those that venture into the dark depths of other peoples code.
As a programmer must code you see even if its your own is viewed as "horrible" there is always a better way, its just how your applying it, i have seen a loop go through 10000 objects just to check if they are alive and to update the. in the end no matter how much you use OOP principles you will always have unefficent code
It might be one of many explanations of why alive doesn't run very well.
Alive is heavily influenced by the compile memory leak
but TheNightstalk3r cleaned that up
oh lol. the timing. #production_releases 😄
@fluid pier OOP is not the solution to performance
or has anything to do with performance at all
@still forum that code is horrifying
thanks for nightmares
no but using the principles can be
If you have a sword that has health data
that takes up data
etc
I mentioned my intercept_db to him, it would solve all the problems, but migrating from extDB to something else is probably too much work. Especially when you actually wrote none of the database interaction code
do not get me started on why OOP is most of the time a horrible idea simply because the "principles" sell a lie
- there is ton of stuff out there telling you just that
what's better than OOP then in your opinion?
clean OOP is impossible to do, the way OOP is usually done is literally "i got theese random data parts and want some methods sticking to it" and later just "adding" stuff to random objects, etc.
X39 what do you code...
well it's better than having myStruct {int a; char b;} then pass it around as struct pointers to your functions 🙄
i'm pretty much learning C++ now, but the amount of abstraction it can add to code is kinda insane to me sometimes
@astral dawn OOP is a tool in your basket, not more
utilize it well and be done with it
but do not hold it up and call "my hammer is the solution for everything because i tell you so"
C++ is not object oriented
it is C with classes
oh... allright 😄
ehh.. in gaming you will more then likely see OOP design stuctures etc
i cant talk about some of what i have been shown at uni due to NDAS
But most funcitons and classes do one thing
So your health function should just handle health
and not drawing the uio
dude ... whoever told you OOP is the solution is a gigantic liar and you should avoid him at all cost
OOP is a tool, thats all
and most of the time, the tool is more distraction then useful
as stuff like "we god a health method that handles stuff" sounds nice
but to stick to your example:
Ok again i have no idea where you have got this from
or where you have this opinion
but either its uneducated or you code something different
and this is where you st*u or can come up with reasons why OOP is such a great thing and the best for everything
with proper arguments
Right so if i have a player
OOP is good as i can just go
Player.health = 100
and i can do that per player
so each player has there own health
and you are already not talking about OOP but rather about data structures
No this is oop
it is not
take a dictionary, can do the same
with a player object has
and now let me reuse your words: "but either its uneducated or" you just got lied to all the time
really do not know where you learnt this
cause the whole point of oop is so you can do player.health
in python, json etc. you have dictionaries that can be accessed with dots
foo.bar --> foo["bar"]
the same applies to literally what you showed
OOP principles are not syntax bound
or player. health = enemy .health
Ok so if I have transformation
AS a base class
all objects contain transformation
if i remove transformation all objects break
so if i add the transformation component
i can transform my object
all the code and data is there
Right but its the same with objects
orintend
i can say an object has a player class
that means it has all the code for the player
input
etc
im just going to let you read up on it
i will stop talking with you right here ...
partially because i got better things to do
partially because this would go on endless ammounts of time without any progress on your side
You have some research to be doing, properties is not what OOP is about, those existed well before OOP arrived and continue to do so in purely functional languages. Would you like some book recommendations?
don't feed the trolls @tough abyss
Just backing you up in what is a ridiculous conversation in the hope to make it productive.
returns to my not OOP code that uses properties.
Kinda forgot,
["_someVar1", "ADefaultVal"],
["_SomeVar2", "AnotehrDefaultVal", "ExpectedDataType"]
];```Right?
you always can double check the biki https://community.bistudio.com/wiki/params
and yes, it is correct
oh yeah 😂
Been doing config stuff, ditched the poorly documented wiki for a while, needed a script and forgot it's more helpful for scripting
ah well, cheers lads
@brave jungle your code is wrong, expecteddatatypes is an array not string
@brave jungle why poorly documented?
The Config stuff is far from all you need to know, it regularly doesn't sufficient say what certain properties do. I am not saying it should be but it isn't where I would go to work out how to configure something, I would go look at a mod that does it already.
Thanks M242, saw that one too while on the wiki 😉
I started to use the wiki to learn modding properly, as candle said, I just went for looking at existing mods and asking questions in #arma3_config instead.
I learn better by just expanding existing stuff that i've made/know, rather than reading a wiki, but that's just me 😃
Is there a way to force a car crash with AI?
setPos two cars into eachother and they will explode. Then tell your players it was a car crash
I don't think you can command the AI to crash into eachother
record the ai movement and play it back
I was thinking about an ambush for a convoy (with a damage Event Handler to avoid the explosion). Was thinking about recording AI movement already, but I guess it doesn't fit the dynamic situation. Might do it as Zeus then.
ask it to drive somewhere, generally they crash very often
sometimes when you kill driver while car is moving, his steering wheel will be locked at one of the extreme positions 🤔 you could simulate driver's heart attack maybe?
allright this one might work actually
https://community.bistudio.com/wiki/setDriveOnPath
doesn't need path recording, you just give it positions
didn't try it myself
Ah I will try that, but I guess it will avoid obstacles (like other vics), will give it a try
no with this one it won't care about obstacles AFAIK (not like it does usually ..... xD)
Okay setDriveOnPath kinda works, but it brakes ~20m in front of the vic and then decides to slowly accelerate into it.
Yep giving it a good push in the end
A rather specific question:
If I kill an enemy vehicle that has been abandoned by its crew in the last 30 seconds or so, an eventhandler "handlescore " will show me that Arma itself gave me 3 points for killing the vehicle, but at the same time, if I try to check if that vehicle was an enemy in a missioneventhandler "EntityKilled" via side group _vehicle I'll get "UnknownSide" or side _vehicle I'll get "CIV".
There has to be another way to determine if that empty vehicle was in fact an enemy, right? Since the "handlescore" EH somehow knew?
Does the vehicle belong to enemy faction?
Yes, does the EH "handlescore" check for factions as well?
If so, is there a way to determine the side of a faction, if something like that is even possible?
Is the alternative syntax for say3d not working ?
https://i.imgur.com/puonch5.png
from say3D [sound, maxDistance, pitch,isSpeech]
Available since 1.91.145286
ah, is the "first person" bug fixed too in 1.91 ?
@tall dock: getNumber(configFile >> "CfgVehicles" >> typeOf(_object) >> "side");
You can just use faction command I suppose @tall dock
You can save variable with last occupant side on vehicle
Yeah I'd like to do that, but getting the side from the vehicles config and then use BIS_fnc_sideType worked for me.
Or is there another BIS function to get the side of a faction?
And then cancel negative score if you destroy vehicle of own side but that was in enemy possession
Is it good practice to do example_variable = nil; when you are 100 % sure the variable is something you won't need anymore? Or is this just a waste of time
Specifically for global variables
most of the time you set vars to nil when you plan on repeatedly using them.like when you do a building system and have "isBuilding = true;" and you stop building and dont want stuff regarding building to be shown you set it to nil when the building process is finished.depends on usage
It's useful, but not much. You reduce the memory usage by a couple dozen bytes if you set the var to nil
1780413: <no shape>
as trigger id
does no shape kinda imply that it won't be "triggering" ?
no shape means it doesn't have a shape
aka a 3d model
which is true for triggers, you don't see them floating in the sky
ok but the triggerism should still work the - aye
example_variable = nil,nil,nil; just to be sure
Or if you really want example_variable = ++nil;
How do you get the direction of a object relative to the player?
@tough abyss why yu tri tu fuul poeple
_desertionTrigger setTriggerStatements ["this",
_onActivation call coopr_fnc_codeAsString,
_onDeactivation call coopr_fnc_codeAsString];
Given this trigger I see the execution of the _onActivation function but not of the onDeactivation.
Biki says
Trigger condition has to return Boolean . true will activate the trigger, false will deactivate it (only if activation is set to repeat).
Does mean that I have to make condition return false and only then onDeactivation will be called? If yes - how can I simply can make it return false if an entity leaves the trigger area?
if (this) then { true } else { false }
Is surely not working right?
PS: This is the activation defintion for the trigger
_desertionTrigger setTriggerActivation ["WEST", "PRESENT", true];
I thought this will have this condition in it somehow? Since it reads to me "if a WEST entity is PRESENT then go apeshit"
if (this) then { true } else { false }
is the same as
this
yea thought so too
but as I said onDeactivation is not being called
that's why I am asking if I am missing anything here
mm, i cant really help on that cause i dont use triggers. I just did a quick test using ur activation snippet and it works for me with a single blufor unit. if more than one are in the trigger it only deactivates once all units have left.
Log this and see if it changes to false fist
@tough abyss nah ... ++ being + + has nothing to do why we cannot have a ++ operator
otherwise, >> would be > > always
Trying to use createSimpleObject but it only accepts posASL, I'm having trouble getting the ASL position 1 meter ahead of the player
@tough abyss https://community.bistudio.com/wiki/ATLToASL
You can’t have greater > greater > it is error
CONFIG >> CONFIG != CONFIG > > CONFIG
>> is a separate operator
from >
same could be done with ++ but it would not make much sense
You can have chained + but cannot chain >, not the same thing
https://discordapp.com/channels/105462288051380224/105462984087728128/548244338556141569
you can create a ++ operator
but it would not work the way one wold expect
What interpreter is supposed to do with ++? Treat it as unary ++ or 2 unary + chained together? How do you resolve this ambiguity?
the same way you do with >> vs >
uhm ... serious question: are you playing stupid right now?
if it was after your saying, >> would be assumed to be two > by the sqf lexer
Seriously considering to never talking to you again
if you want to enable ++, you just tell the lexer that such a thing exists
++ currently gets chained as:
Unary +
Unary +
...```
the moment you add a ++ command, it would be:
Unary ++
...```
And you cannot chain unary + any more after that
Pre and post, they both have their place.
it does not makes any sense right now, it will not in the future
do the same in eg. c/c++, you will end up with same "issues"
int a = 0;
int b = -i;
int c = --i;```
all have different meaning
same would apply to SQF
This doesn't seem extremely accurate, it spawns every 2 meters off and doesn't always respect the direction either
_holder1 = "Land_HelipadEmpty_F" createVehicle (player getRelPos [0.5,0]);
seedPos = getPosASL _holder1;
_seedSite = createSimpleObject ["FARMA\Objects\corn_4.p3d", seedPos];
https://community.bistudio.com/wiki?title=createVehicle --> special * (@robust hollow)
the helipad or the seed?
Hard to say since the helipad is invisible
im gonna assume helipad. use the alt syntax of createVehicle
the seed definitely spawns 2 meters away in a quasi random direction
with special type "CAN_COLLIDE"
@everyone
also ur position needs to be positionWorld not positionASL because ur using the model path instead of a class
Got em
It really doesn’t matter that you can do it by altering existing functionality because it doesn’t make much sense to chain unary + No one will do it.
what the hell you then try to argue??!!??
When I said you can’t have I meant in the game not in sqf-VM
neither was i talking about SQF-VM
you can have ++ but it will not work the way one expects
the "chaining" possibility is more by accident then on purpose
that is the literal thing i said when i mentioned you
and you started arguing about "but no you cannot because chaining +"
Reread what you said, it looks like you were implying we could have had it in the game. If you meant something else, then I misunderstood you
nah ... ++ being + + has nothing to do why we cannot have a ++ operator
otherwise, >> would be > > always``` ???????
has nothing to do why we cannot have a ++ operator
++ being + +
Why we cannot have? We - arma users?
because it would have to be implemented at the same level as = is
not as unary command
there was a discussion in #arma3_tools or #community_wiki not long ago
the way you could have it as unary command, would be ++ STRING
but not ++ variable
Maybe
not maybe, yes
it is as i said
problem arises due to this:
_code = {0};
_value = 0 call _code;
++_value; // Theoretical ++ unary operator
diag_log (0 call _code); // 1```
Alternative Problem
```sqf
_a = 0;
_b = _a;
++_b; // Theoretical ++ unary operator
diag_log _a; // 1```
Looking at deleting a simple object by it's model, would I need to create an array of nearby simple objects and then like delete the closest that matches the modelInfo or something? The example assumes you created the object from a vehicle and not just the model's path
allSimpleObjects ["Box_NATO_Equip_F", "Land_CampingChair_V2_F"];