#arma3_scripting
1 messages ยท Page 238 of 1
Haha, right, it's not working. I'm VERY ignorant of this stuff. I'm trying to get it to not open the doors and all till the chopper is on the ground, at which point, I want it to kick everyone out, then close the doors, fly back to it's origin point and delete.
What does the select 2 do?
So for example
if I use
getPos player
In the debug console (literally right now)
I get:
[14037.6,18751.2,0.897427]
Using select 2, will select the last element of that array, the z component, or altitude
By just asking if that array is less than 0.5, is meaning less
There is no scalar for it to compare to
Hmm... How do I find if it's less than a meter off the ground?
(getPos _GreenPilots) select 2 < 1
Oh... I thought that was like an incomplete thing. I must have misunderstood what you were explaining.
What do you mean by incomplete ๐ ?
Well, if
(getPos _GreenPilots) select 2 <=.5;
doesn't work, I don't understand why
(getPos _GreenPilots) select 2 <1;
will work. I must have just been a page behind your explaination.
How do I make a waituntil just sleep a few seconds before continuing the script? It seems like when I do that, it just doesn't run.
So for this waitUntil {sleep 10; {_x in _GreenChopper} count _assigned == 0;};
In order for it to reach the code on the lines below the waitUntil must evaluate to true, if it's never true then the code below will never run. So for evaluating the waitUntil it will start by sleeping for 10 seconds, then check this condition {_x in _GreenChopper} count _assigned == 0, if that condition is true it will continue on to the code below, if it's false, then it will start over again by sleeping for 10 seconds
I think that {_x in _GreenChopper} count _assigned == 0 is never true
If everyone has been ejected
_assigned is never defined here
That will return true
@native hemlock, Haha, thanks, but I'm not that far yet. Can't get past the first waituntil yet!
@native hemlock, my goal is to have an immersive respawn for a PVP game mode. All of the dead players will be respawned whenever an objective is siezed, then they will all be assigned to the chopper, which will be locked, so dummies won't jump out, then it will kick them out on the ground. I'm bad at this, so I haven't done the assigning part of the script yet, since that will require clients be on to test.
@dusk sage, it isn't defined yet.
Do you have -showScriptErrors on?
I do, yes.
Is there AI left in the chopper?
Just the pilot and copilot.
And nothing popped up for this? I would think you would get a complaint for trying to get the position of a group
crew _GreenChopper will return an array of objects inside the chopper
So using
(count crew _GreenChopper) isEqualTo 2
Would check if just the pilot and co pilot remained
@native hemlock, yeah, something popped up, but I couldn't understand what it was trying to get me to fix. It wasn't very clear to me like they sometimes are.
@dusk sage, oh! That's a good idea! I phrase it like this?
waitUntil {sleep 10; (count crew _GreenChopper) isEqualTo 2;};
But will that exclude players riding as cargo?
waitUntil {sleep 0.5; getPOS _GreenPilots <= 0.5;}; would never be true, as _GreenPilots is a group, not an object which is what getPos requires
Should be _GreenChopper
_GreenChopper select 0
_GreenChopper is equal to the return of BIS_fnc_spawnVehicle
So to access the actual vehicle you want to select the 1st element in the array, which is at index 0
Good point
Phrase like this?
waitUntil {sleep 0.5; (getPos _GreenChopper select 0) select 2 <1;};
waitUntil {sleep 10; (count crew _GreenChopper) isEqualTo 0;};```
^
(getPos _GreenChopper select 0) would probably get the position of _GreenChopper and then select the "x" component of the position
ARMA is just weird when it comes to parenthesis
PEMDAS
Does work, doesn't work
Middle school math all over again
_this select 0 select 2
Works
It's just a bit of a mess
Stick 'em where it looks they are needed
I think it makes sense, but it's still easy to overlook sometimes
I am going to give this a try. BRB.
Crap. I changed something and got more errors.
I want the doors to stay closed until the chopper has landed.
I want them closed before it takes off.
Latest version of script:
_GreenChopper = [];
if (isServer) then {
_GreenPilots = creategroup independent;
_GreenChopper = [getMarkerPos "GreenSpawn", 0, "I_Heli_Transport_02_F", _GreenPilots] call BIS_fnc_spawnVehicle;
_WP1 = _GreenPilots addWaypoint [(getmarkerpos "M1"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["true", "(vehicle this) land 'land'"];
waitUntil {sleep 5; (getPos (_GreenChopper select 0)) select 2 < 2;};
_GreenChopper AnimateDoor ['Door_Back_R', 1];
_GreenChopper AnimateDoor ['Door_Back_L', 1];
_GreenChopper AnimateDoor ['CargoRamp_Open', 1];
_GreenChopper land "NONE";{_x action ["Eject", vehicle _x]; unassignVehicle _x;} forEach _assigned;
waitUntil {sleep 25; (count crew _GreenChopper) isEqualTo 2;};
_GreenChopper AnimateDoor ['Door_Back_R', 0];
_GreenChopper AnimateDoor ['Door_Back_L', 0];
_GreenChopper AnimateDoor ['CargoRamp_Open', 0];
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
};```
Should be easy
I'm not sure if you are aware, but this script also needs to be spawned/run from scheduled environment
Do you know what that measn? ๐
Essentially the nonscheduled environment is not allowed to sleep, wait, or pause, everything needs to execute before being able to continue
That explains why my sleep commands always threw errors.
Yup
Scripts in the scheduled environment can sleep, wait, and pause. The disadvantage is that the nonscheduled scripts have priority, and there is no guarantee your scheduled script will execute exactly when you want it to, especially if there are a lot of other scripts already running.
However, in a majority of cases you won't notice the difference
Yeah, there isn't going to be much going on in the way of scripts in this iteration of the project, at least.
Using [] spawn yourFunction will start that script in the scheduled environment. Any script that starts in the scheduled environment will stay in the scheduled environment
Well I shouldn't say any, you can hack your way back into nonscheduled, but this isn't important so I'm going to stop talking about it. If you want to read more about it check out Killzone Kid's blog or ACE3's
Where can I find info on that? Google didn't give me the BIS Wiki.
Thanks! I have to go now. My community's session starting soon.
There are probably some scattered posts, but back to your issue
Thank you so much for all of your help. I've never wanted to miss a session more than right now to try and get this thing hammered out, haha.
After you use the animateDoor command, put a check for "doorPhase" https://community.bistudio.com/wiki/doorPhase
I guess another waitUntil will do, and you'll be waiting till the door is closed (a value of 0)
You'll get it sorted, have fun and I'm glad I could help
Thank you so much! Sorry for having such trouble understanding.
Also
_GreenChopper AnimateDoor ['Door_Back_R', 1];
Needs to be
(_GreenChopper select 0) AnimateDoor ['Door_Back_R', 1];
^
As we already discussed the object scenario
Making a variable at the start such as _chopper = _GreenChopper select 0; may save alot of time
It'll look a lot cleaner too
@dusk sage, @native hemlock, people aren't logged in yet, so I have about ten more minutes. What do I do now?
See the post above
Any place where you wish to refer to the chopper itself
needs to be
_GreenChopper select 0
So making a variable after you create the chopper, such as _chopper = _GreenChopper select 0;
And using the _chopper variable, will save time, look cleaner, and be a little easier to understand when writing
Awesome!
In that case, can I just make variables for _Chopper, _Crew, and _Cargo each?
You are probably fine with juts the chopper for now
Do I need to create pilots separately still?
I'm not sure if I know what you mean, setting _chopper = _GreenChopper select 0; will not effect the value of _GreenChopper
But now instead of using _GreenChopper select 0 everywhere you wanted to use the helicopter object, you can use _chopper.
Hello, very simple question here but I cant seem to get it to work.... I just want to spawn a unit that is injured. I looked everywhere for this. Everyone says put setDamage in the unit init line, but I am spawning the unit from a script so its not on the editor. I tried createUnit, and BIS_spawngroup. I manage to spawn the unit but i cant define params like "health" or animation to that specific unit i just spawned in. Any help would be apreciated thanks!
p.s I also tried setVehicleInit to no sucess
@native hemlock, I mean, setting variables like:
_Crew = _GreenChopper select 1;```
etc.
I got it to work properly. Step by step debugging the code. was just getting on my nerves. lol cheers
my problem was i wasnt defining the group
_mygroup = createGroup west;
then the init part worked just fine
Nice gj ๐
๐ happy
drag, carry, load into vehicle ? any scripts for that? I ve seen it on some servers ans sure I could write it from the ground up but why reinvent the wheel... thanks in advance
dont sweat, found something that works perfectly
R3F logistic`?
can add custom buildings to altis life ?
Why can 3Den not find my damn scripts that are plainly in the folder? I damn miss the old editor!
it's not an editor issue
3DEN is 100% superior to 2D editor, there's absolutely no feature that 2D has missing from 3DEN
Show Object IDs?
You know why it was removed, cmon :p
Does 3Den have hidden folders somewhere? Why doesn't it save to the same folder?
What do you mean hidden folders? it works the same way the 2D editor did
documents -> arma - other profiles -> yourProfile -> missions / mpmissions
No, that I can absolutely, positively say is incorrect.
If it is loading from those folders, it is NOT like the 2D editor.
My 2D missions loaded their scripts from documents/A3/mpmissions, not from documents/A3otherprofiles/yourprofile/missions/mpmissions.
when was the last time you installed the game ?
I don't think I'm infallible, if you say I'm wrong, I'll believe you, I am just irritated.
if you use default profile, it's documents/A3/missions
I installed it the last time six months ago.
Afaik the main A3 folder in documents it's the default profile
are you using your default profile or a different one?
because that might be your issue
I'm using my default profile.
it's in the main folder then.
Which is what I've always used, never had an alternate.
Haha, maybe I need to stream my issue to you. Wait one, screenshots inbound.
just check in other profiles if you don't have one with the name of your default profile
There is no other profiles folder.
create a new mission and save it under missions,, check if it's present
Check if what's present?
The mission folder
Check if the mission folder is present where? I'm looking at the mission folder with all of my projects in it. I didn't move them into here, this is just where they go by default when I save from the editor.
You want me to create a mission and make sure it goes to this folder I have open? I'm just trying to understand so we are on the same page.
Let me explain:
Your missions are saved in folders under either documents/A3/missions or documents/A3/mpmissions
the folder should bear the name of the mission you, saved
that's where your functions and scripts go
It's hard not to be sarcastic in response to that one, @lone glade, haha. That is exactly where my scripts are.
Wait, you only have the default profile? So no "other profiles" at all. How do you know the editor is looking for scripts in "documents/A3otherprofiles/yourprofile/missions/mpmissions"
I've found the problem, there is apparently a working copy and a saved copy of the folder. My guess is so that things like "undo" are possible.
๐
yeah, the ~folders, right?
i have a huge bunch of them because I always quit the editor with alt+f4 and the game doesn't remove them. ๐
The ~ folders and the normal named folders are both in A3/MPMissions. Then, there is another copy of the folder in A3/UserSaved/MPMissions.
Crap.
isn't usersaved just a cache folder? You shouldn't have to worry about that.
Okay, thank goodness. Then it's the ~folders.
don't worry about those
Dammit. There isn't a ~folder for this mission, only the last mission I was working on.
The usersaved folder didn't acknowledge my sqf and the normal A3/Missions folder didn't acknowledge the sqf and I don't have a ~folder for it... Is it a prerequisite to have another profile for this to work for me??
no but it makes it easier to naviguate
the ~folders shouldn't be touched
just make changes in the normal mission folder
I have been, but in Eden, if I place a trigger to test an sqf, it says that the sqf can't be found, it says it 100% of the time. So, to test my scripts, I have to paste in the code every time, which as much as I have to tweak and test means that I'm wasting a bunch of time doing that. Not to mention, I don't think I can possibly test certain things in that environment.
It's whatever, I'll figure it out or get over it. I don't use the deug console because I am ignorant of its use.
What do I do with the debug console? Just paste the code in and click execute?
yeah
I'm trying to write a script for immersive respawns in a PVP environment, but it's tough, because the friggin editor isn't even reading my description.ext, so whenever I kill myself, it just respawns me right on top of my body instantly, which is odd to me, because I don't know where that setting got switched on.
I'm trying to make it where onplayerkilled, players are moved into spectate mode, then onplayerrespawn, players are assigned as cargo on a chopper that will drop off the players that recently died all together at their base.
@lone glade, using the debug console is WAY better. Thanks for the tip. The problem still looms that whenever I have to use scripts that depend on each other, I have no idea what I'll do.
description.ext and scripts changes need a mission restart
Haha, I've been working on this for a week, even if I didn't know that, I still have been shutting down Arma and starting it back up.
I know you're just covering all of your bases, but I'm not that much of an amatuer. I'm definitely not skilled enough to be called a scripter, but it's not my first outting, either. I've got a few successes under my belt.
just make sure you're using the right path with execVM and spawn
Haha, I am as far as all of everyone's advice goes. I may just start an alternate profile to see if I can work it that way.
Is 1.60 dropping right now?
seems so
Pretty much what you need to know:
- Mission restart required to reload changes in description.ext
- Mission restart required for changes in functions and scripts
- Scripts path start at mission folder, example
scripts\derp.sqfwill bedocuments\A3\missions\yourmission.island\scripts\derp.sqf
@lone glade, yep, I'm covered in all of those fronts.
C:\Users\DEL-J\Documents\Arma 3\mpmissions\AltisPVPPrototype.Altis
also: description.ext changes don't reload when you don't leave the lobby in multiplayer preview
you have to leave the lobby and come back to have the changes reload.
@lone glade, I've been testing from an Eden placed trigger, remember? I've had to leave the lobby every single time anyway. It still never found my deploy.sqf script.
what were you typing exactly ?
I have tried:
[] execVM "Deploy.sqf";
[this] execVM "Deploy.sqf";
nul = execVM "Deploy.sqf";```
All of which except nul= wouldn't let me close the trigger saying "type trigger expected nothing." When I used nul=, it let me close the trigger, but upon executing the trigger, it told me no trigger was found or some ish like that.
I have tried [] execVM "Deploy.sqf"; and got the same error as the others.
trigger code expects a return so you need nul = ... or something. same thing with init fields
@split coral, check two messages up. I already did that.
We aren't supposed to drop screenshots in here, right?
oh, I was just referring to: "All of which except nul= wouldn't let me close the trigger saying"
triggers don't expect a return nor does init fields
only trigger conditions do
(and the rest of the things that do ofc)
My script location:
C:\Users\DEL-J\Documents\Arma 3\mpmissions\AltisPVPPrototype.Altis\Deploy.sqf
I just loaded up my mission fresh in Eden just now, it was called AltisPVPPrototype.Altis, if I remember correctly. I tried placing [] execVM "Deploy.sqf"; I got "type trigger expected nothing," indicating that it did not find a script named that.
sorry, I meant it expects nothing, not something
oh right it returns the handle
Yeah, I tried nul= just to get it to let me close the trigger and try something else.
[] execVM "Deploy.sqf"; creates an error like it's supposed to. It doesn't mean the script can't be found
Why is that supposed to be an error? Unless I'm mistaken, I was just told that's exactly what I'm supposed to do to call my script from an Eden placed trigger.
just put nul = or 0 = in front of it
the trigger just can't handle the handle
Haha, makes sense.
Okay, nul= worked, but that makes me wonder why it didn't work before and it makes me wonder why my description isn't working. More questions than answers. I am much relieved. Thank you both very much.
because the trigger expect nothing and execVM returns the script handle , which the trigger isn't expecting
description.ext changes need mission reload.
No, I mean, I wonder why last time I used nul= it still said nothing expected when I triggered it. I must have mistyped the name of the sqf the one time I tried it. Just my luck. Anyway, once again, I am regularely reloading the mission, man.
what exactly doesn't work ?
My respawn settings. Let me triple check for typos and such, then I'll send it on.
Yeah, I don't see the issue, but I'm sure it's something simple that I'm not seeing.
respawndelay = 3;
respawnOnStart = -1;
respawnButton = 0;```
I have the respawn points properly placed and properly named, I copied the appropriate names straight from the wiki. However, whenever I kill myself, I respawn right where I died, standing over my body.
I restart the mission every time completely from Eden.
try placing a respawn module
I don't think that a respawn module will have the flexibility for my eventual goal, but I shall do as you say anyway.
you respawning on the spot means that the game couldn't find a proper respawn marker and respawned you on your last pos
I have now placed a respawn module, it was visible on map when I was in my multiplayer server, so I know it was placed. It was the appropriate color, so I know it was for the right faction. When I killed myself, I stil respawned directly on my last position.
what version of the game are you running ?
Whatever version just dropped. 1.60
might be broken.
Haha, I agree, but I don't think that came in the latest version. I've been working this scenario for a week. Anyway, I don't want to waste your time on that anymore for now. If I have your attention, I'd rather be learning and moving forward with the project, I can get that stuff figured out on my own later. Upon deletion of the respawn portion of the description.ext, it doesn't respawn me at all, it just ends the mission, so I know it's reading the description.ext file.
@lone glade, in this script:
if (isServer) then {
_GreenChopper = [getMarkerPos "GreenSpawn", 270, "I_Heli_Transport_02_F", independent] call BIS_fnc_spawnVehicle;
_Chopper = _GreenChopper select 0;
_GreenPilots = _GreenChopper select 2;
_WP1 = _GreenPilots addWaypoint [(getmarkerpos " respawn_guerrila"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["this land 'land'"];
WaitUnitil {};
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
DeleteVehicleCrew _GreenPilots;
DeleteVehicle _Chopper;
};```
How do I set the waituntil to find when the helicopter is less than one meter above the ground and how do I get it to delete the helicopter and crew once it returns to WP2? I know that my problem is not understanding the syntax, but the wiki is even over my head. I've made plenty of working scripts, but it's been nearly a year since I've done this as well as, none of the other scripts had this many moving parts.
My previous scripts were all just spawning, regearing, and putting AI on patrol.
Ah, man. Dammit, see, I was doing it that way, but someone VERY skilled advised me to use spawnvehicle.
since you're new to SQF i'm not going to bother teaching you scheduled / unscheduled, just gimme a sec
Without knowing how to schedule it, I won't be able to let it sleep.
Take your time. I've got all day and when you're out of time, I'm sure someone else will be around, haha.
currently your waitUntil does nothing, you need to have what you want as a condition in it
Right. I know it does nothing. I'm trying to ask what do I put in there to make sure the chopper gets all the way to the ground.
WaitUnitil {(getPos _greenChopper) select 2 <= 1};
for the return to wp2 stuff you can use https://community.bistudio.com/wiki/setWaypointStatements
also no need to delete the crew before deleting the vehicle, it's going to delete them
Thanks a bunch! The phrasing for waypoinstatements to delete "this" is kind of odd, right? It's like (vehicle this) this?
this is a magic variable
it's an internal command to reference whatever was passed to the command / init field / trigger field
you can also see it written as _this inside functions and scripts
But _WP2 setwaypointstatements ["DeleteVehicle _GreenChopper;"]; won't work, right? How do I make that work?
So I say _WP2 setwaypointstatements ["DeleteVehicle (vehicle this);"];?
"deleteVehicle vehicle this"
no need for brackets, vehicle this will resolve before deleteVehicle
Thanks!
Okay, this is what I've got so far:
if (isServer) then {
_GreenChopper = [getMarkerPos "GreenSpawn", 270, "I_Heli_Transport_02_F", independent] call BIS_fnc_spawnVehicle;
_Chopper = _GreenChopper select 0;
_Cargo = _GreenChopper select 1;
_GreenPilots = _GreenChopper select 2;
_WP1 = _GreenPilots addWaypoint [(getmarkerpos " respawn_guerrila"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["this land 'land'"];
WaitUnitil {(getPos _GreenChopper) select 2 <= 1};
_Chopper AnimateDoor ["Door_Back_R",1];
_Chopper AnimateDoor ["Door_Back_L",1];
_Chopper AnimateDoor ["CargoRamp_Open",1];
WaitUnitil {_Cargo == 2};
_Chopper AnimateDoor ["Door_Back_R",0];
_Chopper AnimateDoor ["Door_Back_L",0];
_Chopper AnimateDoor ["CargoRamp_Open",0];
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
_WP2 setwaypointstatements ["DeleteVehicle vehicle this;"];
};```
I'll test and see what goes wrong.
It's always the waituntils that give me this much trouble.
Holy. Shit. THANK YOU!
See the little <, thats where it runs into the error
waitUntililililililililil
_WP2 setWaypointSpeed "FULL";
_WP2 setwaypointstatements ["DeleteVehicle ve>
Error position: <setwaypointstatements ["DeleteVehicle ve>
Error 1 elements provided, 2 expected```
I'm also getting this.
disableChannels[]={0}; doesn't disable Global text channel. Anyone know how to fix that?
we broke joko
๐ฆ i know
disableChannels[] = {0, 2, 6}; // 0 = Global, 1 = Side, 2 = Command, 3 = Group, 4 = Vehicle, 5 = Direct, 6 = System. Admin/server/BattlEye can still use Global.
Dammit, @lone glade, I was going to be useful.
That's how it was before the update
(getPos _GreenChopper) should be (getPos _Chopper)
@daring geyser: https://community.bistudio.com/wiki/channelEnabled
disableChannels[] = {0, 2, 6}; Doesn't work for chat now I sippose
You can now enable and disable channel voice and text separately.
@lone glade why we broke ๐ฆ what did i wrong i treated you well(only 2 punches per day)
That is scripting command. I was talking about the parameter in description.ext
@split coral, thanks!
Eh, then I don't know. I know that my server will have to update for that now, too.
Also: WaitUnitil {_Cargo == 2}; will never be true, because _cargo is an array and it never gets changed from what it was in the beginning
How do I get it to figure out when only the pilot and copilot are remaining on board?
@lone glade, how do I make deletevehicle this into two things?
deleteVehicle will delete the vehicle and it's crew
you don't need to delete the crew first
Right, but you said "should be an array of 2 strings," and the errors I am getting indicate you were correct.
Oh! I forgot the "true" part, I think.
@lavish ocean disableChannels[]={0}; in Description.ext doesn't disable Global text channel for some reason. Any suggestions, David?
Without the waituntils, the script is working perfectly, except that it deletes the chopper and two pilots fall into the ocean.
because it's executed all at once
@lone glade, what do you mean?
waitUntil forces the script to wait until the condition is true
in your case if you remove waitUntil it's going to run all at once (except sleeps)
Right... I'm running it without the waituntils to make sure that deletevehicle was working. Without the waituntils, the chopper spawns, flies to it's waypoint, lands for a moment, then takes off, flies back out to it's spawn point and deletes itself, but when it deletes, the pilots aren't deleting. That's what I'm trying to fix right now.
if you don't use createUnit you need to delete the crew too then
Okay, roger that, I'd prefer to keep using spawnvehicle, because I just got everything working with it and deleted my old createunit version.
_WP2 setwaypointstatements ["true","DeleteVehicle vehicle this; DeleteVehicleCrew vehicle this;"]; This is throwing an error that I don't know how to fix. The error is:Error in expression <Vehicle vehicle this; DeleteVehicleCrew vehicle this;> Error position: <vehicle this;> Error Missing ; Which I think in this case is because I need some parenthesis?
missing "
oh wait nope it's here
probably because you're deleting the crew after the vehicle ?
I entertained that thought for a moment, thought to myself no way, but I'll try it!
Error position: <vehicle this; DeleteVehicle vehicle this>
Error Missing ;```
Nope.
@native hemlock, any thoughts on this?
@native hemlock, don't apologize!!
wrong syntax for deleteVehiclecrew
also vehicle looks wierd if youve looked at it for some time
It seems this note might help you:
Posted on April 10, 2015 - 13:43 (UTC)
Tankbuster
Using the following code will remove ALL crew from the given vehicle.
{_myvehicle deleteVehicleCrew _x} forEach crew _myvehicle;
@indigo snow, thanks a bunch! How might I apply this to _WP2 setwaypointstatements ["true","DeleteVehicleCrew vehicle this; DeleteVehicle vehicle this;"];
My syntax stat is under-leveled.
Surely _WP2 setwaypointstatements ["true","DeleteVehicleCrew vehicle this;{_myvehicle deleteVehicleCrew _x} forEach crew _myvehicle;"]; won't work, right?
you replaced the wrong thing
_WP2 setwaypointstatements ["true","DeleteVehicle vehicle this;{vehice this deleteVehicleCrew _x} forEach crew vehicle this;"];``` Might work?
Haha, thanks, I sure did.
{(vehicle this) deleteVehicleCrew _x} forEach (crew (vehicle this));
deleteVehicle vehicle this;
Turn that into the string you need
Is in SQF a possibility to use INTEGERS and not FLOAT? The normal number type is a FLOAT and here is the problem with FLOATs (https://community.bistudio.com/wiki/Talk:Number#Precision_loss)
So (16 777 216 + 1) - 16 777 216 = 0 but it is 1...
@lone glade, if I use createUnit, rather than spawnvehicle, what all would need to change in my script?
if (isServer) then {
_GreenChopper = [getMarkerPos "GreenSpawn", 270, "I_Heli_Transport_02_F", independent] call BIS_fnc_spawnVehicle;
_Chopper = _GreenChopper select 0;
_Cargo = _GreenChopper select 1;
_GreenPilots = _GreenChopper select 2;
_WP1 = _GreenPilots addWaypoint [(getmarkerpos " respawn_guerrila"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["this land 'land'"];
_Chopper AnimateDoor ["Door_Back_R",1];
_Chopper AnimateDoor ["Door_Back_L",1];
_Chopper AnimateDoor ["CargoRamp_Open",1];
_Chopper AnimateDoor ["Door_Back_R",0];
_Chopper AnimateDoor ["Door_Back_L",0];
_Chopper AnimateDoor ["CargoRamp_Open",0];
_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
_WP2 setwaypointstatements ["true","{(vehicle this) DeleteVehicleCrew _x} forEach (crew (vehicle this));
DeleteVehicle vehicle this;"];
};```
@indigo snow, I am getting odd behavior with your solutions. If I deletevhicle first, then the crew doesn't get deleted. If I deletevehiclecrew first, then the crew fall out of the chopper and the chopper crashes.
theres more issues like what the variable this is in this case
youre getting into territory where tis easier for you to make and call a function so you can use some local variables
this is the vehicle group leader, aka the pilot most likely
you need to save both the heli object and the crew objects to some variable and then delete them
mind you i just stepped into this so i have no clue about what youre trying to do but you need some organization
private _chopper = (vehicle this);
{_chopper deleteVehicleCrew _x} forEach (crew _chopper) ;
deleteVehicle _chopper ;
How would I use the last bit of code that you pasted? I call it at the end of my script or I define it in the beginning and call it later?
that bit you can turn into the string you need
you save yourself headache by simply saving the helicopter to a variable and then using that
Okay, will try. Syntax may as well be hieroglyphics to me, though.
its something you can plain learn and study
Haha, I didn't think it was an innate talent, I'm just still really, really bad at it.
@indigo snow, how would I save it to a variabe? I think I've already done that, but it can't be used in waypoint statements.
Isn't this making my variables?
_Chopper = _GreenChopper select 0;
_Cargo = _GreenChopper select 1;
_GreenPilots = _GreenChopper select 2;```
"a = 1; b = 2; hint (a+b);"
these are local variables that belong to your sqf file, imagine it like having its own desk
the waypoints have their own desks and cant see the stuff other scripts have on theirs
I see. Will it cause this freak out on all clients if I make the variables global?
if will freak out if you run it more than once at the same time
but i already did the work for you
private _chopper = (vehicle this);
{_chopper deleteVehicleCrew _x} forEach (crew _chopper) ;
deleteVehicle _chopper ;
turn that into the string you need and voila
Haha, I know that you've done the work, but I don't understand it or its use. I'm pretty ignorant of this stuff. I'm trying to learn it, so that I don't have to bug people anymore.
I'm going to just try messing with your code there a bunch.
this refers to the group leader of the group that completed the waypoint
in the case of your script, what object/unit is this?
OH! So I am just using your code there inside of the waypointstatement?? My this is a chopper spawned using BIS_fnc_spawnVehicle that is completing a waypoint.
wrong
this is the group leader of the group that completed the waypoint
a helicopter object itself can never be in a group, be a group leader, or complete waypoints
who did you assign the waypoint to?
Oh! Sorry, you JUST said that, too. The waypoint is assigned to the chopper pilot.
I thought I defined that as _GreenPilots, but I guess that isn't so, since that's more than one AI.
right so when you get to the waypooint statement, all those earlier local variables have been cleared and youre left with just your global variables and this.
now you first delete the crew of the vehicle (this and his compatriot) but then you try to delete the vehicle by referring to it as this's vehicle
when this doesnt exist anymore, nor is in a vehicle
That makes perfect sense. That's awesome.
So, I use private _chopper = (vehicle this); {_chopper deleteVehicleCrew _x} forEach (crew _chopper) ; deleteVehicle _chopper ; inside of the waypoint statement to define everything that's about to be deleted, so that the script can delete it?
you save a reference to the actual chopper since it gets deleted after this, yes. You need some way of pointing at it
Awesome! It worked perfectly!
I don't understand what it is going wrong here:
_GreenPilots allowDamage false;
_GreenPilots disable>
Error position: <allowDamage false;
_GreenPilots disable>
Error allowdamage: Type Group, expected Object
Error in expression <hopper allowDamage false;
_GreenPilots allowDamage false;
_GreenPilots disable>
Error position: <allowDamage false;
_GreenPilots disable>
Error Generic error in expression``` It's probably also something simple that just isn't clicking.
You're referencing the group not the vehicle
you also have to disable damage for all crew membrs otherwise they'll die
In some cases, yes. Because it's the group whose behavior I want to modify, or so I thought.
just make the helo invincible right ?
Yes.
_Chopper = _GreenChopper select 0;
_Cargo = _GreenChopper select 1;
_GreenPilots = _GreenChopper select 2;
_Chopper setVehicleLock "LOCKED";
_Chopper allowDamage false;
_GreenPilots allowDamage false;
_GreenPilots disableAI "TARGET";
_GreenPilots disableAI "AUTOTARGET";
_GreenPilots disableAI "FSM";
_GreenPilots setBehaviour "Careless";
_GreenPilots setCombatMode "Blue";
_GreenPilots enableAttack false;```
{_x allowDamage false} foreach (crew _chopper)```
I don't understand why yours will work and mine won't. I am trying to understand why these things are happening, too.
Nevermind. Looking back at my errors and comparing that to your code told me wha tI need to know.
Right, they don't think, they just follow instructions.
(driver _Chopper) allowDamage false; worked perfectly.
Okay! Now I have to get my dang waituntils working.
This is why I thought I needed to run a scheduled script:
Error in expression <
WaitUntil {(getPos _Chopper) select 2 <= 2};
_Chopper AnimateDoor ["Door_Ba>
Error position: <<= 2};
_Chopper AnimateDoor ["Door_Ba>
Error Generic error in expression```
Every time I run a waituntil, I am told suspending is now allowed in this context, but I am unsure how to give it the proper context.
how are you firing that script? theres also a script error in there
Rats! I want to focus on the script errors first, if that's possible. I am firing it from the debug console in a hosted server from my machine using the server exec button.
Can I use a waituntil without running a scheduled script or whatever?
@indigo snow, things are working perfectly with the script for now.
i have problem i add UAV "class Item720
{
position[]={15045.713,17.91,16822.574};
azimut=140.328;
id=775;
side="EMPTY";
vehicle="I_UAV_02_F";
isUAV=1;
leader=1;
skill=0.60000002;
init="_nul = [this, 60, 1] execVM ""Scripts\vehicle.sqf"";";
};"
i add to mission but cant use uav
i must brake in to use how to fix this ?
I believe UAV classes have changed
player assignItem "ItemGPS"
doesn't work anymore. Can anyone confirm?
NVM, was thinking of linkItem
Page 3 of 3 - Line Drawing - posted in ARMA 3 - DEVELOPMENT BRANCH: Line drawing is an awesome feature that Im really looking foward to. Should it also happen to come with a set of script commands along the lines of what the ALiVE team requested...well, thatd be just incredible
ย
EDIT: Might be out of scope for your task, but since youre already working on the map: Would it be possible to get an optional toggle for icons so that they have the same scaling behaviour as the lines? (I.e...
how to drop bomb from zeus ?
cursorTarget setDamage 1;its only make damage one object
Place bomb => Select it => Press END
Or place fire support modules such as mortar, etc.
try _toSpawn = "Bo_GBU12_LGB" createVehicle position player; and work
why did KK suggest using a trigger for that?
frame handlers work on servers
and have for years
He did it fast after the update, probably made it as he thought at that moment
i guess... makes him look like a rookie
Well... After what he did for arma modding, I can forgive him for that ๐
meh, he's been hit or miss most of the time
Anyone willing to help me troubleshoot my issue I'm having getting a normal respawn to work in a mission? I swear, it's probably something simple, but I can't for the life of me figure it out today.
You're not the only one reporting issues like this
Let me check the feedback tracker but I think it's a known issue
Really??
yep
Even when I exported the mission and tested on a dedicated server it wasn't respawning me like I thought it should. Very odd.
The fix around this is using respawn position modules set to your side
markers seems borked atm.
I've tried using the respawn modules, it didn't work. Do I need to clear out my description.ext parts that are related or something?
don't use 3DEN attributes AT ALL
those are broken as fuck
mark respawn disabled on 3DEN attributes and use description.ext entries
I haven't been. I use only my description.ext.
Create a repro mission (barebone stuff) and create a feedback tracker ticket
mark respawn disabled on 3DEN attributes and use description.ext entries
Eden respawn settings overwrite description.ext now
because you use addRespawnPosition?
I have 2 missions on the same map with similar settings. Both with respawn markers and respawn=3 in description.ext
Can you try enabling respawnPosition in the templates ?
and first one has "no respawn" in mission.sqm (from Eden) and second one doesn't
guess on which one you can respawn ๐
@vagrant kite, how do I do this? Where does this magic code go?
to be safe, setup your respawn in Eden: it's in Settings -> Multiplayer
@lone glade, how did you write your system? I am wanting to write a system here, I'm just getting the baseline stuff squared away first. I don't want a revive script, what I am wanting is to have an immersive respawn script where whenever an objective is seized all dead players respawn and are assigned to a helicopter that drops off the respawns at base as reinforcements.
Okay, I'll set up 3Den stuff first and BRB.
It's a revive system more like a respawn one
You get shot -> moved into revive state
people can drag / carry you around and revive you
Can someone please check in MP (with someone else)
moveOut _unit;
[_unit, _animation] remoteExec ["switchMove", 0];
while _unit is in a vehicle and then respawn.
@lone glade, that's similar to the revive script that my community made. For ours, we made the players become immobilized at 95% damage, instead of 100% damage, which I think is abnormal, but we did it that way to avoid some other issues.
I think this causes duplication issues across clients
I kill the unit and place the new respawned one where the previous one was del
If I had anyone to test it with, I would. Can you host a server and I'll join it and you can just test the script that way?
@lone glade, that's how the BIS revive works. We had many, many issues with it, so we made our own. We are working on getting a bit added to where we can load the wounded into vehicles. Ours also has a feature where when players are down, they bleed out if they don't get treated in time, which isn't rare, but the neat part is that anyone can stabilize the wounded and stop their bleeding, but after that the wounded has to recieve trauma care every two to three minutes until the medic arrives to fix them, but eventually, they have to have care so often that it takes two people, then eventually they just bleed out and nothing can be done about it, but with two attendants, the wounded person can last twenty or so minutes.
Thing is, mine works better than BIS :p
I ironed out the issues from yesterday's release, now it's gud.
176.148.92.210:2302
Sure, but our community couldn't work with any script that lets the player die first, because we have too many scripts that have to run again when the player respawns. We play in a completley vanilla sandbox that's persistent and has custom uniforms, custom radio channels, and custom ranks and rank textures, as well as whenever players are respawned, our company loses money, so if players were to die and then be moved back to the place they died for the script to work, then we'd have money leaving our account or we'd have to write a script to check those conditions and add the person back their custom rank, uniform, and radio channels.
Connecting now.
:facepalm: I forgot to enable the debug console
gimme a sec
do you see two people standing ?
Standing where?
in front of the vehicle
No problem!
@vagrant kite, setting the settings in Eden/attributes/multiplayer worked perfectly... but I much prefer the old description.ext method, I believe. How do I make it choose the old way?
@lone glade, would you have any idea where to start with a spectator script or with scripting the helicopter wave respawn that I'm talking about?
nope, too busy atm
@shadow sapphire How do I make it choose the old way?
just don't touch multiplayer settings in Eden - ever ๐
@vagrant kite, dammit, what if it's too late? Why is there no way to fix it, dammit!?
Anyone else having problems with executing code with debug console as an admin on a server?
can anyone help me with a arma 3 altis life server looking for a dev/scripter i dont mind paying
Anyone else having problems with executing code with debug console as an admin on a server?
it's broken in 1.60
Seems OK at my side
the debug console uses remoteExec for "SERVER EXEC"
depends on your white listing
It's either call or BIS_fnc_call
Yeap yeap noticed that in the log afterwards, needs to be fixed in the future
The debug console use call for local exec
only watch fields can execute local stuff if you have remoteExec protections.
Can someone spot the difference between these two loadout scripts? I made a switch case for a loadout script for a PVP game mode and when I went to test it today with multiple clients, I have found that it isn't equipping some units, but I cannot figure out why. It's removing all of their gear, so I know that it's getting it started, but it's not applying the new gear.
This one does NOT work:
_unit forceAddUniform "U_I_OfficerUniform";
for "_i" from 1 to 6 do {_unit addItemToUniform "SmokeShell";};
for "_i" from 1 to 2 do {_unit addItemToUniform "SmokeShellYellow";};
for "_i" from 1 to 2 do {_unit addItemToUniform "SmokeShellGreen";};
_unit addVest "V_PlateCarrierIA1_dgtl";
for "_i" from 1 to 9 do {_unit addItemToVest "30Rnd_65x39_caseless_mag";};
_unit addHeadgear "H_HelmetIA";
_unit addWeapon "arifle_MXC_Black_F";
_unit addPrimaryWeaponItem "optic_Aco";
_unit addWeapon "Binocular";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemWatch";
_unit linkItem "ItemRadio";
};```
This one does work. I can't find the difference. They are found one right after the other in the switch and it seems random which ones are working and which aren't. I know it's something I've done wrong, but I don't know what it was.
```case "I_support_Mort_F": {
_unit forceAddUniform "U_I_OfficerUniform";
for "_i" from 1 to 6 do {_unit addItemToUniform "SmokeShell";};
for "_i" from 1 to 2 do {_unit addItemToUniform "SmokeShellYellow";};
for "_i" from 1 to 2 do {_unit addItemToUniform "SmokeShellGreen";};
_unit addVest "V_PlateCarrierIA1_dgtl";
for "_i" from 1 to 9 do {_unit addItemToVest "30Rnd_65x39_caseless_mag";};
_unit addHeadgear "H_HelmetIA";
_unit addWeapon "arifle_MXC_Black_F";
_unit addPrimaryWeaponItem "optic_Aco";
_unit addWeapon "Binocular";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemWatch";
_unit linkItem "ItemRadio";
};```
I don't understand how that will help. Can you explain? The wiki on getunitloadout doesn't say anything relevant to this situation.
instead of having a big list of loadout stuff you have a single array of arrays and you use setUnitLoadout
Where do I use getunitloadout that will give me what I need?
debug console
So, using getunitloadout on units that the script failed on will give me some sort of information?
no, you make a quick debug mission with the virtual arsenal and debug console
then you equip yourself
and use copyToClipboard str getUnitLoadout player
Takes a while to set up, but if you've done that it's super fast
Haha, okay, that's what I thought you guys were getting at. Not helpful, since I've already done that part. All of these units already have a loadout. For some reason my switch case is failing on certain units and I can't figure out why that's happening.
Holy cow... dang it. Okay, that definitely explains the problem, I had a hunch that was the case, but did NOT think it was a reasonable thought. Dammit.
can anyone ELI5 this cfgPatches change in 1.60?
I would if I could, but I am plainly terrible at all of this stuff.
Why doesn't this work?
case west:{
["Initialize", [player, [west], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case east:{
["Initialize", [player, [east], false, true, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case independent:{
["Initialize", [player, [independent], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
};```
Give error pls
It isn't throwing any error that I can see. It's just not doing anything.
add some debug hints and a default case
It's in onplayerkilled.sqf. When I have just:
["Initialize", [player, [west], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator; it works fine.
@rancid ruin, okay, will do.
and remember player doesn't exist on servers
Player doesn't exist on servers? Dammit, that's probably it. How do I fix that?
@carmine galleon, yeah, double checked the .rpt, it's throwing no errors.
Why don't you run script client side ?
Haha, I guess because I don't know how to run clientside from onplayerkilled.
_this = [<oldUnit>, <killer>, <respawn>, <respawnDelay>]
player addEventHandler ["Killed",test_fnc_yourfunction];
you have fun times ahead of you del-j ๐
_player = _this select 0;
@indigo snow Will work, but for what he wants, he should do client side
oh yes, but if he wants to handle it all from the server side it would certainly be possible
Yes it would ๐
@indigo snow ```_player = _this select 0;
switch (side _player) do {```?
Will work
Yes, you must change every player by _player
@shadow sapphire If you want it clean, use it client side
privatise it too? or not?
Don't handle that from server
better to keep on trucking until the entire concept is there. relatively easy to move it around after
if hes new and still learning everything it can be benificial
It could, but increase traffic
but hes obviously still in the learning how2code phase, he shouldnt be worried about stuff like that
no offense btw
Okay, I agree with you, you're right ๐
is private["_var","_var2"] still the best way to privatise vars?
did i imagine a new command recently?
About ?
something to do with private, or maybe params
Well it's not the same
sorry, i've not sqf'd in months, last few patches seemed to be pretty big
params is intended to get parameters passed to the funtion
private privatise variables on script
private is interesting when you call script from inside another script that uses same variables names
So you can privatise the variables inside the other script
According to wiki :
_foo = 10;
if (true) then
{
private ["_foo"];
_foo = 5;
player sideChat format ["%1", _foo];
};
player sideChat format ["%1", _foo];
In this example, the first sidechat (innermost) returns 5 while the second sidechat (outermost) returns 10.
ja i understand the concept
@indigo snow
In onplayerkilled.sqf, this works:
["Initialize", [player, [], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
This doesn't:
switch (side _player) do {
case west:{
["Initialize", [_player, [west], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case east:{
["Initialize", [_player, [east], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case independent:{
["Initialize", [_player, [independent], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
};```
Nor does:
```_player = _this select 0;
switch (side _player) do {
case west:{
["Initialize", [player, [west], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case east:{
["Initialize", [player, [east], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case independent:{
["Initialize", [player, [independent], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
};```
What'd I miss?
i think i was just thinking of params, which privatises vars anyway according to the wiki
Yep of course
because onPlayerKilled first arg is the dead body
those are all side empty
use playerSide
this is on the server tho ๐
Thanks, @lone glade! Will try!
@lone glade
case west:{
["Initialize", [player, [west], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case east:{
["Initialize", [player, [east], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
case independent:{
["Initialize", [player, [independent], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};
};``` This works perfectly! Thank you so much!!
Is there something like onjoininprogress.sqf or latejoin.sqf?
it's a param in initPlayerLocal or init
The word you're looking for is JIP (Join In Progress)
It's a param! Awesome!
why so much shit load of code?
["Initialize", [player, [playerside], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
this do 99% the same
and is just one line of code
@zealous solstice, hahaha, because you weren't here to give advice. Will try your version now.
@zealous solstice, your version works perfectly. Thank you!
I can't find any "for dummies" information on how to gather and apply the didJIP portion of the initplayerlocal. Anyone have a tip?
initPlayerLocal is executed the same whether you JIP or not.
_unit = _this select 0;
_JIP = _this select 1;```
it's either false or true.
I am trying to force players who join in progress to be spectators until the next wave of respawns.
How do I gather that true or false and/or apply it in a code. I'm not sure if it's like an argument or condition or what the right term is.
if(_JIP) then {
// SPECATOR CODE
};
Will it hurt anything if I leave this in the initplayerlocal?
[player:Object, didJIP:Boolean]
I can comment it out, but I want to leave it in as a note so I can understand what's going on.
Do //[player:Object, didJIP:Boolean]
Okay, commented out! Thanks!
np
if(moricky) then {_biCommunity setDamage 1;};
if(apex) then {_arma3Life addWeapon "arifle_thousand_dollars";};
if(apex) exitWith {altisLifeEasyMoneyJetSki};
Hmm... Okay, getting some odd behavior from initplayerlocal:
enableSentences false;
//[player:Object, didJIP:Boolean]
params ["_unit", "_JIP"];
if (_JIP) then {
["Initialize", [player, [playerSide], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};```
Maybe it's because I have the server and three clients all running from the same machine, but when clients join in progress, they are spawning as normal, but with the camera widgets on and no ability to look around.
aaaaaand someone is going to be put in @muted_trolls
@shadow sapphire because spawning happens after init.
Ugh! Always something, haha.
I knew init happened first, but I guess I assumed that the camera would prevent that from happening.
That's okay, though, because now I need a check to prevent them from spawning until conditions are right. I need to add them to an array.
What I want is all dead players and all JIP players to be in camera spectating, but be added to an array and whenever an objective is captured, all players in the array are assigned as cargo to a helicopter that will drop them off. I've got the helicopters working perfectly, thanks to you guys here, but that was probably the easier part of the battle. I thougth the spectator script was going to be super hard, but thankfully BIS had their own already, and it's good!
Is there a way to detect the IDD of the active display?
//List of menu IDDs
_menuSystemIDDs = [60541,60542,60543,60544,60545,60546,60547,60548];
//Attempt to capture display
{
if (!isNull (findDisplay _x)) then { uiNamespace setVariable ["RscFORNavMenu", (findDisplay _x)];};
} forEach _menuSystemIDDs;
I'm not having a lot of luck with this. It doesn't seem to work reliably.
Is there a way to detect the IDD of the active display?
no
Then I could check if the display is in allDisplays for each display in a defined array of displays?
yerp
Thank you very much @jade abyss
_Display = findDisplay 12345;
{
if(_x isEqualTo _Display)then{hint "You won the lottery"};
}forEach allDisplays;
should work, not tested
Can I do this?
_menuSystemIDDs = [60541,60542,60543,60544,60545,60546,60547,60548];
{
if ((findDisplay _x) in allDisplays) then { uiNamespace setVariable ["RscFORNavMenu", (findDisplay _x)];};
} forEach _menuSystemIDDs;
More particularly, will it actually save to the uiNamespace?
Welp, YOLO. Testing it now...
Nope ๐
if ((findDisplay _x) in allDisplays)
if (!isNull (findDisplay _x))
second is a lot quicker way of doing that
and yeah, it should save to uinamespace
I had !isNull originally but couldn't get that to save either. Probably wasn't the condition's fault.
so you've put uiNamepace getVariable ["RscForNavMenu", "nope"]; or similar in the debug console and nothing's coming up?
i don't think there's an issue saving a display to a variable in uinamespace.. but maybe i'm wrong
in which case you could save the IDD instead
I'm going to try a thing. I am wondering if it's the disableSerialization
uiNamespace setVariable ["RscFORNavMenu", _x];
Guess not. Trying capturing the IDD now
Welp, I may have found the problem. I think I'm loading the wrong display...
6,000 random issues later, my navigation bar works. Thanks for your help guys! ๐
In the 6+ months or however long this discord has been around, I've never seen post that many messages, that quickly, in one channel
life players do cocaine
In a chat application with a chat history that displays your question practically indefinitely, asking once is enough.
Not to mention New Message notifications...
Anyone have any idea why respawns are broken? :/
@winged thistle tbh I'd hardly ever reply to some question that was posted days ago because there's a high chance the person already got the answer and I'd end up wasting my time. Repeatedly asking a question, especially when there's other questions overlapping yours is totally fine in my opinion...as long as it isn't spammed each half-hour or sumn spammy like that
I also have muted this channel so I don't get notifications...may be useful to you
Hey gang, looking to remove the "move inside" option from the RHS C-130s, any idea how I might do that?
If rhs uses a local identifier for the action try killzone kids function and modify it depending on the target. See bottom of page https://community.bistudio.com/wiki/addAction
Why doesn't this work?
enableSentences false;
//[player:Object, didJIP:Boolean]
//params ["_unit", "_JIP"];
waitUntil {
time > 0 &&
!isNull player &&
player == player
};
if param[1] then {
["Initialize", [player, [side player], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};```
param[1] is NOT valid SQF
Thank you!
also player == player is pointless after !isNull player
Okay, going to try: ```enableRadio false;
enableSentences false;
//[player:Object, didJIP:Boolean]
params ["_unit", "_JIP"];
waitUntil {
time > 0 &&
!isNull player
};
if (_JIP) then {
["Initialize", [player, [side player], false, false, true, false, false, false, false, false]] call BIS_fnc_EGSpectator;
};```
Okay, that didn't work either. What's happening is that the JIP is spawning a character. I need to prevent the character from spawning or something. Also, the camera is initializing wrong somehow.
IDK how BIS_fnc_EGSpectator works internally. It probably has problems with JIP
If I kill the JIP player, then they initialize the camera perfectly. Maybe what I should do is just have it where when players JIP, they are instantly killed and corpse deleted. Would that work?
Trying now with deleteVehicle
@little eagle, It kinda worked! It's not deleting the corpse, but I think maybe because of the way it's ordered or something.
oh I know
you probably are losing locality of the object so deleteVehicle fails
just setPos it into the ocean before killing it
Yeah, so if I put deleteVhicle first, might taht work?
I will do that when this fails. I just want to sate my curiosity.
you probably can remove the setDamage after deleteVehicle.
@little eagle, Okay, so if I do;
deleteVehicle _unit;
};```
Then it does nothing, the JIP spawns as normal.
If I do;
```if (_JIP) then {
deleteVehicle _unit;
_unit setDamage 1;
};```
Then it kills the player, deletes their clothing, but doesn't delete their body. Odd!
I have one more thing I want to try before setting position to nowhere.
Can't I just do.... hideobjectglobal some way?
no, hideobjectglobal only works on the server
Double dammit.
It also will fail when other people JIP
i don't get why deleteVehicle wouldn't work ...
For locality, see the icons at the top of pages on the BI wiki
just do the setPos thing
@dusk sage, do you have any ideas other than the setpos thing? I don't mind doing it, but only as a last resort or as a placeholder. I feel like it's a bit... hacky, but I guess it's no more hacky than killing someone as they join the game, hahaha.
It was my idea. And no. I don't know any other way
@little eagle, I know it was your idea, but since Boguu was around, I thought I'd ask.
If you are using a respawn type different then 1 ("Bird"), you may want to execute the spectator mode when a player dies, then stop the spectator when the player respawns, this could be achieved in many ways, such as the one bellow, which will make every player start spectating when dead, and stop spectating when he respawns, 60 seconds after:```
```Description.ext
respawn = 3;
respawnDelay = 60;```
```onPlayerKilled.sqf
["Initialize", [player, [], true]] call BIS_fnc_EGSpectator;```
```onPlayerRespawn.sqf
["Terminate"] call BIS_fnc_EGSpectator;```
do you use respawn = 3; or BASE?
@west lantern, I have respawn=3;
and with this you want to disable JIP from playing but joinging spectator insead?
@little eagle, I am now using your idea of dumping them in the ocean. Works perfectly!
@west lantern, yes, I want JIP players to start off spectating, because I don't want players appearing at base mid objective. My next task is writing a respawn template, I guess. My goal is to have all of the dead and JIP players to only be able to spectate until an objective is captured. When the objective is captured, all of the dead players will respawn and will be assigned as cargo to a respawn chopper, which will drop them off at their respective bases.
The goal is immersion, haha.
yw
nice plan, well this above I quoted might help, I thought you would disable respawn altogether in a mission but I see its a bit more complex than what I proposed.
maybe better to set respawn as bird or 1 init spectator and this would fix ( hopefully ) character appearing
for the rest do your thing with your template
I can combine respawn=1 and a template?
What I am wanting to do is add all players that are dead into an array, I think.
1 is spectator basically
1 is respawn type not template so you can use it in description.ext along with custom repawn template
if you use 3 but dont allow respawn that would cause side effects IMO
{
// Class used in respawnTemplates entry
class myTag_beacon
{
// Function or script executed upon death. Parameters passed into it are the same as are passed into onPlayerKilled.sqf file
onPlayerKilled = "\myAddon\scripts\respawnBeacon.sqf";
// Function or script executed upon respawn. Parameters passed into it are the same as are passed into onPlayerRespawn.sqf file
onPlayerRespawn = "\myAddon\scripts\respawnBeacon.sqf";
// Default respawn delay (can be overwitten by description.ext entry of the same name)
respawnDelay = 20;
// 1 to respawn player when he joins the game. Available only for INSTANT and BASE respawn types
// Can be overridden by description.ext attribute of the same name
respawnOnStart = 0;
};
class Spectator
{
onPlayerRespawn = "BIS_fnc_EGSpectator";
};
};```
@west lantern, I think you're onto something good here... Is there a command that can respawn players? I've only been using respawn=3 because I didn't know if there was any other way to get them to respawn.
that is respawn type, there are several to choose from, and 3 or base is as it says respawn on defined marker named respawn_east or west or whatever
it is commonly used respawn type fro mission that allow it
Right, I am using base type respawns with proper markers. The normal respawn is working fine.
you are using mixed type of respawn, not really true respawn in base or at least that is what you want to achieve
What I'm wondering is if I can use respawn=1 and still have players spawn into the game later, instead of just be stuck spectating.
for that part I am not sure you will have to test that
Ah, I see. That's what I was asking is if you knew of a command that would be able to spawn the players who were currently spectating.
I dont think there is one, must do custom scripting there.
That's fine. I'll get it figured out. Thanks a bunch!
But if this works what you have now, carry on, I bited quite more than I can chew myself ๐
Either way, thanks for the input!
pleasure
Could somethine like this be made to work?
_unit remoteExec ["hideObjectGlobal", 2];
_unit remoteExec ["enableSimulationGlobal", 2];
_unit setDamage 1;
};```
looking for someone to set up my server pls msg me for details
@torpid oxide try #server_admins
@shadow sapphire hideobjectGlobal must be executed on server so it wont work
That's what the remoteExec is for...
but you are trying to hide a vehicle I dont think it will work? Tried?
This is similar to the method we use in my sandbox. It works there. They remoteExec these commands somehow to create a custom respawn. When someone dies, they respawn at base, but their simulation is disabled, they are hidden, and their camera is forced into a UAV view until conditions are right for a respawn.
might have quirks with that and its very hacky
Units that have been previously subjected to enableSimulation false; or enableSimulationGlobal false; may stay unrecognised for a long time even after simulation was re-enabled, returning objNull as cursorTarget. Force revealing units with reveal command usually solves the problem. For example:```
`{player reveal _x} forEach allUnits;`
Yeah, but there isn't a respawn command or anything. My group's sandbox is a bit abnormal, but it is becoming VERY professional. Bugs being squashed all the time as new features are added. I'm involved with the development of that very little, though. This project of mine is nothing compared to the complexity of the sandbox.
So, you're saying I need ot force reveal the players when it comes time to "respawn" them? Can do !
just a heads up in case of bugs, if it works without it no need to, but this is failsafe I guess
Thanks a ton!
Also this
_obj setPosATL [getPosATL _obj select 0, getPosATL _obj select 1, (getPosATL _obj select 2)-100];
And to unhide:
_obj setPosATL [getPosATL _obj select 0, getPosATL _obj select 1, (getPosATL _obj select 2)+100];```
if it all fails switch to that one
With the latest patches, in MP / dedicated server, has anyone had issues with the debug console not executing commands for logged in admins?
I'm probably missing something, but debug console is refusing to execute anything, even with description.ext's enableDebugConsole=1 (or 2).
Any chance the console pays attention to the CfgRemoteExec settings, even for simple Local commands like Hint ?
I think you need to whitelist the call command in CfgRemoteExec for the debug console to work now.
Thanks @jaunty drift , that worked.
Anyone have any guidance on how I can add players killed to an array?
Something like this onplayerrespawn:
_reinforcements pushback;```
don't use those shitty event scripts.
if (isServer) then {
My_DeathCount = 0;
publicVariable "My_DeathCount";
addMissionEventHandler ["EntityKilled", {
My_DeathCount = My_DeathCount + 1;
publicVariable "My_DeathCount";
}];
};
(untested, might have typos)
@little eagle, how will this build my array of players waiting to respawn?
It doesn't. You will want to use pretty much what you posted earlier except within the event handler: ```if (isServer) then {
yourtag_reinforcements = [];
addMissionEventHandler ["EntityKilled", {
params ["_killed"];
if (isPlayer _killed) then {
yourtag_reinforcements pushBack _killed;
};
}];
};```
I didn't test it so isPlayer _killed might always return false (and not push the player into the respawn queue) because the unit might not be a player anymore. Depends on how your mission is set up.
@jaunty drift, thanks for the tips! Will look into it!
@jaunty drift, I am actually trying to add recently respawned players to the array, not recently killed ones. How might I phrase that?
@jaunty drift, thanks so much! Does this look sound? Can I just put it in my mission init.sqf?
_reinforcements = [];
addMissionEventHandler ["EntityRespawned",
{params ["_spawned"];
if (isPlayer _spawned) then
{_reinforcements pushBack _spawned;};
}];
};```
It looks hard to read :P. It should be good to just go into your init.sqf
Thanks for the input!
Hey guys, anyone on here think they could help me add some stuff to my planes Electronic warfare script? Our script is 50% done but our scripter went dark!!
What does the script do?
new performance binaries (1.60.136493) in #perf_prof_branch (with fixes for oPC/oPD event-handlers)
@shadow sapphire
Yeah, sorry I skimmed over it. I was asked something similar on Slack.
You might want to drop the isPlayer check if that proves to be unreliable (could be that these respawned units aren't considered players at that point in MP)
AI's don't usually respawn anyway.
Also your script won't work. _reinforcements is a local variable and never defined inside the scope of your event handler. Use a global variable.
If you want to access the variable on client machines, you have to pubVar it every time you append the array. Arrays are pointers only locally, but are copied when send over the network. If you only need the variable on the server machine, then ignore what I just wrote.
@little eagle, thanks for the input! I already got everything else figured out, like making the array global, but I did not know about the public variable. That explains why my array stays empty, I think. How might I do that? Any guidance or links?
@rancid ruin, I'm using a global variable for my array now, but I am unsure of where to call the publicvariable. I have it declared in the mission init, but that doesn't work alone.
The script redirects missiles to hit somewhere else and not any blufor aircraft within a radius of the Growler. We have it so it redirects anything coming to the Growler so far. Our last scripter was Andrew Rindfleisch from the USAF team. He has been busy with real life and hasnt even logged in to skype in weeks.
@shadow sapphire i think you'd publicvar it here
{_reinforcements pushBack _spawned; here}
it's been months since i was deep in to any sqf but i recall that you need to pubvar a variable any time it changes, it doesn't automatically update with any changes
also it might need to be a global var to begin with, e.g replace _reinforcements with delj_reinforcements
it's generally a good idea to put your tag in front of variable names
I already made it a global variable. I've seen people tag variables like that, I don't understand the purpose.
multiple scripters using obvious var names like "reinforcements" and "money" = scripts get fucked up
Oh, I see. I'm the sole scripter on this project, so I don't think it will be a major issue.
@rancid ruin, that fixed it! Thanks so much!
nice, no problem
how come _pos changes when I start spawning units here https://gist.github.com/alganthe/dcac9c7482482619a40277f47e6e2f10
It makes absolutely no sense, i'm confused.
_pos being a location's position.
In the Intro Mission, after I call end. How do I start the mission with the same units where they inserted by helicopter.
At the moment I have had to copy and paste their exact position from where they dismount into the scenario. I tried looking at the BIS missions but couldn't see anything special they are doing.
Two trigger related questions:
- Can empty vehicles be used with triggers that detect Anybody?
- Can thislist be used in a trigger's onactivation?
@lone glade Are you changing the _pos array in any of those other scripts without duplicating it? ie _unitpos = _this select 0; _unitpos set [0,100]; should be _unitpos = +(_this select 0); ...
also, if you have _pos in one of those other scripts where it's not marked private, it will change.
@lone glade
put diag_log _pos everywhere, also check if derp_fnc_sideMissionSelection or any other global function redefines _pos without private
*diag_log str _pos
diag_log doesn't require it to be a string so technically he is not wrong
@agile pumice 1) Not sure about this one. I had it once activate for empty, another time it didn't, so you need to check
2) yes
_pos is a location position that is stored in an array
I've come to the conclusion that locations are simply fucked
doesn't matter, the pos change whenever I spawn the first unit
if I place the markers and tasks first it doesn't
it's simply location fuckery.
or var corruption
maybe it's a problem with 'private'
maybe params is broken and not loacations
.............
just change the var name to something unique
I swear if that's the case....
then you're gonna do nothing? ๐
changing it to an other var fixes it, so var corruption it is
dafuq, soooooo It's weird.
let me count how many calls and scope deep it is.
1 call then 4 scopes then 1 call again and 3 other scopes
Does BIS_fnc_listPlayers report headless clients?
Is isPlayer true for "HeadlessClient_F" ?
yes it is
Is it possible to have a headless client object that is not: HeadlessClient_F
no idea.
I added a note to https://community.bistudio.com/wiki/isPlayer
It said: "Check if given person is a human player."
which is confusing considering headless clients are bots
there's already a note in allPlayers btw https://community.bistudio.com/wiki/allPlayers
Yes, but not in isPlayer
Also, does player report the headless client object on the HC machine?
player does report the headless client object
What's the diff between the above two segements.
Do they function the same? I am thinking the answer is yes, but I wan't to be sure.
Which is more reliable to use in a continously looped segment that updates UI, looped once every 6 seconds.
it's coded like ass
that's what I can tell you
define a max hunger and min hunger, then set the color based on a percentage using those values
The first one is written by someone who doesn't know that switch exists
The second one is written by someone who doesn't know how switch works.
Okay, today, I need help gathering data from an array. This is my array:
reinforcements = [];
addMissionEventHandler ["EntityRespawned",{params ["_spawned"];
if (isPlayer _spawned) then {reinforcements pushBack _spawned; publicvariable "reinforcements";};
}];};```
Now, I need to learn how to grab the elements placed in this array. Sort them by side and stuff them into helicopters. I already have the helicopter script working nearly perfectly, but now I need to stuff bodies onto it.
Now, I need to learn how to grab the elements placed in this array.
reinforcements select 0
???
reinforcements is a global var, just use select
I'm just super ignorant of all of this stuff. I really am way in over my head, guys. I know that's not your responsibility, but I'm very appreciative of all the help you've given so far.
May I trouble you a bit more for an explanation of how this works? I am looking up select now, hopefully that will shed some understanding on how it works.
arr = [unit0, unit1, unit2];
arr select 0
-> unit0
-> unit2```
<array> select <index> -> take element from the <array> that sits at position <index>
(indices start from 0)
Ah! @little eagle, that for some reason clicked in my brain. Thanks much! What I need to do is grab the first sixteen units of each side in the array, assignascargo to a named helicopter, then if there are more than sixteen in a side in the array, then I need to run the script again until the array is empty. So, as I select the units, sort them by side, and assignascargo them, I also need to delete the units from the array, so that the same units aren't grabbed again.
I'm thinking something like alternative syntax 3 of select is what I need to be using.
use a forEach loop that exits if _forEachIndex reaches 16
you could do that, but then you are no step closer to your goal
Haha, indeed. Okay, so, is any forEach a loop?
Or do you make it a loop somehow?
I think I'll go with forEach, since that's the kind I've seen before.
but forEach works pretty good in arma
just keep one thing in mind...
don't modify the size of the array you are iterating through
behaviour is undefined
Modify the size of the array?
like append it or remove stuff from it via deleteAt
{
_array deleteAt _x;
} forEach _array;
It's an array that will be changing constantly throughout the game. It has to.
^ zero divisor
There have to be players being added to and deleted from the array. What's my next move?
yes. and that's one of the reasons why I never use the scheduled env. haha
Dont add and delete to it while looping through it
^
OH! Okay, so loop through, then delete them after the loop?
yes. you can do stuff like:
{
// do stuff
my_units set [_forEachIndex, objNull];
} forEach my_units;
my_units = my_units - [objNull];
Okay, I don't understand that one much.
@shadow sapphire do you have a list of choppers too?
or do you want to create them on the fly? (no pun intended)
I don't have a list, because the choppers are created on the fly.
_GreenChopper = [];
if (isServer) then {
_GreenChopper = [getMarkerPos "GreenSpawn", 270, "I_Heli_Transport_02_F", independent] call BIS_fnc_spawnVehicle;
_Chopper = _GreenChopper select 0;
_Cargo = _GreenChopper select 1;
_GreenPilots = _GreenChopper select 2;
_Chopper setVehicleLock "LOCKED";
_Chopper allowDamage false;
(driver _Chopper) allowDamage false;
(driver _Chopper) disableAI "TARGET";
(driver _Chopper) disableAI "AUTOTARGET";
(driver _Chopper) disableAI "FSM";
(driver _Chopper) setBehaviour "Careless";
(driver _Chopper) setCombatMode "Blue";
_GreenPilots enableAttack false;```
Okay, I don't understand that one much.
Instead of modifying the size of the array while looping through it, it replaces single elements with "objNull"
and at the end, it removes all "objNull" from the array
@little eagle, that's incredible!
{
if(_forEachIndex % 16 == 0) then {
_chopper = <create_chopper>
};
_x moveInCargo _chopper;
} forEach _units;```
_driver allowDamage false;
_driver disableAI "TARGET";
_driver disableAI "AUTOTARGET";
_driver disableAI "FSM";
_driver setBehaviour "Careless";
_driver setCombatMode "Blue";
why that random modulo yours ?
for new chopper every 16 passengers
@vagrant kite, that's awesome!
why not just compare the index to 16 ?
Every 16...
if you have 50 units
32 means two choppas
you have new chopper for 0, 16, 32, 48
oh right, missed that part :p
@vagrant kite, where does this fit within my script? Right at the beginning or after _chopper has been defined?
try to understand what the script I gave you does
cuz you put your code in the middle of mine
I am, haha, it looks like I have to change some names, at least.
I have a bit of a to do list for the moment.
May I paste in the whole script to get some guidance? I've got one other issue. So, I have two different scripts running two different choppers, they are nearly identical, but they come from different points, belong to different factions, land at different bases, so I need to sort out which faction someone in the array belongs to at some point before the script runs, I believe. Should I just create two different arrays and have them sorted before I even get started on the deployment parts of the script?
So I would make this into two arrays and sort them as they go into the arrays for the sake of making the deployment portions of the script easier?
reinforcements = [];
addMissionEventHandler ["EntityRespawned",{params ["_spawned"];
if (isPlayer _spawned) then {reinforcements pushBack _spawned; publicvariable "reinforcements";};
}];};```
make a gist or pastebin del, easier to paste and read
Okay!
I would prefer a gist if I were you, there's sqf highlighting with it.
Where do I set the SQF highlighting? Is it just done automagically?
the name of the file need the .sqf extension
There's sqf highlighting on pastebin too fyi but it's basic
Is there a verdict?
gist > pastebin imo
has anyone else had this problem with drawIcon3D with a custom camera? https://feedback.bistudio.com/T116714
it's the showhud that's the issue here shado
draw commands are disabled too
You cannot remove the action menu icons without removing draws too.
@lone glade but i tried this with showhud and without it
Don't know for custom cameras but showHud remove draw rendering if it's set to false.
@little eagle, any guidance or advice on getting the gisted script to work as I need?
I know I have most or all of the tools here to do it, but I don't know how to assemble things.
Okay, I know that there is something wrong with my parameter here, but I am not creative enough to know how to fix it.
What is wrong with this?
https://gist.github.com/DEL-J/d89d3a8bcc6f7f1749761d76a37fd4a2
or found here:
GreenReinforcements = [];
RedReinforcements = [];
addMissionEventHandler ["EntityRespawned",{params ["_spawned"];
if (playerside == independent && isPlayer _spawned) then {GreenReinforcements pushBack _spawned; publicvariable "GreenReinforcements";};
if (playerside == east && isPlayer _spawned) then {RedReinforcements pushBack _spawned; publicvariable "RedReinforcements";};
}];};```
_spawned undefined?
I was trying to get it to sort the arrays based on player's side, but it's putting both sides into the GreenReinforcements array.
got only ind and east in mission? Players?
Yeah, players can only be AAF or CSAT.
try with else instead of two if
@DEL-J there is no player on the server
could also use a switch
@marsh lodge, crud! That's right, I think you taught me that before. How do I get around that?
Is this for a mod or a script in a mission?
Script in mission.
It works at pushing back into the array, but it doesn't do any sorting.
@lone glade, @west lantern, thank you for the input, will consider both using else or a switch.
Are you using ACE?
@marsh lodge, zero mods.
Use side
side rather than playerside?
Where do I define _unit? Sorry for my ignorance...
So the engine will understand that one without needing it defined?
Use side _spawned in your case
Could I do...
if (side _spawned == east) then {RedReinforcements pushBack _spawned; publicvariable "RedReinforcements";};
Since that is what you called the unit in Params[]
If you want to make sure that the unit that spawned is an actual player then yes
Idk all the conditions that the event handler will be called under
I am also on mobile atm so my answers might not be the most coherent
@marsh lodge, no sweat! I'm super glad for your help!
Yeah, the only slots in AAF and CSAT are players, so I don't think it's needed, but I'll keep it anyway, just to make sure that corpses or something stupid doesn't get added to my helicopters.
No problem, idk if this is intended, but if a unit respawns again, the old and new unit will both be in the list
@marsh lodge, it is not intended, I believe we are already addressing that issue. Would you like to see the script I am working on in whole or just that snippet?
I have the time to look at it if you want
My next concern is if players disconnect after they have died. I want onplayerdisconnect to remove them from the array, but I am unsure of how to do that.
@marsh lodge, using the script or the array?
The array
Here is the script: https://gist.github.com/DEL-J/c4d03d3c4267ce8f5ed880cfef341a7c
The array will be a queue for a reinforcement chopper for an immersive respawn in a PVP mission.
Instead of creating an event handler, you could check if they are still a player before you put them in the helicopter
Oh? That sounds like what I need. How might I do that? I haven't even gotten the arrays loading into the chopper yet.
Whenever your script decides it wants to spawn a wave, as it loops though each unit in the list, moving them into the helicopter, you have a condition that the unit is Player
That sounds good, but now that I am thinking on it, the array is meant to grab JIP players as well, so we could end up with a player being on the array twice if someone high up the role selection screen rage quits and someone fills in that same spot again.
Unless you want to use the list size as the condition for spawning units, extra units in the list should be ok
Even if they are the same unit?
If a client drops and rejoins in the same respawn cycle, I get this.
It might, but what you can do is make sure the list is valid before you do anything with it
So if you decide you want it to spawn when 10 people are on the list, you go though the list checking for duplicates and making sure that all the units are players
It is probably easier to make sure that a unit is not already on the list when you try to add it
@marsh lodge, that sounds perfect, but it's a bit over my head, haha. I will definitely try to go that direction with it.
Glad I could help
@marsh lodge, are you still around? I could use more guidance. Both of my arrays are being filled properly now, but I don't understand how to assembly my deployment scripts to grab the arrays, much less to check for duplicates, etc.
@shadow sapphire Heya ๐ Was just starting to browse the script you posted.
In lines 7/8 in the link, you could add ``` && !(_spawned in (ColorReinforcements))
for each color you have
That would prevent duplicates
Yeah, that one.
Could you explain how it works, so I can wrap my head around its use?
It just checks if _spawned is already in the array
Then, checks the opposite with the !
So if _spawned is already in the array, it skips adding them and broadcasting the array over the network.
@winged thistle, thanks a bunch!
Sure. Now, you're having problems pulling from those arrays?
Not so much problems as I just don't even know how to start, haha.