#arma3_scripting
1 messages ยท Page 285 of 1
You could repair everything if you wanted to ๐
Might be slightly odd if you drove over a fence and it repaired into your car though
with a sleep of ~30 minutes?
would be pretty odd if someone has the bad luck to drive there and it pops back up lol
the problem is i want to use the military fences but dont want people to just drive over them i made holes in there to drive in....
Can you repair destroyed fence?
Maybe hideObjectGlobal it and createSimpleObject\createVehicle a new one though
How do I exactly call my script now? Thats the description.ext entry: ``` class RscTitles
{
#include "game_dialog.hpp"
}; ``` https://gist.github.com/Aebian/c73483240597d826f7dc2a26e346799f (thats the .hpp) // I tried with cutRsc ["AebianUI","PLAIN"]; but I just get a faded stroke thats all.
anyone ever used ace_slideshow_fnc_createSlideshow ?
Really strange, all working ok with checkVisibility functions and now i noticed i'm using ATL position on it... โ
anyone know if there's a workaround for RscObjects loading with no textures half of the time?
performance wise what would be the best way to check if a player is inside a rectangle?
Yep ended up using that
There is no other (native) alternative i know from.
Well I know of a math formula but shit was too long
+i guess it would be the same.
Just wondering, is there a command to get the size of an area?
Ye, I haven't tested it on areas though. Was just curious
How to make an air explosion?
I'm using that:
_bomb = createVehicle ["Bo_GBU12_LGB_MI10",getPosATL _agnt,[],0,"CAN_COLLIDE"];
_bomb setDamage 2;```
But the bomb don't explode.
The bomb is spawned in air, this is why i can't trow it on the ground to make it explode.
I want it to explode in air.
Any help is apreciated.
@tough abyss spawn it with createvehicle?
I remember this explosion, sadly its too small? ๐ฆ
The situation: if a chooper shot a zomibe, the zombie jumps in the direction of the chooper and explodes
explode in air
@little eagle already tried that, don't work even with 2.
lol of course not. 2 is just wrong
Holly chit.
Ammo only explodes when it's destroyed if it has this config entry:
triggerWhenDestroyed=1;
Isn't the case for most ammo and it is not for the GBU
therefore the GBU will only explode when it hits the terrain or any other fire geometry
@little eagle thanks a lot pal!
I have also no idea why you use this one. It's the same as Bo_GBU12_LGB, but with another config entry only relevant to when used with a heli.
@little eagle, @tough abyss "smallSecondary" works.
But the explosion is a bit small.
Also getPosATL will not work over the sea. It uses AGL. Not that that matters much
Yeah, just to be sure it won't cause issues in future.
I don't think there is an easy way to script an equivalent to the GBU that is "airburst".
Well, without config change.
otherwise it's just
class Bo_GBU12_LGB;
class commy_Bo_GBU12: Bo_GBU12_LGB {
triggerWhenDestroyed = 1;
};
Yeah, but it won't work in missions.
Also I'm not 100% sure if the GBU's simulation type accepts that config entry.
But I see no reason why not. It's just a missile.
"missile"
you could try spawning a small/invisible object with a firegeometry just below it
spawn the bomb inside it. But I don't know any invisible object with a fire geo. A fire geo will also absorb the damage.
There is an heli explosinon that is bigger, "friend" explosion of the "smallSecondary" explosion. I used it in Arma 2.
Will just try to find it.
It's big enough and explode on spawn.
Since smallSecondary explode on spawn (tested it) this bigger one, should too.
The two explosions are related to heli explosion.
"HelicopterExploBig"!!!!!
That should do it. I don't think you need setDamage 1 for it. It seems to die on it's own after one second
@little eagle yes, tested it in Eden editor, it explode directly.
timeToLive = 1;
on it.
Best config entry name btw. SAGE engine had the same name, so it's the only one I don't have to search for every time. lol
Can I select a player via cursorTarget and let the client of this player execute a script?
@halcyon crypt and how?
I am just waiting for "Can you write this for me?" ๐
@jade abyss Can you write if for me?
JK, my script works; thanks @halcyon crypt & @tough abyss
๐
The only thing I'll be writing for you is this blank check addressed to myself.
how to enable collision
nope
Is there a way to make my own collision?
make your own model
so that this stealth script works
Can you make a hidden object have collision
in any way>
?
You can make a model that has a GEO lod, but no visual LODs.
Or rather, one empty visual LOD. Otherwise it crashes.
Im new to this so how is that done?
Should be so easy that you don't even need a 3D program besides Oxygen2
Or you pick a model that can be completely retextured and you give it a fully transparent texture via setObjectTexture
The problem with hideObject is, that it also hides the GEO and FIREGEO LODs
It's shitty API, like everything else.
Darn you bohemia
Nope, its good as it is.
The object would still have shadows I think.
nope
If you give it a full alpha texture? Sure it would have a shadow.
uhm... yeah, that... erm... yeah
hmm im trying to make this as vanilla as possable because im gonna maybe use this in a life server
jtg9uiraeb zbte
Is that your password?
Nah, just a tiny Epilepticshock. Happens everytime, when i read "Life Server"
the PTSD is bad
It is. I will never be the old one again.
How would I stop a player respawning with the default respawn menu? I have mucked around with an EVH but it didn't work
How to get oxygen 2
Steam -> Library -> Tools -> Arma 3 Tools
@fathom cloud
Oxygen 2/O2 = Now called "Object Builder"
oh ok
I seem to have an issue with remove uniform can someone point me to the correct syntax?
Guys, my switch stop'd when one of file doesn't exist...
I want to control repawn via script, I want people to die -> go to spectator -> respawn on this script call
What functions should I be looking at.
Also, how will this use / affect onRespawn
Dear god why do I even ask this chat questions anymore haha.
I have one default .paa & 7 optional. If one of them doesn't exist then all switch doesn't work.
How i can make a checker(?) for that?! If one/or all of optional doesn't exists then load default .paa?!
I checked the wiki and the command looks correct but whats wrong with it? comanche addMagzines ["ACE_500Rnd_20mm_shells_Comanche", 2]; ArmA says missing ;
addMagazines
addMagzines
idk
ยฏ_(ใ)_/ยฏ
Dear god why do I even ask this chat questions anymore haha.
"please script this for me thx"
@little eagle has the all seeing eye.
"gz" hurts my eyes, how do you even pronounce that??
I'm pretty sure addMagazines does only work on persons and not on vehicle vehicles.
addMagazineTurret then?
hmm I really oversaw that lol
Yeah, probably this command is needed
turret should be [0]
You can retrieve the turret path required for the command by entering the vehicle in the correct slot and executing:
hint str (player call CBA_fnc_turretPath);
via debug console.
or use the watch lines
sure
remembered them myself just recently. x9
I wish they had the "prev" "next" feature the upper box has.
copyToClipboard (str (assignedVehicleRole player)); hint format ["%1", assignedVehicleRole player]; that works also ^^
I guess for debugging, but in actual code it will break if you're not the group leader.
Because your assigned role is whatever the group leader wants and not what you actually are.
I wouldn't use that command anywhere else lol
if (((_uniformClass) select 3)=="ucp") then
{
_patch = "\test_decoration\optional" + (squad_name_array select 0) + "" + "OCP" + ".paa";
or
_patch = "\test_decoration\optional" + (_squad_name_array select 0) + ".paa";
};
How exactly i need to wright that OR?
@spring dune nested if else or you can use a switch true statement if I understand your question properly otherwise I have no idea what you mean by using an or there as you aren't checking for some other condition on when to include OCP
https://community.bistudio.com/wiki/switch_do
Assuming you are looking for two seperate instances instead of an if else
switch true do {
case (((_uniformClass) select 3)=="ucp"): {
_patch = "\test_decoration\optional" + (_squad_name_array select 0) + "" + "OCP" + ".paa";
};
case (((_uniformClass) select 3)=="whatever"): {
_patch = "\test_decoration\optional" + (_squad_name_array select 0) + ".paa";
};
};
@cerulean whale if first one doesn't exist then load second which exists...
@arctic igloo
nested if else always shows same error ("missing ) ")
if (!_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + "OCP" + ".paa") then {
_patch = "\test_decoration\insignia\" + (_squad_name_array select 0) + ".paa";
} else {
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + "OCP" + ".paa"
};```
oh I semi understand now
I think killzone kid did something to check if a file exist
He did
I saw it, but i'm not sure how to use it
so
like this
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + "OCP" + ".paa";
if !(_patch call KK_fnc_fileExists) then {
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";
};
@arctic igloo , in that switch why don't you do switch (_uniformClass) do It would save you having to write the statement each time
you could just write the condition
@cerulean whale I condensed it in the second example but left it as is for the first so it was transalted exactly to how he did it, regardless of whether it was right or not
as you can see in the example statement i cut it down to just one if instead of an if else as well
ye
@viral rain let me know if that works for you
keep in mind you have to add the code for that fileexist function so you can throw it in your init file
KK_fnc_fileExists = {
private ["_ctrl", "_fileExists"];
disableSerialization;
_ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1];
_ctrl htmlLoad _this;
_fileExists = ctrlHTMLLoaded _ctrl;
ctrlDelete _ctrl;
_fileExists
};
well that makes sense
)))
because you arent backing out if you enter one of the ifs
so its just never set up
what you could do instead is set the variable to the default by default
above the switch statement just do
_patch = "\test_decoration\insignia\" + (_squad_name_array select 0) + ".paa";
why above?
because you have to init the variable at the top most scope
and also it removes the need for your default
Yup, i got that thing.
as the patch only changes in cases where you do have the paa
It's totally stop works if one of them not present. ๐
what do you mean
If one file not presented in folder it won't load default or some...
did you do what i said and put the default line at the very top?
did you put this above the switch statement?
_patch = "\test_decoration\insignia" + (_squad_name_array select 0) + ".paa";
Will try both in next few minutes. )
i seem to have a little trouble understanding you at times so just tell me if im not understanding so i can better explain
the reason im telling you to init it as that is there are a lot of cases where you wont end up with a _patch because you are going into a switch statement and then into some if statements but there is not a definitive else to default the patch variable
and i think you are confusing that as it will mean that the block is supposed to exit and still go to the default
which just doesnt happen
@candid harbor
_patch = "\test_decoration\insignia\" + (_squad_name_array select 0) + ".paa";
switch ((_uniformClass) select 2) do
{
case "emr" ; case "msv" ; case "vdv" : // RU: EMR
{
if (((_uniformClass) select 3) in ["patchless","emr"]) then
{
_patch = "\test_decoration\optional\" + (_squad_name_array select 0) + "_" + "EMR" + ".paa";
};
};
};
if !(_patch call KK_fnc_fileExists) then {
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";
};
Or something broken, or default above cases doesn't help
well that seems to be what would work for your intended purpose but your default really shouldn't rely on a dynamic name and instead be one you know 100 percent will exist
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";```
dafuq? ^^
he is generating the names dynamically
Format
_patch = "\test\decoration\optional\" + (_squad_name_array select 0) + "_" + ".paa";
--->
_patch = format["\test\decoration\optional\%1_.paa",(_squad_name_array select 0)];```
Less confusing/cleaner(/faster)
yeah thats fine but dont worry about that after you get it working
then you can make it all pretty, clean, and fixed up perfectly
systemchat everything, then compare the names with the files, where is the prob right now?
im honestly not sure
it should work just fine as of now until he spits out some debug info or tells me something useful ill have no idea
my guess is he has the naming wrong or path wrong or just doesnt have a default that exist
yeah thats fine but dont worry about that after you get it working```
Thats... not true. Those multiple " can be a reason (like: Missing one of the ", because you used 20.000 in on line)
+Again: systemchat every line, to find out, where it stops/what the output is.
yes but you are obessing about using format when string concatenation works fine
Searching for it. )
Do what you want, i don't care
then why make a big deal about it if you dont care?
@oak compass well let me know but i agree with dscha just systemchat/diag_log it all and find where its screwing up
@jade abyss why is your name famliar to me btw i feel like i remember you from somewhere
@arctic igloo Ok
I tested first thing, when default above cases... Got error "UCP.paa" not found and just loaded rest. That's good because only one of them didn't load.
The bad thing in what i want to replace it with default if not found. )
So.
Trying 2nd suggestion now
try this
_patch = "\test_decoration\optional\" + (_squad_name_array select 0) + ".paa";
switch (_uniform) do
{
case "emr":
{
_patch = "\test_decoration\optional\" + (_squad_name_array select 0) + "_" + "EMR" + ".paa";
};
};
if !(_patch call _KK_fnc_fileExists) then {
_patch = "\test\decoration\optional\default.paa";
};
add a default.paa that is just a generic icon and that way it will always load something
yes
Tricky. ๐
starts with your dynamic default
then checks special conditions
and if it finds one or doesnt it checks to see if that file exsit
if not then it just loads your generic one
your other way could cause issues because even that default might not exist
But it's double load yeah?
in what way
Or not... It will be load default first and then go to special or it will check whole .sqf first and then load .paa?
it doesnt load the paa until you call the load image command
it just sets a string ot the path
at the very end you load it
so its not an issue
Hi guys, sometimes zeus will stop working when switching admins or just because arma. Would just executing the following in the console resolve the issue? unassignCurator zeus_1; player assignCurator zeus_1; where zeus_1 is the name Game Master module
I'm probably late to find out but apparently A3 v1.67 will increase the arma limit of max groups from 144 to 288 ๐ฎ
Why would you ever need more than 144 groups per side? ๐ค
@meager granite I assume "Life"r need it.
One other example; Zombies, lobbies & zeus. I've experienced that I couldn't spawn in any more of my zombies with Zeus, even though I deleted those that were dead (empty groups are supposed to be removed after a minute, but that didn't happen for some reason). I'd then have to deleteGroup _x on allGroups in console to clear it up and be able to spawn moar zombries. Happened a couple times.
Yeah, right. Totaly forgot them.
Zeus cant spawn agents directly
Can't you change it with addon?
Never looked into how Zeus is made, probably you can update it in zombies addon.
Modding Zeus is such a mess. : (
createUnit
Want me to look up the line?
It's createUnit
?
Just a quick question. Doing some GUI stuff. With structured text, you can use HREF's to launch external links. I've basically got a button on my GUI where I would like it to link it to a page onButtonClick
Any idea on how to do this?
Hey Guys, The Mod RyanZombies, is it working with an Alits Life Framework? I want Altis Life with Zombies
@tough abyss Regarding the cursortarget in remoteexec: When I run the script on a local server it works fine. But when I run it on a dedicated server the script is executed on my client and on the client I got via cursortarget. Any ideo how to fix this?
Or Tanoa Life sry
@tough abyss its a standalone mod. you could integrate it anywhere
But how? Do i need to code an full mod like exilez or can i copy exilez ?
The Thing is how do i spawn them?
just like you'd spawn any other ai
@tough abyss standalone meaning it has no dependencies meaning you can run it any wherr
Meaning no need for changes
lol but is it like an trigger or what?
sry
got it working, im just too dumb to read
hey guys is there a way e.g. init field for a zeus not initialise on mission start but rather when the slot connected to it becomes taken by a player so that zeus doesn't stop working once that player leaves or the mission starts without someone in the player slot connected to Zeus
so if one starts a mission on dedicated server ( -autoinit), with a Zeus Game Master module linked to a player slot, the Zeus module becomes unresponsive to users as they are only able to ping zeus and not enter it while in the player slot that is connected to this Zeus module
I am wondering if there is a way to only link the player slot and Zeus Game Master module after a player has actually taken the player slot connected to Zeus
another thing is that if the player that is in the zeus slot leaves the server and another tries to take his place, the same problem occurs as mentioned above
that better @tough abyss ?
and how exactly does that work ๐
I have a slot accessed by anyone who is assigned mission leader during the special operations
got the same thing set up
Could anyone help me understand how to do a keydown event?
myEH_ID = (findDisplay 46) displayAddEventHandler ["KeyDown", {_this call myCodeOrSomething}];
Right, but how do I tell it which key I want to use? That's the part I'm confused on is that.... I don't understand the code there, I guess.
But I don't see any key codes in your line up there.
How?
That's the question, really.
How do I make a certain key trigger the event? That's how I should have phrased it.
@tough abyss your method doesn't suffer from the problem I described?
@shadow sapphire see https://community.bistudio.com/wiki/User_Interface_Event_Handlers
the key that is being pressed will be in the _this magic variable as with other eventhandlers. E.G. (_this select 1) will be the DIK code of the key being pressed
@shadow sapphire In the Searchbar (TopRight) :
in: #scripting keyDown
Sa-Matra just pasted one example yesterday
@jade abyss, thanks!
Hey, so here's a different take on it, what if instead of a specific key 100% of the time, I want it tied to an assigned key? Like, every time a player changes to combat pace, I want to trigger an event or some such thing.
what?
So, if I wanted to spawn a balloon every time a player pressed the crouch key, but they weren't using the default control scheme, how could I make that happen?
actionKeys "crouch"
I could do actionKeys "vault" or actionKeys "sprint" or whatever? I'll google it.
this should be a list of all actions. https://community.bistudio.com/wiki/inputAction/actions
Friggin. Awesome.
Example:
_ctrl = param [0];
_button = param [1];
_BtnShift = param [2];
_BtnCtrl = param [3];
_BtnAlt = param [4];
_ButtonDisabled = false;
_BD = {_ButtonDisabled = true;};
_getKeys =
{
_Arr = [];
{
_Btns = (actionKeys _x);
{ _Arr pushBackUnique _x; }forEach _Btns;
}forEach _this;
_Arr
};
//Buttons: 1-0 Doublecheck needed, because of Re-arranging of the CommandingMenu possible with A3 1.58
//Disable Commanding Menus
_CommandKeys = ["CommandingMenu1","CommandingMenu2","CommandingMenu3","CommandingMenu4","CommandingMenu5","CommandingMenu6","CommandingMenu7","CommandingMenu8","CommandingMenu9","CommandingMenu0"] call _getKeys;
if(_button in _CommandKeys)then{call _BD;};
//TacticalView disabled
if (_button in actionKeys 'TacticalView') then {call _BD;};
//EOF
_ButtonDisabled
Old stuff i did, to disable all btns.
What is the vault action or action key called?
handling some cases is harder though, like double-press keybinds (e.g. 2xv)
*updated
@jade abyss, why would you do that? That's a pretty neat thing, but I am curious as to why you'd do that. Something similar could be useful for me.
Why not? I needed it.
Haha, I see.
@jade abyss Don't let commy see those params
I disabled F1-12 and 1-0
He'll murder you in your sleep
I don't give a damn ๐
gotta spam so it disappears quick
blaaahhh
๐
It was taken out of a testfile, so i don't give a damn ๐
@jade abyss, that's practically exactly something that would be useful for my community. We don't have any AI being commanded in our sandbox, so we using the command menu for our custom radio script would be much better.
Well, haha, we generally make our own stuff. The only exception is a mag repack script. Which... eventually I want to replace with our own.
*edited again
I suck at scripting this game, but my developer is a fuckn wizard.
well @tough abyss there's no documentation on that xD
Modules have been broken for JIP players since modules exist.
Zeus Game Master shows the exact same problem
you can't init the mission without a zeus being present
or you break the module
It has nothing to do with that specific module.
It's just that JIP spawned units are never synched to the module.
They lose their synch.
Not the same as a slot I guess.
It can easily be scripted to be linked to a slot tbqh.
Maybe I should add a simple checkbox 3den setting in CBA. anyone can hit a checkbox.
Typically BI adds the same stuff in the next version whenever I do something like that lol
That is NOT the same as a zeus slot mate.
What is the class name of the "vault" user action?
Anyone know? Can't find it on the wiki.
@little eagle how would you suggest scripting it?
probably calling the module.
๐ I'm not that advanced
@shadow sapphire GetOver
@shadow sapphire GetOver[]={57};
Thanks!!
If you are not sure:
C:\Users\YourUserName\Documents\Arma 3\YourUserName.Arma3Profile
Edit that one with Notepad
- search for the Dik Keycodes taken from here:
https://community.bistudio.com/wiki/DIK_KeyCodes
Thanks so much, @jade abyss
But: Its just an indicator, iirc they don't fit everytime (btw.: "key" must be removed always)
Take my example from above
add a hint str _button
hf
I have a set of lines of code that should run everytime a player uses a certain player slot. Can I use the init for this or should I use something else?
{
this assignCurator missionzeus;
0 = addMissionEventHandler["HandleDisconnect",{unassignCurator missionzeus}];
}; ```
How might I disableAI for an entire group at once?
@tough abyss don't name a variable 0... either you want to have a reference to that EH (Then give it a more meaningfull name) or just remove the assignment part... ๐
thanks @scarlet spoke I removed it already as it wasn't needed for the script
@scarlet spoke this is to fix the stupid editor from complaining about return values.
Oh I thought it was in a normal script...
The editor and it's complains about return values really goes on my nerves sometimes.... Who needs that sh*t?
Well I guess not all traditions are good ones xD
Yeah me too ^^
anyone know how to simulate explosives without having them deal damage I.e. an artillery bombardment w/ out killing off all the AI?
Can someone tell me why the diag_tickTime value is different for every user? Shouldn't that value be the same for everyone because it's server tick time?
from the docs the value is
This command will return time since last client restart as float.
so not specifically the server time (which each client slightly drifts away from, from what I've heard)
Script for spectate mode switchCamera _unitToSpectate; ๐ but how do i get this camera so i can use _cam setCanFov 2 in it?
I'm working in a spectator mode that simulate optics zoom.
performance wise ive made an ai freezer (disables ai simulation when no player targets found) would it be a good call to hideObjectGlobal it and will it result in any performance increase
If I have a player, and is unit is flagged as PLAYER_1 and he dies, and I have a script, that loops, and says if PLAYER_1 is present, and DOESNT CHECK if he is alive, and his body remains in the position to be checked, AFTER he respawns... what should happen.
Anyone here who is good with creating dialogs and maybe have a minute to see what's wrong with mine? It seems to be working (not crashing) but for some reason nothing shows up when I call it. I only see mouse cursor but no dialog ๐ฆ It's a very simple one
Check your .rpt
.rpt?
๐ฆ
RePorT file, Errors etc. are logged in there.
#1 Always check your .rpt's, when something is wrong
#2 try to solve it yourselve a few times
#3 Do #2 for about 30min again
#3 Do #3 again
#4 Ask in Discord.
@jade abyss I don't think RPT att all tells me anything extra interesting apart from what game itself already informed me when I actually had errors (and fixed them after).
Yeah.... gl then.
@jade abyss staying quiet would actually be more helpful of you.
lmao
I gave you the path, you have to go, to find your fkn problem, now you try to smartass me?
Check your fkn .rpts, there are errors msgs in there, otherwise your Dialog would pop up
There is something miss-configurated in the dialog, there is a msg inside the rpt, that does NOT pop-up ingame.
or missing Configentrys...
And: Yes, some of those errors do not pop-up inside arma. They only appear in the .rpt... but hey, what do i know? I just played around with the Dialogs for > 12 Months.
Since when?
@tough abyss Just ignore @jade abyss he is just an asshole. He actually got removed from the altislife dev forums for abusing his mod powers by banning me when I told him to either post something useful or don't post at all. Thankfully I got unbanned and replaced him as the moderator though.
I wouldn't mind taking a look at your dialog just upload it and shoot it over
He is right tho, just look in the rpt
Which the person responded nothing useful showed up in the rpts, instead of just saying "good luck" and then going on a rant I instead offer to spend a few minutes looking over his file.
lulz
@arctic igloo First post here and you're already casting aspersions? Probably not the best way to introduce yourself around here.
@open vigil This isn't my first post here so not sure where you are pulling that one out of but it must be a very dark hole. What I am trying to do is not push off someone that needs help and instead offer real useful assistance instead of talking about how great I am at dialogs and throwing cuss words at him.
If you've got some strange history with Dscha, I don't care. It doesn't belong here.
@open vigil I agree so we can keep any other messages not related to scripting out of this channel? You easily could have just sent me a PM with your previous message and that one
Call it Moderator prerogative
How to put the current cam in a variable so i can use it with camera functions like _cam setCamFov 2;? I found no function like _cam = currentCam;.
camera is the player itself by default I think, then any other camera must be create with createCam, which return a camera Object
@vague hull thanks!!!!
just tryout if that works
Yes, i will try
"In BRPVP you will be able to see your friends camera, with optics zoom and shit!" Donnovan ๐
this could be abused.. a lot
Abused?
You need to grant access to that.
"I grant you access to see my camera".
But for sure i'm missing something ๐
yes, but if you can have two players in the same cam with different zoom levels, the looking through objects and stuff like that is going too beginn
The fov will allways be the fov of the unit
the "conscient" unit
player camSetFov 2; don't work.
ooops...
@vague hull player object don't work as the camera. Have any idea pal? ๐
I assume if you create a camera when you need it and the switch to it, it should work tho
Yes, but the camera must be a unit view.
just create the cam on the eyepos of the other unit
and if the unit move?
Does camsetfov on an INTERNAL camera not work?? Try it
Probably gonna have to take the long approach senfo mentioned then
a good place to start would probably be https://github.com/acemod/ACE3/tree/master/addons/spectator
just: trigger->camCreate->attachTo HeadPos->camsetFov->dowhatever->camDestroy
for "inspiration" ^^
I dont like ACE for that
its too "overdone" for someone to get an idead of what it actually does
first thing that came to mind, there are plenty of others to look at ยฏ_(ใ)_/ยฏ
yea, just wanna state my opinion there ^^
ACE with its CBA macros can be a bit challenging for less-experienced scripters to look at. I'd just do some googling if I were you Donnovan
I did a bit of that myself and found that pretty much all spectator scripts use player switchcamera "INTERNAL" for their first-person mode.
So no secret cigar for you i'm afraid.
You can use gunner for ironsight
Thanks all.
@vague hull it worked, but a little bugged since you see player head from inside.
I can hide the unit, but its weapon will dissapears? lets see...
yeah, you just need some good offsets then :)
just the attach it a bit more ahead
Just noticed there is no "floating arms holding a weapon" in Arma 3... what we see is the real model.
yeah, just the head is "hidden"
Errm... camSetFov not working even on camera created with _cam = camCreate _pos;.
Let me take a big breath and start again lol
Do you use that, after you made the changes?
https://community.bistudio.com/wiki/camCommit
OR
https://community.bistudio.com/wiki/camCommitPrepared
gday all
does anyone know if there's a method to check if a specific EH has already been added to a unit?
@jade abyss oh, no, i will try to use it.
"Just noticed there is no "floating arms holding a weapon" in Arma 3... what we see is the real model." Jup and it makes modding all so easier because everything you see on your body in first person is an accurate representation of how you appear for others without the need of making seperate models for each uniform, though how did you only notice it now? Like, did you never freelpok around noticing you can see almost your entire body with it?
yes, indeed, a obvious thing.
everything i do in camera not work even with camCommit, probabily my fault since i never worked with then. Thanks for all the help.
Will keep trying.
Even the example?
The example worked.
No other way, i will mess with it a bit to get the basics and see if i can do what i want to do.
its too "overdone" for someone to get an idead of what it actually does
Good practice is the best obfuscation.
(or anything that can't be copy pasted really)
Give I wanted to make a top down view gamemode in ArmA, what would be my best bet to make the camera work properly?
Ah sorry I meant more like a Zeus view ^^
I want to make a Command and Conquer like gamemode with 2 vs 2 players controlling Ai units, etc.
And the only thing I haven't really thought of is the camera
same notes but rotate the camera until it's the way you like I guess
It's not meant to be bound to a unit
It's really just like the Zeus camera, a free mode cam
I thought about using the Zeus cam itself, but that would require to disable all UI elements
And somehow force that, disabling all ways to leave it
Just a quick question, I noticed loadFile seems to work on the server. is FilePatching turned on by default?
iirc off
Good practice is the best obfuscation.
Why would you need that in an open source, licenced project tho ยฏ_(ใ)_/ยฏ
If you fork the master branch, the dev environment is basically set up. But life people can't copy paste lines to insert them into their server.
OS does not mean code pile you can draw from for free.
instead copy two files and the STRG+H until you are happy?
I am sorry.. just no
It's not a code pile you draw from for free. Sorry. Just Yes.
Also it's not actually obfuscation. Reading comprehension ...
Aslong as he follows the license for opensource then yes it is
The amount of life people giving back code to this day is basically zero.
Yeah. I'm sure SOMEONE plays life and did something for it.
@jade abyss noch ein stรผck
0,25? (+keep it English, knalltรผte :D)
good girl.
0.25 is about right
Im done with life mods aswell, still need to make that camera for my top down Zeus vs Zeus gamemode >-<
Do you think Company of Heroes in ArmA would work?
I imagine it being fun
tbh. i am just waiting for Enfusion, to do something like that. I am not spending any more time in VR, to do it^^
Ah God damn it discha
And in the meantime, i play around in UE4 ๐
That's also my thoughts
The point is:
obfuscate or encrypt or making it hard to read -> intention: nobody should read it
Why would you publish it then?
Your " But the bad life modders :(" argument is just invalid
I dont want to make something and then have it be rendered obsolete by the new engine
And I am not saying I like them
Well you obfuscate so people don't steal
I mean, it won't happen tomorrow or the next 6Months, soo....
The fact that noone can reads it is sadly the tool to prevent theft
If there was a different way to stop theft, people would use it
But there isn't
A proper lawyer would be a tool
When you sue someone you should be 10000000% certain that you will win
yeah, if you want to get your rights, sometimes you need to pay for it
and if someone "copy and pastes" what is not to be sure about?
Just makes it harder for 99% of em. Just like everything else. 100% protection is just not possible :/
true that, yet they are crying about how that doesnt work
It's a bad side effect that you lock out legit people that might learn from your code, but that's the price your paying
*youre
@jade abyss okay fine ill do the gamemode then
Grrrr
@tough abyss this
gl hf gg no re @tame portal
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipediaยฎ is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.``` that one?
๐
not exactly ๐
Well obviously obfuscated code is not source code. You apply a tool for obfuscation on your real source code to modify it. Afterwards it's no longer source code.
By definition.
which then isnt licensed anymore..
that was new to me too
in their definition thats something different
so if I get a GPL library, obfuscate it and link against the obfuscated stuff it's license free? ๐
its ofc only object to the one who created it
anything not done by the owner doesnt change the license
๐ค
but if you find a obfuscated project licensed like this, then yeah.. is basically royalty free as of what I understood
We used to call those"sea lawyers".
usually licenses will also apply to all 'derivative works' as well, meaning if the source code is licensed, so is the compiled/obfuscated code too under the same license.
though usually, it's understood by most courts that the license on software already extends to the compiled code, meaning the phrase 'derivative works' is already implied.
i.e. too bad, so sad, you lose.
riperoni your money only
.. for the next 10 years (in some cases.)
it all depends on how aggressive the copyright/license holder wants to pursue it.
What if in 20 years lawyers get up and say "GG no re" when they win
... I highly doubt it.
but it'd be funny
in any case, do you know if remote exec is objectively faster than bis fnc mp?
not off hand, no... find a bunch of buds, set up a MP map and test it?
yes @plucky beacon
bis_fnc_mp uses remoteExec itself since RE was released
So it is guaranteed to be faster, for obvious reasons
Hmm, I got to update some scripts then
I haven't used remote exec before, off to the wiki
Be careful if you whitelist in CfgRemoteExec, and forget to change some of the bis_fnc_mp, as they will be affected
It's a private server for a group of friends so I should be good
Wasn't there a program someone made that compiles sqf files and checks for errors without launching Arma?
I installed it to my VSCode
thanks, I didn't know about this
It's a shame it doesn't look in the sqm for global variables but we can't get everything I guess
I'm surprised that on the entire remoteExec wiki page they don't use an example of execVM
yea the lack of examples many times is a problem.
I always want to add a couple but my wiki account doesn't work
I so want to make a way to jam TFAR radio by playing rick Ashley in the youtube channel when there's radio jamming going on...
easy solution: switch radio frequency
pfft hahaa, that sounds great
probably better off removing the radio
because most people I know recognize what freq they were on
nah, you don't get as many first timers going 'WTF'...
@plucky beacon Why does it need to show execVM?
Technically it doesn't need to show anything, but I figured that would be a common use for it
You mean with remoteExec (as a command)?
basically this in remoteexec
["BluforVictory.sqf","BIS_fnc_execVM",true,true] call BIS_fnc_MP;
doesn't call globally
neither does BIS_fnc_execVM?
well isn't that what remote exec is for?
You can use remoteExec with commands
I should go through BluforVictory.sqf and convert every command to be called through remoteExec?
I'm quite lost
What you're doing is executing BluforVictory.sqf on every machine
you can achieve the same with remoteExec
yes, that's what I'm trying to do
I'm just pointing out you don't need to use bis_fnc_execVM
You can use the command, execVM
[[],"BluforVictory.sqf"] remoteExec ["execVM",-2,false];
```
and I have that empty arguments I know, just seeing how it works.
Anyway, all commands are handled the same, so no specific example for execVM needed, but perhaps an example for commands
I wasn't really thinking that far for the examples. just basically thinking "this must be used a lot, I wonder why they chose these examples."
Tbh, not sure why you'd ever want to use execVM w/ remoteExec
Why not compile it prior to the RE ๐ ?
you mean have it on a waitUntil or something?
Define "compile it prior"
So compile BluforVictory.sqf into a variable, and use it with remoteExec
compile...
compileFinal, CfgFunctions
etc
oh
All the same idea
Well I guess I haven't done it before, I've looked at CfgFunctions but not done that.
So in classic fashion "one can only work with the tools they know"
Well, you don't want to compile it every time you run it, sure if this is once, but still, no reason to
CompileFinal looks like it's designed to return a value though, this is just a null
I don't think you quite understand
value = call compile preprocessFile "BluforVictory.sqf";
//Value is null because no return
//Later call
call compile preprocessFile "BluforVictory.sqf";
don't call it
compile preprocessFile "BluforVictory.sqf";
Gives you code
When you call it, you're executing it
Clearly your file returns null
value = compile preprocessFile "BluforVictory.sqf";
//Later call
[] call value;
You dont want to compile it every time you call it
myFncWichIsAVarNow = compile preprocessFile "BluforVictory.sqf";
[] call myFncWichIsAVarNow;```
compileFinal is the same as compile, but doesn't allow the value to be overwritten
like a const
same is done with "CfgFunctions"
readonly blah
And as Dscha said, CfgFunctions is just abstracting this to a config, which is easier to organise
Okay so now that I've established how to get the function and call it, how do I make sure it runs globally
(since its beeing called PreInit)
So if you have your function (compiled your code, assigned it to a variable)
You can use that with remoteExec
remoteExec ["myFncWichIsAVarNow ", targets, JIP];
gotcha
And I can preprocess in the init?
Don't compile/preproc yourself, just use CfgFunctions
You can, but, there isn't much reason to
remoteExec - kinda like Spawn (can be suspended on TargetClient)
remoteExecCall - kinda like Call (can NOT)
You know this solves another problem of mine which is I'm trying to keep an array of the remaining alive players, if I preprocess the script that checks for it I can call it on a killed event handler for each unit
Example:
https://community.bistudio.com/wiki/allPlayers
{
if(alive _x)then{systemchat format["Player: [ %1 | %2 ] is alive", name _x, _x];};
} forEach allPlayers;
Ya I have a script already written out for it, but it's important it's in an array because I need to count for it
_AliveCount = {alive _x} count allUnits;
if(_AliveCount <= 1)then{Systemchat "LastManStanding"};
{
if (alive _x) then
{
if (side _x == East) then {
_ActiveEnemies pushBack _x;
};
};
} forEach allUnits;
if((count _ActiveEnemies == 1) && (!OneLeft)) then
{
code and shit
oops
sorry edited this for viewing
Will alive return true for spectators?
no
_AliveCount = { (alive _x && side _X == East) } count allUnits;
if(_AliveCount <= 1)then{Systemchat "LastManStanding"};```
lol
That's like exactly what I did, the if statements were seperate because I was doing something in between them a while back
also if count == 0 it's mission failure
Also my code is full of hints and system chats for debugging
but I lower the line count once I'm sure everything is working right.
I didn't know you could count something using operators though
yepyep
count reacts more or less to "true" and "false"
_cnt = {false} count allUnits; //always _cnt = 0
_cnt = {true} count allUnits; //always _cnt = the amount of players
Now i did encounter one bug where two infantry in a truck count as one unit when using allplayers
Check if it is a car/plane/Helicopter/boat/whatever
if !(_x isKindOf "Man") then {Magic};
But if the count went from 2 to 1 wouldn't it then be 0 if you check for kindOf?
hf finding that out =} I made enough for today ๐
Lol!
Im just going to use allunits
Thanks for helping, definitely improved my optimization game
yep yep
- save this page:
https://community.bistudio.com/wiki/Category:Scripting_Commands
Boommarked already!
I feel smarter for having read the above discussion. Thanks. ๐
ye! and this recursive function for checking the remaining players on each death is way better than the server checking every second and using a lot of resources
Dear lord I am pulling my hair out.
Can anyone help me put together a round based respawn system..
watcha got
I have been looking everywhere for something like this, and nothin I have looked at seems to do it.
How can I then, implement spectator while waiting on a new round?
Ie, DIE -> Put in Spectator -> onNewRound -> Respawn
I did a mission with this recently, I start with a respawn timer that's like "9999999" so virtually forever, with respawn type "Base" or "3" then I make a script so that when a condition is triggered, every client runs a script that sets respawn time to "1" for 5 seconds, then sets it back to "9999999"
spectator still works, why not?
Oh it does?
are you using EG spectator?
Yeah
are you putting them in spectator via script?
Don't see any reason not to yet, unless there is something I missed D:
Question, does anyone know if its possible to force a client to load a world on startup?
Not yet no.
@tame portal has to be set through the clients launcher
I know that, but what if no world is given
Is there a way to force a mission to run in the main menu?
it loads an empty ocean
Well if you dont enter a value it loads Altis or Stratis..
Or a different map with mods
yes. There is a startparemter one sec
the -world startparameter loads a mission afaik
people have made addons with it, I just forget the command
Yes, but I need it without the start parameter
given the user loads no specific world
gimme a min
In config "CfgWorlds" >> "initWorld" is apparently the map name @tame portal
you can overwrite that in a Addon config
@hearty plover
Remove the "Spectator" respawn template from your Description.ext
OnPlayerKilled.sqf
["Initialize",
[player, //unit being initialized
[West], //sides that can be spectated
false, //can AI be viewed
false, //can free camera be used
false, //can 3rd person be used
false, //show focus info widgets
false, //show camera button widgets or not
true, //Show controls helper widget
true, //whether to show header widget
true //Whether to show entities/locations lists
]] call BIS_fnc_EGSpectator;
hint "spectator mode has started";
systemchat "spectator mode has started";
sleep 3;
BIS_DeathBlur ppEffectAdjust [0.0];
BIS_DeathBlur ppEffectCommit 0.0;
OnPlayerRespawn.sqf
["Terminate"] call BIS_fnc_EGSpectator;
Your the fucking best around bud, then I could toss in some logic on the on killed to set the respawn timer to the amount of time left in the round + 5 seconds
So if you die with 60 seconds left in the round, you respwn in 65.
I wonder if I can use the wave setting to help me here as well.
@vague hull this is the prototype of the friends spectate: http://pastebin.com/SRfbcaM2 you can run it in the EDEN editor console and it will show you a agent running in circles with a camera above its read following its eyeDirection and that can have zoom in and out.
The zoom factor will be stored in the spected player namespace and it will be applyed to the camera.
@tame portal You can also use Missions. Atleast if they are defined in "CfgMissions" But i think also stuff in the Missions folder may work
Alright will look into it
The thing is im making a main menu for a mod
and that main menu requires a specific world to be loaded to allow for interactions with it
(camera shots, etc.)
Sounds neat
Yep. I think in Arma 2 the background was a mission with a scripted Camera. Changed ofcause in Apex as they somewhat removed that
Basically Im making the main menu for Desolation Redux and I want character customization in it like in DayZ but that obviously only works with predefined positions ^^
In ArmA 3 its the same
A dialog that gets opened
RscDisplayMain
and a mission that runs in the background
both can interact with each other
What do people use nowadays for cameras instead of SQS anyway
createCamera
ah
SQF Kappa ๐
nah man, hpp
I wanna create a better third person camera for fixed wing
where it rolls with the plane
It's a project for later, but ultimately I want to do it eventually
Splendid camera for capturing camera positions. Then camCrate in sqf.
ohh
There's a third person camera mod
Alright I need some scripting related help here. So, I have scripts that make AI mount vehicles on their own and move towards objectives, but somehow, especially after mounting vehicles, the AI simply gets stuck after completing their waypoint while other AI's seem to work just fine.
https://gist.github.com/anonymous/0e7eed06224f6f4cba792e39ede840a2
This is the first script which allows AI's to chase down the player with vehicles. Unfortunatly, spectator mode breaks adding units to arrays because the spectator mode gives every unnamed unit a name, and then it doesn't match the _coparray anymore. Does someone know a good way to give units a var name (like the units "name" field in the editor) via scripting & so that I can keep spawning more and more AI and they all have a unique name?
Next: The AI that refuses to move after mounting vehicles. Especially with my conquest AI https://gist.github.com/anonymous/8c1c9e0885777048bf5f2f21da90d888 I experience the issue that they mount up tanks, roll towards an objective, and then just camp there. Somehow it happens rather frequently that they don't realize that the objective has been captured and they get stuck, while AI's spawn there and take the vehicles there just fine. Infantry also seems to have no issue moving away from captured objectives, but it isn't rare that tanks get stuck at the flag. I would highly appriciate if someone could look through both scripts and figure out why the AI sometimes refuse to drive.
Ping me if someone has an idea so I notice it because it will be a while before I come back online. And yes, I know that the conquest AI script is a giant mess right now because blufor and opfor script parts are seperate which is bullshit but my issue exists in both scripts, probably ยดmoveยด and ยดorderGetInยด don't go so well, because especially with the cop script I can clearly hear them giving the "move to grid XXXXYYYY" talk, yet their vehicle which is in perfect condition just doesnt move :/
Try making the driver go in last.
As in. Before giving the car a waypoint. Move the driver out and in
I have the weirdest case of dejavu
Always set your variables to private when you introduce them.
It's only "unnecessary" until that day everything breaks and you're looking through everything to find out why.
It makes virtually no difference when using the keyword.
shouldn't it actually help if you have a longer scope chain
there's no reason to not use it tho
If the variable is undefined I guess it could actually speed things up. But it doesn't matter. If you don't use private the variables scope is flagged as undefined-keep-looking.
private is about as "unnecessary" as tagging global variables.
@commy2 its not breaking variables, its the AI ignpring a move order i know it recieved. Btw I never really understood the purpose private and why it would matter to have it :/
@nigel "out and in" well basically I should try to not mess with their waypoints while they attempt to mount a vehicle? Also moving the dude out and back in doesnt seem to change anything :s
@plucky beacon you really put me in the right direction man! Thanks so much!
No problem! Convenient I made a similar mission last week ;)
What is the command for Units (player units) similar to canMove
Also, does canMove work on players?
while {ACTION_PHASE} do {
{ // start of forEach _players
if (_debug1 isEqualTo false) then {
systemChat "CHECKING FOR PLAYERS AT ALPHA";
sleep 0.5;
_debug1 = true;
};
systemChat format["Checking for %1 on Alpha", _x];
if ((!isNull _x) && (isPlayer _x) && (alive _x)) then {
systemChat format["%1 is on Alpha", _x];
// check distance of all players to that of the point.
if (_x distance (getPos ALPHA_POLE) < CAP_RADIUS) then {
systemChat "SOMEONE IS ON ALPHA!";
[_x] call ff_setAlphaFlagStatus;
}; // if in range of point
}; // if not null
} forEach TOTAL_CURRENT_PLAYERS;
systemChat format["HANDLER LOOP: Alpha Ownership West = %1 | Alpha Ownership East = %2 |", APLHA_OWNERSHIP_WEST, APLHA_OWNERSHIP_EAST];
sleep CAPTURE_INCR;
};```
So, this is my script I use to track players on a capture point.
I have a script for each of the three points.
I spawn each capture point script seprately.
I am getting ALLOT of odd stuff from this.
If a player is on the point, and they die, they can no longer capture points, even after respawn.
Sometimes, if you kill a player, you can no longer capture a point.
Any ideas on what could be causing all of these weird behaviors?
I've been messing around with handleDamage and it seems the values of damage taken and damage player are not actually the same (handleDamage says 0.0184771 and damage player says 0.00346365)
Could anyone explain this?
Also, is there a way to override ArmA's respawn function (so no respawn, I want to implement my own system) via script? I currently have a handleDamage for 0.99 damage but that clashes with my point in my previous message as well as has no rag doll
Because there are 2 different kind of Damages (hitPoints and overall)
Don't ask why, it makes no sense at all.
For example: Drive with a car against a Tree. Check your OverallDamage and your Hitpoint Damage.
I know hitPoint and overall but why is handleDamage any different to Damage player? does it get executed each time A hitpoint takes damage / for each hitpoint that does?
And is there a way to overide that default respawn via script? therefore I can add a custom respawn system?
Just don't active the RespawnSystem?
I thought it was default unless disabled?
initPlayerLocal.sqf
player addEventHandler ["Respawn", {call My_fnc_ToHandleTheRespawn; true} ];```
There is respawn, unless you define it in the description or mission
Yes but I want a custom respawn timer script as well... which that is only for onRespawn....
Just guess, what i pasted above.
So then if I don't activate the respawn system in description.ext my body will just lay there, correct?
Basicly, "custom"-Respawn is just a "I respawn on a remote Island, then creating a Cam somewhere else and startsome fancy UI stuff. When time is over/selection is done: I spawn the previously created Unit to the designated position"
@cerulean whale
+You might also need that stuff
player addEventHandler ["killed", {call MyTag_fnc_Handle_Killed} ];
MyTag_fnc_Handle_Killed =
{
_Player = _this select 0;
_Killer = _this select 1;
_VehKiller = _this select 2;
//set up SepctatorCam
MyTag_OldBody = _Player;
MyTag_DeathCam = "CAMERA" camCreate (getPosATL MyTag_OldBody);
showCinemaBorder TRUE;
MyTag_DeathCam cameraEffect ["Internal","Back"];
MyTag_DeathCam camSetTarget MyTag_OldBody;
MyTag_DeathCam camSetRelPos [0,3,4];
MyTag_DeathCam camSetFocus [60,0];
MyTag_DeathCam camSetFOV 0.5;
MyTag_DeathCam camCommit 0;
[] spawn
{
sleep 5;
camDestroy MyTag_DeathCam;
systemchat "Cam destroyed";
};
};
*updated
+maybe add this also
(findDisplay 415000) displaySetEventHandler ["KeyDown","if((_this select 1) isEqualTo 1) then {true}"]; //Disable ESC```
I've already got a setup like that for my current system. It's just that I use a stupid handleDamage system that doesn't actually kill the player ๐
Check your Files, wich kind of Respawn you use
iirc, some BI-Respawn stuff has overwritten userAdded EHs
(e.g. Description.ext:
respawn = BASE;
//respawnDelay = 4;
respawnDelay = 1;
respawnDialog = 0;
respawnButton = 1;
respawnOnStart = -1;```
Those were my settings. (i also had a "custom"-RespawnMenu)
How would you save the players body to delete afterwards if the script runs after they are already dead?
because won't it unassign the player from it?
@hearty plover I have a script that allows capping points aswell. I can share it with you once I'm home so you can take a look at it. Works in a single loop with an infinite amount of capture points depending on how many you wish there to be. Also with marker + respawn on owned flags
Nice, thanks man would love a look see.
Store the Body in a Variable @cerulean whale
Yes, but after they die won't it unassign the model? @jade abyss
Check above - I updated my example.
Yes, they will. AFTER the EH Killed was executed.
Ah
@hearty plover Just try to remind me in about 8 hours or so that i dont forget :D
Inside that example, you can (for example) get the whole Gear of the dead Person. After he respawned -> Assign it to the new one and deleteVehicle the old body or empty the Corpse.
I assumed it did it before. ๐ seeing it was as onPlayerKilled, but that makes sense. I'll rig this new system up in an hour or so. ๐ Still a pain in the ass that there is no disableRespawn optino
that would be so useful lol
Read what i wrote above
Ye I get it, I just tested it ingame
10min ago
ik wat u were talking about
but it would be easier if you didn't have to respawn a dummy model in 'debug'
You CAN Disable Respawn respawn, soo... your sentence Still a pain in the ass that there is no disableRespawn optino that would be so useful lol
was just wrong ๐
hu?
Respawn a dummy model in debug for what?
<- confused
Yes, but that's in a slightly different context to what I'm meaning
don't worry bout it lol
Anyway, I need to get off for the night, it's late af already, talk to you lot tomorrow or something lol
thanks for the help @jade abyss
kk
@turbid thunder I will sir, and thanks again.
I'm using vectorCrossProduct when dealing with vectors, this make me proud of my self (tear). And have the feeling no one using vectors can left it behind.
Just moving my right hand like a retard to know direction of new vector.
Ooops sorry for off-topic...
You can use it in sequence to reach the vector you want.
lol
There's one issue I've been meaning to solve for a while now. When making multiplayer missions I sometimes reference playable units using their variable name, but when a player doesn't take that unit it doesn't exist and outputs an error. I've used if (!isNil "unit_name") then {...} before but it's frustrating to go through each unit and do that. Is there a better solution?
isNil has one L
there isnt really a nicer solution. you can missionNamespace getVariable ["unit_name",objNull] too but that plays out mostly the same.
maybe arrayOfExistingUnits = arrayOfUnits arrayIntersect arrayOfUnits
i forget how that command handles nil
well part of the problem is Nil only reads strings
You could:
- use
missionNamespace getVariablelike ^ - define all unit names you use as
objNullas default values before doing anything with the variables - stop using the scheduled environment
so I can't ask isNil Unit_1 it has to be "Unit_1"
Why is that a problem?
If using an array of variables
?
[unit_1,unit_2] can't be asked isNil
lol
{
{
_x setDamage 1;
} forEach [unit1, unit2];
} call CBA_fnc_directCall;
this works
sure. or whatever else you want to do with them
oh you mean directCall
directCall is for executing unscheduled from inside scheduled, right?
Yeah.
So basicly, a []spawn ?
The other way around, Dscha.
But seriously. I'd just define the variables as objNull at the start of the script.
uh, kk.
isNil is unscheduled no matter what? ๐ฎ
They made it that way for whatever reason.
weird
I guess so you can use.
isNil {_undefined};
is SQF a language supported by discord now too?
for code formatting
{
{
if (alive _x) then
{
_aliveUnits pushBack _x;
};
} forEach _ListOfUnits;
} call CBA_fnc_directCall;
I guess so
i dont think you can use local vars with directCall, you'd have to use the return value
private _aliveUnits = [{_this select {alive _x}},_listOfUnits] call CBA_fnc_directCall;
or pass _aliveUnits as a reference
no i think the way CBA handles it is store it and they have a nonscheduled script elsewhere running the code
e.g. in a different scope
nope
ah cool
nice shit
now for the final concatenation
private _activeUnits = [{_this select {alive _x}},_listOfUnits] call CBA_fnc_directCall;
_aliveUnits = { (alive _x && side _X == West) } count _activeUnits ;
//turned into this...
private _activeUnits = [{_this select {alive _x && side _X == West}},_listOfUnits] call CBA_fnc_directCall;
_aliveUnits = count _activeUnits;
this should work?
no, just need the count
then just count in directCall
listofunits is defined ya
private _aliveCount = {{alive _x && {side _x == west}} count _listOfUnits} call CBA_fnc_directCall;
mm that's a spicy line of code
replaces my 14 line mess I made last week
Thanks
most of my code is commented out versions of worse algorithms
its good for learning
I like to keep it like that until I have a 100% working project
I'm having this one big where my mission ends right at the beginning 1/5 of the time, I'll have to look into it later.
This way of using DirectCall to count though might help
cptnnick - Today at 3:46 PM
private _aliveCount = {{alive _x && {side _x == west}} count _listOfUnits} call CBA_fnc_directCall;
(edited)```
Why call directCall?! oO
read up
Should be more then enough.
_aliveCount = {alive _x && {side _x == west}} count _listOfUnits;
But what about when a variable in _listOfUnits; is nil?
null or nil?
whats the diffrence
Why should it be?
nil - undefined
null - objNull, groupNull, configNull etc.
@jade abyss if a player doesn't take the unit slot in the lobby, the unit doesn't exist
puts an error
grpNull*
Uhm, yeah? And?
But you must have at least one guy ingame, so that list should be filled.
So null is just empty not undefined
okay
empty and with a type. objNull is an object. nil could be an object, number, string ...
โ
But you must have at least one guy ingame, so that list should be filled.
It would error when any of the _x are undefined. Not if all of them are.
if (local _vehicle) then {
_vehicle setFuel 1;
};
Can locality of the vehicle change between line one and two?
But you'd need another line like that to even make the array.
In scheduled environment, yes
In unscheduled environment no
Where is _listOfUnits assigned + with what?
so you're saying that as long as one of the units in the list exist the count should still work even with an error. i.e. Leader_1 exists, Leader_2 doesn't, Leader_3 exists, the rest don't. Return count 2.
_BluforUnits = [Leader_1,Leader_2,Leader_3,FTL_1,FTL_2,FTL_3];
_aliveCount = {alive _x && {side _x == west}} count _BluforUnits;
That would error in scheduled environment if any one of these are undefined
It would be fine in unscheduled environent
right that's what I experienced
Oh my oO
as an aside, arrayIntersect doesnt error in scheduled when it encounters nil. so thats an option too.
A3 CTF game mode confirmed
"because they need it"
Of course
everyone is super judging you RN
I'm embawessed
If you fail -> You become a life-Scripter.
NOOOOO
muhahahhahahahahahaahaha
I feel like I'm being graded
That's the point of this channel.
@plucky beacon
But still, why don't you just assign the Vars, right at the start like FTL_1 = ObjNull; ?
so you're saying forEach _BluforUnits _x = ObjNull?
You'd have to do that in preInit to not overwrite them. Or use isNil I guess (and hope the scheduler doesn't screw you over)
I don't know what that would do
was just about to write it that one, yeah.
preInit not rly needed. Init should be enough (serverSide)
your current shit works Nitro dont worry about it too much
....
but I wanna be the best @indigo snow !
gl
there are other ways that arent necessarily better
Yep
sometimes its fun to discuss them but that doesnt make it work less well
I know but whenever I hear of a way of doing something I haven't heard before I wanna know
Some alternatives might be better or worse. Many ways to accomplish your goal + don't mind toooo much about a 0.2-0.3ms difference.
so my first reaction is to ask
and I don't know what FTL_3 = ObjNull would do if FTL_3 isNil still
wut?
_BluforUnits = [Leader_1,Leader_2,Leader_3,FTL_1,FTL_2,FTL_3];
_aliveCount = {alive _x && {side _x == west}} count (_BluforUnits arrayIntersect _BluforUnits);
another way
It wouldn't be isNil oO since its a NULL
You can obviously assign variables that are previously undefined.
You just can't use them on the right side of the assignment operator or any other expression sometimes because Arma
And thats a sentence, you wil see/hear/think pretty often: "Because: Arma".
Had that first hand, especially whenever trying to get AI to do something specific
anyone has info on playGesture (https://community.bistudio.com/wiki/playGesture )?
is the effect local or global?
do the arguments have to be local or not?
it might be the same for all playX commands
Command doesn't seem to be functional
lol
who does remoteexec reference when referring to targets as 1 or -1