#arma3_scripting
1 messages Β· Page 434 of 1
safe from a guy injecting actions allowing him to spawn a tank for example
People remotely executing code if they have managed to execute arbitrary code on their local machines already.
dude, best anti cheating thing is admin π
and BIS_fnc_call is -really- powerful as it can call on the server
dude, best anti cheating thing is admin
This. It's the only anti cheating method you have.
yep... sad_face.paa
It also protects from spammers and griefers.
@lusty canyon maybe this will help, if you haven't seen it yet http://steamcommunity.com/sharedfiles/filedetails/?id=459317544
π€ -HC test/benchmark missions interesting
Can somebody help me with this script? this addActions is for a laptop and when it gets executed it sets a texture on diferente monitors creating an animation effect but other players can
can't see the images changing
setObjectTextureGlobal?
its for a powerPoint that i'm creating
are you the new rock pusher Lou?
[
schoolLaptop,
"Start Presentation",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance schoolLaptop < 2",
"_target distance schoolLaptop < 2",
{},
{},
{
PowerPointScreen_1 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
PowerPointScreen_2 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
PowerPointScreen_3 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
schoolLaptop setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_1_ca.paa"];
sleep 6;
PowerPointScreen_1 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
PowerPointScreen_2 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
PowerPointScreen_3 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
schoolLaptop setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_2_ca.paa"];
sleep 0.1;
},
{},
[],
0.5,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
even if i use setObjectTextureGlobal
other players can't see when the images are changing
@subtle ore ?
are you the new rock pusher Lou?
you mean the sqf hard worker? π
@winter rose Same thing :p
I wasn't sure I got it the right way, hehe
but hey I am on a run
next week I may be on a strike π«π·
Lol, Bullseye there isn't a lick of setObjectTextureGlobal In your code
Please paste the revised if you can
revised?
actually it should work with setObjectTextureGlobal, so maybe the mission wasn't recompiled/redownloaded properly
also, the sleep 0.1 at the end doesn't do anything, you can remove it
Revised - New code that yoy were talking about inputing setObjectTextureGlobal
haha the 0.1 sleep command is to change images faster so it creates a video effect
i had to cut the code in half in order to be able to put it here
action priority 1000 like extremely huge* π
change images faster
Whaaa...? That's suspension dude doesn't make any sense
it is a long code
dude
[
schoolLaptop,
"Start Presentation",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance schoolLaptop < 2",
"_target distance schoolLaptop < 2",
{},
{},
{
PowerPointScreen_1 setObjectTexture [0, "\scripts\BEW\PowerPoint\images\bg\desktop_1_ca.jpg"];
sleep 0.1;
PowerPointScreen_1 setObjectTexture [0, "\scripts\BEW\PowerPoint\images\bg\desktop_2_ca.jpg"];
sleep 0.1;
PowerPointScreen_1 setObjectTexture [0, "\scripts\BEW\PowerPoint\images\bg\desktop_3_ca.jpg"];
sleep 0.1;
PowerPointScreen_1 setObjectTexture [0, "\scripts\BEW\PowerPoint\images\bg\desktop_4_ca.jpg"];
sleep 0.1;
PowerPointScreen_1 setObjectTexture [0, "\scripts\BEW\PowerPoint\images\bg\desktop_5_ca.jpg"];
sleep 0.1;
PowerPointScreen_1 setObjectTexture [0, "\scripts\BEW\PowerPoint\images\bg\desktop_6_ca.jpg"];
},
{},
[],
0.5,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
that
you can see that the sleep 0.1; is very fast
so it change images on screens fast so it creates a video effect
setObjectTextureGLOBAL please ^_^
Remove the sleep and you're watching the world unfold
lol
if you don't set it to sleep it will jump immediately to the last image though
yeah
that's why it has that sleep command
cause i tried without the sleep command
replace with
{
for "_i" from 1 to 6 do {
PowerPointScreen_1 setObjectTextureGlobal [0, format ["\scripts\BEW\PowerPoint\images\bg\desktop_%1_ca.jpg", _i]];
sleep 0.1;
}
}
^ this code should do the job
okay i will try it in a min
Isn't the problem with setObjectTextureGlobal, that when you pack your mission into a PBO, the one calling setObjectTextureGlobal uses the absolute path, so all other connected machines get an invalid path?
dang that's a problem? o_o
I just recently had to rewrite BIS_fnc_setUnitInsignia since it did not work with insignias placed in the mission folder.
pierremgi had the same problem. See the middle of this post, where in MP the full path is used https://forums.bohemia.net/forums/topic/193213-setobjecttextureglobal-path-in-mp/?do=findComment&comment=3073659
dangdangdang... I may have to revise some missions
The way I do, since it is Arma that makes internally converts the relative path to the absolute, is to use my own "global" function, that then triggers the local command on each machine with the relative path.
I see how to do it, but I totally was unaware of the issue! and I recently made missions using that
For BullsEyE|WORKS#3222, it might be enough with just a publicVariable that holds the current slides, and client then just has an event handler for that. And JIPs of course just add the event handler, and read the current value.
well, good to know
define mission root maybe in description with preproc
Well, yes that will work. But for setObjectTexture(Global) there is no need since supplying the relative path works fine. The problem is the setObjectTextureGlobal command that tries to apply the absolute path across the network. Basically, setObjectTextureGlobal is useless for textures stored in the mission.
oh ic
But you are right, defining the mission root can be useful for config based entries. Like ORBAT textures stored in the mission.
insignia = __EVAL(MISSION_ROOT + "arstotzka.paa");
setObjectTextureGlobal with sleep so short will not create a video effect, due to network delay and also the scheduler. This will not work.
@ornate pawn so, result? π
https://community.bistudio.com/wiki/findIf Nobody saw that in dev-branch changelog?
A actually useful and awesome command
performance-wise AND logical-wise
Finally we can yell at people who put a exitWith into their forEach to exit it early
π±
Looks awesome !
tbh
All I want is the cmd for mapdraw for my boy @cold quartz can link athena to it
mapdraw?
π€
from my knowledge
ACE has line drawing with cursor :u
Yeah, but vanilla has it as well.
Waiting for it to be released for he can link his mod to it and be able to show drawn lines from vanilla to his 2nd monitor app.
I would prefer my AddWeaponWithAttachmentsCargo(Global) command.
yessss
They just need to copy-paste :U Shouldn't take them that long
Yeah, not entirely sure why it takes them a while to actually put out some of this stuff.
unit tests! QA!
I already tested it thoroughly by reading it's code atleats 3 times!
"oh! okay then, carry on"
lol
TESTING IS FOR THE WEAK
TRUST YOUR CODE
I say that when I want to scare my colleagues away
Finally we can yell at people who put a exitWith into their forEach to exit it early
@still forum
Nope
readability first!
except for sqf where short-named vars will improve performances π
it won't
Please don't start that argument @lone glade otherwise I would need to say things that no one here wants to hear.
that people using sentences as vars should be π 'ered ?
Yes. Paper them all
readability first!
BIS_fnc_showRespawnMenuInventoryLimitRespawnyeah...
lol
readbility first!
AddWeaponWithAttachmentsCargo(Global)YEAH MAN
tbh this ^ is... like.... better ?
modelToWorldWorld says hi
visualworldvisualworld
if (unit call _myFnc_fnc_UnitIsAliveAndNotDeadAndAlsoHeMustHazAGunKThxBai) then { (β¦) }
btw I didn't say how it is, I said how it should be :p
Is there a command to return the level of zoom in an optic?
No, but you can calculate it yourself, that's what we did for ace arsenal stats
name length for script commands doesn't matter
Well, all I want to know is if they are zoomed in (say on the LRPS) or using the zoomed out mode.
but variable length does matter-ish
@lone glade is that findIf command actually on dev-branch? Didn't see that in changelog anywhere.
same
Not in todays changelog
I guess I can scrap my intercept variant of that then π
One done. A couple dozens more to go
What happend to the github thing u guys were doing for arma
https://github.com/arma3/arma3.github.io It's right there
My PR is ready. But I'm scared of clicking the merge button
MERGE THAT GODDAMN PR DED
hypertext? XD
text with hyperlinks
you know, clickable text that get you to web pages
Yeah we don't have any design yet π

NOTE: Because command findIf terminates as soon as it finds an element that fulfills the condition, it is more efficient then count in scenarios where you need to check for presence / absence of at least one element that evaluates to true.
than*
@little eagle for count yes, not for foreach.
Will { _x enableFatigue false; } forEach (units group player); disable stamina for everyone?
no
ree
only for units in the group of player
Heh
trying to execute a code while on multi to disable fatigue
On multi to disable fatigue? What?
Using Achille's execute code module to execute a script in order to disable fatigue on a multiplayer server.
GROSS. π€’
Current fatigue settings on the server are like.. 1lb = no stam lol
it's fed
f'd
And so are you for using archilles,
{
_x enableFatigue false;
} forEach allPlayableUnits;
yes
animate not JIP on simple objects ?
@little oxide Well I don't know mr read the wiki man, what's the problem you're having?
I have a animate on server on my simple object, but when connect i don't see the animate
a animate?
yeah i have an animation on my object, when created with simple object, i animite it on my server, but when i connect to my server so JIP, i don't see the animation working at alll
it's a limit of simpleobject or just a bug
So findIf is a replacement for anything like:
private index1 = -1;
{
if (cond1) exitWith {
index1 = _forEachIndex;
};
} forEach array1;
index1
right?
yes
Be honest. Did this really need a command?
You save one if command per iteration, which isn't much, at the cost of ugly looking code.
And people freak out after #. I don't understand.
i have a killed EH on a hostile plane, when triggered how reliable is it to get the correct killer player object if it doesnt die right away but dies due to crashing?
If the cause of death is crashing then it will return null
however the instigator
will not
so i should always just get the instigator (select 2) instead of the select 1?
Pretty sure the killer is the pilot if the plane crashes. And the same should be true for the instigator.
Not <null>
Rock pusher probably has something to say about it
Not if it was damaged beforehand?
It's sort of like if you were to kill somebody after they were injured
killed eventhandler is not concerned with who damaged the object last, no.
so whats the most reliable way to get the player obj that made the plane crash?
Then what is with instigator? It's the same thing as killer at that point
_plane addEventHandler ["HandleDamage", {
params ["_plane", "", "", "_source"];
if !(_source in [objNull, driver _plane]) then {
_plane setVariable ["commy_lastDamageSource", _source];
};
}];
_plane addEventHandler ["Killed", {
params ["_plane"];
private _source = _plane getVariable ["commy_lastDamageSource", objNull];
}];
Something like this maybe.
how about i use the hit EH to record a tally of each instigators hit on the plane? when the plane crashes the player with the highest hit count WINS π
yeah ill go with lastdamagesource, seems more reliable than anything else since it works even if the plane died in air
thanks bigC
@peak plover something like this ? https://gyazo.com/73cd6e2f3bd5071938b1f84383f4d2bc
hmm, yeah
Every vector, except 0,0,0; points away from the player.
oaky
need some corrections for this
player addAction ["Test move thing",{
private _caller = _this select 1;
private _eyePos = eyePos _caller;
private _target = cursorTarget;
if (!isNull _target) then {
private _vector = _eyePos vectorAdd (_eyePos vectorFromTo getPosWorld _target);
private _targetDir = _eyePos vectorFromTo getPosWorld _target;
private _vectorUp = _targetDir vectorCrossProduct [0,0,0];
private _speed = 10;
private _velocity = _targetDir vectorMultiply _speed;
_target setVectorDirAndUp [_targetDir, _vectorUp];
_target setVelocity _velocity;
};
}];
i'm horrible with vectors
_this param [1];
What's the point?
*fixed
You could've written param [1] without the _this.
Because the unary syntax of param uses _this. That was what I was talking about.
rgr
You wrote _eyePos vectorFromTo getPosWorld _target twice. Seems like a waste.
Vector cross product with 0,0,0 is always 0,0,0.
Also a waste.
private _vdir = _origin vectorFromTo _target;
private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]);
private _vup = _vlat vectorCrossProduct _vdir;
This is how you get an up vector for setVectorDirAndUp.
oh ic with vectorNormalized
Yeah, and [0,0,1]. You know, pointing upwards.
0,0,0 is not a normal vector. It's the null vector. Cross product with the null vector is another null vector.
I wonder what the normalized null vector is according to SQF / Arma π€
that what happens now https://gyazo.com/b1aec3a3409f2ebc20341d3b9da0852a
with private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]); π€
Well yeah. You don't want to change the vehicles direction. Previously your setVectorDirAndUp code just failed silently, because you produced an invalid up vector.
Now that that is fixed the code works. Just not how you intended it.
hey commy2 - RE: your suggestion yesterday using killed EH works fine but not in mp sessions
and mpkilled doesn't seem to work
just trying to delete a weapon on a players dead body
The MP eventhandlers are junk, yeah.
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
same code works on client but not server, both global though
ugh
Wait, does it work in SP or "on client"?
SP
There's no client in SP.
yea - I meant works in SP not a client on a server
Post code?
ok - 1 sec
https://pastebin.com/kY8KJQf6
its garbage code atm but I was trying everything/all combos I could think of for MP
works fine for SP so I would actually make a clean version and not that
just trying to pick any method, tried directly removing from player, going through nearest objects clearing cargo/removing weapons.. treating it as a cargo object/weapon holder treating as a player
no dice
it correctly displays that a player has weapons in all those searches but never removes it
Where is this executed from?
player addAction ["Test move thing",{
private _caller = _this select 1;
private _eyePos = eyePos _caller;
private _target = cursorTarget;
if (!isNull _target) then {
private _targetDir = _eyePos vectorFromTo getPosWorld _target;
_target setVelocity (_targetDir vectorMultiply 10);
};
}];
```da hotfix v 3. https://gyazo.com/ea93eacee01214102c030064d0fcfe37
@peak plover
Β―_(γ)_/Β―
_player addMPEventHandler ["MPKilled", {_this call Server_onMpKilled}];
player addEventHandler ["Killed", { _this call Client_events_onKilled}];```
on player creation is first one (serverside) and second is in a postinit
I have another method which would be scanning the inventory when someone opens up gear and deleting a weapon but that would be terrible running that on an InventoryOpened EH
π¦
Which is the one you linked?
lol
was originally trying just server and copied it directly to client/sp and made a regular EH with it and it removes all weapons fine
now just trying to worry about server
And the point of this is to remove the pistol, rifle, launcher and binocular from the player units once they die?
lul
was trying to do just launcher, but yes if needed/only way is to remove it all then I would remove everything and I could add it back to the body I guess
// initPlayerLocal.sqf
params ["_unit"];
_unit addEventHandler ["killed", {
params ["_unit"];
_unit removeWeapon primaryWeapon _unit;
_unit removeWeapon secondaryWeapon _unit;
_unit removeWeapon handgunWeapon _unit;
_unit removeWeapon binocular _unit;
}];
Isn't this basically just this?
yes - that would work for the player in SP
^ MP too.
even underwater on dedicated π
Have you actually tried this in MP, Andrew?
I'm not 100% sure removeWeapon works with the binocular. It might need unlinkItem. I can never remember this.
I'll give it a shot using initplayerlocal - had it in a mod before
unassign fails if the inventory is full. And it just puts it into the containers, not removes the item.
removeWeapon works with the binocular < works
Thanks.
#100
starting up the server now - will see
πΏ
slight tension in the auditorium
just a random text you just read
Andrew is typing
I don't know if I should be surprised or upset.. probably both
It doesn't work
I used sublime to search all mods I am running and there is a file called that removes all killed eventhandlers
player removeAllEventHandlers "Killed";
bruh
salt
π€¦π»
I dunno why I didn't think of that lol
This is why any code using removeAllEventHandlers and removeAllActions is always bad code.
infiSTAR does that alot
Well yes. As I said.
Who wrote it?
seems like Andrew - Today at 05:13 π
Well, someone did.
@torn juniper If you are using infiSTAR /* Revert Killed EH */ _RKH = false; /* true or false */
im not but that is good info to know
Making a mod, all testing in base arma 3 works fine but loaded up exile to try and check compatibility and well.. thats where the line came from
they unhook a lot of eventhandlers which I rely on
I guess thats where my issue lies
Any other mods loaded?
One Does Not Simply Walk into Mod
Good luck with that then. lol
Was there ever any doubt really?
I mean, if I post something here and it doesn't work... Means pretty much always you fucked up somewhere.
of course π but yea I was annoyed thinking that arma was not letting me do something but nope I got exiled
blind sighted
also about that infiSTAR addon... maybe that menu will add couple more options and maybe that will/can help for new guys... but imo it will just broke more than it will add...
the 30 euro addon?
well... i know i'm started it, but that is really bad topic tbh, let's just stop it... sorry
if only arma was client-sided C++ the amount we could stop shady stuff would drastically increase
page gaurds all the memorys
which values will be better to get from object for _target setVelocity (_targetDir vectorMultiply <value>),
trying to make it like slight push, but it should be universal for all kind of land vehicles... mass or size of bounding box / some value ?
was trying to help... now creating my own things with vectors lol
problem solved with getMass
params [
["_object", objNull, [objNull]],
["_title", "", ["", []]],
["_script", "", [""]],
["_arguments", nil, [[], nil]],
["_priority", 1.5, [0]],
["_showWindow", true, [true]],
["_hideOnUse", true, [true]],
["_shortcut", "", [""]],
["_condition", "true", [""]],
["_radius", 50, [0]],
["_unconscious", false, [false]],
["_selection", "", [""]],
["_memoryPoint", "", [""]]
];
_object addAction [_title, _script, _arguments, _priority, _showWindow, _hideOnUse, _shortcut, _condition, _radius, _unconscious, _selection, _memoryPoint];
[_object, "Test", "", nil] call SR_fnc_addAction;
Any idea why this function isn't working?
16:28:45 Error 12 elements provided, 3 expected
memory point is in 1.81, so not out yet
Oh wow silly me, didn't even realise. Cheers
Not sure where to ask
Is it possible to fire an Tigris when attached to a Taru...upsidedown
yeah... at the same time you can fire with the goats as projectiles, to make it more immersive
Sarcasme.....helpfull
ok... serious answer:
Dear SabuMaru, yes you can, feel free to do so.
Does missionNamespace pass properly through remoteExec?
i.e. Would the following work
[missionNamespace,["globalVarOnClient",123]] remoteExecCall ["setVariable",remoteExecutedOwner];
what for you doing that ?
Server sided handling of some data like cash
Basically the client will remoteExec a request to the server with data for logging purposes where the server will update their balance by an amount in a database and tell the client the new balance and whether the transaction was successful or not
If I can pass missionNamespace in remoteExec, that means I can simply call a function in a scheduled environment and have it wait until the server has finished it's part and return true/false (success) to whatever needs to update the balance
waitUntil {!isNil _randomTransactionVar}
I could achieve the same through publicVariableClient but that has risk of var clashes
I suppose I could always make a wrapper function if it doesn't
well i don't get why you doing it this way... you can just set/getvariables to/from missionNamespace...
that means I can simply call a function in a scheduled environment
you can run any function in sheduled...
It needs to be set in the client's missionNamespace (global var space)
It's no good if I set that directly on the server lol
you understand that missionNamespace is global, yes ?
Global to the client
setVariable will only set it on all clients if you tell it to
Which I do not want to do
I want to set a global var on a specific client
Because otherwise there's a (very small) risk of var clashing
And unnecessary data transmission if it were global to all clients
Although, looking at the wiki, you can now use a client ID in place of the true/false global arg
Added around July it seems https://community.bistudio.com/wiki?title=setVariable&type=revision&diff=103718&oldid=98864
check this https://community.bistudio.com/wiki/setVariable
Alternative Syntax: varspace setVariable [name, value, public]
Not what I need, but there's is new functionality in the command that works
It's own of those commands you use so often that you never need to check the wiki for syntax lol
i cant seem to access missionNS get/set in the debug console, is there a restriction in that scope?
: Does missionNamespace pass properly through remoteExec?
Yes.
There is no point in usingremoteExecCalloverremoteExechere.
Shouldnt remoteExecCall be used preferrably with basic functions that arent very intensive?
remoteExec is identical to remoteExecCall for commands. So all you do by using REC is making your code look more complicated than it has to be.
Oh for commands yeah, didn't read up enough
Anyone have the path of offroad p3d, I don't have my PC and i need it
i want to spawn one plane at a time at map center, each time a player shoots down a plane they get score +1, then the next plane spawns after.
if (!hasInterface && !isServer) then {
_startPos = [worldSize / 2, worldsize / 2, 0];
_numPlaneWaves = [1,2,3,4,5];
_plane = objNull;
{
waitUntil { (!alive _plane || _forEachIndex == 0) };
_plane = createVehicle ["O_Plane_Fighter_02_Stealth_F", _startPos, [], 0, "FLY"];
createVehicleCrew _plane;
_dir = direction _plane;
_plane setvelocity [(sin _dir*300),(cos _dir*300),0];
[(group _plane),_startPos,4000] call BIS_fnc_taskPatrol;
_plane addEventHandler ["HandleDamage", {
params ["_plane", "", "", "_source"];
if !(_source in [objNull, driver _plane]) then {
_plane setVariable ["DW_IMS_LAST_DMG_SOURCE", _source];
};
}];
_plane addEventHandler ["Killed", {
params ["_plane"];
private _lastHitByPlayer = _plane getVariable "DW_IMS_LAST_DMG_SOURCE";
_scoresArr = [];
{
if ( _x == _lastHitByPlayer ) then {
_updateScore = (_x getVariable "DW_IMS_PLAYER_SCORE") +1;
_x setVariable ["DW_IMS_PLAYER_SCORE",_updateScore];
};
_scoresArr = _scoresArr + [(name _x),(_x getVariable "DW_IMS_PLAYER_SCORE")];
} foreach (allPlayers - entities "HeadlessClient_F");
missionNamespace setVariable ["DW_IMS_SCOREBOARD",_scoresArr];
}];
} foreach _numPlaneWaves;
};
but it doesnt work at all
Well.. You are spawning a plane in the ground.. I think..
What's the point of setting all the player's scores to 0 at the beginning? This won't work for JIP anyway, so just handle 0 as the default value when using getVariable and remove that code block.
ive tried running isolated bits of it locally and it works, the plane is in the air with crew and patrols as normal but when its on the HC nothing happens
ok ill get rid of that block
waitUntil { (!alive _plane || _forEachIndex == 0) };
The or is pointless as null is always not alive.
Have you checked the HC's RPT file? Added some diag_log to see if the code was executd? Where is this executed from anyway?
for that conditional i want to make it create veh on first loop, but all subsequent loops have to wait until the previous plane dies first before creating new one
Yeah, and that is what this would do.
yeah something seems to fuck up once its on the hc, ill add some diag logs and split it up some more
It should never work really, because as dedmen pointed out, the plane would spawn at the ground level and probably just collide with it and explode.
that part i tested multiple times, it does work
everything else tho doesnt
it even follow the flight path after banking a bit
"fly" isnt ground level "none" is ground level
z=0 is ground level though.
your _startPos z/heght is 0
well all i saw in game wasthe pilot was pretty good at recovering lol
what if i get rid of the z index and turn it to pos2d
will the createveh "fly" auto add the z coord?
It shouldn't, but who knows. The command already treats boats over sea different than other vehicles.
It's chaos.
yeah i have problems spawning boats, is always underwater even with asl z + 3000
^ createVehicle position argument is PositionAGL for boats and PositionATL for land vehicles, which are both you've mentioned at once basically.
anyways I still prefer using setPos afterwards. Not sure how createVehicle treats vehicles exactly.
Is there a command to force nightvison on or off. And if there is, Is it possible to do the same with thermals
ty
i have a custom scoreboard array i would like to display.
example array data
[
["player1name", 5],
["player2name", 2],
["player3name", 1]
]
cant seem a way to get that into a single hint (cant use systemchat cuz disabled) array size count based on allplayers.
i dont want to make any messy UI custom dialogs just for this
The links you ave me before dont seem to work for what i am trying to do. @lusty canyon I want to Force night vission on a player. Not enable disable it.
this will prob work tho https://community.bistudio.com/wiki/currentVisionMode
nvm that link wont work π
Any one ever tried makin a hull invisible and only showing the turret from for instance a tigris
Did find this :
https://www.google.nl/amp/s/amp.reddit.com/r/arma/comments/2y7z08/apcs_without_the_turrets/
But want it the other way around
@fringe torrent You can only do that because there's "animations" setup up by BIS to do so, there's no way to do it the other way round other than maybe embedding the vehicle in the ground but you'd probably need to godmode the vehicle
Attachto object on ground
Wanna get the turret underneath a taru
As the blackfoot is just horror on a publicserver
I wanna create a alternitive
And things donβt work upside down for some reason
@zenith totem thanx anways
Generally weapons on vehicles don't work when the vehicle is upside down
You could remove weapons from the blackfoot if that works for what you want
Do I have to make an entirely new cfggroups file for OPFOR (currently have Blu working fine) or can I add an 'east' extension onto my file as it is?
ive looked everywhere for help on this but nothing seems to correlate with my issue lol
Hi guys. I trying to make a sound that moves around my object.
when using playSound3d, the sound is stuck to where the object was when playSound3d was called.
I also tried to move the object around (setVelocity or animating it) but the sound wont move.
Is it possible to make moving sounds?
could I have like a radio that flyes around a house?
you can use createSoundSource with a CfgSfx entry and it may move thay way. Dunno.
ok thanks Ill try
Sounds have to have a speaker (or source). I was making a mission where I had to create audio at certain positions. playSound3d did not work because of mission paths varying in MP. So I send message over the network, and created a fake hidden object that played the sound.
You could use that and then move it around
Either createSoundSource or say3D. These two commands are the only ones that create potentially moving sounds.
@errant jasper I tried playing it from a hidden object that I move around but it didnt work. right now Im creating and deleting objects at certain points. works fairy ok, but it gets choppy
I'd say createSoundSource is ideal for looping sounds, say3D is "ideal" for one-time moving sounds and playSound3D is ideal for one-time stationary sounds.
ok thanks Ill try say3d
createSoundSource and say3D both need mission or addon configs, and they look different for both. For playSound3D a soundpath is enough, although it has to be dynamically created when used in a mission which is also cumbersome.
It's a huge mess, but once you get used to it, the scripting itself is simple enough. It's all documented on the wiki for each of the commands.
ok. Im trying to make an hidden object where I use say3d now, and attacing it to an animation
Ill let you know how it works out
This is my modifed say3D for positions: https://pastebin.com/DBDtkNRX
Another difference is, that playSound3D and createSoundSource have global effects. Which means the code has to run on only one machine (e.g. server). But say3D has local effects, which means the script has to run on every machine, or you need to use remote execution.
Man, when Dedmen ever finishes the blog, this might warrant a post.
Minus the true. Or do you want the sound to start over each time a client connects?
@little eagle It won't be finished before people posted lots of stuff
so post something :u
ohhh no I dont. I remove that
The 0 is explicit code I guess, but it's not needed either, as that is the default: execute everywhere.
thanks
anyone knows how to make RHS Grad shoot at distances longer than ~1200 meters?
@little eagle It worked by the way. Only issue now is that my attached object has choppy movements when attaching it to a translation animation. This also causes the sound to get choppy
"attached to a translation animation" Huh?
@errant jasper Here's a tip. You can use #particlesource as object class and then you don't have to worry about hiding the object. It's currently the fasted created and lowest cost entity type we know of.
@little eagle Neat! Thanks for the tip.
question
Ask instead of asking if you can ask a question
is there away to get the vehicle position index for a player, so like if the player is in the driver seat ,how can you get -1, if they are in gunner get 0 and so on
I use that for TFAR to check on what turret place a player is. But I guess that only works if you already know what turrets exist
Eh...
What did you expect to happen?
https://community.bistudio.com/wiki/setVariable read that
After you are done with that scrap everything you have done so far and use this: https://github.com/acemod/ACE3/blob/master/addons/medical/functions/fnc_setUnconscious.sqf#L15
if (player getVariable ["ACE_isUnconscious", TRUE]) then {
hint format ["Script active"];
};
};```
but when i enter in the lobby, and join at first spawn, when i die nothing happend, when i do respawn and join again, when i spawn the script start
and i'm not in ACE_isUnconscious
Uh...
I think you should go back to looking at the scripting basics
your code there doesn't really make sense
Just read what i linked
well
explain me
when i go unconscious *
for first nothing happend
and when i respawn the script start
I don't know.
* Example:
* [bob, true] call ace_medical_fnc_setUnconscious;
Its just not a simple setVariable i suppose.
But why did you post player setVariable "ACE_isUnconscious" then?
setVariable is obviously not getting it
yeah i write wrong i know it, and after i write just a second
bc i see i write the wrong code
^^
player getVariable ["ACE_isUnconscious", TRUE]
Are you sure you want true as default value?
I know that?
Well I'll just assume you know exactly what you are doing... Good night o7
is it possible to get a list of all the defined vars in a specific namespace?
how can i make the tracks on verhicles are invisible
tried
AA_7 animate ["Track_R",0];```
an when doing animationSourcePhase gives me that value back in game
but they still show
any one know what animation state the tracks need to be in ?
how does one propagate setOvercast across a server via script?
weather is supposed to be synchronised across the network, for all players
So if I execute 0setOvercast 1; on a trigger that executes on server. It will propagate/sync globally.
yes, but the change won't be immediate though; you will have to "apply" it with forceWeatherChange
less than a second later, players will be sync'
also if that for mission params BIS_fnc_paramWeather works
@lusty canyon https://community.bistudio.com/wiki/allVariables
my simple addAction doesnt appear in the players scrollwheel menu
_satComHQ = createVehicle ["Land_DataTerminal_01_F", player, [], 0, "none"];
_satComHQ addaction ["<t color='#7396ff'>IMS SUPPORT:</t> SPAWN IN JET",
{
_caller = (_this select 1);
_airportPos = missionNamespace getVariable "DW_IMS_MAP_POS_AIRPORT";
_jet = createVehicle ["rhsusf_f22", _airportPos, [], 10, "NONE"];
_caller action ["getInPilot", _jet];
},
"args", 400, true, true, "", "(alive _target)", 15, false
];
π
its working locally now, but not global, how do i global it without remoteExec or cfg init?
Impossible
someone said remoteExec is evil so i cant use it anymore π
this means nobody is using addaction, only cfg useractions?
is there a limit to how much you can cram into missionNS? after testing on a server running for +3 hrs none of my setters or getters are working????
Whoever told you that has never made a good MP mission
^
Are you sure they didn't tell you that remoteExec without a CfgRemoteExec whitelist is evil
remoteExec enabled without whitelisting would allow anyone who can gain arbitrary SQF execution on their local client the ability to execute arbitrary SQF on any client
Or maybe they don't know how BE filters work and got kicked anytime they tried something lol
Lol
@lusty canyon allVariables
too late π
how can you create entire preset groups of infantry? like the viper team? or a recon squad?
i always just create group through manual array of whatever infantry i can find
CfgGroups ?
how can i get that through sqf?
like the viper team
how can i get that through sqf?
check "Escape From Tanoa" mission
nvm then ill just stick with my arrays, how about that ghost hotel structure , BIS made it like the freedom all cut up, did they make a handy spawner fnc for it too?
thats crazy, the alignment alone >.<
also maybe this (possible outdated) https://community.bistudio.com/wiki/Dynamic_Object_Compositions
@lusty canyon
yeah says not working in a3, plus BIS didnt tag the ghost hotel as a composition
still good tho, i can use some of those existing stuff, thanks @meager heart
gl
@meager heart can we get the list of composition classnames through cfg >> _arr ?
check first link, if compositions included in mission, you can do something like missionConfigFile >> "CfgCompositions"
_cfgDisplayName = [];
_cfgClassName = [];
_cfg = configFile >> "CfgCompositions";
for "_i" from 0 to count _cfg - 1 do
{
_class = _cfg select _i;
if (isClass _class) then
{
private _name = getText (_class >> "name");
_cfgDisplayName pushBack format ["%1", if (_name == "") then {"N/A"} else {_name}];
_cfgClassName pushBack format ["%1", configName _class];
};
};
maybe something like this??
I think the mission maker shouldn't be the one to define CfgRemoteExec actually...
the game should, analyse the code and at least allow only the code found in scripts (and functions used by the game itself of course) if we want more precision then we can add or set specific commands or destinations
the only issue with this automatic thing would be string-based remote exec, like remoteExecCall [_command,] or remoteExecCall [format ["setPos%1", selectRandom ["ATL", "ASL"]] but then you could manually add
I do think that Server Network Security shouldn't be made by the mission indeed.
yeah server admins should be able to override whatever settings the mission maker has put in.
afterall where would these poorly made missions go without someone paying for a ds?
i have a cute civvy prop plane
_jet = createVehicle ["I_C_Plane_Civil_01_F", player, [], 1, "NONE"];
_mag = ["2000Rnd_20mm_shells","300Rnd_CMFlare_Chaff_Magazine"];
{ _jet addMagazineTurret [_x,[-1]]; } foreach _mag;
_wep = ["Twin_Cannon_20mm","CMFlareLauncher"];
{ _jet addWeaponTurret [_x,[-1]]; } foreach _wep;
i cant seem to add any weapon mag to it, is this more that that Its ILLEGAL for civs to have military hardware Laws Of War IDAPussies BS????
thank you useless DLC
- as an alternative is there a prop plane in CUP/RHS that i can add weaps to?
found the antonov but its so damn slow!
I think the issue is that the civ prop plane doesn't have a turret. addWeaponTurret adds a weapon to a vehicle turret.
There are some exceptions, I am pretty sure that the gbu launcher can be added to turretless vehicles (and players.)
I just used the code you posted and I can use flares with the jet.
Plane. It's not a jet.
no weaps tho
What do you mean ui?
it doesnt add the weapon ui at the bottom right
but it can shoot hah! thanks for testing it more bigC
now i just have to give obscene amounts of ammo
Well, the plane unit info type display doesn't show any weapons as the vehicle has none.
getText (configFile >> "CfgVehicles" >> typeOf cameraOn >> "unitInfoType")
"RscUnitInfoAirPlaneNoWeapon"
i cant do anything about that in sqf right?
Well, you cannot change this config entry, but you could manually add the controls with ctrlCreate and update them yourself every frame.
I don't think anyone ever did this, but it should be possible.
doesnt seem worth the performance hit just to see how much ammo is left so i add 80,000 ammo π
the copilot can shoot too sweet!
Are you scared of "every frame"? There would be no noticable performance impact if done right.
I mean, the ui already is updated every frame anyway.
yeah i have addactions that had complex conditionals that lagged me down so yeah scared af
Well, "if done right".
well i do shit code with a balls to the walls dont give a fuck attitude (unless i make arma hard crash)
π
do you have -showScriptErrors in startup params, jayTAC ? π
nope, so you wouldnt want to use my mods, its practically malware at this point !
i just look at rpt
π
will that param give me more stuff or its the same as rpt?
no
it will show script errors on screen
but sometimes something fails silently...
yeah its the silent types i hate, is there a way to make your own parallel rpt that only contains your mods errors?
findDisplay 46 ctrlCreate ["RscText", 10127];
private _fnc_update = {
params ["_display"];
private _string = "";
if (typeOf cameraOn == "I_C_Plane_Civil_01_F") then {
_string = str (cameraOn ammo "Twin_Cannon_20mm");
};
(_display displayCtrl 10127) ctrlSetText _string;
};
findDisplay 46 displayAddEventHandler ["MouseMoving", _fnc_update];
findDisplay 46 displayAddEventHandler ["MouseHolding", _fnc_update];
There. Ammo counter only for this jet.
commy, disableSerialization on top of that ^ ?
Only if you execute this from a scheduled script.
that will be probably in init.sqf...lol
You could also wrap it into isNil.
There. Edited so it doesn't need disabled serialization...
jayTAC is in safe now π
wow, going the extra mile! thanks commy! seriously go backstab BIS and make Arma 4 already before they do, call it "ANMA 4" and it will be a modders paradise!
Does anyone know why lbSetCurSel doesn't seem to work when it's inside of a function (that I know for a fact is being called) but works fine in the debug console? Seeming this is what I'm using (both in the script & debug console) SQF lbSetCurSel [6, 0]; Yes, that is the correct IDC btw
Have you tried the binary version? This one depends on detecting the active display and I never trusted that.
What's the binary version if you don't mind me asking?
Example 2?
Alternative syntax. "Binary" because it has arguments on the left and right side.
Yeah, also example 2.
I've tried example 2, but doesn't seeming to work. I'm guessing because my dialogs idc is too long. Or I might be getting the class wrong
let me check, that is probably the exact reason
yes omg how didn't I think of that
-_-
let me change that and I'll play around with it lol
SQF uses single-precision floating-point format and integers too big might suffer from rounding errors.
yes
does anyone here could help me how to script?
"how to script" is a very broad term.
true true
Just in general?
Do you have any experience with writing code in any other scripting languages before?
@little eagle yer that is the exact reason why I can't seem to use "Example 2" (_control). Hopefully this fixes the issue I'm having with lbSetCurSel
just put questions in here
if you want, idm just don't expect an answer ASAP
np
@lusty canyon is it possible to get a list of all the defined vars in a specific namespace? Look at allVariables
got it thanks, but nobody told me its so large my client crashed when i tried to output it
π Β―_(γ)_/Β―
which one? The biggest is missionNamespace it has around 2756 variables in vanilla, and it doesnt crash for me π
None of mine crash for me. And I'm running more than a few mods
im running 90 mods and missionNS killed me
why doesnt basic string concat work!?!?!?! why does the most basic shit have to be so difficult !!!
string concat, but how's that around your missionNamespace?
unrelated
how do you concat player names from foreach allplayers
i want to display to it hint
hint (allPlayers apply {name _x} joinString "/n");
^
Is it /n or \n , I can never remember?
so joinstring replaces +
\n
joinString doesn't replace +, as it does something completely different?
i cant just do _varString + "sdlkfjklsdfj"
Sure you can.
whats the apply keyword?
@little eagle Just think of the fΓΌhrer.
The arm goes up to the right like \o So it's the same for \n or \t and such. The arm always goes out to the right
It's a command and not a keyword. It takes and array on the left side and a piece of code on right side, and creates a new array with the same size containing all the return values of the code block where _x is a magic variable for the element with that index of the array of the left side.
o/ would be the right arm, Dedmen.
Muscle memory.
Just say backslash.
If you laugh about it. You won't forget it
π― no jokes
Too bad I have weird humor.
do you still need to add broadcast TRUE with setvars on missionNS? or doesnt matter?
is there only one missionNS or all clients have to update their copy of it?
sometimes my getvars mNS just dont work maybe cuz i didnt add broadcast true?
need to add broadcast TRUE with setvars on missionNS?
if you need to broadcast it then jawohl else nein
in other words why would i need to broadcast something thats already global in scope? (mNS)
or am i not understanding the broadcast thing at all?
you can check this http://killzonekid.com/tag/variables/
sings: was wollen wir trinken... also this https://community.bistudio.com/wiki/Variables
global, but not network-speaking β we are talking about a namespace, which applies on a -machine-
so all clients do not share from a single mNS but have their own local copy that doesnt auto update without broadcasting? ive been assuming there is only one mNS and thats on the server.
correct. Everyone has their own
I don't know of anything that everyone shares and only exists on the server.
serverTime maybe
so all the namespaces are copied everywhere? including HC? and the only time all of them get updated is when u broadcast true? doesnt that defeat the point of making them global? is there no auto-sync?
addPublicVariableEventHandler < semi-auto-sync*
no namespaces are copied anywhere
No there is no autosync.
No That is not autosync
semi-auto-sync*
Every client has a different mission namespace. Global and local variables have nothing to do with local and global commands.
setVariable has local effects, unless you use the true/public flag, then it has global effects.
No auto sync at all @meager heart
jesus efcpdt! i have to use an EH just to declare a pretend global var?? id given up on this arma code a long time ago but im a masochist and i want more pain!! my mistress is called "Locality" and i am her bitch
It's not automatic if you have to do it manually.
i have to use an EH just to declare a pretend global var??
No.
i should of never learned about remoteExec, should of just stayed in the wonderfully peaceful world of single locality pc, running stuff in virtual arsenal non the wiser
I agree
PublicVariableEventHandler will detect if variable was broadcasted and will execute code... looks like kinda automatisation, but yes you have to add manually Β―_(γ)_/Β―
That... is not what anyone here was talking about. Not even close.
What?
That doesn't change anything on the variable being broadcasted
It happens no matter if you have the PVEH or not
You mean if two machines set the same variable and on a third machine they arrive on the same frame?
Yeh
One of them will arive first, trigger the event, then the second arives, overwrites the variable with the new value and triggers the event again.
The only problem with sending around globals at the same time is, that they will take different values on all the machines. Depending on when they arrive.
imo the worst thing about pveh - possibility to broadcast from any pc to all...
U can also do that with re
how do you global exec addAction to an object?
_satph = createVehicle ["Land_SatellitePhone_F", player, [], 0, "CAN_COLLIDE"];
private _addActionsSatPH = {
params = [_satph];
_satph addaction ["TEST GLOBAL ACTION",
{
_satPhoneObj = (_this select 0);
hint str(typeof _satPhoneObj);
},
"args", 400, true, true, "", "(alive _target)", 15, false, ""
];
};
[_satph] _addActionsSatPH remoteExec ["BIS_fnc_call", 0];
doesnt work
and why is there no addActionGlobal (do i have to createvehicleLocal globalExec instead?)
Instead of:
_satph addAction [
"TEST GLOBAL ACTION", {
_satPhoneObj = (_this select 0);
hint str(typeof _satPhoneObj);
}, "args", 400, true, true, "", "(alive _target)", 15, false, ""
];
You write:
[_satph, [
"TEST GLOBAL ACTION", {
_satPhoneObj = (_this select 0);
hint str(typeof _satPhoneObj);
}, "args", 400, true, true, "", "(alive _target)", 15, false, ""
]] remoteExec ["addAction"];
why cant i just pass an entire block and do whatever inside? say its an array of obj needing the addaction and other stuff like add dmg EH? you would have to do multiple remoteExec? isnt that worse than just one big remoteExec?
Of course you can also use BIS_fnc_call, but then you have to fix this line:
[_satph] _addActionsSatPH remoteExec ["BIS_fnc_call", 0];
If there is an array next to a variable, then your code has broken syntax. There always has to be one command inbetween at least.
so [_satph] call _addActionsSatPH remoteExec ["BIS_fnc_call", 0]; ?
[_satph, _addActionsSatPH] remoteExec ["BIS_fnc_call"];
Or wait.
Nah, I think that's right.
[params, code] call BIS_fnc_call;
You sure that works?
Yes.
Well, of course you have to fix the other syntax error:
params = [_satph];
->
params ["_satph"];
Wouldnβt _addActionsSatPH have to exist on the other machine?
No, the whole array is sent including the local function.
Forgot the quote marks in my syntax fix.
How can I make the friendly AI not go instantly crazy when friendly fire happens?, it seems like its going to be an issue
gosh didnt realize i had so many syntax booboos in that one, it works now with the changes. ty
Define "instantly crazy".
instantly turn you into an enemy to them
i did a handleScore + handleRating EH to fix that
player addEventHandler ["HandleRating", { (_this select 1) max 0; }];
player addEventHandler ["HandleScore", { (_this select 1) max 0; }];
HandleScore < server only (if that for mp mission)
player addScore (-(score player) +10e10) hehe
i got an error
Fix it.
script error.
Hm, why?
Did I put that in the wrong place or something?
where would you put that bit?
Change handlescore to _this select 2
thats bcuz jayTAC dont have -showScriptErrors startup param π
@meager heart haha so true
or put there false
Because _this select 1 returns the player there
nope, still errors
Whatβs it say this time?
Oof

Replace it all with this:
player addEventHandler ["HandleRating", { (_this select 1) max 0; }];
player addEventHandler ["HandleScore", { (_this select 2) max 0; }];
its right to be in the init.sqf ...right?
Why bother with the score if only the rating is what effects this?
back to the original error
Just delete the HandleScore line. The HandleRating line is enough.
Yeah, listen to commy2
did that, same error
Always.
ffs
can it not just be as simple as "ai will not fire upon receiving friendly fire" bohemia? come on
Are you restarting the mission?
It essentially is though.
yes
You doing it from editor?
ok its working
thats a big relief as I can't be having Americans turning on me when I accidently kill them in my vietnam jungle mission lmao
thanks guys
One day I'd love to be able to do this stuff on me own
hm, thats odd. I get the error when I load from editor but not from normal play.
hows that work?
Thatβs because the showscripterrors param is off
In editor, it acts like itβs on
But otherwise, it doesnβt just so it doesnβt bother players
I imagine it will be fine then for the mission
wrong
i dont mind if its on in editor
Bad habit
player addEventHandler ["HandleRating", { (_this select 1) max 0; }];
thats what you said to put in, right?
...why
The error might not be shown in outside the edior, but it will still be printed in the log file and break the script.
π
also ```sqf
player addEventHandler ["HandleRating",{0}];
No.
I removed it completely but it still shows..i dont know what to do
Save the file. Load the mission.
I have..it still shows
Are you loading from save?
Shouldnβt.
guess i need to find a different way to have my allies not turn on me in case of accidental FF
An error doesn't "stay" in a mission.
If your code is incorrect when executed, it will trigger an error, you just have to correct it and you won't see it again
It's really not this difficult.
Hy. Why object obj2 created at the same position as obj1 is not in the same place?
https://plays.tv/video/5aa193ebbfd95c66f2/pourquoi
because createVehicle automatically makes sure that doesn't happen
read the wiki page of createVehicle
ok thanks
has anyone managed to use __EXEC/__EVAL in description.ext and get it to work without MakePbo.exe complaining about it?
makePBO shouldn't even think about touching description.ext
that file is not binarized
Maybe message Mikero in #arma3_tools
cool, cheers dude
Does screentoworld only intersect terrain? Is there a command that returns any interactive object intersected?
Yes. lineIntersectSurfaces is the newest and best raycast command.
so many parameters TT_TT
Yeah, it's great.
You are great
ikr
private _posStart = AGLToASL positionCameraToWorld [0,0,0];
private _posEnd = AGLToASL positionCameraToWorld [0,0,1000];
lineIntersectsSurfaces [
_posStart, _posEnd,
cameraOn, objNull,
true, 1,
"GEOM"
] param [0, []] params [["_intersectPos", _posEnd], "", ["_intersectObj", objNull]];
There. _intersectPos will be ASL position of the first intersection. _intersectObj will be the object or <null>. 1000 meters raycast.
could someone take a look at something for me, see if it can be tidied up a little bit ? im pretty sure it can be done, but not sure what to do xD
waitUntil {_itemsReturned};
This will either wait forever or pass first try.
Definitely bugged/weird script.
its shouldnt do either.
its defaulted as false, and at the end of the return function, it returns true;
oh shit./
The variable is never changed. Variables don't change their values retroactively.
Fff. Finally got script to register on lineintersectssurfaces, now it's throwing my objects up above ground level to the same amount as the target is above sea level... my head hurt just trying to write that.
Are you using what I wrote?
Yeah, that's from the wiki right? Or very similar.
Dunno, made it up myself on the fly.
_intersectPos is ASL format. What are you doing with that position?
It's a really basic (at least, for use) defense placement script - if player has toolkit, addaction "place sandbag." Action checks if the target position is under 5m away, then places the sandbag there, setting direction on the player.
setPos or what?
then {ShortSand = createVehicle ["Land_Bagfence_Short_F", Placepos select 0, [], 0,'CAN_COLLIDE']; ShortSand setdir getdir player; };
Sorry, dunno how to make it fancy on discord :/
three ` before and after
```sqf
//code here
```
'''
then {ShortSand = createVehicle ["Land_Bagfence_Short_F", Placepos select 0, [], 0,'CAN_COLLIDE']; ShortSand setdir getdir player; };
Shit
Ahh.
Getting off topic.
The testing place is 226m asl, and the sandbags appear... 226m above my head.
Anyway, createVehicle uses the AGL format. My position is ASL format. Use ASLToAGL to convert these.
Ahh.
then {
_shortSand = createVehicle ["Land_Bagfence_Short_F", ASLToAGL (placePos select 0), [], 0,'CAN_COLLIDE'];
_shortSand setdir (getdir player);
};
why do the objects need to be global ? for a reason ?
you probably don't want to have a local sandbag
that means only one client sees it... π
no.. I mean the variable...
this should still create a sandbag for everyone, unless createVehicleLocal is used.
This is just the outline stage, one I've got it working I'll fit it back to multiplayer.
Minor success - sandbags now appear at player's head.
I mean, do you need to reference "ShortSand" again ?
Nah, it's more for bugtesting - checking getpos ShortSand if I didn't see it appear.
so your trying to place a sandbag where the player is looking ?
Yeah, got it - the lineintersect needed to ignore the player.
Nice.
And now it stacks π
might be cleaner if you used a var passed from the addaction for the object.
ill get an ex together 2 seconds.
Sure π Networking code and locality are my weakness, I have a bad habit of just wrapping everything in a {code}remoteexec["bis_fnc_call",0] shell and praying.
myTag_fnc_placeFunction = {
params ["_type"];
_object = createVehicle [_type, ASLToAGL (placePos select 0), [], 0,'CAN_COLLIDE'];
_object setdir (getdir player);
};
placableActions = [];
private _objects = [
"obj1",
"obj2",
"obj3"
];
private _displayName = {function to retrieve displayname};
{
placableActions pushback (player addaction [format ["Place %1",_itemDisplayname],myTag_fnc_placeFunction,_x])
}forEach _objects;
{function to retrieve displayname}; there are a few around the place.
Nice, and I'm glad you wrote that up for posterity's sake, future generations searching the logs and all... but I should have said from the outset, my project is for remote execution on the public servers >_> I'm kinda enamored with the admin console and it's possibilities on the zeus servers.
right.
I think im getting confused...
if I use
_return = [] call something
does it wait for the call to finish before It continues ?
Yes @wary vine, otherwise you wouldn't be able to use it's return value after it.
Entrenching script is functional for MP, if a bit janky for using addAction and all... but my attempts to add it to the Zeus interface are problematic. Problem is resolved by creating a trigger that, ideally, runs whenever someone places an object - but I can't suss out how to have a player addAction command change a variable such that a trigger will notice. I imagine it's something to do with PublicVariable, but I've run out of time and brainpower to test.
if you need detect when new object was placed in curator interface, you can try this https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorObjectPlaced
Stop with the trigger talk already π€’
How would I go about getting a smooth CPR animation? I'm currently trying to use the MedicStart animation with playActionNow in a loop, but cant seem to get it working properly as it just makes the player stand all the way back up again. Hopefully im using the right animation for this. I heard this animation was meant to loop, not sure if this has anything to do with me testing in singleplayer.
that one is kinda special, also its "interruptible"
0 spawn {
hint "Animation started";
player playaction "medicStart";
sleep 60; //--- set any delay you want
hint "Exit animation";
player playaction "medicStop";
};
```try it in debug console ^
also when animation will start, press any move keys
@warm gorge
interruptible... interruptable π€
can be interrupted*
It's "interruptible".
thanks π
@meager heart Cheers for that, ill give it a go shortly. Was wondering why it kept cancelling. I think ill just disable input while the animation is being played
btw there is really nice "throw" animations, seems like unused
Grenade throw animations?
Have any of you guys made it so AI can fire flares? I can use the modules to make it look like they fire flares but the brightness etc is really bad on the basic arma 3 ones
driver _plane forceWeaponFire ["CMFlareLauncher", "Burst"];
I imagine that's only if they have said item equipped?
I'm doing a vietnam mission so don't think that applies
The plane has to have flares for the pilot to fire them, yes.
No I mean Ai infantry based on spawn triggers
Vietcong spawn, red flare goes up
the module flares for arma are useless lol
I have a pistol and a shoulder launcher based flare in BWA3, but those use addon configs. The throwable flares from ACE are scripted. This is how: https://github.com/acemod/ACE3/blob/master/addons/grenades/functions/fnc_flare.sqf
Pretty simple.
Ah I'm not using ACE myself
Wouldn't stop you from copying the script. It's very basic.
so how exactly does the script work, sorry
Creates a lightsource, then sets some parameters like color, birghtness and intensisity, then attaches the light source to a projectile, then starts a timer to delete the light source.
π
interesting
maybe you can just spawn flare and set velocity for it π
He said they're too dim.
ye they dont light up the ground like in this;
basically I want Vietcong to spawn via blufor trigger, Flare module goes off upon VC spawn for immersion
For gameplay, not rly immersion
Lightwource
Wud do it
I wonder if they have fps impact
Ofcause they do
each light source costs 0.00375 fps
Most things have some fps impact.
And if you can see them then 100% they do
Yeh, but how bad
I think light sources also count towards the dynamic light limit?
So you can only have a dozen or two.
I'd say more than negligible
Less than a SQF comment in a PFH
Dynamic light, doesn't even cast dynamic shadows
What does dynamic light mean
That it can draw light to surfaces and objects?
@little eagle So how would I go about implementing this into my mission then? please
also you know what would be nice, if you could draw the shapes for triggers 
π
[14:57] nigel: Dynamic light, doesn't even cast dynamic shadows
nope, but Enfusion does it π I was happy to notice it yesterday
Yeh, saw that on flare. I was blown away
@meager heart I just tried the code you showed me earlier for the CPR animation, but for some reason it ends the animation after the first pump, even with my hands completely off the keyboard
Tested through the console, added a sleep at the start to make sure the pause menu wasnt interrupting it
just checked in game... also added sleep and it's still playing lol
spawn { sleep 3 ; player playMove "_animName_"; }; @warm gorge Β ?
still playing π
Alright I figured out what it was, I was using a civilian sided character which must have bugged out the animation. Just tried with a BLUFOR character and it worked, however it seems like this animation is different to the one I was looking for. Ive seen it on several servers, its just a constant CPR animation while someone is being revived,
yeah, don't use people for your tests or disable their AI π
I was the player though, just not sure why it wouldnt work for civilian sided players. I guess ill just have to try and find the animation I want to use, proving quite difficult though. Appreciate the help though guys π
anim viewer will help then... (btw still playing lol)
they can try to move, run away, etc
never trust a civilian π
Can actions be viewed in the animation viewer?
actions like top body "hi gesture", nope
How hard is it to add a timer or something similar to delete a bunch of units that were spawned in via triggers. Would it be adding a line of some sort to the actual trigger or do I need to make a new script for this?
or would I add something into this part of my groups trigger
// If it's night, use NVS scopes instead
if !((dayTime > 4.5) and (dayTime < 20)) then {
{_x setUnitLoadout [[nil,nil,nil,"optic_nvs",nil,nil,nil],nil,nil,nil,nil,nil,nil,nil,nil,nil]} forEach (units _newGrp);
};
sleep (30 + (random 30));
// Stalk players
waitUntil {sleep 5; simulationEnabled (leader _newGrp)};
_stalk = [_newGrp,group (allPlayers select 0)] spawn BIS_fnc_stalk;
{_x disableAI "Autocombat"} forEach (units _newGrp);
_newGrp setBehaviour "Stealth";
_newGrp setCombatMode "Red";
@obsidian chasm easy
[] spawn {sleep 600; {deleteVehicle _x} forEach units _newGrp}
someshit like that
actually not someshit like that cos you'd have to pass the _newGrp to the spawn scope
[_newGrp] spawn {sleep 600; {deleteVehicle _x} forEach units _this select 0}
someshit like that maybe
my sqf rusty
so I imagine I'd just add that to the file I posted?
yeah try it out
i didn't test it
might need some brackets around the shit at the end
and someone will turn up here in a moment and say forEach is bad
Peach field Apple tree Tempest Automatic How to prevent harvest
.
@silent saffron ?
nono..
What the heck did I just read?
spam
@open vigil Are we getting hit by a bunch of spambots?
Not that Iβm aware of
@silent saffron @tough abyss We donβt take kindly to spam here.
ok.... sorry'
Um, anybody used Als Monsoon script? my helicopter AI wont land anytime I have it activated. I genuinely didn't think the Ai could detect weather.. can I make him not?
ok, just had to make the script sleep longer, what a crazy interaction though
for eventhandlers - adding an event handler to a player over and over - if its the same exact EH it doesn't seem to keep adding it to the player/unit
only if its a new/unique EH
am I correct with this testing of mine or should I be worried? π
same script - one second I'll show you what I mean
Take_EH = player addEventHandler ["Take", { _this call events_onTake_1}];
Take_EH = player addEventHandler ["Take", { _this call events_onTake_2}];
Take_EH = player addEventHandler ["Take", { _this call events_onTake_3}];
That will bump up the EH index when added because they are pointing to different code
but this returns the same EH index when added to the player
Take_EH = player addEventHandler ["Take", { _this call events_onTake}];
Take_EH = player addEventHandler ["Take", { _this call events_onTake}];
is that just a fluke that I am somehow getting and I should check myself
or is that correct and can arma manage that
I never saw that it does that
But I don't think anyone every tried
because doing that is kinda dumb anyway
right - that was the example but what I am doing is a postinit and it spawns a hook file that will wait until there is a player and then add eventhandlers to them and then right after it will wait until there isn't a player or the player is dead and call the hook file again
which in turn readds the eventhandlers on the player and the index never seems to increase
you mean after adding it after the unit respawned