#arma3_scripting
1 messages ยท Page 397 of 1
I'm talking about this topic in general, I don't like people doing wooki wooki stuff because they heard it somewhere sometime and then their code ends up looking like spaghetti and obviously they don't comment ยฏ_(ใ)_/ยฏ
"Pseudoimprovements" I'd call it
I usually do it after I run in through the performance thing or actual loop that needs to run a lot
I profile my code. Find problems and fix them
What's "profile"
And not in debug console trying to optimize microseconds. But in real missions with other players under real conditions
Checking which code runs when how long and where the slow parts are
Code profiling without tools in ArmA is ehhh ๐
Without proper profiling tools it wouldn't make much sense
Slap some diag_log diag_tickTime in there ( อกยฐ อส อกยฐ)
no..
w h a t tools
That's not a proper tool
Profiling branch is called that for a reason
Me and probably majority don't got no clues how to use that
https://forums.bistudio.com/forums/topic/211626-arma-script-profiler/ I put so much effort into that post though
Disclaimer: If you don't use unscheduled scripts or you don't know what "unscheduled" means this won't be useful...
At first I used my subtree method that I wrote on the profiling wiki. It works well but is tedious
You don't really need profiling build
But it has an easy way to display the data in a nicely readable form
Please don't run it with TFAR or ACRE. You'll probably find many ms's
All explained in the forum post :u
enter profilerCaptureFrame and press F1 in the debug console
If it doesn't tell you anything then the mod didn't load. Maybe forgot to load Intercept?
Oh eh.
profilerCaptureFrames 10; kinda works when I run it like a coupel of times
This look correct?
Maybe you don't have enough unscheduled scripts running. If there are none it won't trigger
you have to press on "PASTE ALL" on the bottom
ill try a differentm isison
put compile "test" into debug console watch
The code that generates should be different than "test"
empty
typoed compile
it should contain a _scooope
lol complie
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
I got the latest profiler exe
I got laterst intercept
I gotr latest script profiler
Run it all together with ace and cba
Run command in debug
Did I goof up?
onEachFrame {profilerTrigger} run that in debug console
And then do profilerCaptureTrigger
It should pop up the UI thingy and when you PASTE ALL it should.. display stuff
Although... no
onEachFrame (compile "profilerTrigger") do that
that should definetly create enough data to display
I usually try just hopping into Eden preview on VR. That's enough to get some ACE functions running and create enough data each frame to display
I was in editor and in va
Every script function you look at in Debug console watch field should start with private _scoooope = ...
Both have ace running
Oh! And if it doesn't I know why
ok tell me
The profiler is overwriting the compile script command to add the profiling code
Aah, so disable profiel branch?
It can only do that if the Intercept plugin is digitally signed with my key. That is probably not working
https://ci.appveyor.com/api/buildjobs/aa0v51wt3tjnld8l/artifacts/intercept_host.zip Use that Intercept version
I made a fix on the signature verification after the last release
gotcha, I'll do that after I'm done updating
Definetly works correctly for me with intercept dev build. Guess I have to look more into why the signature thingy fails sometimes
whats the difference in doing this -->
private _var = 10;
and
private "_var";
_var = 10;
is it the same thing?
It does the same thing
ok, thanks
but the second one is infinetly slower than the first
awww did someone get a fancy color? ๐
hehe
Hello, is there a way of getting the RHS's (or aznyother mod's) CfgWeapons for me to display a Sghting item on a weapon
like this type of script line :
ConfigFile >> "CfgWeapons" >> Currentweapon Player >> .......
Uh... what?
I have a Script that calls a set of scops (that I set) form an other script, when the mission is run with no mods, it works perfectly. But when I adapt the mission with RHS mod the the weapons show up but not the Scops, as if it couldn't detect a compatible scope for a modded weapon.
configfile >> "CfgWeapons" >> _your_weapon_here >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems"//--- Optics
That one ?
I have this one
ConfigFile >> "CfgWeapons" >> Currentweapon Player >> "WeaponSlotsInfo" >> "CowsSlot" >> "CompatibleItems"
but yes, same thing
The display doesn't work but the Scope is on the weapon. the player just can't see it
give me a sec
501
So I have a Weapon Menu with an external cam that displays the weapon/Scope that the player is choosing. This all works I've been playing with it for years with no mods on. But now i'd like to a RHS in my mission.
What happen is :
1 : I select a weapon > Thats OK I see the RHS weapon.
2 : I select a Scope > That doesn't work, I doesn't display the scope I have chosen.
3 : But if I click OK so confirm the Scope (that I can't see) and the Weapon, then TADAAAM, the scope miraculously shows up on my weapon out of the WeaponMenu.
So i'm thinking maybe i'm not selecting the right CfgWeapon file ?
Some locality issues maybe ? How you add weapon items ?
AddPrimaryWeaponItem
Also with rhsusf_acc_specter something was bug
switch (stance _unit) do {
case ("CROUCH"): {
_unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 0.1);
};
case ("PRONE"): {
_unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 2.0);
};
default {
_unit setCustomAimCoef (1.5 + _fatigue ^ 2 * 3.0);
};
};
proneing has more shake than crouching in ace3
Check that scope in arsenal @quartz coyote
I tested with rhsusf_acc_ACOG_RMR
but I also tested with vanilla scopes like optic_Holosight and I does the same
as if the RHS weapon didn't detect a compatibleItem Slot
Is it works with vanila weapons and weapon items ?
Yes, i've been using it for years without problems
Maybe some bug in addon
you have 3 variant of scopes
2d, 3d & pip
it's changed automatically ingame so you don't have arsenal clogged up with bazillion variants of same scopes but in different techs
@quartz coyote
What the fuck does that mean ?
you are using wrong class name
yes
I know only of one ...
so for rhsusf_acc_ACOG_RMR what would be the right classname
just check ingame which scope do you have with some script command
you can have different variants depending on which mode did you selected in RHS Options Menu
There is prefered optic list box & you can switch between variants that I mentioned before
are those the right ones ?
http://class.rhsmods.org/rhsusaf/CfgWeapons.html
you are checking your own accessories or some AI units?
my own
So, anyone interested in a func to port VA loadouts to ACE Arsenal ones?
https://pastebin.com/FWuDdLgE here you have variants of acog
@dim terrace Is that mean that "compatible Items" return from config is incorrect ?
depends, RHS weapons are using class compatibleItems instead of compatibleItems[] array
Sooooo what shall i do ???
you can paste your script
i suppose you could also export Arsenal loadouts?
nope
BI loadout format is so fucked up I don't want to deal with it
so my func here:
https://forums.bistudio.com/forums/topic/193161-ace3-a-collaborative-merger-between-agm-cse-and-ace/?do=findComment&comment=3257898
load all loadouts and save them one by one
it was directed at Flash-Ranger
@inner swallow it's same problem, but don't bother, I went for a VArsenal solution lol
Would there be a way of executing this in initplayerlocal with item and weapon restrictions ?
["Open",true] spawn BIS_fnc_arsenal;
without going through the command
[myBox,["arifle_MX_F","arifle_MX_SW_F","arifle_MXC_F"],true] call BIS_fnc_addVirtualWeaponCargo;
maybe a class Arsenal in Description.ext or something
@quartz coyote You can add that to a box or unit and whitelist items with functions like BIS_fnc_addVirtualWeaponCargo and it's reciprical BIS_fnc_removeVirtualWeaponCargo
Not aware of a way without it
But i'm sure Dedmen has a intercept solution packed and ready to go
Welll........ You could replicate what addVirtual... commands do manually
Meh
inb4 I self plug ACE Arsenal
Just use ACE arsenal. It can do that
@subtle ore my interest is to nypass the "object"
plus you don't have to wait 20s for it to load ๐
Yeah. I'm proud :3
right so how to I summon the ACE arsenal from my InitPlayerLocal
arsenal documentation
what a bunch of schills
ah fuck we don't have the slackbot
hey, i'm not shilling I wrote the damn thing
it's more of a self plug ๐
ADVTING
SHAMELESSLY
also:
this https://imgur.com/a/wWsfn
damn imgur compression isn't nice to BI fonts
@lone glade You and your ACE fairy dust, sprinkle it on and it magically works. Kick the team's butter into action with that medical rework. #testersForMedicalRewrite
Can u link framework in the feature page?
I could've called it alganthe's weapon cave
and in hindsight I shouldn't have used the word arsenal
I tihnk it's good. it's similar
but it get people confused
I thouyght it's a replacement 'tho
@lone glade PM
it is.
It's not the same as the normal one it's next to it. it does nto replace it comepletly
@lone glade Alganthe Weapons Cave works
omg please someone understand me ...
["Open",true] spawn BIS_fnc_arsenal;
this works perfectly, no need for ACE for that !
What I want is for it to ALREADY have the restrictions when it opens !
@quartz coyote Withought a virtual box or unit with it added to, then it's not possible
A player is a unit tho
That's what i'm saying
Ok well BIS if you're reading this : Thats Dumb !
Although others would be able to use it off of you
nah, don't need to add the interaction
That wasn't their initial plans for it @quartz coyote
Huh
what does this mean? "extDB3: Protocol Error: [0,""Error MariaDBQueryException Exception""]"
the query that I'm trying to do is like the others, but this one doesn't work
nvm, found why
Mind posting why?
SQL syntax error
Okay, what would that error be? What's the correct syntax? Just for the better of myselt
It just means check extDB3 logs for more info why it failed. Only generic error info is available in sqf
Could be anything from typo mistake to that database table doesn't exist
my server keeps restarting, could this be the cause? 20:29:05 Attempt to override final function - bis_fnc_storeparamsvalues_data
@kindred bane are you trying to define that as your own function?
I dont believe so, hold on
But could thisi also be a cause of the problem, @river meteor ?
20:35:57 File tmf_police_and_ems_gear\config.cpp, line 362: '/cfgWeapons/TWF_SWAT_1_vest.author': Missing ';' at the end of line
Im getting tons of those from a mod i use
did you create any of the scripts you are trying to load or are they all external downloads?
you have to correct the config.cpp and place a ";" where it's supposed to be
well im using a life miission
all right ill do that xAndreei is that the problem though u think
Also i dont think im even using the bis_fnc_storeparamsvalues_data function anywhere it must be in a mod
I'm reading that it could be the order you load mods. If you are using CBA, make sure it is being loaded first
aight its being loaded like this: (CBA) is in the archonrp folder so ill try and load that first
@life_server;@ArchonRP;@extDB;@infiSTAR_A3
@river meteor
In any case you definitely want to fix the other syntax errors that are reported. If you didn't make the mod yourself you should also consider that a developer who released code with syntax errors may have other bugs and problems with their mod.
aight, i fixed them, ill see if it works, if not ill report back and also yeah im not even sure when i added that addon so i guess ill remove it if im not using it in the mission
@river meteor ok, so sadly did not fix the problem. However i tried something else, and took the rpt file before and after i joined, after i join i get this:
21:05:25 Unsupported language English in stringtable
21:05:25 Unsupported language English in stringtable
21:05:25 Error: Weapon[arifle_MX_pointer_F]: max attachments slots count reached(maximum = 5)! Attachment slot[asdg_OpticRail_MX] for weapon's proxy[\a3\data_f\proxies\weapon_slots\TOP]
21:05:25 Mission Archon.LakesideValley: Number of roles (110) is different from 'description.ext::Header::maxPlayer' (200)
21:05:26 BEServer: registering a new player #8281630
Would the max roles thing matter?
have you modified the config.cpp ?
which one?
20:35:57 File tmf_police_and_ems_gear\config.cpp, line 362: '/cfgWeapons/TWF_SWAT_1_vest.author': Missing ';' at the end of line
yeah i fixed that
any other errors?
theres all the rpt after i join the mission
it doesnt crash before i start connecting and receiving mission file,
@river meteor
Where did you get these mods that you are using from? Were there server setup instructions?
those are altislife
i think
that the new arma update acctually made this crash
cause there was an update like 2 days ago and its been down for around 2-3
@river meteor what could this be 21:05:27 Server error: Player without identity Alex Newman (id 8281630)
@kindred bane Not sure, but I get that when I start my server and it hasn't caused problems for me. It seems like you have a broken mod installed. I would just go to the author of the mod for help themselves. You have never gotten this mod working correct?
Hey folks, is there any known solution for the UI flickering which occurs if you load the .paa into your title via ctrlSetText? FYI: the image is changing every 1s through a looping script and then its flickering like the system doesn't cache it.
@still forum profiler works now
With the new one you posted
Good stuff
nonee of my scripts are there 'tho becaues I don't have unscheduled scripts
Yo, Manason i cant tag u cause ur offline, but it seems that the new arma 3 update from a few days 2-4 that has caused this, i have the update just before that on my pc and server doesnt crash
I believe this might be the problem, im not sure how to fix it though,
21:05:42 Attempt to override final function - bis_fnc_storeparamsvalues_data
Make your own life from scratch instead of copying the existing ones?
If your not gonna help dont
but then stop giving me a reply i cant use, as im not gonna recreate a whole mission that already exists..
But you are recreating a server that already exists
Description.ext: allowFunctionsRecompile = 1
Y
It's a lot easier to debug it if you made it yourself
21:05:42 Attempt to override final function - bis_fnc_storeparamsvalues_data this is a normal log
whaats allowFunctionsRecompile do? also Midnight i never seen that before and its a message right before server crashes
@peak plover @subtle ore
it's a normal log
okay weird
allowFunctionsRecompile disables recompiling functions during runtime for security
0 = disallow
1 = allow
but the newest arma update from like max 4 days ago made this crashing thing happend
so i should have it allowed?
don't allow it, the arma update did not change anything that'd make your game crash
at all
no the game doesnt crash
the server does
after the update
nothing changed on the mission or addons
So log it
let me guess, did you update the server?
Yes
Do you have any RPT to show for?
what would i update in them i dont get it
I told you to disable what?
wait nvm
heres the rpt
it crashes first when you start receiving mission thats where i gave the rpt from^^
First try to see if the server works without mods and custom contnet
it does
๐คฆ
did it not cross your mind that the mods may be the issue?
yeah it did, but how can i know which ones the issue ๐ฎ
disable them 1 by 1. I've don that with ~50 mods before
You have 500 mods?
wouldn't you reach over the PBO limit?
about 540
and you're wondering why the fuck it crashes?
yeah i am
it crashes when you join the mission
not when the mods load or when you start your game
Why do you think you need 540 mods?
I find that hard to believe
I do too
that's an insane amount of PBOs
its 540 pbos
Ohh
PBOS != Mods
It's 1 mod
christ man
I hope you have permission to use all of them before I continue to assist
so, how many minutes do you need to load arsenal?
what you mean
?????
Since doesn't it parse upon load Alganthe?
My arsenal doesn't have loading times ๐
Caching on game startup
Good job ๐ that's like so nice
and that's dedmen who made the caching
even without it loading times were under 400ms
Nothing
outside of fixing enum errors, nothing, and those errors weren't even errors, just RPT spam
e.e
it just doesnt make sence to me, its first when player starts receiving mission it crashes, wouldnt it output logs ?
In your console sure, I'm not sure about the rpt
if it's a crash it should create a dump and show an error in the RPT
no, also where do i find the dump files, also i dont have access to console
i use nitrado
...........
Hoster
Just try if it's the mission. if it's not the mission. delete half of the mods and see if it works. Continue halving it until you find out which half breaks it and so on.
im considering suicide lmao
the servers ip had for some unknown reason changed so it was unwhitelisted with infistar
and i never checked that cause why would the ip not be whitelisted suddenlyy :::
That's Life ยฏ_(ใ)_/ยฏ
Literally?
hey anyone good at scripting?
Literally! @little eagle
hey anyone good at scripting?
No.
nope
What about koffein flummi
No
@tough abyss bring it
I'm sure everyone's IQ combined will be over 80 so we can figure something out
Here take 1iq from me
up to 81 already
I've got an idea
Not sure how goood it is, I'm guessing ~65-70% good
Woah, thatโs 65-70% more than me o_o
For my next ai script I will have an _extra parameter when spawning in the units and this will be attached to the unit for future.
['pool', ['B_Soldier_SL_F'] // array, classanmes
['area',[a,b,angle,isrectangle] // array, based on cba_fnc_randPosArea
['perim',true] // bool, spawn on perimieter of area
['areaMarker','markerName'] // area marker name as string
['areaTrigger', triggerName] // variable name of the trigger
['house', bool] // patrol houses instead
So I can put one of these in there
THe order won't matter
because I will match the first element to a search later
So then I can save this for safe keeping later
shit i had it muted
anyway
class Extended_Init_EventHandlers {
class Man {
init = "_this call {(myCurator select 0) removeCuratorEditableObjects [[this],true]}";
};
};
^^^^ that right there keeps zues from fucking with units it isnt suppose to be messing with, but i keep getting a generic error.
I just saw you double posted into #arma3_scenario
["All", "initPost", {_this call loadout_fnc_auto}] call CBA_fnc_addClassEventHandler;
This is to add a eh to everything that's added
Just make a function that uses ```sqf
removeCuratorEditableObjects
where would that go again? in init or description?
Ohh
btw your code
class Extended_Init_EventHandlers {
class Man {
init = "_this call {(myCurator select 0) removeCuratorEditableObjects [[this],true]}";
};
};
[thise],true
this does not exist
could be youyr generic error
Why is it _this call btw?
I kinda took what this guy did, without really knowing what he did
ok @tough abyss are you using hc in any form for zeus objects? will szeus be able to spawn in objects at all?
Nope
objhects and units*
[] spawn {
while {true} do {
sleep 10;
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
};
But do you want a curator to be able to control certain units?
and then using classes in the description.ext I used _this because its local
allCurators select 0 is unreliable
allCurators select 0 is the first zeus to load in
it could be different every game
How many zeus slots do you have?
ok what are the variable names to those?
I just use a for each
{_x addEventHandler ["CuratorObjectPlaced",{
// spawn to allow suspension
_this spawn {
// sleep, this keeps AI clothes one on ownership transfer
sleep 5 + (random 5);
private _target = param [1];
// Changeowner
_target remoteExec ["headless_fnc_changeOwner",2];
};
}];
} forEach allCurators;
unles you want to remove them from all zeus?
aaah
gotcha
then it's ez
I thought it's blufor zeus vs opfor zeus ๐
if (isServer) then {
["All", "initPost", {
private _object = _this param [0];
{
_x removeCuratorEditableObjects [[_object],true];
} forEach allCurators;
},true,[],true] call CBA_fnc_addClassEventHandler;
};
When a unit is spawned in or an object
Nah its a singleplayer RTS, the multiple zeuses are because i use switch units and the strategic map to give my mission that Tac ops feel to it, You get to pick where you are in the battle field
It's automatically removed from all zeus
I don't understand that much
So you want zeus to be able to do nothing ?
No, with the class system i had set up. Any unit spawned that wasnt spawned by zues, was uneditable
Well aslong as it was a man, vehicles still were editable
I want all units that are not west to be removeCuratorEditableObjects
right now alive, as well as arma 3 sites modules, spawn in units that my zueses can manipulate
if (isServer) then {
["All", "initPost", {
private _object = _this param [0];
{
if !((side _x) isEqualTo west) then {
_x removeCuratorEditableObjects [[_object],true];
};
} forEach allCurators;
},true,[],true] call CBA_fnc_addClassEventHandler;
};
do i need a high command module for this to work
{_x addEventHandler ["CuratorObjectPlaced",{
// spawn to allow suspension
_this spawn {
// sleep, this keeps AI clothes one on ownership transfer
sleep 5 + (random 5);
private _target = param [1];
// Changeowner
_target remoteExec ["headless_fnc_changeOwner",2];
};
}];
} forEach allCurators;
that one won't work for you
It's just an example
headless_fnc_changeOwner is a custom function
But that one only works for zeus objects
i dont understand what ur init post is doing
and it doesnt seem to work
the CBA_fnc_addClassEventHandler
{_x addEventHandler [
"CuratorObjectRegistered",
{
_x removeCuratorEditingArea 0;
(getAssignedCuratorLogic player) addCuratorEditingArea [0,position player,100];
}
];
} forEach allCurators;
that works, It makes it so that when ever the curator opens his interface, the edditng area is placed 100 meeters around him
But for some reason when i add your cba add class event handler, into the same script, that is included in my init. It doesnt seem to do anything
and when alive spawns units to fill in the surrounding areas, they are still editable
Why don't you just disable the curators ability to edit anything?
Needs to edit blufors
Yeah, and like ace adds garrison modules, thats going to be hella useful
but im interested, You have a way to add all placed groups & units to high command?
honestly I have around 4K hours in arma, I never touched High command
and i'm fairly sure it's abandonned / unfinished
LOL
I touched it
It's actually good
Gave task for a few groups to attack a town
They actually do some cool shit
I saw the interface (drone view) disabled the key and ignored it for the rest of my playtime
if (isServer) then {
["All", "initPost", {
private _object = _this param [0];
{
if !((side _object) isEqualTo west) then {
_x removeCuratorEditableObjects [[_object],true];
};
} forEach allCurators;
},true,[],true] call CBA_fnc_addClassEventHandler;
};
I messed up the side check
before
this works
testedโข
Only blufor units will be editable
I know there's a mod for HC
hmm
You have a way to add all placed groups & units to high command? https://community.bistudio.com/wiki/hcSetGroup
class Extended_Init_EventHandlers {
class Man {
init = "_this call {(myCurator select 0) removeCuratorEditableObjects [[this],true]}";
};
};
Thats the closest ive ever gotten to it working, And all it does is Make infantry un editable. Anyway it hates the "mycurator select 0" but everytime i change it, it doesnt give any errors but it doesnt work
Anyway if i wanted it to make all units, then i just have to change the class man to something that incorperates everything
But im not going to work on that till i get rid of the generic error
On the end of the longest line
change this to _this
fixed
Just use the initPost i posted
Put that into init.sqf
mhmm
hmm
I wonder
'tho
If it will work if you are not in the curator...
your init post doesnt seem to work ๐ฆ
good idea, hold on
it came back with true....
but yeah it works
Just you have to be in zeus, Or maybe if i add a sleep
let me try out of zues
{_x addEventHandler [
"CuratorObjectRegistered",
{
_x removeCuratorEditingArea 0;
(getAssignedCuratorLogic player) addCuratorEditingArea [0,position player,100];
{(getAssignedCuratorLogic player) removeCuratorEditableObjects [[_x],true];} forEach (allUnits + vehicles);
}
];
} forEach allCurators;
Add that as well
I guess replace the
distanceo ne
(edited)
wait
You gotta do the check for west as well but that should do it
if (isServer) then {
["All", "initPost", {
private _object = _this param [0];
{
if !((side _object) isEqualTo west) then {
_x removeCuratorEditableObjects [[_object],true];
};
} forEach allCurators;
},true,[],true] call CBA_fnc_addClassEventHandler;
{
_x addEventHandler [
"CuratorObjectRegistered",
{
_x removeCuratorEditingArea 0;
(getAssignedCuratorLogic player) addCuratorEditingArea [0,position player,100];
{
if !((side _x) isEqualTo west) then {
(getAssignedCuratorLogic player) removeCuratorEditableObjects [[_x],true];
};
} forEach (allUnits + vehicles);
}
];
} forEach allCurators;
};
Both combined
This way when you load zeus, it removes everything that's there nad if something gets added while you are in zeus it will get removed too
try it
The opened interface part works, but once it open, when units are spawned they are still editable
west/east?
east
I havent spawned any west units
man if alive would of just not automatically include all units it placed as editable
That code
I put in the debug before going into zeus
spawned in some blufr oand opfor
only had blufor
yeah it works flawlessly in debug
i wish i knew what your [all init post was
welp
I did it
i think
yup
private "_this";
_this = _this select 0;
[] spawn {
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
fuck....
class Extended_Init_EventHandlers {
class Man {
init = "_this call (compile preprocessFileLineNumbers 'classes\unitInit.sqf')";
};
};
thats my description.ext
private "_this";
_this = _this select 0;
[] spawn {
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
thats my unitInit.sqf
That won't work
Wouldn't that compile it everytime it runs?
private "_this"; makes no sense
and you never even use _this
so it does work because you don't use it. That's just weird and confusing
and yes that compiles it everytime it runs.
What did he mean by this
Hands on the Table:
Do you know ANYTHING about scripting @tough abyss ?
Nah, it's a different thing to say "I need help, my knowledge is limited" and "uhm, i know everything" (and knows nothing in the end)
class Extended_Init_EventHandlers {
class Man {
init = "if !((side _this) == west) then {(allCurators select 0) removeCuratorEditableObjects [[_this],true];};";
};
};
Why does that not work? Looks fine to me
I mean, everyone starts, no shame to know fkn nothing^^
It's that psychology thing that you are so inadped that you think you are good at something
No i dont really no a whole lot about scripting
You have no idea about the concept of understanding it yet. study more ๐
But umm like, Yeah when ever a unit is spawned, it runs that code
Good, now we know where we are =}
Just like every Engine eventhandler ๐
Alive offered their snippet, and thats the code it used to like change stuff on the units it spawns
Hey Dscha, found out today that switch with very basic and simple variables is faster than three if statements by 0.003 ms.
So it's not Slow Af mayn
Hey Dscha, found out today that switch with very basic and simple variables is faster than three if statements by 0.003 ms.
So it's not Slow Af mayn```
Whats: "very basic"
"Simple"
@subtle ore 0.003ms is a single script command call.
3 nanoseconds WOHOO
microseconds
anyway, yeah i got rid of the private stuff at the top
Sure
You probalby had the first entry on true the whole time and added another 20 behind it.
Then yeah: Of course it's faster
[] spawn {
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
@jade abyss No, it's technically still not "Faster"
Do me a favor pls:
Add 5 cases to the switch, all false, except the last one. Then the same with IF statements ๐
call {
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
};
faster
nigel
Yeah there would never be a case where you'd make me do that Nigel
not even three cases in a switch do
That's just...
switch = slow af. period
Sure
damn testers
But swittch = very neat
always arguing
// Determine position coordinates
private _position = call {
if (_pos isEqualType objNull) exitWith {
getPosATL _pos
};
if (_pos isEqualType "") exitWith {
getMarkerPos _pos
};
if (_pos isEqualType []) exitWith {
_pos
};
};
ITS NEAT DSCHA
I AM! NOT SWITCH!
:/
Switch == lagswitch
It looks "cleaner", but in the end... meh
swith looks dumb af man
But in the end, it's negligable for not heavy commands
man i dont even know what you guys are talking about, wanna try an key me in?
switch _switchGlorious do
{
case true:
{
hintSilent "This is a switch do";
};
}:
ยฏ_(ใ)_/ยฏ
0.003 ms == 3 ns
@tough abyss The speed difference between: switch(case)do{} and a line of if(case)exitWithstatements
switch = Slow af
Don't use it
oooh
ignore what midnight says
Dscha is just jealous
Nvm @still forum right
Yo mama is jealous
My mama might be jealous, but ur like x2 jealous
I might be 2x jealous, but you are just a peasant tester.
BOOOOOOOOM
So, stop the spamming now
๐
how to get HC units
[] spawn {
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
das et
That was what was posted
Errr...you shouldn't be updating a publicVariable super often
publicVariableEventHandler I saw this a bunch of times now, but I (((think))) having tons of code there would run it all every new publicvar?
remoteExec is probably better. Probably.
What kind of event are you talking about @wraith cloud
Many times per minute
That's insane
quick question
[] spawn {
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
So all curators select 0 kinda only picks 1
How would i go about throwing all the curators in there?
Yeah, works like it's written
So like would I have to do an _x for each again?
You won't need all curators there
i switched my zues slots, And well so yeah for one zues slot, it works
for the rest it doesnt
{
if !((side _x) isEqualTo west) then {
(getAssignedCuratorLogic player) removeCuratorEditableObjects [[_x],true];
};
} forEach (allUnits + vehicles);
(getAssignedCuratorLogic player)
Charges?
Like bombs?
remoteExec was made for exactly what you are trying to do
PVEH is just a ducttape solution that BI added before they made the real solution with remoteExec
[player,'Racist'] remoteExec ['nig_fnc_addCharges',2];```
Whoa
CANT DETECT IF IT'S > 1?!?!!?
IT'S THE C U R R E N T Y E A R
How is this acceptable?!
count(s)
Why!?!?
But yeah
You want to use remoteExec instead
['nig_fnc_addCharges',2];
@peak plover ๐ค
What are you adding charges for?
Is Nigel a lifer?
Is this a conspiracy theory in the making?
LOL no
That's what they all say ๐ค
one of my dreams is to have a huge gamemode that I make myself that's got RPG elements, but picking apples is just downright booring
LOL
It was terribly coded and filled with bugs and exploits ( which made it more fun for me ) ๐
I question your sense of humor there Nigel, it may be used a means of evi
I only played resistance because I knew all the glitches for ex. manufacturing -100 lockpicks and getting money insteaad of losing it ๐
No worries about money so I can just kill blufor ๐
Man, im disappointed with the tac ops dlc
Why
Idk, just whole lotta altis was so amazing. I thought they were going to do something to that extent, especially with the direction they went with apex. I love what they did with the load out screen, i have a line of code that will add Cfg groups to it so you dont have to manually plug in loadouts.
But yeah, whole lotta altis was buggy, i wonder how amazing it would of been if a real development team took a crack at it
Some modded missions are sick yeah
Anyway, the coolest aspec that i fucking love about arma 3, that no other game has captured
The anticipation and looting. Like You will spend a good hour getting to your destination, and when your there, you gotta set up to get the best advantage over your enemy as possible. And then the looting... Omg
....
Especially when one of your teamates dies, and you gotta figure out which fucker needs to carry the Explosives
my favourite part is roleplaying as controversial armies
controversial armies? how so?
Russia, Pakistani
oh
Iran
ISIS, Irish, separatists - the good stuff
Any of you guys fuck around with the iron front mod?
Role playing as an actual greek god is cool too
Zeus
Zeus ๐
Sorry, im making it into an rts, that just went over my head
I dont consider it you being god, Just a general
hey is there a way i can connect 4 units to one zeus module?
The only reason i have 4 units is because of the switching
what
Tac ops allows you to jump into the shoes of other units
just asssign it to a uid
but when i upload it to the workshop, thats gonna be an issue
getPlayerUID or sth
also i think that only works on the PLayer slot
So like if the player switches to another unit
His uid might still be tied to his previous body
UID is steam id
^
anyway the reason i ask, is because there are ace modules that i can only access on the player unit, and not the units that the player can switch into
What module?
(getPlayerUID player)```
like garrison and other stuff
is there a switch eventhandler?
like something that can trigger when ever you take control of another unit
switch units*
hey so whats the difference between exec and execvm?
Both are terrible ๐
then whats your alternative?
Watch out Nigel, you may be thrown rocks at for downing execVM
Alternative? Intercept
functions are simpler and more readable
onTeamSwitch {[_from, _to] execVM "myTeamSwitchScript.sqf";};
So how would i go about using your superior method ^_^
onTeamSwitch {[_from, _to] call nig_fnc_teamSwitchEH;};
why do you add EH to the end?
just naming it like that so I know that function is used in the Event Handler
lazy
is all
so umm when i make my function, i can just add _from and _to anywhere in it?
and it will automatically know
fnc_teamSwitch = {
unassignCurator myCurator;
_to assignCurator myCurator;
}
A
[1,2,3] call nig_fnc_gucci;
in func
params ["_first","_second","_third"];
B
'Gucci' call nig_fnc_displayGangName;
_name = _this;
hint format ["%1 Gang",_name];
would output Gucci Gang
lol
Hint: If you write functions: Always add a Tag before (mostly 3 letters, nut not fixed to that)
e.g.:
bli_fnc_MyFunction
Same should be done with Vars (adding a tag)
@peak plover Now you can't hide that shit. Hand over the lifer code now!
๐ณ
Nigel...
๐จ
i never knew you were mentaly disabled
nig_fnc_displayGangName
also, you should consider another Tag ๐
best tag ever โค
nig_fnc_sendToJail ๐
My germany translation function is great
My germany translation function is great
Yeah.... no
It's not like you're any better with english dchsa
nig_fnc_translateEngToGer
You can't even spell my name correctly, dipshit
https://i.gyazo.com/f7a9c4dbd6750535361bc138f7f5ce4c.png
Dscha
im still alittle confused, [_from, _to] call fnc_teamSwitch; So ? ```
fnc_teamSwitch = {
params ["_from","_to"];
unassignCurator myCurator;
_to assignCurator myCurator;
}
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {[_from, _to] call fnc_teamSwitch; };
}];```
thats why
If you don't need it, just don't send it
nig_fnc_teamSwitch = {
params ["_gucci","_gang"];
unassignCurator myCurator;
_gang assignCurator myCurator;
}
// same as
nig_fnc_teamSwitch = {
private _gang = _this param [1];
unassignCurator myCurator;
_gang assignCurator myCurator;
}
params["_cool","","_notCool"];
just param if only 1 parameter
params["_cool","","_notCool"];
params[0,1,2];
Does that not error?
and 1 is not assigned
Ah
just showed index positions
yes I'm fucking retarded
Yep
fnc_teamSwitch = {
private _to = _this param [1];
unassignCurator myCurator;
_to assignCurator myCurator;
}```
so would that work?
I dont know what the commands do and what you wanna do but the param part adds up
even with param ? I thought tht was params only
lemme check
๐ค
Yep
When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument
_HandleBlocked = false;
_Container = param[0,ObjNull,[ObjNull]];```
damn cool
Only when you select a different _Array than _this
Can we vote the cutest command for 2017 ?
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {[_from, _to] call fnc_teamSwitch; };
}];
fnc_teamSwitch = {
_to = param [1];
unassignCurator myCurator;
_to assignCurator myCurator;
};
that didnt work
the Param part should work
idk i need to plug a hint in there, maybe its my Event not working
yeah
btw... does
addMissionEventHandler["TeamSwitch",
give's you _from and _to as LocalVars? ๐ค
hmm
Anyway, just to be sure:
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {[param[1]] call fnc_teamSwitch; };
}];```
and
fnc_teamSwitch = {
_to = param [0];
OR:
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {(param[1]) call fnc_teamSwitch; };
}];```
```sqf
fnc_teamSwitch = {
unassignCurator myCurator;
_this assignCurator myCurator;
};```
Should also work
Also: Did you start your game with "Show script Errors"? If not: Do it. If it pops up: the # indicates the place of the error
yeah, it shows script errors. But no like.... SO when i go to map, and i click on team, and click switch unit
nothing seems to be firing
i doubt its the code, maybe the eventhandler is for Multiplayer?
Isn't it easier to have 1 zeus and just change the area every time you switch?
there is only 1 zeus
what do you mean change the area? it needs to follow the unit. When you switch units, you are no longer "player"
nope
selectPlayer fireTeam; unassignCurator myCurator; fireTeam assignCurator myCurator;
that works
the unit is fireTeam
well i named them after the group.
You know how in the tac ops dlc, you can play as Special operatives Or Infantry
I never played it
lol well your lucky, you werent disappointed when it came out
i mean it added some cool features
But arma 3 vanilla missions are such a wet blanket compared to the community created missions
wouldn't i love to get paid to create missions
Wouldn't be the same
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {(param[1]) call fnc_teamSwitch; };
}];
So i dont understand
fnc_teamSwitch = {
unassignCurator myCurator;
_this assignCurator myCurator;
};
How does param [1] = _this
onTeamSwitch {(param[1]) call fnc_teamSwitch; };
Is just like a function
so in there exists _this
which is equal to [oldUnit,newUnit]
But only way to get the oldUnit and New unit is param/params
well anyway it doesnt work, But i dont know if its even calling so let me add a hint
[oldUnit,newUnit] param[1] //newUnit
unassignCurator myCurator;
_this assignCurator myCurator;
You are removing the same curator
and adding it back again
It won't change anything
You have to remove the curator before you can readd it to a different unit
What resource can I look at to find out how to make custom items?
unasssingCurator curator_a;
_this assignCurator curator_b;```
@river meteor I'd start by unpacking some items that people have made before
Maybe even bis stuff
lol good luck, their dlc stuff is locked
It'll probably be unlocked in a few months
anyway yeah its not firing, i need a new event handler that detects when player switches
where can i find all the cba event handlers?
Not sure if they have it but it's gotta be on the github
CBA_fnc_addPlayerEventhandler. The handler is called unit
i was just being dumb
addMissionEventHandler["TeamSwitch", {
unassignCurator myCurator;
player assignCurator myCurator;
}];
this actually follows the player around regardless of what unit he takes
anyone on?
i want to move a player out of a moving vehicle but not inherit that vehicles velocity
@tough abyss Only 1600 people. But otherwise. No.
Lol
@plucky willow I could see how that would be Un ideal
@still forum know anything about zeus and high command?
No
Dang
@tough abyss any ideas on how i could accomplish that?
i suppose a workaround would be to simply set the players velocity to zero
but i am not aware how to do that
vehicles use velocity but I cant find what players get
hold up i think i know how
player addeventhandler ["fired", {
_bullet = nearestObject [_this select 0,_this select 4];
_bulletpos = getPosASL _bullet;
_o = "M_AT" createVehicle _bulletpos;
_weapdir = player weaponDirection currentWeapon player;
_dist = 1;
_o setPosASL [
(_bulletpos select 0) + (_weapdir select 0)*_dist,
(_bulletpos select 1) + (_weapdir select 1)*_dist,
(_bulletpos select 2) + (_weapdir select 2)*_dist
];
_up = vectorUp _bullet;
_o setVectorDirAndUp[_weapdir,_up];
_o setVelocity velocity _bullet;
}];
I played with this soo much
THis turns your bullets into missles
Anyway look _o set velocity velocity _bullet;
sometimes id change it into a plane, and then move the player into cargo...... Lol
IF ur wondering what happened... umm you still crash, because the plane is going so fast that you cant leave the arc
setVelocity only works on vehicles, not players
players are vehicles
move the player into a vehicle? then set that vehicle velocity and delete it?
my setvelocity isnt working on players for some reason
anyway so nigel, what are you working on?
{
if((side _x) == CIVILIAN) then {
moveOut _x;
_x setVelocity [0,0,0];
_x setPos getmarkerpos(_myMarker);
};
}foreach allUnits;
this is roughly what i have
but it works on non players?
can i ask what the context is?
so i want the player to be driving around in vehicles and after a set amount of time I want to boot the players out of their vehicles and teleport them to a different location
I'm trying a workaround where I stop their vehicles but I would prefer the vehicles to continue moving
will setpos reset velocity?
It should
I can be flying in the air with a plane and setpos to somewhere
take no damage
so yeah
tested it, seems to work, thank you
{_x addEventHandler [
"CuratorGroupPlaced",
{
player hcsetgroup [(_this select 1)];
}
];} forEach allCurators;
that right there, creates an hc group, but when i set a waypoint, The guys dont move, its like their empty HC groups
eh i dont want to do that anymore
lol nobody work on that
hc is worthless
i have a local script that checks if a player is in a given area, but the area is very small and the player will be moving very fast. is there a way to guarantee that the inArea script will go off without increasing the amount of checks per second?
specifically, i do not want to check every few seconds at all
id rather it work like a trigger or something
fuck it im too tired to improve this, if it works it works
There are plenty people that implemented hcs. I know jonpas did for acex.
hm
I've been doing some digging to intercept how the curator draws unit icons
and it seems it passes icons to a variable in the curator object namespace
except when I grab that data, it's just the number '1'
does anyone know how curator handles the drawIcon3D event handlers it must be running?
i need a bit of help with a script spawning in a vehicle on a dedicated server
_Raider_1 = [];
_extractChopper_1 = [];
if (isServer) then
{
_Raider_1 = createGroup WEST;
_extractChopper_1 = [getMarkerPos "extractionSpawn_1", 0, "B_Heli_Transport_03_F", _Raider_1] call BIS_fnc_spawnVehicle;
extractChopperGlobal = _extractChopper_1 select 0;
publicVariable "extractChopperGlobal";
//Extraction Waypoints
_wp = _Raider_1 addWaypoint [wp_POS, 0];
_wp setWaypointType 'MOVE';
_wp setWaypointSpeed "FULL";
_wp1 = _Raider_1 addWaypoint [position ab1, 1];
[_Raider_1, 2] waypointAttachVehicle vehicle ab1;
_wp1 setWaypointType 'MOVE';
_wp1 setWaypointSpeed "FULL";
};
the script is called from a trigger via execVM
Its no longer spawning after the last few arma 3 updates and it was working like 6 months ago on my dedicated server... any idea whats wrong?
try calling it as a function first
wp_POS is undefined.
ab1 is undefined.
Probably deleted those two in the mission and the script is bad and depends on global variables.
ab1 is a boat in the mission and wp_POS is an invisable helipad
I'm starting to learn scripting. I've got some questions. The first one is - What does compile do actually? It seems to me that it just encloses an expression with a pair of curly braces, which is quite different from what the compiler does in C++.
Anyone know why this doesn't work?
while {true || 900 < 600}
The script runs but doesn't stop. Shouldn't the second operator throw false and cause the while to exit?
...nvm dumb question. brain dead
It would work if I used &&
๐
gotta love that
I see, playing with logic.
yup
Because appearantly my brain is so dumb that I gotta really dumb it down before It clicks ๐
Footage of justin playing with logic elements.
haha seriously...
@little eagle There are plenty people that implemented hcs. I know jonpas did for acex.
he's talking about high command
confusing that they have the same abbreviation
Ouch -.-
so how can i fix my script?
@stable wave compile compiles your script. You cannot see binary.. so when you stringify it it displays you the actual script that was compiled. So what you see is curly braces with code inbetween.
Add some debugging log to it and check the intermediate values of the variables. systemChat str [_var] and/or diag_log [_var].
Why [_var]? [] not needed
To catch undefined variables.
hm, good point
systemChat str _undefined
just fails silently.
Just something I got used to after being confused one too many times.
Yeah, fully agree.
@still forum Thanks for the explanation. But why would one compile an expression instead of using plain code?
Every code is compiled
If you load a file it's a string that has to be compiled
If you copy-paste a script into the debug console it is a string that has to be compiled before you can execute it
so "using plain code" is just not possible. Arma doesn't provide the ability to load pre-compiled binary code
I could do that though.
I guess that would be a neat side project ๐
_descExtPath = str missionConfigFile;
currMissionDir = compileFinal str (_descExtPath select [0, count _descExtPath - 15]);
Maybe even build a very basic optimizer.
That turns a static array from
push element, push element, push element, build array. To just a constant value
Take this code for example. Why does it compile the string holding the current missiong directory?
I don't know why the author decided to do that
He probably wanted to prevent the variable from being overwritten
you can't overwrite variables marked as Final
and the only way to create final variables in plain SQF is using compileFinal
Actually only the CODE variable type even has the possibility to be final in engine
Ah. That makes sense
all, how can i get the relative position _posRel of an object A to another object B, so that I can move object C in the same position as object A by using _posC = ATLToASL(B modelToWorldVisual _posRel);?