#arma3_scripting

1 messages · Page 11 of 1

tender fossil
#

What if one's better at defining the core problem and coming up with a general level solution to it than actually implementing it... There's no patent system for that and while the lack of it is a good thing as well, I realized that it probably also does quite a lot of damage too when people come up with smart but also easy-to-implement (easy-to-copy) solutions and become demotivated by the competitive disadvantage, never making their improvement a reality KEKSad

(Before someone points it out: yes, I know that the devil is often in the (implementation) details. But you still need to be solving the right problem, and defining it is surprisingly hard. Even quite poorly working solution to the right problem – as long as it isn't actively harmful – is more useful than superb solution to a wrong problem)

little raptor
#

let me know how it works (if at all) 😅

ocean folio
little raptor
#

no you should set the breakpoints before you run the script

#

the breakpoints are just functions

#

this whole system is written in SQF itself. it's not an external debugger

ocean folio
#

currently trying to hunt down the point where one of my saved variables gets overwritten. That's what I'm dealing with right now

little raptor
#

you can use the file debugger if you don't want to use the console

#

add #include "\dbug\debug.h" in the first line

#

then put BREAK (all caps) after the line you want to put a breakpoint

ocean folio
#

neat, I'll have to try that

vocal valley
#

Anyone have any experience using JBoys Fish Jump Script? cant seem to get it work despite pretty elementary instructions

tough abyss
#

post the script and/or the github so we can give help

tough abyss
#

i have a feeling this is using old syntax's

vocal valley
#

Gotcha, I dont know anything about syntax so no clue.

#

So this script is no longer functioning then?

open fractal
#

It's messy but it should still work if the conditions are met

vocal valley
#

Tested it for like 15 minutes and no fish jump on a SOG map

open fractal
#

how are you calling it?

vocal valley
#

What do you mean?

open fractal
#

how are you running the script?

vocal valley
#

I just followed the instructions exactly

#

put that code in a triggers activation

#

then copied and pasted that body of text into a text file and named it JBOY_FishJump and saved it as an SQF

open fractal
#

where did you save it

vocal valley
#

Its in the mission folder

open fractal
#

where in the mission folder

little raptor
open fractal
#

look at the execVM

#

it needs to be in Scripts\

vocal valley
open fractal
#

Yes

#

Or change the path in the trigger activation

vocal valley
#

okay, ill try it again

#

currently sitting on a boat - Ill let you know

#

nothing just yet

#

not sure how often its supposed to happen

open fractal
#

You can put a systemChat line to see if it's executing

little raptor
#

when you step into the trigger

vocal valley
#

So there will only be one fish jump the whole mission?

little raptor
#

when you step into the trigger

#

if you set your trigger on repeatable then multiple times

little raptor
#

oh actually nvm it CREATES the fish

#

it doesn't animate existing ones

vocal valley
#

still no fish 😦

little raptor
#

what is the code you run in trigger?

vocal valley
#

activation anybody activation type present and I checked the repeatable box then on activation is - dmy = ["Random", thistrigger,-1] execvm "Scripts\JBOY_FishJump.sqf";

#

exactly what it say in the instructions

#

then I have the SQF copied and pasted into a text document titled "JBOY_FishJump.SQF" and its an SQF file

little raptor
#

did you try a systemChat to make sure it runs?

vocal valley
#

I dont know what that is, so no

little raptor
#

at the beginning of the file type systemChat "running";

vocal valley
#

in the text document?

little raptor
#

if the script runs you should see a message at the bottom left corner

little raptor
#

JBOY_FishJump.SQF

vocal valley
#

I put that in there but no message in the bottom left corner

little raptor
#

put another one in your trigger too

systemChat "trigger running";
vocal valley
#

on activation?

little raptor
#

yes

vocal valley
#

nope, nothing happened

little raptor
#

then your trigger is not being activated

#

what is the trigger condition?

vocal valley
#

faceplam forgot to resize the trigger haha

#

so that worked

#

then I get Script Scripts\JBOY_FishJump.sqf not found

#

but... its there.

little raptor
#

maybe your format is wrong

#

have you enabled file extensions in explorer?

vocal valley
#

Well I have other working scripts

#

one other by the same author actually

#

okay got the error to go away by changing the file name to JBOY_FishJump and just keeping it an SQF File, but still no fish

little raptor
vocal valley
#

yeah I have "trigger running" in the bottom left

little raptor
#

no the script one

#

you're supposed to have 2 systemChats

vocal valley
#

So I have taken the the system chat out of the trigger, so anything coming is from the script where its still there

#

I hate scripts so much haha

drifting portal
#

Is there a way to stop agents from reacting to danger?

#

Throwing a grenade at them will make them go prone

little raptor
drifting portal
#

Tried

cursorobject disableAI "all";
#

Not much luck

vocal valley
stable dune
ocean folio
#

I am totally stumped on my data overwriting issue.

#
//changeWeapon.sqf
_vehicle = vehicle player;
_pylonIndex = lbCurSel 1500;
_weaponIndex = lbCurSel 1501;
_possibleWeapons = _vehicle getCompatiblePylonMagazines 0;    //nested array of every item available for every pylon

//updates weapons in list
_weaponsArray = _vehicle getVariable "weaponList";
_weaponsArray set [_pylonIndex, (_possibleWeapons select _pylonIndex select _weaponIndex)];
_vehicle setVariable ["weaponList", _weaponsArray];

Somehow this code is overwriting the data in my presets array immediately when changing the weapon on a pylon

#

I have a hash map stored in the _vehicle namespace called "customPresets" and for some reason this code alters the values in there

#
_weaponsArray set [_pylonIndex, (_possibleWeapons select _pylonIndex select _weaponIndex)];

this specific line seems to be the offender ^

tough abyss
#

hm

ocean folio
#

those system chats are showing the contents of "customPresets" before and after that specific line

winter rose
#

yeees? set edits the values?

ocean folio
#

set should only edit _weaponsArray though, correct?

winter rose
#

yes, but is customPresets a pointer to weaponsArray ?

ocean folio
#

customPresets is a hash map that gets created from data in the profile namespace and stored in the _vehicle namespace

winter rose
#

created from scratch?

ocean folio
#
if (_vehicle getVariable "presetInit" == false) then {
    _customPresetsInput = [];

    _vehicle setVariable ["presetInit", true];

    //load custom presets from profile
    _customPresetsInput = profileNamespace getVariable ["pylonPresets",[]];

    _customPresets = createHashMapFromArray _customPresetsInput;
    _vehicle setVariable ["customPresets", _customPresets];
};
winter rose
#

and how is weaponsArray created?

ocean folio
#

it should be local to changeWeapon.sqf

#

_weaponsArray = _vehicle getVariable "weaponList";

winter rose
#

and how is that set variable created?

ocean folio
#

weaponList?

winter rose
#

yes

ocean folio
#

_vehicle setVariable ["weaponList", (getPylonMagazines _vehicle)];
in the same file as "customPresets" gets created

winter rose
#

the two are entirely unrelated then

ocean folio
#

everything I have ever learned about programming tells me that

#

yet it seems it is not the case

winter rose
#

I don't deal with black magic

ocean folio
winter rose
#

also, use private with your variable declarations

ocean folio
#

yes, that's something I need to do lol

#

I dont know when I dropped that habit

winter rose
#

and print the other var above and below

winter rose
#

and _weaponsArray isEqualTo _theOtherArray

#

oh wait
you reference that array in the other, you didn't make a COPY

tender fossil
#

HA! I somehow got the gut feeling that this is related to reference! Yay 😄

ocean folio
#

oh am I not creating a unique array?

winter rose
ocean folio
#

mannnnn, I've been on that page so many times and just scrolled right past it not even considering that

winter rose
ocean folio
#

so customPresets contains a reference to the weapons array

#

the data in that hash map

winter rose
#

yep
so, if the hashmap is supposed to be a db, make a copy so the reference is "lost" and the other can be edited freely

ocean folio
#

that would also explain why every single custom preset I saved was identical

winter rose
#

hehe, yes

#

pointers, pointers everywhere

tender fossil
#

Primitive vs. referenced variables doing their magic 😛

ocean folio
#

you'd think having gone through a year of college doing C and C++ I would think more about pointers

winter rose
#

it took me some time to get it, in OFP times oldman

ocean folio
#

well, actually its probably C that screwed me up here

#

I'm used to explicitly declaring and passing references, I never considered that it would do it on its own

#

😆

tender fossil
#

Welcome to the upper floors of a shaky tower of programming abstractions 😄

ocean folio
#

what a fresh and exciting experience

#

a whole new world of problems for me to spend..... I think I have been working on this preset management system for 7 hours now?

#

😅

#

more like 5, having some breaks in between lmao

drifting portal
#

is it a good idea to remoteExec switchMove?

sharp grotto
#

so depends on your situation/needs.

drifting portal
#

well yeah the animation doesn't play at all on clients so I will remoteExec my way I guess

copper raven
winter rose
#
private _valueA = 1;
private _valueB = _valueA;
_valueB = 2; // _valueA is still 1 (hopefully!)
```whatever the shenanigans behind, the "pass by reference" _seems_ to only happen for arrays and hashmaps, from a user PoV - I get it is not accurate, but it is how it is
copper raven
#

they're still by reference, it looks like that because these types cannot be modified in place as is(fx., array set), a new value needs to be constructed

#

(aka constants)

#

reverse unary command for example, it reverses the array by modifying the actual value, while the string overload for it creates a reversed copy instead, because strings are a constant, and if they did get reversed array-like, you would end up reversing the string everywhere it's used

_fn_str = { "Hello" };
_str1 = call _fn_str;
_str2 = call _fn_str;
_str3 = call _fn_str;

all of the three variables are holding the same exact reference to "Hello", now imagine if there was set for strings, modifying _str1, would modify _str2, _str3, and the string in the function itself (it's the same instance)

winter rose
#

as I said, I get it :p

#

there even was (or is?) a bug with Structured Text set to a control, if the provided text was used in many controls all the controls' content was changed

tough abyss
#

The closest equivalent, if you're familiar with C++, would be this

#
private _valueA = 1;
private _valueB = _valueA;
_valueB = 2; // _valueA is still 1 (hopefully!)
std::shared_ptr<int> ValueA(new int(1));
std::shared_ptr<int> ValueB = ValueA;
ValueB.reset(new int(2)); // ValueA is still 1
#

though I also generally just think of it as only arrays/hashmaps being references

granite sky
#

What's the source that it passes numbers by reference?

#

Like it makes sense for strings but not stuff that's strictly <=32 bits.

tough abyss
#

Dedmen came in not too long ago and confirmed that everything in SQF is a reference with a shared pointer system

#

(or, at least analogous to a shared pointer system)

#

why exactly things like integers and the like would always be treated as references is weird to me as well but who knows

ripe sapphire
#

yo bros i need some tips, in this example, i want to make it so that if _i is <=10 then code proceeds as is, but if _i is >10 then i want it to skip to the 2nd waituntil and skip the first one. How would i do this? is it possible to use breakTo in the 1st waituntil to jump to the 2nd one?

_i= speed player

waitUntil {_i >= 10};
hint "10";

waitUntil {_i >= 50};
hint "50";

waitUntil {_i >= 90};
hint "90";
granite sky
#

it wouldn't work as written anyway, because you only write _i once.

#
{
  if (speed player >= _x) then {continue};
  waitUntil {speed player >= _x};
  hint str _x; 
} forEach [10, 50, 90];
#

There should really be a sleep of some kind in that waitUntil too, but I'm not sure what sort of acceleration you're working with.

ripe sapphire
ripe sapphire
#

one problem though what if i want the hints to display something else for example a, b, x, etc

granite sky
#

you can use something like [[10, "a"], [50, "b"], [90, "x"]] as the forEach parameter.

#

and then speed player >= _x#0 and hint str (_x#1)

ripe sapphire
#

ohhh rightttt thanks mate i'll do that

granite sky
#

In other cases you might want to put the string -> number mappings in a hashmap first.

#

depends how unwieldy it's getting to dump all the data in there at once.

#

and whether you're using that data anywhere else.

#

Dumb version that should actually work, for reference:

if (speed player < 10) then {
  waitUntil {speed player >= 10};
  hint "10"; 
};
if (speed player < 50) then {
  waitUntil {speed player >= 50};
  hint "50"; 
};
if (speed player < 90) then {
  waitUntil {speed player >= 90};
  hint "90"; 
};
ripe sapphire
#

Right i’ll try to learn how to use hashmaps

ripe sapphire
#

I guess not since you can only breakto to a scope thats been defined with a name

ocean folio
#

is there some way I can get a reference to a specific building created with BIS_fnc_objectsMapper?

#

I'm hoping to use the function to spawn a compound in a random location, then add a killed event handler to one of the buildings or something, to see if the compound was destroyed

#

if someone knows of a better way to go about this, by all means let me know

warm hedge
#

I don't really know what it was, but doesn't it return an Array of Objects?

ocean folio
#

it returns an array of classnames, among other things

#
    ["Land_PaperBox_closed_F",[3.41064,4.94531,0.00115967],152.595,1,0,[],"","",true,false], 
    ["Land_Cargo10_sand_F",[5.2334,-4.14063,0.000343323],42.4202,1,0,[],"","",true,false], 
    ["Land_Cargo10_grey_F",[3.39697,-6.33691,0],34.6231,1,0,[],"","",true,false], 
    ["CamoNet_OPFOR_open_F",[6.41064,4.70898,0.0228577],227.626,1,0,[],"","",true,false], 
    ["Land_PaperBox_open_full_F",[4.71484,5.91406,0.0022583],227.626,1,0,[],"","",true,false], 
    ["Land_HBarrier_3_F",[2.47363,6.35645,-0.0187073],317.544,1,0,[],"","",true,false], 
#

this is a small chunk of its output

#

at least for my specific case

warm hedge
#

The example that stated in BIKI returns an array of an object properly

ocean folio
#

oh I was looking at the wrong one lmao

#

that gives me something to work with I suppose

tender fossil
#

I need support/advice. Realistically speaking, I can only afford working on one major project atm, and it can't be anything Arma related because I have very limited resources so I need to spend them to more instantly useful things from my perspective... My artistic (armaic) expression is being taken away from me due to practical limitations. No me gusta 😭

little raptor
tender fossil
#

Proceeds to found a support group for armaholics

sharp grotto
#

So NPC's don't shoot at the RHS BRDM if they don't have a strong enough gun even tho other guns can also penetrate/damage the vehicle.
AI with an ASP-1 is shooting at the BRDM but for example not the AI with a PKP (can penetrate BRDM armor).

How do i force NPC's shooting at a "wheeled APC" while having normal guns ? 🤔

I tried editing config and reducing armor value in the config but no success.

winter rose
#

maybe script-forcing them with fire, forceWeaponFire and all the line of aim- & fire-related commands

ivory lake
#

preferring their rifles to AT for example

#

I had to set armor to 75 to get infantry to fire at a vehicles exposed gunner for example

sharp grotto
ivory lake
#

well that includes tanks etc... so be warned lol

drifting portal
#

I'm having difficulty using BIS_fnc_ambientAnim for multiplayer
when the function is executed in initServer.sqf, when the client joins the server first, he will see that the units are not playing the animation, but if he aborts then chooses the slot again, then the animations work normally, why is that?

#

I'm using agents as units here

#

agents are created in initServer.sqf, so they should be local to the server

winter rose
#

most likely a JIP thing - on the next anim loop, the JIP client should see it?

drifting portal
#

the agents have their weapons drawn

#

no animation at all

#

until the client aborts and select a slot again

winter rose
#

without mods? 🙃

drifting portal
#

I guess I will test it without mods

copper raven
#

just animate yourself, it's literally just switchMove, plus some FiredNear eh stuff that cancels the anim

drifting portal
copper raven
#

then just loop switchMove with AnimDone EH

frigid oracle
#

How do I properly attach things like turrets and emplacements to other objects? Trying to attach a remote turret and/or Phalanx upside-down to an object but the turret wont rotate and aim around but it attaches fine.

hallow mortar
#

Turrets are usually automatically disabled when they're upside down. I don't think there's a script-side way around it.

drifting portal
#

yeah upside down turrets can't be moved

tough abyss
#

_list = spawnpos nearEntities ["man", 5];
{
[_x,[0,0,100]] remoteExec ["setvelocity"];
} foreach _list

_ps1 = "particlesource" createVehicle spawnpos;
_ps1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,13,2,0],"","Billboard",0.07,5,[0,0,0],[0,0,6],0,0,7.9,0.1,[0.5],[[0.305037,0,1,0.555015]],[1000],1,0,"","","",0,false,0,[[0,0,0,0]]];
_ps1 setParticleRandom [1,[2,2,2],[0,0,15],20,0,[0.550799,0,1,0.146989],0,0,1,0];
_ps1 setParticleCircle [0,[0,0,0]];
_ps1 setParticleFire [0,0,0];
_ps1 setDropInterval 0.01;

im getting an error missing ; at spawnpos is defined as an object initname would i need to use getpos or getposatl?

# _ps1 = "#particlesource" createVehicle spawnpos;
hallow mortar
#

forEach _list;

ocean folio
#

you are missing a

#

yeah that

tough abyss
#

are you sure?

#

because _list will be any man that enters within 5 metres of spawnpos

hallow mortar
#

The error is a missing ; and that is a place where ; is required but is not present in your code

tough abyss
#

oh

#

on my end

ocean folio
#

is this the place to holler about issues with documentation? pretty sure the wiki page on setTriggerActivation is wrong.

hallow mortar
ocean folio
#

Ah, thank you!

tough abyss
tough abyss
#
while (true) do
{
    _list = spawnpos nearEntities ["man", 5];
    {
    [_x,[0,0,100]] remoteExec ["setvelocity"];
    } foreach _list;
};
_ps1 = "particlesource" createVehicle spawnpos;
_ps1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,13,2,0],"","Billboard",0.07,5,[0,0,0],[0,0,6],0,0,7.9,0.1,[0.5],[[0.305037,0,1,0.555015]],[1000],1,0,"","","",0,false,0,[[0,0,0,0]]];
_ps1 setParticleRandom [1,[2,2,2],[0,0,15],20,0,[0.550799,0,1,0.146989],0,0,1,0];
_ps1 setParticleCircle [0,[0,0,0]];
_ps1 setParticleFire [0,0,0];
_ps1 setDropInterval 0.01;
little raptor
#

missing ; after while {} do {}

tough abyss
#

yeah i noticed that

copper raven
#

while takes code, not bool

little raptor
#

while (true) do
oof

tough abyss
#

testing

#

not going to be there the whole time

little raptor
#

and your while needs some sleep meowsweats

#

also I don't get the purpose of the code

#

your while loop never exits

tough abyss
#

it creates a particle effect and if they go within 5 metres it makes them go flying a bunch

#

the while loops stops at line 7

#

i think

little raptor
tough abyss
#

why doesnt it? in visual studio it looks like it does

granite sky
#

I think it does, but that means the rest of the code will never run, so I don't get it either :P

tough abyss
#

its in a init box

granite sky
#

You're relying on the 10k max loop?

tough abyss
#

i feel like im doing stuff very wrong

granite sky
#

If you want something to run forever then spawn it.

tough abyss
#

ok

ocean folio
#

little confused on why this script isnt working. It seems like the value isnt getting set in the missionNamespace like I thought it would. Probably just not understanding something in here.

private _activeMissions = missionNamespace getVariable "activeMissions";

//create unique task name
private _taskName = "task" + str count _activeMissions;
//add task name to array
_activeMissions pushBack _taskName;
systemChat str _activeMissions;    //debug stuff
//update array with new task name
missionNamespace setVariable ["activeMissions", _activeMissions];
#

you know that feeling when you just had to say it out loud to realize what the issue is?

hallow mortar
#

If this is for multiplayer, you might want to broadcast the setVariable e.g. ["activeMissions",_activeMissions,true]

ocean folio
#

If what I understood from the task framework is correct, then this array shouldnt be broadcast out, its just storing unique names used for BIS_fnc_createTask which I thought broadcasted the task on the network

#

my thinking is that this only needs to be stored on the server

copper raven
#

activeMissions is undefined otherwise i don't see an issue

hallow mortar
#

Well, it depends on what you're doing with it, hence "might". If a client needs to access the variable other than the client that set the variable, then it needs broadcasting. If only the server will ever need to access it, and this code is run on the server, then you'll be fine.

ocean folio
#

yeah, this can only be reached from a .sqf that exits if run on a client

#

and the issue was that the sqf which runs this isnt finished, so I was initializing the array every time I ran it to test

copper raven
#

unless you're broadcasting (which you aren't), the missionNamespace setVariable ["activeMissions", _activeMissions]; is redundant here

hallow mortar
#

^that because global variables are missionNamespace by default

ocean folio
#

ohhhh, thats new to me. interesting

hallow mortar
#

You also don't really need getVariable for missionNamespace variables unless you want its default fallback function

ocean folio
#

so its basically the same as just activeMissions

copper raven
#

activeMissions = _activeMissions would also do nothing

hallow mortar
#

how about this: what you said and because global variables are missionNamespace by default

copper raven
#

you're assigning the same value the variable is already pointing to

hazy rampart
#

Hi, I am having an issue with executing a script server side. I have it executed with [] execVM on the init.sqf file but it does NOT get executed whatsoever. There are 0 errors on the RPT I even tried adding a diag_log so if it loads the file and it does not show it on the RPT.

I am not sure what I am missing but is there anything that would prevent a script from loading at all?

open fractal
#

did you put diag_log in the script to make sure it's running

hazy rampart
#

yup it does not run it at all

#

I did put it in init.sqf and it does load that

open fractal
#

you can run a fileExists check on the path

hazy rampart
#

returns true

open fractal
#

did you try putting a diag_log at the very top of the script and right underneath the execVM line

#

execVM also has a return I think

hazy rampart
#

Only underneath I'll try on top

open fractal
#

next step is to post the code either here or at sqfbin.com

#

you can also use
debugVariable = execVM "filePath"
and monitor debugVariable. There will be a return on success

hazy rampart
#

good idea I'll try that as well

livid wraith
#

spawn and execVM returns a scriptHandle, not a bool

#

you can monitor it with scriptDone i think

hazy rampart
#

Thank you for the help. I'll try to do all of that 🙂 foxlove

open fractal
#

quickest thing would be to just paste the execvm line in debug console and if you get a printout the file has been loaded and the issue is within the file itself

hazy rampart
#

hmmjew _scriptHandle completely hangs the server. fileExists returns 0 results when doing it from server side mod init.sqf. (First time I did it was through debug console).

Running script itself on debug does nothing either

copper raven
#

_scriptHandle completely hangs the server
wat?
fileExists returns 0 results
what does that even mean? it either returns true or false, whether file exists or not

hazy rampart
copper raven
#

not possible

#

unless it's argument is nil, then it doesn't get executed and nil of type bool is pushed onto stack

winter rose
#

something tells me you have no idea what you're doing @hazy rampart 😄
let's restart from scratch

hazy rampart
#

nope KEKW got 0 experience with running ArmA servers

#
[] execVM "\irp_server\Functions\Scripts\fn_initDD.sqf"; // custom drug dealer
//_scriptHandle  = [] execVM "\irp_server\Functions\Scripts\fn_initDD.sqf";
//waitUntil { scriptDone _scriptHandle  };
fileExists "\irp_server\Functions\Scripts\fn_initDD.sqf";
diag_log "does it load under";```
#

exactly how I have it

winter rose
#

of course, you just write "fileExists", you do not do anything with the returned value

hazy rampart
#

needs do be in a var? pepederp

copper raven
#

it returns nothing. Neither a true or false
fileExists "\irp_server\Functions\Scripts\fn_initDD.sqf";
you're just discarding the result of fileExists

winter rose
#

0/ make sure the file in the mission directory is init.sqf (or better, initServer.sqf for the server) and not e.g init.sqf***.txt***

1/ initServer.sqf

diag_log "server logs: initServer.sqf runs";
private _filePath = "\irp_server\Functions\Scripts\fn_initDD.sqf";
diag_log format ["does %1 exist? answer: %2", _filePath, fileExists _filePath];
private _scriptHandle = execVM _filePath;
diag_log _scriptHandle;

2/ ????

3/ profit

hazy rampart
#

thank you

#

that makes more sense now

copper raven
winter rose
#

his fault with []!

hazy rampart
#

My bad

winter rose
#

you all saw nothing that wasn't there

copper raven
#

also why are you using execVM when clearly looking at the filepath, it's supposed to be a function which you should be able to just call (though it's rp, so you never know meowsweats )

tender fossil
hazy rampart
#

it points to a timer to make sure everything is loaded before running the drug dealer script once the timer is up it executes the function

copper raven
tender fossil
winter rose
#

that's a whole new box of wasps I'm not going to open here, have fun y'all 😄

livid wraith
#

been playing around with the new Projectile EHs to get 40mm smokes to be less bouncy, but neither the Deflected or HitPart events seems to fire ....

open fractal
#

are you on dev build

livid wraith
#

obviously

#
_unit addEventHandler ["FiredMan", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];

    if (_ammo isKindOf ["SmokeShell", configFile >> "CfgAmmo"]) then {
        diag_log text format ["Smoke fired: %1", _ammo];

        _projectile addEventHandler ["Deflected", {
            diag_log text "Smoke deflected";
        }];

        _projectile addEventHandler ["Deleted", {
            diag_log text "Smoke deleted";
        }];

        _projectile addEventHandler ["Explode", {
            diag_log text "Smoke exploded";
        }];

        _projectile addEventHandler ["HitPart", {
            diag_log text "Smoke hit";
        }];
    };
}];
#

only getting Exploded and Deleted events fired:

17:54:09 Smoke fired: G_40mm_SmokeRed
17:54:11 Smoke exploded
17:55:09 Smoke deleted
little raptor
#

they're simulated by PhysX

livid wraith
#

ok, so it's by design they don't work on smokeshells ?

#

well, intended

little raptor
#

yes

livid wraith
#

rgr

little raptor
#

they're probably shotGrenade

livid wraith
#

so would any of the EPxxxx events work on them ?

#

correction, EpeContact

little raptor
#

I don't think so meowsweats

#

try

livid wraith
#

says it's between physx objects, but worth a try

#
20:06:07 Smoke fired: G_40mm_SmokeRed
20:06:07 Error in expression <"Smoke fired: %1", _ammo];

_projectile addEventHandler ["EpeContact", {
diag_lo>
20:06:07   Error position: <addEventHandler ["EpeContact", {
diag_lo>
20:06:07   Error Foreign error: Unknown enum value: "EpeContact"
#

interesting

little raptor
#

yeah those are not supported by projectiles

tough abyss
#
ncl_spookparticle = [] spawn 
{
_ps1 = "particlesource" createVehicle getpos spawnpos;
[_ps1, [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,13,2,0],"","Billboard",0.07,5,[0,0,0],[0,0,6],0,0,7.9,0.1,[0.5],[[0.305037,0,1,0.555015]],[1000],1,0,"","","",0,false,0,[[0,0,0,0]]]] remoteExec ["setParticleParams"];
[_ps1, [1,[2,2,2],[0,0,15],20,0,[0.550799,0,1,0.146989],0,0,1,0]] remoteExec ["setParticleRandom"];
[_ps1, [0,[0,0,0]]] remoteExec ["setParticleCircle"];
[_ps1, [0,0,0]] remoteExec ["setParticleFire"];
[_ps1, 0.01] remoteExec ["setDropInterval"];
while {true} do
{
    sleep 2;
    _list = spawnpos nearEntities ["man", 5];
    {
    [_x,[0,0,100]] remoteExec ["setvelocity"];
    } foreach _list;
};
};

#

ok ive fixed the issues

#

but for 0 reason (from what i can see) the particle isnt spawning

#

the while true is for testing

winter rose
stable dune
pseudo ridge
#

When i set a Render to Texture on a Bill Board and connect a camera to it, if i'm a bit away from the Bill Board, let's say 30 meters, the PIP will show as a white texture, and the camera image will only show when i walk to near the Bill Board.
Any way to force the image to appears without the need to walk near the Bill Board?

tough abyss
#

Good ol PiP weirdness

copper raven
#

anyone noticed fps dropping with setBehaviourStrong?

#

for some reason if i set a group behaviour to careless, my fps drops by like 30, and if i set it back to aware, it's all normal again 🤔 WUT

tough abyss
#

Maybe the AI for careless is less optimized or something but I can't imagine it'd justify a 30fps drop

copper raven
#

AWARE,COMBAT, STEALTH are all fine, SAFE or CARELESS drops fps 😄 what the hell

tough abyss
#

Might be good to do a sanity check with only a few units to see if it's just a weird scaling issue

#

Could also be the map you're using?

copper raven
#

i'm standing in the same position everytime, not moving the mouse, as i swap behaviours to careless or safe, there is a clear consistent fps drop

copper raven
#

it seems to only happen when you setPos the AI around

#

have a video in abit

#

at the end it gets really bad 😄

tough abyss
#

interesting to me that aware went from getting you 165 -> 200 -> 170 whereas careless went 165 -> 180 -> 130

copper raven
#

the last 20 seconds displays it the best, seems like it's caching something or whatever, but then only for safe or careless 🙃

tough abyss
#

Mhm seems like it

#

wonder if there's any way to dump said cache

#

perhaps briefly disabling/enabling the AI?

copper raven
#

no effect

#

i guess instead of teleporting AI, i'll just recreate them blobdoggoshruggoogly

tough abyss
rough summit
#

I want create map in tab (like ctab) but with all map controls and other features. How can i rescale map display to my specified position?

ctrlMapSetPosition

Change ctrl cords, but other space on monitor is black.

opal zephyr
#

Are entities the same as objects?

warm hedge
#

Context?

opal zephyr
#

Im using get3DENSelected, and the object that it outputs looks like this https://imgur.com/a/q6gSMok (I have 2 objects selected)
But when I try and use that object as a reference for ace add action, it doest work.

The add action code works since I tried it with other predefined objects

warm hedge
#

Umm, why would you add an action to Eden objects?

opal zephyr
#

The action should be there when I start playing though no?

warm hedge
#

No, Eden workspace is not connected with preview

opal zephyr
#

So I would need to store that action, and then call it upon mission start for it to actually add it

warm hedge
#

Basically yeah. Keep it mind that most 3DEN commands are not usable in Preview

opal zephyr
#

Hmm alright

#

If I wanted to have a 3den file retain info between saves, what would I need to do? Would attaching the variable to the object work?

quiet gazelle
#

this function i wrote somehow modifies the things that i pass to it

#

how do i make it not do that

opal zephyr
winter rose
quiet gazelle
#

i do

winter rose
quiet gazelle
#

allright

copper raven
# quiet gazelle i do

modifies the things that i pass to it
then it's not the things you pass to it 😄

winter rose
#
_var = 1;
call {
  _var = 2;
};
hint str _var; // 2
``````sqf
_var = 1;
call {
  private _var = 2;
};
hint str _var; // 1
quiet gazelle
#

i did not know that things i call can modify the scope i call them from

#

thanks

copper raven
#

yea, sqf is basically a dynamic scoping mess

winter rose
#

use private as much as possible, everytime you declare a variable - it saves lives (and hair)

#

I personally use my privates a lot

#

the soldiers, of course! wait, I mean…

copper raven
#

always private reeeeee

warm hedge
opal zephyr
#

Oh yaya, I know that.
What im trying to do is put down a module in 3den, I then select objects and it opens a dialogue where I input parameters.

I want to then be able to access those parameters tied to each object in the game, even after saving the 3den file and closing the game

#

So I guess the new challenge is making it so it saves

fringe gazelle
#

Hi guys, how do I register the built-in pnv in the helmet in the config?

hallow mortar
ocean folio
#

looking for some help with passing variables through my trigger

#
_trg setTriggerStatements ["this", "[_bluforPos] call landingPrep", "hint 'trigger off'"];

this is the line that is giving me trouble

#

[_bluforPos] call landingPrep works fine on its own, but when I shove it into the trigger it doesnt work, I assume its because its a string?

#

trying to mess around with format but to no avail (yet). Idk if that's the right way to do it

little raptor
ocean folio
#

shouldnt that pass it in thought?

little raptor
#

No. Why should it?

#

It doesn't execute here

ocean folio
#

OH that actual like doesnt execute in this scope

#

I understand what you mean now

little raptor
#

Variables only "pass thru" when they execute here

little raptor
#

You just told the trigger to execute a code when it triggers

#

Does it trigger in your code? No

ocean folio
#

I've had some limited success with format now, its being a little funky but the only part of the location.... man every damn time

#

I need a rubber duck

little raptor
#

You shouldn't use format

ocean folio
#

no? I had seen it used in similar situations so that's why I was trying to use it here

#

what's wrong with format?

little raptor
#

Unless the stringized value is the same as value, it won't work

ocean folio
#

seems to work for my purpose

#

_bluforPos is a position, so an array of 3 numbers

little raptor
#

Which is not valid sqf

ocean folio
#

AH I see what you mean

#

like the output of systemChat str player

little raptor
#

Yes

#

If you type that in sqf you get an error

ocean folio
#

so what would an alternative to format be?

little raptor
#

setVariable

#

On the trigger

ocean folio
#

interesting, I wouldnt have thought of that

#

didnt know you could set a variable on a trigger

little raptor
#

Trigger is an object

ocean folio
#

object as in a game object, or an instance of a class?

little raptor
#

Game object

#

Like player, etc

ocean folio
#

so any game object you can set a variable on? That is good to know. It's probably in the wiki but I didnt remember it since it wasn't pertinent to what I was doing at that time

#

me and my damn 1000 miles a minute brain

ocean folio
#

oh?

little raptor
#

Not all of them support it

#

E.g. some terrain objs

#

And super simple objs

#

And cameras

#

And projectiles, but they will support it since v2.10

ocean folio
#

you can set a variable on a projectile??? thats wild

#

thank you for the good information

ripe sapphire
#

is there a similar command for goto for SQF?

stable dune
#

Hey,
I don't know if this is the right channel to ask.
Is it possible to assign a variable to an object in your inventory?
Now I save as local variables to be used by my messaging device.
So when I drop an object on the ground and another player picks it up, the device is empty or if it has been used before, the device shows the information which are the player's own variables, not the object.
So what should I do to get all the messages stored on the device so that I can forward them to the new user on the device.
I use the GUI when using the device, and through this the messages that are received by it are saved.

tough abyss
#

if you need to be able to jump to a piece of code it is far better to use a function

#

very good people I have this script but I can not make it work it is to make a garbage box deleteTrash = {

["Reciclar"] remoteExec ["playsound", 0];
 uiSleep 2.2;

clearItemCargoGlobal CajaReciclado;
clearMagazineCargoGlobal CajaReciclado;
clearWeaponCargoGlobal CajaReciclado;
clearBackpackCargoGlobal CajaReciclado;

};

tough abyss
# stable dune Hey, I don't know if this is the right channel to ask. Is it possible to assign ...

AFAIK there is no way to store data on inventory items directly, as they are always returned as class name strings by the inventory commands and cease to exist as actual "objects" when in the inventory. That being said, one way I could think of to "track" unique items moving in and out of the inventory would be to make them magazines, with the ammo count being set as a unique ID. This ID could then be stored in a hashmap or otherwise somewhere, to be looked up to find the player associated with that ID.

tough abyss
tough abyss
#

going to need more detail

#

where are you running it from and where is deleteTrash defined

stable dune
tough abyss
#

So basically the keys in the hashmap would be the unique ids stored as an ammo value in the "magazines" and the values in the hashmap would be the received messages and whatever else you want to save

stable dune
#

Do I need cfg my item addon to get something specific there?
Now I only have
Pictures which shown on invertory and arsenal, and model which show on ground when dropped from inventory.
is there anything specific i need to add to the config

tough abyss
#

Are they already magazines or something else?

#

If they're not already a magazine you'd have to set them up as such using a CfgMagazines entry

stable dune
# tough abyss If they're not already a magazine you'd have to set them up as such using a CfgM...
class CfgWeapons {
	class ItemCore;
	class InventoryItem_Base_F;
	class sanlaItem: ItemCore {
		author = ""
		displayName = "Sanla"; //Item's Display Name
		scope=2; //Scope 2 will show in editor
		scopeArsenal=2;
		scopeCurator=2;
		simulation= "ItemMineDetector";
		picture = "\sanla\images\sanlabaseinv.paa"; //Displays icon in your Inventory
		model = "\A3\Structures_F\Items\Electronics\MobilePhone_old_F.p3d"; //Path to your model
		icon = "\sanla\images\sanlabaseinv.paa"; //Leave as is "iconObject_circle"
		descriptionShort = "Messenger"; //Description displayed when mouse is hovered over item in inventory
			class ItemInfo: InventoryItem_Base_F {
				mass = 40;
			};
   	};
};
tough abyss
#

Mm

#

Alright

#

Could store the magazine in the weapon then, would just need to ensure it doesn't get removed

#

Could even call it a memory card or something lol

#

So I'd set up a basic shell cfgMagazines entry that only needs to be used to store an ammo count

#

The actual ammo can be anything in CfgAmmo, doesn't really matter

#

Then set that magazine as the phone weapon's magazine

#

Then you can generate a short id for each player, generate one of those magazines with the ammo count set to the id, and load it into the phone weapon

stable dune
#

Aaa, nice way to do

tough abyss
#

Cool thing with that is that technically players would be able to exchange "memory card" magazines into each-other's phones to read each-other's data

#

Could be an interesting opportunity

stable dune
#

Yeah, amazing.
I will try this out. sounds cool way to set up.
Thanks 🙏

tough abyss
#

No problem, hope it goes well

stable dune
#

I'm going to come and tell you how my case will turn out

frigid oracle
#

is it possible to make a object fade in and out rather than pop into existance?

warm hedge
#

Nope, there is no way to make somehing semi-transparent

frigid oracle
#

darn

warm hedge
#

Unless you make an object very specifically for it

frigid oracle
#

its a user texture I want to fade like a hologram

#

guess I can fake it with several copies of the texture with different transparencies

drowsy geyser
winter rose
winter rose
#

shush, you :^p

little raptor
#

wait they're there. nvm meowsweats

winter rose
#

some are there
not the new {{Note}} thing, only the old <dl><dt> thing

manic sigil
#

I have a selectable role in my project that a player can elect to take, setting a global variable roleTaken to true, and assigning the roleVariable = playerTakingRole for the purposes of the script. There are options to return it, or it will time out in about 30 minutes, both of which will set the global variable roleTaken to false and roleVariable = "" for safety, so the action to take it appears again.

The final case would be if the player disconnects; I see the mission EH playerDisconnected, but im not sure which element I need to compare to roleVariable to see if the player who left was the one who took the role :/

winter rose
#

check if isPlayer ?

#

roleVariable = "" can be replaced by roleVariable = objNull
roleTaken can be replaced by isNull roleVariable

on player disconnection

if (not isPlayer roleVariable) then { roleVariable = objNull };
#

@manic sigil ↑

manic sigil
#

Thats a good way to look at it; I dont need to check everyone leaving if they are Role, I just need to check Role and see if it left.

winter rose
#

lazy way best way 😁

left pine
#

is there any way for change addaction to radio menu? need to change scroll menu to radio for prevent missclick

#

/%FSM<STATE "Re_add_my_action">/
class Re_add_my_action
{
name = "Re_add_my_action";
itemno = 6;
init = /%FSM<STATEINIT""">/"if(isNil ""ace_interact_menu_fnc_createAction"") then {" \n
" _actionID = player addAction[""<t color='#ffffff'>시야거리 설정</t>"",TAWVD_fnc_openMenu,[],-99,false,false,"""",''];" \n
"};"/%FSM</STATEINIT""">/;
precondition = /%FSM<STATEPRECONDITION""">/""/%FSM</STATEPRECONDITION""">/;
class Links
{
/%FSM<LINK "true">/
class true
{
itemno = 1;

left pine
#

using taw view distance

#

like _actionID = player addAction[""<t color='#ffffff'>시야거리 설정</t>"",TAWVD_fnc_openMenu,[],-99,false,false,"""",''];" \n

to _actionID = player ~?

little raptor
#

umm what? did you read that page?

left pine
#

yeah read that

#

[caller, pos, target, is3D, id]

#

so theres no [title, script,

#

na. thanks. rather just asking someone

gusty flume
#

anyone know if its possible to have a script that stop players using specific weapons unless they're in a specific slot for example players in a player slot with variable marksman can use {list of weapon class names} and tells others that try to get them from the arsenal they aren't allowed to use this item

manic sigil
gusty flume
manic sigil
#

Thats just for the vanilla arsenal. Cant say for ACE :x

gusty flume
rough summit
#

How can i get duration of specified animation?

manic sigil
little raptor
#

1 / speed for positive speed

#

-speed for negative speed

rough summit
little raptor
#

actions don't have speed

#

also that doesn't seem like a valid action anyway

rough summit
# manic sigil What are you trying to achieve?

I want to catch the moment when the player's animation is playing and attach a variable to him at that moment for prevent do any actions.
Im using animDone EH, but if the players animation is interrupted, for example, due to a car hitting him, EH didnt fire.

#

For that i need condition ("suggested animdone" || "suggested animtimeover")

#

Got it. thanks

getNumber (configfile >> "CfgMovesMaleSdr" >> "States" >> "AinvPknlMstpSlayWnonDnon_medic" >> "Speed")
winter rose
coarse dragon
#
titleCut ["", "BLACK FADED", 999];  
[] Spawn { 
 
 
["<t color='WHITE' size='.8'>Africa,<br />Civil war. hot bed for terrorist, The U.N. are taking heavy loses, The World decided to help,</t>",-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText; 
 
sleep 12; 
"dynamicBlur" ppEffectEnable true;    
"dynamicBlur" ppEffectAdjust [6];    
"dynamicBlur" ppEffectCommit 0;      
"dynamicBlur" ppEffectAdjust [0.0];   
"dynamicBlur" ppEffectCommit 5;   
 
titleCut ["", "BLACK IN", 5];

The fade to black doesnt work in a trigger, but the text does.. any idea why?

winter rose
#

the dynamic text might be reset by it, try setting a sleep between the two?

hallow mortar
#

The following information is obsolete. Reason: cutText should be used instead.

  • titleCut wiki page
    It doesn't look like you're using the animation capabilities of BIS_fnc_dynamicText, and cutText supports structured text, so by switching to cutText as recommended you may not need BIS_fnc_dynamicText at all
coarse dragon
#

oh

copper raven
#

code works fine for me

#

(apart from the missing })

coarse dragon
#

ha thats why the fade was not working. thanks @copper raven

copper raven
#

the text shouldn't have worked either then, i assumed it was a copy paste issue meowsweats 🤔

coarse dragon
#

i added my own in. but put it in the wrong place#

sullen sigil
#

is there any way to straight up just disable a rope breaking

sullen sigil
#

nvm i already fixed that bug and forgot..?

#

ive spent one and a half hours trying to do this

opal zephyr
#

Is there a way for me to convert a string into a "side"? Im aware of compile and all its down sides, as well as missionNamespace getvariable... but I see that normally used with objects, and no sideNull option exists. Just a grpNull option. Is this something thats possible without using nested if statements?

copper raven
#

use a hashmap

winter rose
opal zephyr
winter rose
#

if you want a correspondence between string > value, yes, use a hashmap
if you just want a string as a side, use compile or something else

#

(and why not store it as a string, or call a function to convert that string value?)

opal zephyr
#

Every forum post I have seen has said to avoid compile at all costs lol. And I'm not sure what you mean with that last message

crude vigil
opal zephyr
copper raven
crude vigil
opal zephyr
opal zephyr
crude vigil
#

Inside your Attributes class, wherever that combobox is, you should be having a Values class, inside that, you can simply display BLUFOR and return 1 from that. Ex:

//Inside some Attribute class that uses control = "Combo" etc.
class Values 
{
  class OPFOR
  {
     name = "OPFOR"; //Display value in 3DEN.
     value= 0; //Value to be passed if chosen.
  };
  class BLUFOR
  {
     name = "BLUFOR";
     value= 1;
  }
...
};
opal zephyr
#

I see what you mean, use a number instead of a word

crude vigil
#

u can use east, west etc as well.

opal zephyr
#

right now it looks like this

name="BLUFOR";
value="BLUFOR";
crude vigil
#

altho maybe that wont work, I would need to read the code of combobox to say something accurate.

opal zephyr
#

If I use numbers I would still need to use a hashmap, unless I can refer to a side by its id?

crude vigil
#

you can refer to a side by its id. east = 0, west = 1, ind = 2, civ=3 etc... It is how it is defined within game.

opal zephyr
#

Ill give that a shot, thanks

crude vigil
#

The reason I gave combobox with number examples is because Im 100% sure it supports numbers. Not sure if it supports side values.

winter rose
#

and BIS_fnc_sideName if needed

opal zephyr
#

Ok, so using a number in the value of combobox doesnt work... I still get an error. Now it says "Type number, expected, grp, object, side, etc"

#

So I guess you cant use units with a number for the side

#

And im not so sure a hashmap will be good for me here, if I use it I would essentially getting allUnits twice every second, multiplied by an unknown number... I can see how that would become unperformative very fast

hallow mortar
#

Why would a hashmap cause you to retrieve allUnits twice a second? It's just a means of quickly converting between "west" and west. The hashmap sharp posted does exactly what you need and doesn't touch allUnits once.

opal zephyr
#

The options are civ, opfor, blufor, independent, and all. The only way for me to be able to loop with forEach is to store the entire second half that I need, example:

forEach "units opfor" (the quotes is what I have to store, because of the usage of all side in the next line)
forEach "allUnits"

#

_
So I can't just swap out the side, I have to swap out the unit as well

#

To include that in a hashmap I would have to write out the word units and allUnits, and wouldnt that actually run the function?

copper raven
#

can you explain what exactly are you trying to do?

winter rose
#

call compile "allUnits" then 😆

hallow mortar
#

Perhaps you could store it as {units east}, and then reference it as forEach (call _side).
Alternatively a switch case:

switch (_side) do {
  case "east" : {
      _units = units east;
  };
  case "all" : {
      _units = allUnits;
  };
};```
opal zephyr
# copper raven can you explain what exactly are you trying to do?

Sorry, I felt like I did.

A player is selecting a side value from a combobox, in this case its in a module.
That value is then stored in the module until runtime when a script runs, that value is brought into the script through _logic getVariable and comes in just fine.

I then need to check if a player of that side is going within a certain distance of an object. To do that I have a while loop updating once a second with 2 a forEach in it for the objects and a nested one for the units of that side. Right not I am getting those units at the time of the forEach, like this: forEach units "side"; so that that list is up to date every time

long bloom
#

Has anyone attempted to Disable the what I can only assume is noclip protection?
The thing that makes you run at Mach Jesus if you're running up a wall.

copper raven
#

where _sideStr is what you get from the logic

winter rose
#

yes, but there is an "all" option

copper raven
#

you should also use inAreaArray probably over having two loops

long bloom
copper raven
opal zephyr
copper raven
#
tag_sidesHashmap = ["WEST", "EAST", "ALL"] createHashMapFromArray [{ units west }, { units east }, { allUnits }];

private _units = call (tag_sidesHashmap get _str);
#

keep in mind it's case sensitive

opal zephyr
#

wont the creation of that hashmap call the code thats in it? i.e. the units west, units east, allUnits

copper raven
#

no

#

they're code values for a reason

winter rose
long bloom
opal zephyr
#

I'll give that a try sharp. Thanks everyone for your help

long bloom
#

Aha - I cannot post videos here, can I?

south swan
#

As in "your speed is extra high when you go up on a steep slope"?

opal zephyr
long bloom
#

Vertical?

#

Turns you into a Nato Spaceforce trooper real quick.

#

I'll upload a youtube clip 'ere

little raptor
#

afaik Arma doesn't impose a speed limit when you're running on a roadway LOD

#

it only does so on terrain

long bloom
#

Uh.
May I DM you this video whilst it uploads?

#

The link when it's ready

little raptor
#

what running?

#

there's no running

long bloom
#

Yeah because I'm getting dragged at mach Jesus up the wall with no player input

little raptor
long bloom
#

Yeah - Like I say

#

80% sure this is Noclip protection?

little raptor
#

maybe blobdoggoshruggoogly

long bloom
#

Any suggestions on how to maybe slow 'er down?

little raptor
#

fake the motion yourself, using setVelocityTransformation

crude vigil
long bloom
little raptor
#

then the problem is in your code? blobdoggoshruggoogly

long bloom
#

What I wanted was to give the player a little control left/right/down as well as having a proper walking animation.

#

Which I can't do if they're not pressed against the wall
Which causes uncontrollable dragging up said wall

opal zephyr
little raptor
#

I've done weirder things and I've never seen what you've shown

long bloom
#

So that video is literally me throwing the rope, hooking up, then taking my hands off the keyboard.

#

As SOON as the player puts feet down on the wall, they start getting dragged up it.

#

No external forces outside of the engine.

little raptor
#

So I'm actually already doing that
you said you're already using setVelocityTransformation

long bloom
#

Which I am, usually, and will be for final implementation.
For that video, and testing, I've commented it out to see if it was causing it - It's not.

crude vigil
little raptor
long bloom
little raptor
#

let me test it for myself. I'm pretty sure you're wrong tho

long bloom
#

Would you like my code?

little raptor
#

no

little raptor
long bloom
opal zephyr
#

Theres gotta be a way for me to be checking if a player is within proximity of my object.
Right now im using a while loop with a sleep, the radius is very small (0.5m) so I need it to check often, but thats bound to kill performance so fast, especially since the check is a foreach for an undetermined amount of objects

long bloom
#

Because I'm literally looking at mine now catapulting me to saturn.

little raptor
copper raven
#

use sqfbin plz

long bloom
#

Absolutely no idea what that is, but I shall if you don't mind pointing me in the right direction!

copper raven
little raptor
#

[player, 90, 0] call BIS_fnc_setPitchBank;
you might want to avoid using that function

#

it's slow

long bloom
little raptor
#

use vector math

#

what trig?

long bloom
little raptor
#

vector math has no trig

long bloom
#

Then I am unsure what Vector math to use -
regardless, can you see the issue?

little raptor
#

you deleted the code... blobdoggoshruggoogly

long bloom
#

I didn't.

#

I assume a mod did because it was long - let me see if I can work out this SQFbin

#

I assume that's how you do that, yeah?

little raptor
#

yes

#

for long codes

long bloom
#

Solid; there you are; thanks for showing me that @copper raven !

little raptor
#

you suddenly teleport the player 3 meters higher

#

is that not the issue?

long bloom
#

When they get onto the wall to prevent them getting stuck in the floor on certain buildings with lips - an issue I ran into when I was using them for testing

#

It's not in the loop, and doesn't result in any velocity changes.

long bloom
little raptor
#

which part of your code detects touching the object?

#

I don't see it

long bloom
#

Line 145

little raptor
#

isTouchingGround
player will never "touch the ground"

#

isTouchingGround is for when you touch a roadway LOD or terrain

#

you touch neither here

sullen sigil
#

isTouchingGround works for objects too

long bloom
little raptor
#

setVelocityTransformation [...vectorDirVisual player, vectorDirVisual player, vectorUpVisual player, vectorUpVisual player
well first of all do NOT use the visual variant with setVelocityTransformation
second of all, if you're trying to walk up a wall why do you use the original dir and up?

long bloom
#

Stick a hint in that code - that part fires every time the player goes boots down

little raptor
little raptor
long bloom
#

No but I know how to put a testing hint into my code.

#

That fires every time the player puts boots on the wall.

little raptor
#

do you use enhanced movement?

#

or some other similar mod

long bloom
#

Yeah, I do - would that effect it?

little raptor
#

yes

#

they put a roadway LOD under your feet

long bloom
#

So that codes still fine, that verification is still sound in the environment I'm using it, no?

little raptor
#

yeah that's 100% enhanced movement's fault

#

verification is still sound in the environment I'm using it, no?
no

long bloom
#

Because if you're then saying that it should be firing all the time, it's not - it doesn't fire in the brief time between hooking up and being boots down

little raptor
#

like I said there's no roadway LOD there

long bloom
#

Nor falling.

little raptor
#

it should be firing all the time
it puts the roadway LOD under your feet when you touch the GEOM LOD

#

it's not always there

#

if it was always there you would never fall

long bloom
#

So what's the issue

little raptor
#

yes

#

I also use the EM

#

but as you see with correct coding you never run into the issue

long bloom
#

You still haven't explained the issue?

little raptor
#

it tries intersection with GEOM LOD from ~20-30 cms above your feet

#

and when it does it puts a roadway LOD there

long bloom
#

And how would that be causing sudden and rapid boosts in speed.

little raptor
#

so you keep teleporting 20-30cm every frame

long bloom
little raptor
#

lineIntersectsSurfaces

#

with GEOM LOD

long bloom
#

So, what, are you just putting a helper object at the players feet and checking for an intersection with the Geom between the helper and the player?

little raptor
#

?

#

what helper?

long bloom
#

I don't know - I was asking you if that's how you did it.

little raptor
#

no

#

why would I waste performance with a helper? blobdoggoshruggoogly

long bloom
#

No idea - how

#

did you do it then?

little raptor
#
onwall = false;
wallnorm = [0,0,0];
wallpos = [0,0,0];
walldir = [0,0,0];
onEachFrame {
    if (isGamePaused) exitWith {};
    if (onwall) exitWith {
        player setVelocityTransformation [
            getPosWorld player,
            getPosWorld player vectorAdd (walldir vectorMultiply 0.25*diag_deltaTime),
            walldir,walldir,
            walldir,walldir,
            wallnorm,wallnorm,
            1
        ];
        player playMoveNow "amovpercmwlksraswrfldf"
    
    };
    _p1 = player modelToWorldWorld [0,0,0.35];
    _p2 = _p1 vectorAdd velocity player;
    _inters = lineIntersectsSurfaces [_p1, _p2, player, player, true, 1, "GEOM", "NONE"];
    if (count _inters > 0) then {
        onwall = true;
        wallnorm = _inters#0#1;
        wallpos = _inters#0#0;
        walldir =  vectorNormalized (wallnorm vectorCrossProduct (player vectorModelToWorld [1,0,0]));
        player setPosWorld wallpos;
    }

}
#

I wanted to add full ability to walk on the wall but I wasn't in the mood so most of the code is redundant

long bloom
#

Virtual helper , I don't understand the p2 part though - why are you adding the players velocity?

little raptor
#

that was just so I can walk up a wall as I move onto it

#

it wasn't the same as your goal

long bloom
#

Makes sense -
Judging by this, did you find or look for a way for a smooth transition from upright to sideways?

little raptor
#

why look or find? just use vector math like I said before

#

let me add it to the code

long bloom
little raptor
#
onwall = false;
wallnorm = [0,0,0];
wallpos = [0,0,0];
walldir = [0,0,0];
transition = false;
transDur = 0;
onEachFrame {
    if (isGamePaused) exitWith {};
    if (onwall) exitWith {
        player setVelocityTransformation [
            getPosWorld player,
            getPosWorld player vectorAdd (walldir vectorMultiply 0.25*diag_deltaTime),
            walldir,walldir,
            walldir,walldir,
            wallnorm,wallnorm,
            1
        ];
        player playMoveNow "amovpercmwlksraswrfldf"
    
    };
    if (transition) exitWith {
        transDur = transDur + diag_deltaTime;
        if (transDur >= 1) exitWith {
            player setPosWorld wallpos;
            onwall= true;
        };
        player setVelocityTransformation [
            getPosWorld player,
            wallpos,
            walldir,walldir,
            vectorDir player, walldir,
            vectorUp player, wallnorm,
            transDur
        ];
    
    };
    _p1 = player modelToWorldWorld [0,0,1];
    _p2 = _p1 vectorAdd velocity player;
    _inters = lineIntersectsSurfaces [_p1, _p2, player, player, true, 1, "GEOM", "NONE"];
    if (count _inters > 0) then {
        transition = true;
        wallnorm = _inters#0#1;
        wallpos = _inters#0#0;
        walldir =  vectorNormalized (wallnorm vectorCrossProduct (player vectorModelToWorld [1,0,0]));
        player setPosWorld (getPosWorld player vectorAdd [0,0,1])
    }

}
little raptor
sullen sigil
#

actual vs intended. methinks its borken

little raptor
#

code?

sullen sigil
#

just edited my msg

ocean folio
#

I see you got that rope to not sag

sullen sigil
#

yup, created a new type of rope which is just super stretchy heh

#

the thing i thought was fixing it only fixed it for shallow angles

little raptor
#

setVelocityTransformation takes ASL

sullen sigil
#

I tried ASL and ended up being teleported into the air

little raptor
#

_playerPos = _playerPos vectorAdd[0, 0, 5];
lol that was a lucky hack meowsweats

sullen sigil
#

...that'd be why 😅

little raptor
#

on VR ASL height of the terrain is 5

sullen sigil
#

one moment then im trying to bloody get rid of atom from all my default apps

#

oh thonk

#

oh yeah obviously cos the pond

#

duh

little raptor
sullen sigil
#

ok better but not optimal i dont think

little raptor
#

make sure everything is ASL

#

I always tell people to ditch ATL

#

they never listen blobdoggoshruggoogly

sullen sigil
#

I just ctrl+h ASL to ATL

#

however now the rope is just never getting deleted

little raptor
sullen sigil
#

uh oh

little raptor
#

createVehicle["CBA_B_InvisibleTargetVehicle", _entityPos];
that needs AGL for example

sullen sigil
#

oh with setPosAGL right

little raptor
#

so use ASLtoAGL if _entitPos is AGL

little raptor
sullen sigil
#

sad

winter rose
# little raptor I always tell people to ditch ATL

ATL makes sense, if the terrain is not granted to remain unchanged
otherwise I agree, ASL makes sense… hoping the terrain elevation is set to 0 (otherwise zomg I don't want to think about it if it offsets the results)

little raptor
#

ATL is never useful imo.

sullen sigil
#

what actually is the difference between ATL and AGL? roadway LODs again?

little raptor
#

e.g. here he does _velocity = (_playerPos vectorFromTo _entityPos) vectorMultiply 10;

#

in ATL it would be wrong

little raptor
#

AGL is same as ATL on terrain

#

on sea AGL is the same as ASLW

sullen sigil
#

oh right

little raptor
#

roadway LODs again?
that's AGLS

sullen sigil
#

do i want all my helpers to be using AGL

#

i'd assume yes?

little raptor
#

unless you set their positions manually (using setPosASL), convert them to AGL when you use them with createVehicle

sullen sigil
#

i think i setpos for all of them

little raptor
#

if (_entityPos select 2 < 9) exitWith {systemChat "You cannot ascend to the floor!"; ropeDestroy _projectileRope;};
might want to fix that too

sullen sigil
#

yeah when going through this by hand i get the same as ctrl+h to asl i dont think i understand properly

little raptor
#

if _entityPos is ASL that value of 9 makes no sense

sullen sigil
#

oh right i'd want it as relative to player or something wouldnt i

#

no i wouldnt

#

i think i understand what i mean

sullen sigil
#

i want _entityPos to be AGL in that case wouldn't I?

little raptor
#

no?

#

idk

sullen sigil
#

I dont want them to be able to use it below 10 meters above the ground as that causes fuckiness

#

(and it's not meant for that)

little raptor
#

then yeah AGL

sullen sigil
#

gotchu

#

so i'd want ASLtoAGL for _entityPos

winter rose
sullen sigil
#

ok so that doesnt work as intended

#

i think i want getPos as it needs to be above objects too

little raptor
#

I don't know what the point of that was blobdoggoshruggoogly

#

I dont want them to be able to use it below 10 meters above the ground as that causes fuckiness
it makes no sense to me

sullen sigil
#

to stop people shooting it at the floor and the script running and putting them under the floor :p

little raptor
#

then it means relative to player

#

not AGL or AGLS

sullen sigil
#

person shoots the grenade at floor
script tries to move person to grenade impact below the floor

winter rose
#

if getPos _stuff select 2 < 0.1 ? if you mean floor as all floors, not just ground

#

ooor check that there is room below where it's shot
anyway, maths

sullen sigil
#

yeah as in all floors

#

except iirc i had issues with this before when the entity was already gone

#

wait nvm

#

derp moment

#

uhhhhh

#

still aint workin when using getpos either

#

it works against terrain just not against objects

#

let me just clip this its easier

little raptor
little raptor
#

how can the script put them under the floor?

sullen sigil
#

ye

#

shooting to floor sinks you

little raptor
#

just check a line intersection in front of the player

#

I assume you still want to allow going downwards?

sullen sigil
#

nein its an ascension cable not a descension cable :p

#

but if the player shoots upwards and it lands on top of a roof for example

#

they go through the building which is also bad

#

its meant for hitting overhangs and such

sullen sigil
little raptor
little raptor
#

if (_entityPos#2 < _playerPos#2) exitWith {...}

#

(both must be ASL)

sullen sigil
#

yeah but if the player shoots on top of an object they'll go through it too

long bloom
little raptor
#

sure

sullen sigil
#

like they shoot upwards and the grenade comes back down and lands on the top of an object theyd just go straight through

#

searching above the nearest object would stop that from happening surely

long bloom
#

Plugged it directly in to see the effect.
A few seconds after you start climbing, your camera freaks out, your gun disappears in first person and you can't see yourself in third

little raptor
#

just use lineIntersectsSurfaces

little raptor
#

let me test it again

sullen sigil
#

so if lineIntersectsSurfaces [_entityPos, (_entityPos vectorDiff [0,0,9])] returns anything then i'd exit right?

little raptor
#

if line intersects between player and entitypos

sullen sigil
#

i'll do both :p

little raptor
#

doesn't the player move linearly?

#

it looks linear in the vid

sullen sigil
#

yeah but there may not be anything between the player and the ground

little raptor
#

then do 2 intersections

sullen sigil
#

its setvelocitytransform so i dont know the maths that well

little raptor
#

one from [0,0,1.7]

#

another from [0,0,0.1]

sullen sigil
#

ya do something like

lineIntersectsSurfaces [_entityPos, (_entityPos vectorDiff [0,0,9])] || lineIntersectsSurfaces [_entityPos, _playerPos]``` right?
little raptor
#

player modelToWorldWorld

little raptor
#
if (count lineIntersectsSurfaces [player modelToWorldWorld [0,0,1.6], _entityPos, player, player, true, 1, "GEOM", "NONE"] > 0 || {count lineIntersectsSurfaces [player modelToWorldWorld [0,0,0.1], _entityPos, player, player, true, 1, "GEOM", "NONE"] > 0})
sullen sigil
#

i dont particularly have much understanding of that but i'll try it regardless

little raptor
#

another from where his feet would be

#

you can add a 3rd for torso blobdoggoshruggoogly

sullen sigil
#

shooting the grenade at the feet on an object seems to just make it travel along the surface until it hits a wall 🤔

little raptor
#

so? thonk

sullen sigil
#

it also seems to be incredibly hit and miss on the underside of objects

#

Ok can work around that by just subtracting 0.5 from _entityPos Z before doing that

#

however that doesn't fix being able to shoot at walls which are <9 meters above the floor

little raptor
#

above the floor?

#

or player?

sullen sigil
#

above the floor

little raptor
#

what does it have to do with floor?

sullen sigil
#

if its above the floor the player goes into the ground also

#

actually let me double check that theory

#

ok this works decently enough i think

#

now i just need to get the rope cutting again

little raptor
#

rotated it by 10 degrees and it looks fine now

#
_side = walldir vectorCrossProduct wallnorm;
        _rot = [[1,0,0],[0,cos 10, sin 10], [0, sin -10, cos 10]];
        _rotatedAxes = matrixTranspose (matrixTranspose [_side, walldir, wallnorm] matrixMultiply _rot);
        wallnorm = _rotatedAxes#2;
        walldir = _rotatedAxes#1;
long bloom
sullen sigil
#

i suppose this is my lesson to stop testing stuff exclusively on vr terrain

#

shooting the grenade on the underside of objects is still really really dodgy though

little raptor
long bloom
little raptor
#

put it at the end of the if (count _inters > 0) then { scope

long bloom
#

Solid - another quick thing. I see you're playing the walking animation - which doesn't let you look around or aim your rifle anywhere but straight.

Is there a necessity to that anim, or is it just there for you to be able to video it form third person?

little raptor
#

no it was just so that the player wouldn't play the falling anim

long bloom
#

So as long as you're bellow (It's 100M, freefall, right?) With out without that line it'll look the same?

sullen sigil
#

100m is freefall yes unless youre rc build 👽

little raptor
long bloom
#

How do you mean?
Does this not work the same way pitch does - that if you're close enough to the wall the player can walk on it as if it was ground?

little raptor
#

which doesn't let you look around or aim your rifle anywhere but straight.
that's not related to animation

little raptor
sullen sigil
#

...this may be an infuriating question however for this use is there any point in me using setvelocitytransformation over just setvelocity in the direction of _entitypos

little raptor
little raptor
sullen sigil
#

but the collisions make me want to burn kermit the frog alive

sullen sigil
long bloom
# little raptor I'm confused now. what are we talking about again?!

Alright there's two separate points here I think

  1. With the older method - setting the players Pitch, as seen in my video when the characters not being pulled around, they can impact and walk around on the walls without the use of an animation - as if they were standing on ground. I assume the way you've set this up doesn't do that?
  2. If its not the animation - why can't you aim side to side in this variant?
little raptor
#
_fnc_hasIntersect = {
  params ["_p1", "_p2"];
  _p2 = _p2 vectorAdd (_p2 vectorFromTo _p1 vectorMultiply 0.1);
  count lineIntersectsSurfaces [_p1, _p2, player, _entity, true, 1, "GEOM", "NONE"] > 0;
};
if ([player modelToWorldWorld [0,0,1.6], _entityPos] call _fnc_hasIntersect || {[player modelToWorldWorld [0,0,0.1], _entityPos] call _fnc_hasIntersect})
little raptor
sullen sigil
#

bruh moment

long bloom
little raptor
#

setVelocityTrans

#
player setVelocityTransformation [
            getPosWorld player,
            getPosWorld player vectorAdd (origdir vectorMultiply 0.25*diag_deltaTime),
            walldir,walldir,
            walldir,walldir,
            wallnorm,wallnorm,
            1
        ];
long bloom
#

Aha.
So I understand the first half of thats what causes the smooth turn - the bottom half locks the dir?

little raptor
#

that part does not smooth anything

#

it just moves you up (in origdir direction)

long bloom
#

Wait, then I'm confused

#

I thought that multiplication was what caused the tilt, no?

#

The pitching, is probably a better term

little raptor
#

that multiplication was what caused the tilt, no?
if you mean
origdir vectorMultiply 0.25*diag_deltaTime
that just scales the origdir vector

long bloom
#

I did but I get that now, with you now.

#

So I can sub in that bit for the older bit that locked rolling and turning but not looking side to side, right?

little raptor
#

if you just use vectorDir and vectorUp you can turn fine

#
player setVelocityTransformation [
            getPosWorld player,
            getPosWorld player vectorAdd (origdir vectorMultiply 0.25*diag_deltaTime),
            walldir,walldir,
            vectorDir player,vectorDir player,
            vectorUp player,vectorUp player,
            1
        ];
#

but you won't be facing up the wall anymore

long bloom
#

So, I should use pitch then, no?

little raptor
#

if you mean setPitchBank thing, I just don't recommend it

#

you can probably fix it by creating a new walldir vector

#

in the same plane as the wallnorm

#

but not sure if Arma can handle turning at that angle

#

let me try it

sullen sigil
#

better than before however at longer ranges its taking like 6 shots

little raptor
#

but it's kind of glitchy

long bloom
#

I just tried pitch - worked alright. Why would you reccomend against it?

little raptor
#

slow

long bloom
#

Is that with the walking anim?

little raptor
#

yes

#

I'm just walking on the wall now meowsweats

#

and rotating the aim

long bloom
#

How'd you manage that?

little raptor
#
if (onwall) exitWith {
        walldir =  vectorNormalized (wallnorm vectorCrossProduct (player vectorModelToWorld [1,0,0]));
        player setVelocityTransformation [
            getPosWorld player,
            getPosWorld player vectorAdd (origdir vectorMultiply 0.25*diag_deltaTime),
            walldir,walldir,
            walldir,walldir,
            wallnorm,wallnorm,
            1
        ];
        player playMoveNow "amovpercmwlksraswrfldf"
    
    };
sullen sigil
long bloom
#

Huh. Throws up an error for me.

#

player setVelocityTransformation [ "Three elements expected, got 0"]

little raptor
#

you probably put it in the wrong spot?

long bloom
#

Did it move from its place as the second scope?

#

Huh - I'll check what I had wrong here, definitely something, that's working fine now.

sullen sigil
#

Ok I think I've got my shit all working now

#

Need to test again in a moment but beyond MP testing I think that's me done

#

Sans messing with rope and offsets

ember wing
#

For HC use I have it on the server I bought. But I feel like things are acting differently since I have HC on (headless client) we are using Alive. Is there anything I need to do to make sure the HC if focusing where it needs to?

granite sky
#

A headless client doesn't do anything unless you put AIs or scripts on it explicitly. I don't know whether Alive is capable of that or not.

#

Given how Alive works, that's very much its responsibility.

ripe sapphire
#

it doesnt have the global/local logo

granite sky
#

Yes, it does.

#

well, maybe questionable if the marker doesn't exist locally...

copper raven
ripe sapphire
#

ok thanks, i wanted global but wasnt sure since there was no logo

ripe sapphire
#

thanks =)

tough abyss
#

is there any way in vanilla to spawn body parts or hide parts of a body?

#

like maybe with setobjecttexture and selectons or something?

#

if anyone knows

pulsar bluff
#

no

#

like , hard no

tough abyss
#

ok

tough abyss
#

thanks

ripe sapphire
#

no thats my player

drifting portal
#

you can only change vest texture right?

ripe sapphire
#

no vest textures need to be changed by addon

drifting portal
#

well

#

as far as I remember human characters only have 1 texture

#

that you can change

#

for example you can't change their hands

ripe sapphire
#

not really, it depends on the model

drifting portal
#

model?
can you give one where you can change something other than the torso?

ripe sapphire
#

the tee model

#

combat uniform tee

sharp grotto
#

Do some destroyed map objects get simulated by the server & client somehow, because it looks like?!
I just tested destroying many terrain objects (houses,fences etc via setDamage) in a bigger radius (400m), and the simulated object counter of the server & client basically increases drastically.
Also the client performance suffers massively even if not near the destroyed objects ? meowhuh

With counter i mean the result from this on the server & client side.

{simulationEnabled _x} count allMissionObjects "";

I could get rid of some simulated objects (~40%) by running this on the server.

{  
 _x enableSimulationGlobal false;  
  
} foreach allMissionObjects "RUINS"; 

Now the question is what are the other types or why do ruins and the other remainings, have do be simulated at all ?

delicate lotus
#

I have a problem with getAttackTarget and assignedTarget.
In my scenario I have a jet on east team, and me + an apc (seperate groups) on the west team. east is hostile to west.
The jet seems to always have me as a assigned target unless I am captive, then it has no target at all (both commands return objNull) even though it is engaging the APC in both cases (captive true / false).

#

Is that intended behaviour?

#

It also seems to differ between the unit / the vehicle the unit is in.

delicate lotus
#

if (...) exitWith {do This} should work

winter rose
#

@granite haven ↑

or just else, that's its purpose 😄
but exitWith avoids a scope, so I would go for that too

quiet gazelle
#

is there an easy way to log stuff in my scripts without having to go through the log file that also logs everything else?

little raptor
#

build an extension that does this

#

there might be existing ones

long bloom
# little raptor https://sqfbin.com/ozexinorasemuhisojew

So I've been playing around with this - have you played around with this system much? The idea of rotating the player.

Every attempt I make at being able to change the direction a second time, return to ground, or for example require a keypress to continue going up (using DIK keys) it fails in one way or another.

little raptor
#

no. I just wrote it last night

#

change the direction a second time
wdym?

#

or for example require a keypress to continue going up (using DIK keys) it fails in one way or another.
this should be easy

long bloom
#

Which I can do if I swap the last if - the one that gets the vectors, to the first part of the code - but then you don't get the transition, which, eh, not the biggest deal

long bloom
#

I think I know how to return the player to the ground though - by using a lineintersect looking for a Roadway LOD in front of the player, right?

#

Then just an empty onEachFrame

little raptor
# long bloom Which I can do if I swap the last if - the one that gets the vectors, to the fir...

well if you try to hack things together ofc things end up broken. try to understand what each part does and adjust it to your purpose

either you immediately fell off the wall or were stuck and couldn't move if you want because it's constantly applying the vector to keep you stuck to the wall.
use a keyUp and keyDown to detect key presses. when movement key is not pressed, all you have to do is use a multiplier with 0.25 * diag_deltaTime. set that to 0 and the unit will not move. also apply the stop animation
I think I know how to return the player to the ground though - by using a lineintersect looking for a Roadway LOD in front of the player, right?
yes

little raptor
#

it was just for testing

#

use properly stackable event handlers

little raptor
#

if nothing under the feet, rotate 90 degrees around player's X axis
and then check for roadway LOD intersection to end the wall walk

long bloom
#

Yeah - I guessed as much - basically drawing a line down in front of the player, right?