#arma3_scripting

1 messages · Page 61 of 1

winter rose
#

so: does objectParent have a special thing for weapon holders or not? should the page be updated now or not?

still forum
#

weapon holder no, but uniform/vest containers
for all uniform/vest/backpack it returns the unit wearing that thing (And potentially, would need to test, would return the weaponHolder/AmmoBox/Vehicle they are stored inside)E

low zodiac
#

Hello,
Returning to a problem of mine: I currently have a intro, scenario and outro phase. There are two videos, one video plays at the beginning of the intro phase, while a other ones starts in the outro phase.
While I am able to start the Intro video with initintro.sqf, I wasn't able to find anything for the outro. I could start the outro with a trigger instead, but a slight delay tends to happen. Any idea if something like initintro.sqf exists for the outro?

little raptor
#

you can start it wherever you end the mission

low zodiac
#

True, but this would also mean it won't be skippable, which I would like to have for players.

still forum
winter rose
low zodiac
#

It didn't trigger for me. It only worked for the intro and not for the outro, but it could be that I did something wrong.

winter rose
#

hm, it should AFAIK

as there are no parameters provided allowing to distinguish, you could trick by naming the player unit differently, or some other trick

if (vehicleVarName player == "OutroWin") exitWith { execVM "initOutroWin.sqf"; };

or
just place execVM "initOutroWin.sqf" in a unit's init field

low zodiac
#

Going with the last idea, thank you so much! I always forget that the units inits field works like that LUL (Should make some notes sometimes)

winter rose
#

don't forget that copy-paste may sometimes trigger all the scripts at once 😆 (memory of the OFP era…)

#

"ah yes, I did put the script in that one unit too…"

low zodiac
#

LUL no worries, but thanks for the heads up

drowsy cipher
#

so from everything ive read in different forums seem to make it sound like trying to control AI heli fly height is pointless, just use unitcapture and fly the thing yourself, anyone think different?

winter rose
#

no idea what you mean here, sooo

drowsy cipher
#

is there something to make AI heli pilots actually fly the height you want them to when using flyinheight or flyinheightASL, they never go below 50m no matter what you set

#

or is there another way of doing it

granite sky
#

Hmm. If they're already hovering then they can go right to the ground with flyInHeight.

#

I don't know what test case you're using.

drowsy cipher
#

basically i just want a heli to fly low (below 50m) through a valley, it seems if you put a value in for flyinheight and flyinheightASL less than 50m it doesnt work

#

ive seen alot of forums about how both those commands dont work if you want the heli to fly below 50m, which seems crazy but watever

#

alot of people just use unitcapture and prerecord the flight path, which i have done before, i just suck at flying heli's lol

granite sky
#

Honestly I'd say the AI low-level heli flying is pretty good compared most other AI code, but 50m would be pushing it.

drowsy cipher
#

yes i guess im asking for too much maybe, cuz another thing id love to do is have a heli do a rooftop insertion (which i figured out how to do) but make the decent to the roof more gradual as the heli gets closer

tender fossil
#

I want to emphasize that I'm not sure about this but I think that it's quite deprecated option as we have much better functionality for this now (like the engine based remote execution framework etc. etc.)

#

Or, let the server only to use setVariable with the public param set at least. It's not the best idea to let clients to set them because then you can't categorically filter them out with Battleye filters

granite sky
#

It's not automatically wrong to public setVariable from clients but you should stick to an ownership concept.

#

Do not risk situations where client and server try to publish the same variable at the same time.

kindred zephyr
#

^ in an example that comes to mind, any control list that has to be broadcasted from server to client, like when a mod sets lists that can be modified by server and only read by clients

tender fossil
#

I.e. that stuff coming from clients should always be sanitized and verified and setVariable as a command makes it a bit complicated

#

Unless one wants to write complex BE filters with regexp... Or do I have a mistake in my logic here somewhere?

granite sky
#

I think in an ideal world that's true but there's no actual block on public setVariable or publicVariable anywhere?

surreal wave
#

I have a Problem i want to set an Array when a specific condition is set. But this dont work is there a syntax error or something?

{
  case "con_1": {_new = ["1","2"]};
  default {};
};```
granite sky
#

At least, as far as I know, CfgRemoteExec only applies to remoteExec.

tender fossil
#

I.e. should always use it when just possible

granite sky
#

kinda hard to avoid using global or object-setVariables in SQF :P

tender fossil
#

(Speaking of the script based ones)

granite sky
#

Nah, the trouble is that even if you never publish a variable in the mission, any client can still do it.

tender fossil
#

I'm not sure if I understand. What if you just filtered all variable broadcasts (with the direct commands) with BE filters? Wouldn't it work then?

granite sky
#

Oh yeah, I guess BE can do it.

#

fair point then, if you want to build your mission secure from the start.

tender fossil
#

I see, thanks for the insight in any case!

median nimbus
#

is it possible to tweak the damage BIS_fnc_moduleLightning does?, possibly to nullify the damage and just use it as an effect

sullen sigil
#

step 1 copy function
step 2 comment out line

tender fossil
#

If you used strictly remote execution framework only (configured properly), every script based cheat/hack would have to be customized to the mission so the generic ones would get caught/kicked off the server with Battleye filters

#

So it's like disabling the low hanging fruits (and the vast majority of) cheats with relatively simple and easy-to-implement tricks

median nimbus
somber cloud
#

in init

#

but it worked in init before and i did something idk what

distant egret
#

Any way to rotate text created with setObjectTexture and the new text texture?

willow hound
# somber cloud in init

Yes, but which init? init.sqf? initPlayerLocal.sqf? initServer.sqf? The init field of some object in the Editor?

somber cloud
willow hound
#

Alright. Does the countdown work? Do you get to see the output of the last line (hint "Teleported!") after the countdown ends?

somber cloud
kindred zephyr
#

just init?

#

btw, if that code is intended to run once, it would be better to run it in initServer if this is a multiplayer mission and have the server manage the tp of the players

#

By the way, you can save some lines by doing a for loop instead of a while if its just a single time counter

for "_i" from 1 to 60 do
{
    hint format ["Choose Loadout: Timer %1", (60 - _i)];
    sleep 1;
};
willow hound
#

The only obvious mistake in the script is publicVariable "_countdown" (local variables can not be broadcast).
It is possible that side player does not return what you expect it to return, so try to confirm that the setPos-statements are actually reached; for example like so:

switch (_side) do {
    case west: {
        systemChat "case west";
        player setPosATL getMarkerPos "blufordome";
    };
    case east: {
        systemChat "case east";
        player setPosATL getMarkerPos "opfordome";
    };
    default {
        systemChat "default";
    };
};
still forum
faint oasis
#

Hi, is it possible to prevent drone to fire ? Because the drones are firing on random target everytime so which AI feature i need to disable ?

placid root
#

hey guys. does anybody know what the 3rd parameter of the ilsposition is? ilsPosition[] = {9240,10144,141};

#

found this on "sara"

placid root
#

this mixed up my script which finds airstrip position with the right direction

faint oasis
# open fractal https://community.bistudio.com/wiki/disableAI

yeah thank you but i already know that but i don't know which one will prevent to fire on a random target. I will try to disable the AutoTarget feature but i can't test because like i said it's a random target and the drone shoot when he want. There is no feature against "Fire" and i think it's something like "AutoTarget" or maybe "Target" or maybe both or maybe an other feature so it's why i'm asking 😄

Edit : I forgot that we can change to "Don't shoot" on a drone waypoint so i think now it will work.

placid root
#

it is propably just n error, since a some config data seems to be off

little raptor
prisma glen
placid root
#

yeah you are propably right. wasn't sure where to ask this, since the problem is the output of my script ^^

fossil smelt
#

Bit lost...

fair drum
fossil smelt
# fair drum Help you in 30

I'm not great at ArmA. I'm a plug and chug kind of guy, and if I need to change a name sure. But it's a bit Greek to me.

fair drum
fair drum
# fossil smelt I'm not great at ArmA. I'm a plug and chug kind of guy, and if I need to change ...
if !(isServer) exitWith { false };

// create task
private _description = "my task description here";
private _title = "my task title here";

[
    west,                                   //side
    "dropoff",                              //task reference name
    [_description, _title],                 //self explainatory
    [0,0,0],                                //destination position - probably the location of your dropoff point
    "CREATED",                              //starting task state
    -1,                                     //priority - largest priority first
    true,                                   //show notification
    "rearm",                                //icon
    false                                   //always show
] call BIS_fnc_taskCreate;

// task completion
[] spawn {

    private _trucks = [
        truck_ammo_0,
        truck_ammo_1
    ];

    while {sleep 1; true} do {

        //task failure - any truck is not alive
        if (_trucks findIf {!(alive _x)} != -1) exitWith {
            ["dropoff", "FAILED"] call BIS_fnc_taskSetState;
        };

        //task success
        if (_trucks findIf {alive _x && !(_x inArea "myAreaMarker")} == -1) exitWith {
            ["dropoff", "SUCCEEDED"] call BIS_fnc_taskSetState;
        };
    };
};

true
round scroll
#

Morning, is there a function that abbreviates first and anything but the last name of a name in Arma 3? Bis_fnc_something? I get the name on the side of a plane via sqf private _name = format ["%1 %2", [_unit, "displayNameShort"] call BIS_fnc_rankParams, name _unit]; currently, but the name can be too long to be displayed.

warm hedge
#

You mean name _unit part?

#

Good question actually. I don't think there is a good native method to show only either first or last name

drifting epoch
round scroll
#

yes, I meant that. I quickly came up with this now, but I don't know how it works with non ascii strings: ```sqf
ttt_fnc_abbreviateName = {
params [["_name", ""]];

private _newName = _name;
private _nameArray = _name splitString " ";

if (count _nameArray > 0) then {
    // systemChat str _nameArray;
    private _lastName = _nameArray select -1;
    _nameArray deleteAt (count _nameArray - 1);
    _newName = "";
    {
        private _firstLetter = _x select [0, 1];
        _newName = format ["%1 %2", _newName, _firstLetter];
    } forEach _nameArray;
    if (count _newName > 0) then {
        _newName = format ["%1 %2", _newName select [1], _lastName];
    } else {
        _newName = _lastName;
    };
};
_newName;

};

#

oh, this works too: sqf private _lastName = _nameArray deleteAt (count _nameArray - 1);

warm hedge
#

forceUnicode command may help

round scroll
#

I wasn't even aware it exists, hmm

timber shore
#

just for wasteland?

brave jewel
#

Hi there, getting an "Error isnull: Type Bool, expected Object."

_squadMember1Target = objNull;
_target = cursorTarget;
        if (isNull _squadMember1Target) then {
            _squadMember1Target = _target;
            hint "Target assigned to Squad Member 1";
        };    
warm hedge
#

Are you sure this part is causing the error?

brave jewel
#

I'll post you the full script

warm hedge
#

Please do

brave jewel
#
// Initialize variables
_squad = units group player;
_squadMember1 = _squad select 0;
_squadMember2 = _squad select 1;
_squadMember3 = _squad select 2;
_squadMember1Target = objNull;
_squadMember2Target = objNull;
_squadMember3Target = objNull;

// Define the _assignTargets function
assignTargets = {
    params ["_squad", "_squadMember1", "_squadMember2", "_squadMember3", "_squadMember1Target", "_squadMember2Target", "_squadMember3Target"];
    // Get the target under the mouse cursor
    _target = cursorTarget;
    // Check if the target is an alive enemy unit
    if (alive _target) then {

        // Assign the target to the first squad member
        if (isNull _squadMember1Target) then {
            _squadMember1Target = _target;
            hint "Target assigned to Squad Member 1";
        };    
                
        // Assign the target to the second squad member
        if (_squadMember1Target != _target) then {
            _squadMember2Target = _target;
            hint "Target assigned to Squad Member 2";
        };

        // Assign the target to the third squad member
        if (_squadMember1Target != _target && _squadMember2Target != _target) then {
            _squadMember3Target = _target;
            hint "Target assigned to Squad Member 3";
        };
                };
};

waitUntil {!isNull(findDisplay 46)};
// Add the event handler for the T key to assign targets
(findDisplay 46) displayAddEventHandler ["keyDown", "if (_this select 1 == 20) then {call assignTargets};"];
#

Of course it goes on but the rest is out commented

warm hedge
#

assignTargets receives the EventHandler's _this

#

Which is why

brave jewel
#

Ooooh I see

#

Hm, but how would I fix this?

warm hedge
#

No idea since the intention is yet unknown

#

Probably by initialize inside of the fnc not outside

brave jewel
#

So in general I want to create a syncshot script as in Ghost Recon Wildlands/Breakpoint.
With the eventhandler I want to be able to press the T key and assign up to 3 targets.
Everytime I press the key again it should check if a squadmember already has a target assigned and assign it to the next member.

still forum
#

params reads the parameters you give to a function.
it doesn't magically find local variables you have defined somewhere else.

#

You have the display in your function, and you have the display as parameter inside the eventhandler.
you can use setVariable/getVariable on the display, to store your variables on there

lunar goblet
#

What would be the proper script (in the object init) to add an action that kills the player?

winter rose
lunar goblet
#

Everyone should see it, also MP

winter rose
#

(and please don't crosspost)

lunar goblet
#

sorry, just wasn't sure which channel it should go in.

#

Won't happen again

winter rose
#

thx, np 👍

#
private _actionTitle = "Kill that dude";
if (this == player) then { _actionTitle = "Kill self"; };
this addAction [_actionTitle, {
     params ["_target", "", "_actionId"];
    _target setDamage 1;
  },
  nil,
  1.5,
  true,
  true,
  "",
  toString { alive (_this select 0) },
  5
];
lunar goblet
#

another thing, I already have another action on the object so if i wanted to combine the other action and this action would I just paste everything after line 2?

winter rose
#

no idea… what exactly do you want, merge these two actions in one?

lunar goblet
#

yes

#

I can send a screenshot of what I have right now

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
winter rose
#

what is your other action?

pulsar bluff
#

i like that tostring thing u did lou

#

@lunar goblet also from your question it sounds like just sqf this addAction ["Kill Player", {player setDamage 1}]; is what u want?

lunar goblet
#

oh my god im an idiot

winter rose
lunar goblet
#

I really need to get used to syntaxing and formatting stuff properly...

lunar goblet
#

I'll check that out, thanks!

pulsar bluff
#

morgan freeman narrator voice "he never checked it out"

lunar goblet
#

I swear my settings are broken or something, when i put the mission file on the server it has the action, but when i host it on my laptop it doesn't work 😂

pulsar bluff
#

im pretty useless outside of dedicated server environ... no ideea what the issue could be

#

i would be using the "initplayerlocal.sqf" init script and a respawn event handler for the action

lunar goblet
#

well it works on the server, which is all i need.

pulsar bluff
#
// initplayerlocal.sqf

player addAction ["Kill Player",{player setDamage 1}];
player addEventHandler ["Respawn",{player addAction ["Kill Player",{player setDamage 1}];}];```
lunar goblet
#

It seems to be giving me an error, I've never done the // initplayerlocal.sqf thing so i don't know what this means nor how to fix it.

kindred zephyr
pulsar bluff
lunar goblet
#

will do 👍

winter rose
hallow mortar
#

Expansion:

// initPlayerLocal.sqf```
This line is a comment, which means it's for you to read, not the computer. It causes an error when placed in an Editor code fields because of enginelimitations, but also it's there to tell you to put the code in the initPlayerLocal.sqf file (look that one up) and not in an Editor code field at all.
fair drum
winter rose
#

it was when condition was added to addAction (in Arma 2, so first syntax) that I seriously wondered why they went for String again
now it occurs to me that it was maybe for consistency, but I was confused then

pliant stream
#

Those action callbacks are also executed in a new thread, which is pretty surprising. I pass

isnil
{
    // args to pass to addAction: [callback code, args]
    // calls the script with [args, [object target, object caller, int ID, args]]
    [_this select 3 select 1, _this] call (_this select 3 select 0);
    nil
};

And the actual callback and arguments in an array in the addAction arguments.

kindred zephyr
#

Would there be any real difference between these 2?

myFunction = 
{
params ["_result"]; 
//Some Code here using result;
result;
sleep 10;
[result] call tag_fnc_myFunction;
};

[someParameter] spawn tag_fnc_myFunction;

instead of

[] spawn
{
private _result = someValue;

while {true} do
{
//Some code here using result
_result = //newValue from code;
sleep 10;
};
};

No specific code, just wondering if something has advantage over the other

little raptor
#

the first one is worse

#

because its stack keeps growing and it keeps slowing down

earnest kayak
#

How can I find what number a certain key is? I.e displayCtrl 2414

#

like where do I find what button on the keyboard that is

little raptor
#

displayCtrl has nothing to do with key

kindred zephyr
#

^

earnest kayak
#

Oh lmao

kindred zephyr
#

for keys you are looking for the hex code or DIK code

earnest kayak
#

There is an admin menu script but I can't for the life of me find where it tells it what key to use

kindred zephyr
#

do you have the script at hand?

little raptor
warm hedge
#

Yeah the two, it is very hard to see what's common part

earnest kayak
#

What's keyup ?

#

i can't find keydown but there is keyup lol

kindred zephyr
#

the action of releasing a key

#

what does it has inside?

warm hedge
#

When you push DOWN, it is keyDown. Up, vice versa

earnest kayak
kindred zephyr
#

onKeyUp

Use on: Display, Control
Fired on: Releasing any keyboard key. Fired after the onKeyDown event.
Returns: Returns the display or control, the keyboard code and the state of Shift, Ctrl and Alt.
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];

The code doesn't condition the key used, so it would fire when pressing any key.
Is this your code or you got it from somewhere?
Was it working already?
Is this a public tool of some sort with documentation? If so you should probably read how to use it properly

warm hedge
#

_key it is

modern meteor
#

Hi, is there a way to make a unit follow the player while keeping a certain distance (300m)?

winter rose
modern meteor
#

yes, exactly. it should always keep its minimum distance to the player.

winter rose
#

I would go with

private _angle = _followed getDir _follower;
private _expectedPosition = _followed getPos [300, _angle];
_follower move _expectedPosition;
modern meteor
#

thanks very much for this!

#

I am trying to spawn a small sniper group which follows the player at a certain distance. This is the code I have so far:

SniperUnitList = [

"rhsusf_socom_marsoc_sniper",
"rhsusf_socom_marsoc_spotter"


    
];



snipertotal = (count SniperUnitList);
rndsniper = 1;
grpsniper = createGroup west;


for "rndsniper" from 1 to snipertotal do {   
picksniper = SniperUnitList select rndsniper -1;

sleep 0.2;
 

spawnpossniper = [player, 5, 50, 3, 0, 0, 0] call BIS_fnc_findSafePos;
_myUnit = grpsniper createUnit [picksniper, spawnpossniper,["myMarker1","myMarker2"], 200, "NONE"];

 
    
    

sleep 1;
};

_sniperunits = units grpsniper;

//Set Anim Coefficent
{
_x setAnimSpeedCoef 1.15;


}forEach [_sniperunits];

//Order team to follow    
{
_x  doFollow player;
}forEach [_sniperunits];

My problem is, that the group is not following the player. Any idea what I am doing wrong?

winter rose
modern meteor
#

Oh i see.

#

Is there a command I could use to make the team follow a unit which is not in their group?

winter rose
#

this requires scripting, so what I posted

modern meteor
#

ah, i see. you are using move for this. testing it out now. thanks a lot again.

boreal parcel
#

decided to ask chatGPT some questions, is this a good idea? would the logic running each frame affect performance at all?

addMissionEventHandler ["EachFrame", {
    private _time = diag_tickTime;
    if (_time - time_last_save > 300) then {
        saveFactionData();
        time_last_save = _time;
    };
}];
#

imo it still gives good guidance, sometimes even code you didnt think about

#

good for helping create a plan for myself

high vigil
#

doesnt even know the syntax

granite sky
#

Absolute garbage as usual. It's a terrible idea doing anything in EachFrame that isn't required. saveFactionData() isn't SQF. time_last_save isn't defined.

high vigil
#

i use that bot for powershell and regex shit thats about it lol

boreal parcel
#

yeah kinda figured but just wanted to see if gpts code got any better

#

I usually use it for sql honestly

#

its pretty good at that

granite sky
#

Hopefully better than the human SQL I've seen

boreal parcel
#

even if it gives better than human sql, I can make it worse

#

ez

high vigil
#

i mean 95% of arma 3 steam workshops are same way lol, we just done have the old school arma2 genius coders anymore

#

kids writing shit like track each bullet with public variable type of shit

grand stratus
#

Is there a place to report code related bugs?

modern meteor
#
SniperUnitList = [
"rhsusf_socom_marsoc_sniper",
"rhsusf_socom_marsoc_spotter"
];
snipertotal = (count SniperUnitList);
rndsniper = 1;
grpsniper = createGroup west;
spawnpossniper = [player, 0, 1, 0, 0, 0, 0] call BIS_fnc_findSafePos;

for "rndsniper" from 1 to snipertotal do {   
picksniper = SniperUnitList select rndsniper -1;
sleep 0.2;
_myUnit = grpsniper createUnit [picksniper, spawnpossniper,[], 200, "NONE"];
sleep 1;
};

//Set Vars for group
{
_x setAnimSpeedCoef 1.15;
_x disableAI "RADIOPROTOCOL";
_x enableFatigue false;
_x setSkill 1;
}forEach (units grpsniper);


sniperloop = {
_followed = player;
_follower1 = units grpsniper select 0;
private _angle = _followed getDir _follower1;
private _expectedPosition = _followed getPos [20, _angle];
_follower1 move _expectedPosition;

_followed = player;
_follower2 = units grpsniper select 1;
private _angle = _followed getDir _follower2;
private _expectedPosition = _followed getPos [20, _angle];
_follower2 move _expectedPosition;
};

while {alive (units grpsniper select 0) || alive (units grpsniper select 1)} do {
call sniperloop;
sleep 5;
};
hint "Lost contact with Delta 2";

Can someone tell me why those two units do not spawn next to each other and how to fix this? Somehow they spawn at completely different positions around the player.

grand stratus
#

try putting "CAN_COLLIDE" instead of "NONE" in the createUnit arguements

modern meteor
#

Still spawning at different locations

#

Not sure why

#

Oh I guess because: placement: Number - placement radius

#

Never mind, got it sorted. Thank you

winter rose
sullen sigil
#

isnt createVehicle at [0,0,0] then setPosASL faster?

runic warren
#

Question about Dedicated Servers, I'm trying to use a Show/Hide module with Hold Action. In code complete i have science = true and on trigger condition i have science
This works in single player but I don't know how to make it global so it works on a dedicated server

#

Tried reading through the Wiki, but I didnt really understand the examples. (im not doing it through an external SQF either, i'm doing it through the object's attributes)

granite sky
#

What are you trying to hide?

runic warren
#

does it matter?

#

lol

#

some static props

granite sky
#

Well, I can't help you with the show/hide module because it's not documented for scripting.

#

But there's hideObject and hideObjectGlobal.

runic warren
#

I just need to make that "Code complete" from the object's attribute menu to run globally

granite sky
#

You just want to set science=true globally?

runic warren
#

yes

granite sky
#

science = true; publicVariable "science";

runic warren
#

I'll test in Dedi give me a minute

runic warren
median nimbus
#

I was coming to ask a question but in the process of writing it down, I realized the issue. For future reference, if you use BIS_fnc_moduleLightning on a target that was created below ground, the lightning strike would result in a water splash effect

#

Fixed it by shifting my target to at least be above 1m above terrain level

drifting epoch
#

I don't host anything other

#

So I dont know

frank cedar
#

Hi, All. Have following problem. I create mission using ticket system. Also I want AI slots in lobby dissapears after tickets for this slot ended. Now when tickets ended I can just exit to lobby, sat on the same slot and play game as if I have at least 1 ticket. Does anybody know how to solve this problem?

tough abyss
#

disable respawn?

frank cedar
#

yes, for this particular slot

#

not respawn, but remove slot from lobby

tough abyss
#

Don't think thats possible

frank cedar
#

Maybe there is some workaround, ticket system is just meaningless when everyone can "cheat" leaving to lobby and entering the same slot?

tough abyss
#

I'm not aware of any.

#

You could try to delete that unit. deleteVehicle _unit

fossil smelt
#

I do apologize Hypoxic it's been many moons since I've played arma 3 and made missions I'm trying to get back into the groove

#

I really appreciate your help man

frank cedar
#

will try

fair drum
barren valve
#

Is it possible to have AI become unfriendly to their own side, but keep their group as friendly?

I'm using this:

independent setFriend [independent, 0];

But can't find a way to keep them from shooting their own group.

winter rose
#

if you want one group to go rogue / join the enemy, it is possible

frank cedar
#

also theoretically I can set respawnOnStart=1 and set faster respawn on first enter to mission, will try also

hallow spear
#

@tough abyss , perfect thank you for the information

lunar goblet
#

Is this code good? 3den is giving me an error that it is expecting a bool.
addAction ["Make a Wish",{[_this#1] joinSilent createGroup east},[],6,true,true,"","_this isEqualTo vehicle _this and side _this isEqualTo west",5,{player setDamage 1}]

modern meteor
#

Hi I am using the following code to spawn a unit in a safe position:

grpsniper = createGroup west;
spawnpossniper = [player, 205, 250, 0, 0, 0, 0] call BIS_fnc_findSafePos;
_myUnit = grpsniper createUnit ["B_ghillie_lsh_F", spawnpossniper,[], 1, "CAN_COLLIDE"];

This spawn the unit in a 360 radius around the player. I am now trying to find a way to spawn the unit only behind and out of sight of the player. Is this possible?

warm hedge
lunar goblet
#

so would i remove the brackets?

warm hedge
#

No, remove it

#

addAction takes a boolean there, not a code

lunar goblet
warm hedge
#

Actually, when do you want to do so?

lunar goblet
#

when they use the action via scroll wheel interact

warm hedge
#

Then replace {[_this#1] joinSilent createGroup east} into that

lunar goblet
#

Actually correction, i want them to be killed after they are swapped over to OPFOR (east)

#

so they respawn at the OPFOR spawn point

warm hedge
#
{[_this#1] joinSilent createGroup east; (_this#1) setDamage 1}```
lunar goblet
#

alright I'll try that

#

So the code would be

warm hedge
#

Like that

lunar goblet
#

Alr thanks, it seems to work now

prisma glen
#

I think the slot can't spawn if there aren't any tickets left

#

for tickets the respawnTemplate appears to work pretty well

round bison
#
tv setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
uav lockCameraTo [tgt, [0]];

cam = "camera" camCreate [0,0,0];
cam cameraEffect ["External", "Back", "uavrtt"];

cam attachTo [uav, [0,0,0], "PiP0_pos"]; 

cam camSetFov 0.1;

"uavrtt" setPiPEffect [0];

addMissionEventHandler ["Draw3D",
{
    _dir = 
        (uav selectionPosition "laserstart") 
            vectorFromTo 
        (uav selectionPosition "commanderview");
    cam setVectorDirAndUp
    [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];
}];

so currently we've gotten the UAV to stream live feed to a screen but it currently just shows the "driver" view instead of the gunner view (which does point at the correct target. Any suggestions?
credit Killzonekid for scripts via his blog.

frank cedar
#

@prisma glen cant respawn if respawnOnStart=1

#

if respawnOnStart=0,-1 then slot can spawn but can't respawn

meager granite
#

Vehicles have RenderTargets config class in them which lists cameras it has

#

Use Splendid Config viewer, find your vehicle class, RenderTargets in it and see what it has there

#

PiP0_pos seems to be driver view camera position in most vehicles

#

Bones are unique per vehicle, so best solution would be to dynamically pull them from the vehicle

#

If your vehicle is always the same, you can just hardcode it like you have now

cobalt path
meager granite
#
class RenderTargets {
    class commander_display {
        renderTarget = "rendertarget0";
        class CameraView1 {
            pointPosition = "commanderview";
            pointDirection = "commanderview_dir";
            renderVisionMode = 0;
            renderQuality = 2;
            fov = 0.305731;
            turret[] = {0,0};
        };
        BBoxes[] = {"PIP_COM_TL","PIP_COM_TR","PIP_COM_BL","PIP_COM_BR"};
    };
    class driver_display {
        renderTarget = "rendertarget1";
        class CameraView1 {
            pointPosition = "PIP0_pos";
            pointDirection = "PIP0_dir";
            renderVisionMode = 0;
            renderQuality = 2;
            fov = 0.8;
            turret[] = {-1};
        };
        BBoxes[] = {"PIP_DRV_TL","PIP_DRV_TR","PIP_DRV_BL","PIP_DRV_BR"};
    };
};
```Some other vehicle
#

PIP0_pos is driver here

#

I guess checking for uavCameraDriverPos and uavCameraGunnerPos is easier though

#
cam attachTo [uav, [0,0,0], getText(configFile >> "CfgVehicles" >> typeOf uav >> "uavCameraGunnerPos")]; 
```guess this should work
meager granite
#

STRING in HASHMAP makes me wish we could do same check for entity variables

#

Something like OBJECT isNil STRING, so:

isNil{_entity getVariable "key"}
```can be shortened to
```sqf
_entity isNil "key"
#

Though it could use a better name, something like hasVariable

#

_entity hasVariable "key"

winter rose
#

yep, otherwise in allVariables which is not pretty

#

also in would be case-sensitive (I think setVariable/getVariable isn't)

meager granite
#

isNil {} is very fast already, but still makes me wish to be able to do the check in a single command

meager granite
winter rose
#

I know Dedmen would prefer isNil over hasVariable because it is using an existing command, but still, hasVariable would make sense to me

#

but isNil covers a case where ["TAG_varName", nil] too

meager granite
#

Hmm, does setVariable ["key", nil] triggers a delete instead of setting a nil? 🤔

winter rose
#

there was a mismatch iirc where setVariable ["var", nil] would delete locally but setVariable ["var", nil, true] would not delete but set to nil, at least remote ones

it's really "off the top of my head" so confirmation needed

meager granite
#

🤔

proven charm
#

are there any other ways to disable AI features and improve FPS than _x disableAI "all"; ?

meager granite
#

enableSimulation false

#

hideObject true

#

deleteVehicle

proven charm
#

thx tried with enableSimulation but no notable FPS inc

#

ooh it works if I disable the vehicle sim (enableSimulation)

quiet gazelle
#

if i want to make a registered sqf function (using intercept) return an array of arrays of positions, do i need to construct that array in some special way or can it just cast from std::vector<std::vector<vector2>>?

proven charm
#

is there any use calling disableAI "all"; if you do enableSimulation false ?

#

I'm calling enableSimulation on static gun

proven charm
#

ok thx 🙂

#

just trying to squeeze every FPS out that I can

little raptor
proven charm
#

I have this for static guns and their gunners

#

disabling only the gun atm

granite sky
#

Interesting question whether it still runs AI stuff if you disable simulation on the crew's vehicle.

proven charm
#

at least the lag is gone

granite sky
#

You could check whether targets changes, although that might be separate from FSMs etc.

little raptor
proven charm
#

the gunner also becomes invulnerable

little raptor
#

I would assume the same for other seats

granite sky
#

Gunner also becomes invulnerable if you disable simulation of the gunner but not the static.

#

I forget whether they also shoot back :P

little raptor
proven charm
#

gunner doesnt die first (when I shoot him) but when i shoot the static the gunner dies....

chrome hinge
#

How did we make the code box again?

stable dune
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
chrome hinge
#
params [ 
  "_is3D", "_group", "_waypointId", 
  "_mouseButton", "_posX", "_posY", 
  "_shift", "_control", "_alt" 
 ];  if (_shift == true && _control == true && (_group getVariable ["mined", false])) then 
{ 
  group1 setVariable ["mined", "true"];                                                                     createMine ["ATMine", (leader _group) getRelPos [0, 90], [], 0.1]; createMine ["ATMine", (leader _group) getRelPos [3, 90], [], 0.1];  createMine ["ATMine", (leader _group) getRelPos [6, 90], [], 0.1]; createMine ["ATMine", (leader _group) getRelPos [10, 90], [], 0.1]; createMine ["ATMine", (leader _group) getRelPos [3, 270], [], 0.1];  createMine ["ATMine", (leader _group) getRelPos [6, 270], [], 0.1]; createMine ["ATMine", (leader _group) getRelPos [10, 270], [], 0.1];{ west revealMine _x; } forEach (allMines select { _x inArea  [(leader _group), 50, 50, 360, false, 20] });                                                                                
};}];```  Thank  you kind lad
#

Im trying to have multiople groups able to lay mines once by switching a variable when they do lay mines, but i dont seem to get the variable set for group before this runs. Any ideas what i could try?

willow hound
#

i dont seem to get the variable set for group before this runs
What do you mean by this?

chrome hinge
#

im trying to have "hasmined" as false, and the Eh can only trigger if the group has "hasmined" false. The code triggering sets "hasmined" true, preventing further use

#

for group

little raptor
chrome hinge
#

alrighty, ill try those out

#

is the idea of how to do this correct in itself?

little raptor
chrome hinge
#

yeah, and that works

#

i just want it to work once for each group

granite sky
#

The condition is backwards, group1 should be _group and the set should be a bool.

little raptor
# chrome hinge i just want it to work once for each group
_this setVariable ["mined", false];              
addMissionEventHandler ["GroupIconClick", { 
params [ 
  "_is3D", "_group", "_waypointId", 
  "_mouseButton", "_posX", "_posY", 
  "_shift", "_control", "_alt" 
 ];  
if (_shift && _control && !(_group getVariable ["mined", false])) then 
{ 
  _group setVariable ["mined", true];
  { west revealMine createMine ["ATMine", (leader _group) getRelPos _x, [], 0.1]; } forEach [
      [0, 90],
      [3, 90],
      [6, 90],
      [10, 90],
      [3, 270],
      [6, 270],
      [10, 270]
  ];                                                                                
};}];
granite sky
#

And yeah, the allMines stuff was disgusting :P

little raptor
#

also there's no need to write == true or == falsemeowsweats

chrome hinge
#

Im sorry im still in my baby steps on what comes to coding😄

granite sky
#

I wonder if revealMine is local effect like reveal.

#

gonna guess not.

chrome hinge
quiet gazelle
little raptor
#

also that question has no place here meowsweats
ask in dedicated intercept channel in Dedmen's server

quiet gazelle
#

where do i find that server?

little raptor
quiet gazelle
#

thank you

formal pasture
#

hey so I want to make my player's spawn feel a bit more alive. currently messed around with a shooting range, other soldiers walking around, etc.

I want to make a bunch of people (AI) do the kata / karate animation and have it loop, is there anyone willing to help me? as I am completely clueless in this matter

tough abyss
#

some error

warm hedge
#

respawnTemplates[] =

tough abyss
warm hedge
#

No I meant your first part is wrong

tough abyss
#

ah alr

#

ty

#

@warm hedge by chance, would you know how to get rid of the overlapping?

warm hedge
#

I don't know how you make the respawn

tough abyss
#

oh okay

#

ill try and find how to get rid of the overlapping

hallow mortar
#

Look at the list in the centre left panel. It's overlapping because you've got the position defined twice for some reason

tough abyss
#

i fixed the Respawn Base positions to their respective areas (one at the malden heliport section, one next to the large hangar)

#

however the overlapping does continue

#

as seen

frank mango
tough abyss
#

christ

frank mango
#

wait

tough abyss
#

?

frank mango
#

I posted that as you posted the image meowsweats

tough abyss
#

lolol

frank mango
#

That isn't normal behaviour.
I meant, if it was only one respawn (the main one)

frank mango
tough abyss
#

right, however, both respawn points (diferrent variable; respawn_west_base/respawn_west_heliport)

#

bet

#

respawnTemplates[] = {"MenuPosition"};
respawnOnStart = 0;

#

lol

frank mango
#

the full thing?

#

not just that bit

tough abyss
#

there you go

#

thats the full thing

frank mango
#

thats your entire description.ext

tough abyss
#

that is the entire description.ext

frank mango
tough abyss
#

as i was following youtube videos

#

and theyre usually pretty lackluster

#

id be delighted to put in absolutely everything i need

frank mango
#

lemme send you what I use (as a template, and try it with that)

tough abyss
#

sure

#

im only using the scripts for respawn points

#

i just need to have my friends be able to use them etc etc

frank mango
#

Should have everything you may need.

#

incl links to wiki where applicable

tough abyss
frank mango
#

copy or download. whatever is best.
I would personally download and replace.

tough abyss
frank mango
#

Read, what it says next to & under //respawn parameters.

tough abyss
#

i do not have an onPlayedKilled.sqf so

frank mango
#

would you like one?

tough abyss
#

im good, we're just playing with regular USMC

#

all i really need atm is just a non-fucked pick-respawn map thingy

frank mango
#

and IIRC there may be an internal one that gets fired

tough abyss
#

okay

frank mango
tough abyss
#

okay

#

then send it

frank mango
tough abyss
#

okay

#

@frank mango ok got this error now

frank mango
#

did you delete your one?

tough abyss
#

yep

frank mango
#

your two bits?

#

so it's a completly new file?

tough abyss
#

i just inserted this into yours as your script didnt pop up the respawn area

#

yeah

#

respawnTemplates[] = {"MenuPosition"};
respawnOnStart = 0;

i inserted this into your script

frank mango
#

No

tough abyss
#

and i did try before your script

#

i mean

#

before i put in those 2 lines

frank mango
#
  1. not a script.
  2. it includes those
frank mango
tough abyss
#

okay

frank mango
#

for respawn on start

tough abyss
#

okay your script does not bring up to pick where to respawn

#

or whatever its called

#

all in all, same point

#

i just respawn at either respawn point

#

@frank mango

frank mango
#

The script doesnt do that

#

as I said.

#

the description.ext i sent was a template

#

you need to change the respawn type

#

(as the wiki link, that is text to it, explains the different types

tough abyss
#

okay

#

@frank mango yeah this is way too much i have to look through for 2 locations on a map

#

especially with me whose almost illiterate with this

frank mango
#

change

#

respawnTemplatesWest[] = {"Base"};

#

to

#

respawnTemplatesWest[] = {"MenuPosition"};

#

change.

#

not copy.

tough abyss
#

okay pur, it works buttttt theres still the overlapping

#

i did not modify anything else besides base to menuposition

frank mango
#

right. what else is in your mission

tough abyss
#

as you said this might just be an admin thing

#

nothing

frank mango
#

how are the respawns placed?

tough abyss
#

just zeus

#

two

frank mango
#

how

tough abyss
#

oh

frank mango
#

what did you use

tough abyss
#

im tired as shit im just tryna get this done, my apologies

#

okay i am using respawn position, and placed down in the map regularly

frank mango
#

why are the respawn variable name respawn_west_base ?

tough abyss
#

that was following some youtube video, i'll fix it

frank mango
#

not sure if that is the issue. just a thought

tough abyss
#

i dont think it is

#

ill check

#

nope, not an issue

#

it could easily be an admin glitch

#

ill ask my friend to hop on

frank mango
#

changed the respawn modules to markers and it worked fine

#

I'm guessing using the modules AND description.ext caused it to double the respawns

tough abyss
#

makes sense

frank mango
#

It was the variable name

#

you named the respawn module, respawn_west

#

as the module already does respawn, you naming it, that. gave it 2 respawns

tough abyss
#

ah alright

#

so id assume leave the variable name empty? or

frank mango
#

Yes. also you changed some things in the description.ext that shouldnt be changed.

tough abyss
#

which were?

ivory locust
#

Does anybody know why my unarmed, ungrouped NPCs congregate in groups after running for a bit

#

Are they running out of stamina?

tough abyss
#

if it was the AI shit, i was just looking at that; has been disabled

#

well- reverted

frank mango
#

disabledAI
This was set to off (0), which is why AI were automatically assigned to your player roles.
aiKills
This was set to off (0), which Enables AI units score to appear in score table.

tough abyss
#

oh yeah those, i was just looking

#

nun bad

#

anyways, thanks for the help

tough abyss
#

i know, its all good now

#

thankyou

frank mango
#

really?

#

bumping something after 6 minutes?

hushed tendon
#

Having an issue with code scope and I'm failing on finding a way to fix that. There a way to work this out? Please ping if you answer as this will probably be lost in other questions / Much appreciated

// Simplified names to make it easy to read
switch STATEMENT do {
    case "CASE": { 
        INNERSCOPE_VAR = VALUE;
    };
};

PLAYER setPosATL INNERSCOPE_VAR //aka OUTERSCOPE use INNERSCOPE_VAR 
hushed tendon
#

This can be fixed by grouping them together. When grouped together they usually space out in their designated formation but will all have a common end point if you do that blobdoggoshruggoogly

meager granite
#
private "INNERSCOPE_VAR";
switch STATEMENT do {
    case "CASE": { 
        INNERSCOPE_VAR = VALUE;
    };
};

PLAYER setPosATL INNERSCOPE_VAR //aka OUTERSCOPE use INNERSCOPE_VAR 
```or this
#

If you need to return several values you can do something like this:

switch(true) do {
    case(condition): {
        [getPos obj1, getDir obj1]
    };
    default {
        [getPos obj2, getDir obj2]
    };
} params ["_pos", "_dir"];

player setPos _pos;
player setDir _dir;
#

Lots of options, structure your code depending on what you need

#

When squeezing performance is not important, you can make it even prettier\readable with hashmaps

#
private _result = switch(true) do {
    case (condition): {
        createHashMapFromArray [
             ["pos", getPos obj]
            ,["dir", getDir obj]
        ]
    };
    case (other_condition): {
        createHashMapFromArray [
             ["pos", getPos obj] // Only returning pos here
        ]        
    };
    default {
        createHashMap; // Empty hashmap
    };
};

player setPos (_result get "pos");
player setDir (_result get "dir");
#

More advanced method of doing it, If there is no key in hashmap (other condition or default), then get will return nil and setPos/setDir commands will do nothing. Be careful with nils though.

#
player setPos (_result getOrDefault ["pos", someDefaultPosition]);
player setDir (_result getOrDefault ["dir", someDefaultDirection]);
```another way of having it, with `getOrDefault`
stable dune
#

Good morning.
I read from wiki that attachTo event is terrible for performance in MP.
If I want create multiple objects where is multiple attached objects.
Can I do this via config?
I would have bomb where is attached wires which is needed to cut.
But if I do this via attachTo commans. I attach every wire to my object, let's say 7, and i delete wire when it get cut.
This works on SP fine and when I'm testing alone in MP. But if I understand correctly, my way will cause lot of traffic in MP , if I have 10 different Bombs (like canister where is 7 wires attached oneach) , I'm right?

meager granite
#

What did you read exactly?

stable dune
#

Comments from attachTo event in wiki forum, I can research. Dedmen answered there that attach To event it's not good for mp

#

Not sure about this so I'm asking here. Which is correct way to do.

pulsar bluff
#

you'll find that the OCD over-optimizers dont actually produce much if any playable content

meager granite
#

Didn't see anything related to it being bad for MP

pulsar bluff
#

Build what you need to build for a fun experience, and then assess whether performance is hindering that experience

molten tree
#

Q: I want to add some trees to my mission, but the specific trees in question don't show up in the mission editor. I know I have to create a class for it, but is there a way to do it without creating a mod? Can I also reference the class in the mission file?

meager granite
#

You can get model paths with getModelInfo command

molten tree
#

That or I can have it delete itself after.

meager granite
#

Logic objects are a good fit

#

Keep locality in MP in mind though (create and delete only on server)

molten tree
meager granite
#

Tried it myself:

createSimpleObject ["a3\plants_f\tree\t_pinuss2s_f.p3d", player modelToWorldWorld [0,5,7]]
```Works, but the tree can't be broken down with a tank unlike normal tree
meager granite
#

Also tree trunks aren't exactly in the center of the model so you'll need to account for that

molten tree
#

Ah okay. It's specifically this log and these stumps:

"a3\vegetation_f_exp\treeparts\d_treestump_natural_small_f.p3d"
"a3\vegetation_f_exp\treeparts\d_treestump_natural_large_f.p3d"```
pulsar bluff
#

happens to me often after using ropes

#

it is a physx thing, applying vehicle setdamage (damage vehicle) fixes

#

any sort of physx wake

#

although the "awake" command is too weak

modern meteor
#

Hello, I am trying to build an eventhandler which get the player out out incapacitated state after 3 secs. This is my script but it does not seem to work. I am not very familiar with EHs but can you tell me what I am doing wrong?

player addEventHandler ["HandleDamage", {
  params ["_unit"];
    if (lifestate _unit == "INCAPACITATED" ) then {  
        sleep 3;
_unit setUnconscious false;
  };
}];
proven charm
modern meteor
#

no script errors

#

let me try to remove sleep

#

It still does not work

#

I am trying to trigger the EH with:

player setUnconscious true;
 player setDamage 0.2;
#

But nothing happpens

proven charm
#

not sure if setDamage triggers the EH

#

put some debug hint in the EH to see when/if it triggers

modern meteor
#

Ok, I will try to trigger the EH with an explosive. But any idea how to avoid that the player dies and only goes into incapacitated state?

proven charm
#

dont know if arma ever sets the INCAPACITATED or do you have to use the command

modern meteor
#
player addEventHandler ["HandleDamage", {
  params ["_unit"];
  hint "EH live";
_unit allowDamage false;
_unit setUnconscious true;
    if (lifestate _unit == "INCAPACITATED" ) then {  
        sleep 5;
_unit setUnconscious false;
        
      

  };
}];

This works but as you mentioned sleep does not work with EH. Any idea how to implement a delay?

warm hedge
#

Use spawn

modern meteor
#
player addEventHandler ["HandleDamage", {
  params ["_unit"];
  hint "EH live";
_unit allowDamage false;
_unit setUnconscious true;
    if (lifestate _unit == "INCAPACITATED" ) then {  
spawn {
params ["_unit"];
 sleep 5;
_unit setUnconscious false;
_unit allowDamage true;

};       
      

  };
}];

Haven't used spawn before but this gives me a syntax error.

#

Ah got it sorted Forgot to use _unit

#

Thanks very much both

formal pasture
#
{ 
  {_x playMove "AmovPercMstpSnonWnonDnon_exerciseKata"} forEach [kar,kar_1,kar_2,kar_3,kar_4,kar_5,kar_6,kar_7,kar_8,kar_9,kar_10,kar_11,kar_12]; 
};```

managed to get the karate thing to work, however I still need a bit of help in terms of having the animation loop
warm hedge
#

Apparently the kata animation is not really good for looping, but you can force them to loop using AnimDone EventHandler

formal pasture
#

alright, thank you i'll test it out

modern meteor
#

How can I make an AI mate report "injured" via the radio?

warm hedge
#
player sideRadio "SentHealthCriticalDefault"```
modern meteor
#

Hmm, somehow I don't hear anything

warm hedge
#

Probably your character doesn't have voice

formal pasture
warm hedge
#

No

#
this addEventHandler ["AnimDone",{
  params ["_unit", "_anim"];
  _unit switchMove _anim;
}]```
modern meteor
warm hedge
#

“But”?

modern meteor
#

Got it working. Thanks Polpox.

distant egret
#

I'm trying to make an "smart" teleport script where an object will get teleported in the same model position from the from object to the to object, both objects are of the same type, but are elsewhere and have a different direction.
setPos part works great, but can't get the direction working.
I've tried doing it with getRelPos and some stuff with vectorDir, but I just can't get the correct end result.
Anyone has any clue on how to get the direction working correctly?

meager granite
distant egret
#

You have that script available somewhere :P?

meager granite
#

You need to run your object vector dir and up with vectorWorldToModelVisual and then convert it back with vectorModelToWorldVisual

meager granite
#

Sadly couldn't make it cool enough, you had to catch a moment when player didn't see any windows so teleport isn't noticable, also there is an issue of preloading after teleport, then there is house orientation and shadows

#

Was brainstorming ideas for a horror mission, didn't go anywhere

distant egret
#

Uhm... tried something but still not really working...

{
    private _modelPos = _from worldToModel (ASLToAGL getPosASL _x);
    private _dir = _to vectorModelToWorldVisual (_from vectorWorldToModelVisual (vectorDir _x));

    _x setPosASL (AGLToASL (_to modelToWorld _modelPos));
    _x setVectorDir _dir;
} forEach _objects;

Is this what you meant?

meager granite
#

Looks okay, what didn't work about it?

distant egret
#

well the end rotation isn't correct

#

it's not the same from the fromObject.

meager granite
#

(There is modelToWorldVisualWorld btw, which is ASL)

#

Are all your objects upright?

#

If no, then you'll need to do that for both vector dir and up

distant egret
#

I'm doing it on the salt lake in Altis so I guess so 😛

#

ok... changing the setPos part to what you said with modelToWorldVisualWorld somehow fixed it?

#

actually that script from above works as well... idk what happened maybe I forgot to save the function after editing...

modern meteor
#

I am trying to find a way to give units four times more hit points before they die. This is the script I am using but it is not working. Any idea how to fix this?

{
_x addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit", "_dam"];
//(_this select 2)/20;
_damage = _damage / 20;
hint format ["%1", _damage]
}];
} forEach units group player;
hint "EH started";
meager granite
meager granite
#
    private _old_damage = if(_hitIndex < 0) then {damage _unit} else {_unit getHitIndex _hitIndex};
    private _added_damage = _damage - _old_damage;
    private _final_damage = _old_damage + _added_damage / 4;
    _final_damage;
distant egret
modern meteor
# meager granite ```sqf private _old_damage = if(_hitIndex < 0) then {damage _unit} else {_un...

Thank you, I tried this but it does not seem to give the units more hitpoints, does it? I guess I am doing something wrong.

{
_x addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit", "_dam"];
    private _old_damage = if(_hitIndex < 0) then {damage _unit} else {_unit getHitIndex _hitIndex};
    private _added_damage = _damage - _old_damage;
    private _final_damage = _old_damage + _added_damage / 4;
    _final_damage;
    hint format ["%1", _final_damage]
}];
} forEach units group player;
hint "EH started";
meager granite
#

Your event handler doesn't return anything, _final_damage; must be final statement.

#

It returns result of hint command, nothing.

#

Your original script didn't work because of that as well btw.

#

It didn't return anything

#

EH is called for each selection (body part) btw so your hints will override one another

modern meteor
#

Sorry, I am confused. What I am trying to achieve is that the units can take more hits before they die. I am not very familiar with EHs. The hint is not really relevant. Just put it in there to see if the EH fires.

meager granite
#

Last statement of the function is its returned value

#

Your last statement is hint which returns nothing, so game ignores EH result.

#

Have _final_damage; as final statement of the EH

fleet sand
# modern meteor Sorry, I am confused. What I am trying to achieve is that the units can take mor...
{
_x addEventHandler ["HandleDamage", {
  params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit", "_dam"];
    private _old_damage = if(_hitIndex < 0) then {damage _unit} else {_unit getHitIndex _hitIndex};
    private _added_damage = _damage - _old_damage;
    private _final_damage = _old_damage + _added_damage / 4;
    hint format ["%1", _final_damage];
    _final_damage;
}];
} forEach units group player;
hint "EH started";``` Like this.
modern meteor
#

Oh, I see

#

I didn't realise that the order with hint makes such a big differnce

#

Thanks very much guys

quiet gazelle
#

if i have a spot in an array that can either contain either an array in a predetermined format or nothing, then what would be the most reasonable thing to put in there for "nothing"?
like should i use an empty array, an empty string, a number, objNull or something else entirely?

meager granite
#

Depends on what you do with that spot

#

You can have nil there which will mute all commands that operate with that spot.

quiet gazelle
#

if i use nil i'm gonna eventually introduce a bug where everything gets muted and i don't know where it came from

meager granite
#

Up to you to design your code around it

#

If you iterate through that spot, have empty array there

#

If you compare against it, you can have 0 there, 0 isNotEqualTo [your,array,here] will work fine

quiet gazelle
#

i plan on accessing it directly and then checking if something is already there

meager granite
#

If you'll use in or find, empty array is a good idea then

quiet gazelle
meager granite
#

count(_array select _my_spot) == 0 is pretty fast too

quiet gazelle
#

thanks

fleet sand
#

Quick question how do you arm claymore ?

willow hound
#

What do you mean?

fleet sand
#

I found it thank you i was applying dmg to Claymore_F but armed clay more is ClaymoreDirectionalMine_Remote_Ammo

mellow scaffold
#

I've seen stuff like somevar#0 in other people's scripts. What does the # do? It's basically impossible to search for on the wiki

mellow scaffold
#

ah! thank you

quiet gazelle
proven charm
#

can this be optimized? ```sqf
private _units = [];
_esides = [west,east]; // Random
{
_units = _units + (units _x);
} foreach _esides;

manic sigil
proven charm
#

well "normally" the _esides would be dynamic so I dont know the sides..

cosmic lichen
#

units <side>

little raptor
manic sigil
#

Huh, that's a new one on me.

quiet gazelle
#

same

cosmic lichen
#

It is new

#

kinda

little raptor
proven charm
#

sorry i forgot to mention the _esides would be random

little raptor
#

then flatten (_sides apply {units _x})

proven charm
#

that really faster? thonk

little raptor
proven charm
#

ok thx I will run some tests to make sure 🙂

little raptor
little raptor
#

ironically insert is faster thonk

#

Execution Time: 0.0249 ms

#

I guess it's a bug in append

quiet gazelle
#

with how many units per side are you testing?

proven charm
#

yeah + is little bit faster than append (in my tests)

little raptor
#

3 sides, ~40 units per side

little raptor
little raptor
mellow scaffold
#

I am using a mission framework that has a bunch of functions that are rarely used. They're defined via CfgFunctions{} in description.ext. AIUI, the only "dead weight" in this case is some memory and some loading/parsing time. Once the mission is running, it only eats a small amount of memory. Is that assertion correct?

quiet gazelle
#

what does AIUI mean?

mellow scaffold
#

As I understand it

hallow mortar
#

Functions take up a small amount of memory when preloaded, but have no other performance impact if they're not actually running.
They do contribute a bit to file size which affects how long it takes to download the mission file from the server.

pliant stream
mellow scaffold
#

Yeah, I figure that some pollution of the global scope happens, but I figured that lookups there aren't any worse than O(n)

ivory locust
#

Is there a way to check if the mission is currently active? Like the PC is alive and being controlled by the player? And it is not just open in the editor?

little raptor
#

for being controlled by player you can add a alive player or !isNull player

#

you can also check !isNull findDisplay 46 (mission is running)

ivory locust
#

Thank you

mellow scaffold
#

Another question. A script I am tinkering with is using _sideN = getNumber (configFile >> "CfgVehicles" >> typeOf _pvic >> "side"); and then compares that to 3 and 4 to see if a vehcile's base class(?) is Civilian. I presume this is because this ignores the occupants of the vehicle, and instead looks at what side it would be, had it spawned with default occupants. The comparison with 3 and 4 has two problems: it's not all that readable (compared to west etc) and I have no clue what side 4 is supposed to be. Are there better ways of doing this?

#

(_pvic being the vehicle the player is in by way of objectParent player)

#

The basic goal is to figure out if the player stole a vehicle from a side that is aggressive to them

little raptor
#

4 is unknown

#

it's not all that readable

#

you can define them as macros instead

little raptor
mellow scaffold
#

well, it never had a crew

little raptor
#

side group (crew _veh param [0, objNull])

#

if it has no crew you have to use the config method then

mellow scaffold
#

Imagine setting down an empty CSAT vic, and the player steals it. How do I distinguish that from the player stealing a civ vehicle?

#

I see, thanks. the #define will help with the numbering bit

#

where does that enum (and thus its order) come from? Just so I can put in a comment for future-me

little raptor
#

BIS_fnc_sideID

mellow scaffold
#

thanks again!

little raptor
mellow scaffold
#

wow, that just eliminates like two dozen lines of code 🙂

#

I owe you a beer (or other beverage of choice)

lapis ivy
#

Hello. Maybe there are ideas how to create inertia for the player? I would like to make it so that the weight of the equipment would affect the movement and speed of the player's turn.

hallow mortar
#

weaponDirection

little raptor
quiet gazelle
#

how do i print out a numbers full value without it being rounded?

little raptor
#

toFixed

quiet gazelle
#

thanks

little raptor
#

atan2

#

get what?

#

asin

quiet gazelle
#

what kind of number is -1.#IND?

#

i got it as a result of acos

little raptor
quiet gazelle
#

how's it different from NaN?

little raptor
little raptor
quiet gazelle
#

how do i check if a number is NaN?

little raptor
#

finite

quiet gazelle
#

thanks

little raptor
#

idk what pythogoreum is... meowsweats
asin is arc sine

#

i.e. it gives the angle corresponding to a sine

quiet gazelle
little raptor
#

well that's all I could do in paint meowsweats

#

and I wanted to explain it in 3D

#

note that if magnitude wasn't 1 you would have to do asin (_vec#2 / vectorMagnitude _vec)
but azimuth is still _vec#0 atan2 _vec#1 (if you want 0 to be north and angle is CW, like in Arma's getDir)

modern meteor
#

Hello, I thought that a local variable within a child scope is already defined if the local variable is defined in its parent scope. However, I am getting several errors about undefined variables and I am not sure what the issue is. Here is my code: https://sqfbin.com/oquximemufucaqikiqad

#

What am I doing wrong?

quiet gazelle
#

your code is not executed

#

you put it all into curly brackets

#

that just makes it be a code type value

modern meteor
#

Not sure if I understand. Deleting the first and last curly bracket does not sole the issue with the undefined variables.

quiet gazelle
#

what precisely are the errors?

modern meteor
#

All the local variables after

for "_taskruns" from 1 to _taskcount do {

are undefined

#

Although I defined them at the beginning of the script

quiet gazelle
#

there's again curly brackets inside your for loop

modern meteor
#

And?

sullen sigil
#

you are doing

for (blah blah blah) {
  {
    //your code is here
  }
};```
quiet gazelle
#

that stuff is not being executed

sullen sigil
#

get rid of the double curly braces

modern meteor
#

But the local variables remaining undefined

#

I don't know how I can use the within the curly brackets.

sullen sigil
#

you are creating them in a deeper scope than you are using them

modern meteor
#

Sorry, I don't know what that means

sullen sigil
quiet gazelle
#

therefore it will only be valid in the inner for loop and scopes inside that

#

you are trying to access it from outside of the inner for loop

#

you need to initialize that variable before you enter the inner loop

#

for example add a _spawnpos = []; in line 42

sullen sigil
#

that wont actually solve their issue it'll just get rid of the error

#

they want something along the lines of if (_rnd in [1,6,11,16]) then {continue};

quiet gazelle
#

i didn't look to deep into their code

modern meteor
#

Hmm, appreciate your help but I am a bit lost now.

modern meteor
sullen sigil
#

no, read the local variables scope section of the wiki page i sent to you

modern meteor
#

On it

open hollow
#

i want to disable the onboard laser marker on a vehicle.
Any idea on how to do it?

little raptor
#

remove the weapon?

open hollow
#

yea, that will work

#

but there is no "remove weapon" isnt it?

open hollow
#

removeWeaponTurret meowsweats

sullen sigil
#

or that

open hollow
sullen sigil
#

wiki says unit or vehicle 🤷

open hollow
#

prob i did something wrong then

sullen sigil
#

possible wiki is wrong too 🙃

open hollow
#

ohh im doing this on a drone, maybe is that

sullen sigil
#

that's still a vehicle

little raptor
little raptor
#

is it a main vehicle weapon? or a turret weapon?

#

drone laser pointer is a turret weapon, obviously

open hollow
#

i used drone = allunits select 0 notlikemeow
i was using the crew instaed of the vehicle

sullen sigil
#

is there a rate limit for scripted ehs

winter rose
#

didn't know they were rated
5 out of 7?

#

if you mean "a max amount", no (but maybe int.MAX)

little raptor
#

*24 bit int if so

sullen sigil
#

a maximum amount per second or whatever

little raptor
#

per second? meowsweats

#

why would you add EHs so often?

sullen sigil
#

not adding just the eh being fired -- eh fired on people talking

little raptor
#

no, EHs just trigger when they need to

sullen sigil
#

ok sound

#

no need to worry about 100 people talking at once

ivory locust
#

Anybody know why my ungrouped indep units with default everything are hostile to each other

warm hedge
#

Probably a Mod

#

It is very hard to answer what exactly it is when we know no details

granite sky
#

If you create units in a group of an enemy side (rather than joining them to the group later) then they'll be hostile to each other.

#

IIRC they'll even shoot each other if they're in the same group.

ivory locust
#

Ah I see

#

That's exactly what I was doing, thanks

tough abyss
#

so im trying to get my ai to stop walking i've given them these commands and they stil want to walk is their anyway i can use the phsyics system to not let them walk ( if there isn't much i might just attach them to a can)

warm hedge
#

disableAI "MOVE"?

granite sky
#

disableAI "PATH" is normally sufficient.

tough abyss
#

was thinking lambs was getting in the way but should be disabled via their documentation

#

link for reference

warm hedge
#

What, you need not to let them shoot as well?

granite sky
#

See if you can replicate the behaviour without Lambs. If not then report it as a bug or something.

tough abyss
#

good point

meager granite
#
unit = group player createUnit [typeOf player, getPos player, [], 0, ""];
player remoteControl unit;
deleteVehicle unit;
```Apparently there is no way to remove remote control state from the player and its stuck forever 🤔
#

If anyone had experience with remoteControl and bullshit around it, please let me know

#

selectPlayer, switchCamera, remoteControl on a new unit, on itself, nothing helps

granite sky
#

makes some sort of weird Arma sense given that the suggested removal syntax is objNull remoteControl unit

meager granite
#

Yeah, the command is both weird and bugged

#

Couldn't find a way to fix remote control if controlled unit is deleted or fully dies (removed from group), you're stuck forever

#

selectPlayer to another unit and back doesn't fix it either

#

What's interesting it keeps AI unit stuck too

#

Using UAV terminal to connect to UAV fixes stuck control btw

#

So a hack fix would be:

  1. Spawn some UAV
  2. Give player UAV Terminal, connect it to UAV through script
  3. player action ["SwitchToUAVDriver", player];
  4. Delete UAV and Terminal
#

Now imagine a new scripter trying to figure this all out

pulsar bluff
meager granite
#

action is binary, needs both operands

#

And that action needs real connected UAV, doesn't work otherwise

pulsar bluff
#

check alt syntax?

meager granite
#

🤔

pulsar bluff
#

👀

meager granite
#

Yeah, action ["SwitchToUAVDriver", player] is enough

#

player action ["SwitchToUAVDriver"] works too

#

no argument needed

meager granite
#

WTF is boundingCenter exactly?

#

Thought it might have something to do with offset between getPosASL and getPosWorld, maybe related to land contact position but nope

#

getPosASL and boundingCenter * -1 are at different Z

#

boundingCenter for Mohawk is [-0,-1.26353,3.54672], thus my assumption I need to add it to getPosASL

winter rose
#

isn't it just the bbox's volume centre?

meager granite
#

Lines around the heli are drawn with boundingBoxReal return

winter rose
#

add unitAimPositionVisual to the list?

#

I am flabbergasted and willing to know more about it

meager granite
#

Close to [0,0,0]/getPosWorld but not quite

winter rose
#

thonks
damn, now I wanna know too!

#

Dedmeeen!

warm hedge
#

We need Dedmeeeeen

meager granite
#

I remember something about aiming point being an issue back in OA, with BAF Jackal specifically, it had its aiming point positioned super weird, front, left and bit above the vehicle

#

And it turned out that engine looks for hardcoded memory point name

#

Found it, aim point used to be hardcoded to zamerny memory point

#

Mohawk doesn't have it though, I guess it got changed in A3

#

I guess its calculated procedurally now?

still forum
meager granite
#

Quad bike has the selection, but its different from unitAimPosition

still forum
still forum
meager granite
still forum
#

yes

meager granite
#

What a useless command 🤔

still forum
#

unless autocenter thingy where it gets moved according to... either bounding box or bounding sphere

meager granite
#

Very misleading in its name, makes you think its related to boundingBox somehow

willow hound
#

Should we update the Wiki to point this out?

meager granite
#

We should

meager granite
#

Found a single official use in SSM module back in A2(OA?):
modules_e\ca\modules_e\SSM\data\scripts\init.sqf

// developer documentation https://wiki.bistudio.com/index.php/SimpleSupportModule
//-----------------------------
// Simple Support Module - SSM
// By LaKing, BI Studios 2010.
//-----------------------------
...
_newHeight = ((boundingCenter _x) select 2) + (((boundingBox _x) select 1) select 2) + ((getPosASL _x) select 2);
#

Won't be surprised if this command was introduced just for this module 🤔

winter rose
#

WFSideText flashbacks

meager granite
#

@still forum Can you please confirm what unitAimPositionVisual does now? Back in OA aim position was set from selection with a hardcoded name zamerny, but looking at quad bike it has this selection but unitAimPosition differs from it.

#

Was it changed to be auto generated somehow instead of hardcoded selection name?

still forum
#

seems to be geometry center

#

yeah geometry center (bounding box) by default, and zamerny IF it exists

meager granite
#

Command is needed if there is no selection though (like for Mohawk)

#

tiny difference in precision due to floats

austere granite
#

Anyone has an idea how I can keep the ability to use map* when using switchCamera?

#

I just want switchCamera change the camera to a different view and that's it... no other stuff

modern meteor
#

Hello, is there a way to select the last element of an array without knowing how many elements are stored within the array?

meager granite
#

And since last update you can do:
_array select -1

#

Negative indexes are selected from the end of array

#

[1,2,3,4,5] select -1 => 5
[1,2,3,4,5] select -2 => 4

modern meteor
#

Brilliant, thanks a lot for your help!

stray flame
#

for things like this, what do I need to do to adjust object values in a script or trigger?

I want to have an interaction with one of these where players cannibalize one to replace another. But for that I need to be able to adjust these values. How may I do that?

#

Land_PortableServer_01_sand_F

digital hollow
#

That's an animation or animationSource.

stray flame
#

Is it?

#

I mean I could have a look

#

Where would I find the object related stuff I would need to imput? Since im guessing you dont just do animatesource on an object and nothing else

#

Like the example given is

barGate animateSource ["Door_1_sound_source", 1]; // Open

digital hollow
#

You can check what that slider is doing by looking in config Attributes

hallow mortar
#

Look in its animationSources in its config to see all possible animations

stray flame
#

Alright

fleet sand
#
this addaction ["Open", {
    params ["_target", "_caller", "_actionId", "_arguments"];
    _target animateSource ["Server_Move_Source",1];
    _target animateSource ["Lights_Off_Source",1];
}];

this addaction ["Close", {
    params ["_target", "_caller", "_actionId", "_arguments"];
    _target animateSource ["Server_Move_Source",0];
    _target animateSource ["Lights_Off_Source",0];
}];
stray flame
#

I found my ways but thank you

modern meteor
#

How can I compare two arrays? The following code gives me an error:

if (_selectedarray == _lastselectedarray) exitWith {
    hint "Exit - same array";
};
fleet sand
modern meteor
#

oh, i see

#

Thank you L3gion

jovial robin
#

could someone help i wanan try making so a opfor sqaud inside a trigger don't fire at bluefor only if blurfor attacks them then they turn hostile

little raptor
#

anyway you can do it in 2 ways:

  1. make the blufor guys captives. that way opfor won't target them
  2. join the OPFOR guys to another side that is friendly to BLUFOR, then make them join the OPFOR side when BLUFOR attacks them
hallow mortar
#

You could also have the group set to Careless, and change that when they're attacked, e.g. with a Hit or FiredNear EH

little raptor
#

careless groups do attack tho think_turtle

hallow mortar
#

Under what circumstances?

little raptor
#

idk I seem to recall they do blobdoggoshruggoogly

hallow mortar
#

https://community.bistudio.com/wiki/AI_Behaviour
According to this, careless units will not typically attack, although vehicle gunners will (I remember seeing this actually, so that's still true). It also says they will attack if they have injured legs!?!?!?!?
So you could combine it with the Forced Hold Fire combat mode, to be safe.

deft quail
#

Hello. I'm playing OPEX mission from workshop. Creator have made some script to it, that player can't hear (or see text) himself giving order to AI. Orders work, but I would like to also hear my guy speaking them. I found this code from function viewer (named DisabelingameRadio). Can you guys se from this am I able to overwrite code from debug menu? Or is there any other way to get voice outloud? Thanks for your help

#

Code is:

if (!isMultiplayer) exitWith {};

[
"Gemini_disableInGameRadio",
"onEachFrame",
{
private ["_allHumans", "_playerSquad_ALL", "_playerSquad_HUMANS"];
_allHumans = (allPlayers - entities "HeadlessClient_F");
_playerSquad_ALL = units group player;
_playerSquad_HUMANS = [];
{if (_x in _allHumans) then {_playerSquad_HUMANS = _playerSquad_HUMANS + [_x]}} forEach _playerSquad_ALL;
if (count _playerSquad_ALL == count _playerSquad_HUMANS)
then {enableRadio false}
else {enableRadio true}
}
] call BIS_fnc_addStackedEventHandler;

fleet sand
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
sullen sigil
deft quail
sullen sigil
#

you have to create a new mod entirely to override another mod's function

deft quail
little raptor
deft quail
willow hound
#

In this case you should also be able to remove that undesired feature by running ["Gemini_disableInGameRadio", "onEachFrame"] call BIS_fnc_removeStackedEventHandler from the debug console.

digital wasp
#

i used to place logs as a target position for cruise missiles xD

willow hound
#

Yes, that would work (though getPosATL would be better in this case).

high vigil
#

i need to send remoteexec from HC to Client, only thing i have is the remote Object that belongs to the client. Any idea how HC can get the client ID of the object ?

willow hound
high vigil
#

let me try one more time with debug

jovial robin
jovial robin
little raptor
#

then making those guys captive might be easier

high vigil
little raptor
# jovial robin players blufor

you can try something like this in trigger activation code:

[{
  player setCaptive true;
  private _eh = player addEventHandler ["FiredMan", {
    _this#6 addEventHandler ["HitPart", {
       private _hitObj = _this#1;
       if (side _hitObj == east) then {
          [{player setCaptive false; player removeEventHandler ["FiredMan", player getVariable ["CaptiveFiredEvent", -1]]; player setVariable ["CaptiveFiredEvent", -1]}] remoteExec ["call", 0];
       };
    }];
  }];
  player setVariable ["CaptiveFiredEvent", _eh];
}] remoteExec ["call", 0];
#

it's a bit lazy but meh

#

and you can put this in trigger deactivation to make them targetable again:

[{player setCaptive false; player removeEventHandler ["FiredMan", player getVariable ["CaptiveFiredEvent", -1]]; player setVariable ["CaptiveFiredEvent", -1]}] remoteExec ["call", 0];
#

also make the trigger server only

willow hound
#

😠

little raptor
#

he said just 2 players 😛

#

not worth optimizing

red rune
#

what about changing their combat mode to not fire unless fired upon?

little raptor
#

well they still target you

#

not sure if that's wanted

jovial robin
#

uh

#

sorry like 15 players at least?

#

our guild ops

little raptor
#

meh. it'll still work blobdoggoshruggoogly

#

not in the mood to write something else

#

it won't be terrible don't worry

jovial robin
#

so i post either one in every opfor uinit?

little raptor
#

wat?

#

I told you where to put each code

#

first one is for trigger act, second trigger deact

jovial robin
#

oh

#

same trigger?

little raptor
#

yes

#

second one is optional

jovial robin
#

not sync opfor to trigger?

little raptor
#

if any further steps were needed I would've told you

#

you just need to copy paste the codes

jovial robin
#

ok so how does the code work for opfor in the trigger ai they won't shot any blufor players and not act aware only if players shoot them?

little raptor
#

all opfor units will ignore the players while they're in the trigger and do not shoot any opfor unit

#

well while at least one of them is in the trigger

jovial robin
#

alright

#

thank you

little raptor
#

np

tranquil nymph
#

There's no way to do that other than emulating map behvaiour manually

digital wasp
#

how do i attach something to a map object? (e.g. attach a flag to a building)

tranquil nymph
#

A bunch of random things are tied into the current camera unit :P

winter rose
#

it is not recommended to use attachTo because the simulation rate is low
"just" place the flag pole on the building where you want

nocturne bluff
#

Mmmm spectators

#

such joys of fun

tranquil nymph
#

Yup :D

#

I'm excited to see what comes of BI's spectator stuff

open hollow
#

when it join the lobby, if the mission its already running

#

afaik there is no way to execute code as soon the player join the server, and the mission its on the lobby

#

if there is any, ill need it to a modlist check meowawww (i dont use verify Signatures)

winter rose
#

missionEH OnUserClientStateChanged?

open hollow
lone glade
#

proper support for respawn templates pls

tranquil nymph
#

Maybe some developments that will help 3rd party spectator, or hopefully even redundancy of 3rd party spectator :P

digital wasp
#

also, please ping me in the replies. thank you

nocturne bluff
#

Haaaaaaaah

#

HAAAAAAAAAAAAAAAAAAAAAH

#

Hah

tranquil nymph
#

;)

#

I can dream!

nocturne bluff
#

I want VIEW mode for cameras tho

#

like in VBS

tranquil nymph
#

I'm actually not aware of what that is?

nocturne bluff
#

Emulates the camera like the remote client sees it

#

scopes etc

#

When he ADS , camera shows it too etc

#

"VIEW": exactly what spectated unit sees (gun optics, binoculars, TI and NV, etc.) (1.30+ only)

tranquil nymph
#

Ah I see

#

That would be pretty sweet

#

I'd also love a command that returns the current camera object

#

Currently there's no general way to find out if some scripted system has switched to a camera

lone glade
#

I know we're approaching the date but it isn't christmas yet.

ivory locust
#

What is everybody working on this evening

little raptor
#

everybody?

ivory locust
#

Yes everybody

nocturne bluff
#

SilentSpike cameraOn?

ivory locust
#

Anybody know why you can't create a unit in a friendly group as in sideFriendly

tranquil nymph
#

I mean when something does cameraEffect ["Internal","back"] on a camera object

little raptor
#

because it's not a unit side

tranquil nymph
#

There's no (practical) way to check for that

little raptor
#

or should I say it has no center

nocturne bluff
#

cameraView?

#

Ah

#

I see what you mean

tranquil nymph
#

Yup :)

ivory locust
#

So if I want to use that side can I just create the unit with a group in one of the 3 unit sides then set the unit's group to a friendly group after it's created

#

It is working in this manner

kindred zephyr
#

yes you can but weird stuff start happening if you dont let the engine handle side friendly and side enemy

austere granite
#

So... no? :D

#

In this case it's not spectator though. It's revive system that uses ragdoll and everything about it works okay, just that I lose the map when incapped (Yes I know, not 'realistic', but that's not a reason for it not to work). I just set cameaView on the old body after respawn...

tranquil nymph
#

Does the openMap command work?

#

Could temporarily create a keybind for it

tough abyss
#

I think I remember using it once so yes.

#

Will try

tranquil nymph
#

It works, I just meant under his circumstances

grizzled cliff
#

I just realized with the ACRE configuration for zeus you could technically go into the camera of a shell while in ACRE and scream

#

so you'd be flying down range screaming through ACRE

lone glade
#

"I AM YOUR DOOM WEEEEEEEEEEEEEE"

tough abyss
#

cfgammo doesn't like setvariable

grizzled cliff
#

nope

sullen marsh
#

Is there an eventhandler that fires when an object is destroyed

#

i.e. a bullet

tough abyss
#

nope

#

no eventhandlers for bullets

sullen marsh
#

This saddens me

#

thanks

tough abyss
#

you could make something with particle effects though.

#

But that requires config changes

winter rose
tough abyss
#

So it won't support addon X

digital wasp
winter rose
#

_building allowDamage false or HandleDamage EH, iirc

#

@digital wasp ^

digital wasp
winter rose
#

@digital wasp ^ (sorry, keep forgetting the ping)

digital wasp
#

it's ok

sullen marsh
#

I'm trying to find where a bullet lands (every bullet, really) without it utterly murdering server performance in a large firefight