#arma3_scripting

1 messages ยท Page 271 of 1

wispy cosmos
#

Pretty much what I said earlier: a balance between practice and practicality.

#

@halcyon crypt

#

Not exactly using SQF to deliver lightning fast computations.

#

For larger systems, of course you'll want to get the most bang for your buck though -- and this boils down to the programmer's own judgement on what he should do.

tough abyss
#

I use scheduled single function spawn

#

then call inside it the rest of the way.

#

This way the spawn is only a single thread.

#

and it has wthin it, everything else staying within a single thread.

#
    [] call myTag_fnc_myFunc1;
    [] call myTag_fnc_myFunc2;
    [] call myTag_fnc_myFunc3;
};
#

This way @wispy cosmos it keeps it all within the same thread.

#

and if the functions are just proceedures doing something

#

I still get them to return a value

wispy cosmos
#

Yep, same here @tough abyss

tough abyss
#

Namely a , true or false.

#

Flag to say failed yes or no.

wispy cosmos
#

With my game mode I'm working on, I have one thread running per machine which handles everything within its gameloop

tough abyss
#

You seen BMR insurgency?

wispy cosmos
#

I haven't

tough abyss
#

1200 VM threads

wispy cosmos
#

๐Ÿ˜

little eagle
#

Just wanting to point out that
It's going to give you the results the fastest (since it executes as fast as your CPU allows, and isn't tied to your framerate IIRC). Sometimes you may want that, sometimes you won't.
is completely wrong

tough abyss
#

๐Ÿ˜ฑ

wispy cosmos
#

@little eagle I thought we already covered that earlier?

#

No need to revive it

#

I already admitted that I was wrong

tough abyss
#

Fun fact. If AI spawning is called within the unscheduled environment

#

The game hitches.

#

Very badly.

wispy cosmos
#

makes sense

#

in an unscheduled env, it's waiting for the createUnit command to finish executing

tough abyss
#

Yep.

#

Weather functions also cause massive hitching.

#

If called in unscheduled.

little eagle
#

no need to make things less "readable" for a 0.00001ms (obviously don't know the number.. ^^) improvement
It would be irrelevant if it were that small. But it isn't. The exact figures depend on what you're doing.
It's also not a simple matter of replacing while with for or eachframe
It's deeper design decissions that actually make a difference.

tough abyss
#

This is why I verify the AI has complete it's initialisation.

wispy cosmos
#

@little eagle yea. my argument was that it's not some simple one-size fits all solution. It's all about one's judgement

tough abyss
#

Gear saving scripts should run completely async from anything else.

#

But, got to be careful about that as well.

#

Pseudo-code Quiksilver.

#

My new best friend.

little eagle
#

There is no problem with you having your scheduled poll loop in your mission
But now imagine every addon uses these.
Or one of these in every component of the addon.
It would suck and break everything else.

wispy cosmos
#

of course

#

that's why it's up to one's judgement whether to go that route or not

tough abyss
#

Queue DS's are not hard to implement I went over-kill and wrote functions for them.

#

The queue DS works though.

little eagle
#

There. The goal is to explicitly not break missions or addons.

wispy cosmos
#

like with my mission, it's small scale, very little computation occurring

tough abyss
#

mission-design you need to live a lot of the time in scheduled.

wispy cosmos
#

and likely not to be used with lots of script heavy mods

tough abyss
#

Also unscheduled.

#

From what I've noticed doesn't throw errors.

#

When there is an error.

wispy cosmos
#

so I can get away with not worrying so much about using cutting-edge scripting techniques

tough abyss
#

So sometimes you have to spawn the code.

#

To actually see the "ERROR in LINE # "

little eagle
#

unscheduled does not throw errors for referencing undefined variables, which can make for simpler code, but also harder to find certain bugs.

tough abyss
#

^

wispy cosmos
#

^

#

lol

tough abyss
#

Been there done that.

wispy cosmos
#

I realized that recently

little eagle
#

The real pain for someone that makes API functions is, to test them in either environment

tough abyss
#

E.g

#
params [
    ["_object",objNull],
    ["_variableName","", [""] ],
    ["_state",false],
    ["_isPublic",false]
];

missionNamespace setVariable [ _variableName, _state, _isPublic ];

diag_log format [ "_object: %1", _object ];

_HandlerID = _object addEventHandler [ "killed", format ["
    diag_log 'EH Fired';
    missionNamespace setVariable [ '%1', %2, %3 ];
    'Main Mission complete, give us 60 seconds and we will start the next' remoteExec ['hint',0,false];
    ",_variableName,true,_isPublic]];
#

Without qoutes around the '%1'

#

It complained.

#

"undefined" no errors...

wispy cosmos
#

Can you actually have a variable named %1?

tough abyss
#

It did..

little eagle
#

it only works, because it's in another format

tough abyss
#

It works perfectly.,

wispy cosmos
#

Wouldn't %____ be an invalid var name?

tough abyss
#

Fires perfectly too.

#

No more while loop for any blow up objective I want.

#

Just invoke that function.

#

On ANY destroyable object.

#

I have a system thats completely EH driven.

wispy cosmos
#

I think that's a better way to go

#

you only execute things when needed

tough abyss
#

It is I've noticed EH's execute differently to other things.

#

This is flexible though...

#

I can give any Global variable.

wispy cosmos
#

race conditions are the worst

tough abyss
#

So I can invoke it for many objectives.

little eagle
#

-2 doesn't work for local hosted MP

thorn saffron
#

anyone good at scripting AI?

lavish ocean
#

fast excerpt from recent DEV branch builds Added: A new terrainIntersectAtASL script command Added: A new enableWeaponDisassembly script command Added: New setFlagAnimationPhase and getFlagAnimationPhase script commands Fixed: the TurnIn / TurnOut Event Handlers would return [] for the driver turret (instead of [-1]) Added: A new isSimpleObject script command Added: Support for randomly generated values based on a seed (random command) Added: A new "BuildingChanged" mission Event Handler ...

wispy cosmos
#

is that to detect if windows break in buildings, etc?

#

btw, I love it when new commands come out! ๐Ÿ˜„

#

never know what people come up with using those

#

^^

lavish ocean
#

@tough abyss it's to detect model replacement (sections collapse, ruins etc.)

wispy cosmos
#

perfect! @lavish ocean

#

I actually needed that for my BloodLust mod

#

I realized that the Killed EH didn't do the job for detecting when a building was destroyed, because some buildings had partial destruction.

wispy cosmos
#

That'd be very useful ^

tough abyss
#

@wispy cosmos But, the kill'd EH did detect, my objects destroyed?

wispy cosmos
#

@tough abyss I think there are some buildings that don't trigger it if they have partial destruction.

#

Could also just be an issue with some logic in my code

tough abyss
#

Everytime I try enabling DynamicSimulation i get thrown expression errors

#
"Group" enableDynamicSimulation true;
"Vehicle" enableDynamicSimulation true;
"EmptyVehicle" enableDynamicSimulation true;
"Prop" enableDynamicSimulation true;
"Group" setDynamicSimulationDistance 2300;
"Vehicle" setDynamicSimulationDistance 2300;
"EmptyVehicle" setDynamicSimulationDistance 300;
"Prop" setDynamicSimulationDistance 100;```
#

was what i tried

#

Danke

wispy cosmos
#

the joy of finding a function that does everything you need

#

โค BIS_fnc_invAdd

#

oh oh oh, it's magic!!!!

wispy cosmos
#

[unit, "H_MilCap_blue"] call BIS_fnc_invAdd;

#

^ returns false, even though it put the hat on my character

#

works for weapons and mags just fine though

#

seems headgear isn't being checked properly

#

welp, I guess I better leave our hats and shit from my mission >.<

#

for now at least

#

It also replaced my weapon and returned false

#

time to work around this :C

tough abyss
#

Wonder if Dynamic Simulation will improve FPS in non-ai missions as well

slim yacht
#

@everyone With zeus, how do I only make the soldiers in the helicopter get out when landing, and not the pilots?

tough abyss
#

Make them transport unload

#

On the waypoint

slim yacht
#

Tried that

#

They jumped out to their deaths

tough abyss
#

Did you add a delay?

#

To the next waypoint after the unload transport?

slim yacht
#

What

#

Should I just do

#

A land

#

Unload transport

#

And then the helicopter and soldiers go their ways?

#

It's not landing

#

It's hovering above the ground

#

Actually landed now

#

The troops wont get out

#

;-;

tough abyss
#

Set an unload then away from it set a "Wait time"

#

For where the helicopter flies away.

#

damn that @ everyone usage.

#

@tough abyss from what i read it should also improve non-ai missions

#

Thats good to know.

vague hull
#

@tough abyss from a technical point of view,it should improve any mission with a high amount of AI,vehicles and or objects,

One of those there or any combination results in low FPS at high counts so yeah.. I think the dynamic sim will help, but let's not freak out. I guess it won't give you an amazing frame boost and it could cause a lot of trouble when set up wrongly

open vigil
#

Good thing "everyone" is disabled for normal users. It's Very poor form to use it.

tough abyss
#

Its been available for a while in many mission frameworks. This might be a bit more efficient but its got the same trade offs and its not going to solve the issues with client side performance from what I have seen, it barely has an impact on the problem we have.

thin pine
#

Try the EH EpeContactStart

torn jungle
#

I was wondering if it was possible for the Swivelling Target to stay down just like the regular popup targets, until i call for their anim to pop back up.

kindred kayak
#

For anyone using BI's new revive implementation, is there a way to control how much health a revived player receives? It's defaulting to set damage = 0.

tough abyss
#

onPlayerRespawn.sqf @kindred kayak

#

It fires when a player respawns so I assume that because Revive template is a respawn template

#

it means that it should be firing onPlayerRespawn.sqf when you revive someone

kindred kayak
#

Interesting. So something like MPKilled won't fire, but it still calls the respawn event post-revive.

#

Now to find where they configure the text that displays as you approach an injured person. Doesn't seem to be RscRevive.

tough abyss
#

Test if it does.

#

I am assuming it might.

#

Untested.

#

feedback.fsm might be what your looking for?

kindred kayak
#

Yes, it fires the respawn event

#

That solves the health part, however it's not clear which controls are being used to display information like "Hold Space to revive"

#

And can't find them in the localized strings.

kindred kayak
#

Seems like they're in the engine.

vapid frigate
#

I'm guessing it wouldn't have the 'space' in the localized strings

#

it would probably get that from control settings

tough abyss
#

Lets see what Tanoa Zeus does in the 64bit executables.

#

Ouch...

rancid ruin
#

is there any way to effectively disable gravity on a player?

#

to be able to suspend a unit in mid-air without falling

vital onyx
#

setmass?

rancid ruin
#

can't make an object invisible, and units still fall with setmass

tough abyss
#

Reverse mass?

rancid ruin
#

and disablesimulation means no animations are played

vital onyx
#

you can try to create a sphere (used in training missions) hide it, and then attach player or other unit to it

#

anyway

#

I am back :)

rancid ruin
#

ah that's not a bad idea, nice one

#

i don't need to be able to control the player, but if i did, that'd probably be impossible right?

#

like hiding one of the quay pieces in mid-air that you could run around on

vapid frigate
#

i do that in the gear selector i made.. but i had trouble attaching the player to most objects

#

for some reason it works properly with a flag though

#

i just attach the player 30m above the flag so you cant see it

rancid ruin
#

yeah, gear selector, you know what i'm doing

#

will try a flag if i get stuck, thanks

vital onyx
#

there also an invisible wall object in vanilla, you can also play around and build a transparent box and place player inside

torn jungle
#

When respawn is enabled, is it possible for a player to be able to select spawning location from both preset locations AND his location of death? What i mean is that in the spawn location map, you can select the usual locations, but you can also select your previous location before dying.

vital onyx
#

you may add an event handler to his death, and add additional respawn point using position of a dead body

opaque topaz
tough abyss
#

anyone do experimenting with nearEntities/nearestObjects/etc, regarding Z? wondering if it checks around a given position with infinite height, or if it checks in a sphere (with given radius and position). if the latter, is the input position in ASLW?

jade abyss
#

Sphere-like

tough abyss
#

ty

tender root
#

(in the params)

torn jungle
#

@vital onyx @opaque topaz Am i in the right track?

#

player addEventHandler ["killed", {_this exec "addrespawn.sqf"}]

//addrespawn.sqf
_bodypos = getpos player;
[player,_bodypos] call BIS_fnc_addRespawnPosition;

tough abyss
#

that can be documented somewhat better on the biki

#

@torn jungle use execVM for .sqf. The "respawn" event handler has the corpse object, which you may want to be able to know the death position.

#

@torn jungle or you could use "Instant" as the respawn template in the description.ext

#

You spawn where you died I believe

#

Haven't used it in ages, but I think that is right.

torn jungle
#

@tough abyss But "respawn" is when youve clicked respawn on the location selection screen right? I need to create the respawnposition (so that you can select it) before that.

#

So i thought id create the spawn position using "killed" then remove that spawn position on "respawn"

tough abyss
#

I don't think there is a respawn dialog, but that may have come after I last used it.

#

I would test that though, might get the result you want.

torn jungle
#

@tough abyss yep instant does that ๐Ÿ˜ƒ but i want the player to be able to SELECT respawn locations INCLUDING where he dies. So it cant be the instant respawn mode. It really has to be "base".

tough abyss
#

In that case I don't think that is what you want lol

torn jungle
#

Does the "respawn" event handler trigger AFTER you've spawned or is it already called while you are selecting a respawn position?

tough abyss
#

I'm guessing it doesn

torn jungle
#

because "killed" event handler doesnt have a corpse argument ๐Ÿ˜ฆ

tough abyss
#

t happen until you hit respawn

#

Just make a file in the root of the mission called "onPlayerRespawn.sqf"

#

It is triggered on respawn

#

in the "killed" event handler, it's possible that the unit (_this select 0) still refers to the corpse, BEFORE you click respawn on the dialog.

torn jungle
#

will test ๐Ÿ˜‰

tough abyss
#

yes

torn jungle
#

hopefully

#

before i do that, does this make sense?

#

_bodypos = getpos player;
[player,_bodypos] call BIS_fnc_addRespawnPosition;

tough abyss
#

Just put 2 units in the editor, load it up, add an event handler to them that does systemChat format [%1, getpos this]; and then kill the unit.

#

editor doesn't do respawn

#

You were worried about the event handler "Killed" not returning the proper position of the corpse

#

Zaf was.

#

That is a way to check. controlled environment

#

"killed" will have the position of the corpse in the editor regardless, since it's not gonna do any respawn functions

opaque topaz
#

player addEventHandler ["killed", {_this call compile preprocessFilelineNumbers "addrespawn.sqf"}]

//addrespawn.sqf

params ["_unit", "_killer"];
_bodypos = getPos _unit;
[_unit, _bodypos] call BIS_fnc_addRespawnPosition;
tough abyss
#

looks good

opaque topaz
#

problem now is those respawn positions will be added and will acrue and not automatically be removed

torn jungle
opaque topaz
#

yes use a respawn EH and remove the respawn position

tough abyss
#

just use myLastDeathRespawn = [_unit, _bodypos] call BIS_fnc_addRespawnPosition;

#

Then use myLastDeathRespawn call BIS_fnc_removeRespawnPosition;

#

In onPlayerRespawn.sqf

torn jungle
#

sorry @opaque topaz can you give quick explanation on why call compile preprocessFilelineNumbers INSTEAD of execVM?

tough abyss
#

I think (?) execVM reads the file each time. the preprocessFilelineNumbers helps to optimize.

#

Well that method is calling it every time.

#

If you want to save time on that, call compile it once in the init and call it differently.

opaque topaz
#

so in mission root folder...
onPlayerKilled.sqf

player addEventHandler ["killed", {
    params ["_unit", "_killer"];
    _bodypos = getPos _unit;
    _respawnInfo = [_unit, _bodypos] call BIS_fnc_addRespawnPosition;
    _unit setVariable ["respawnInfo", _respawnInfo];
}];

onPlayerRespawn.sqf

params ["_newUnit", "_oldUnit"];
_respawnInfo = _oldUnit getVariable ["respawnInfo", []];
_respawnInfo call BIS_fnc_removeRespawnPosition;
tough abyss
#

I don't see the need to use set and get variable, just use a local variable.

opaque topaz
#

the execVM command has delay depending on how many other scripts are in the queue and how busy VM is. execVM compiles and adds the script to the scheduler queue

#

setVariable is there to make sure the scripts get the right parameters

tough abyss
#

And it wouldn't in a regular local variable?

opaque topaz
#

also using setVariable because the code is separated into different files

tough abyss
#

Local variables are known across all scripts.

opaque topaz
#

no they are not

#

global vars are

tough abyss
#

Well, sorry, local to the machine.

opaque topaz
#

local vars are local the file and machine

cerulean whale
#

Anyone got an idea why the debug console doesn't work in my mission? I've ran in to this problem before and can't remember how I fixed it.... It opens fine and I can watch variables but I can't execute anything. Anyone know the problem?

opaque topaz
#

using setVariable and getVariable makes his event handler durable as well so nothing should really happen or break

tough abyss
#

Script 1: myVariable = 1;
Script 2: finalVariable = 2 + myVariable;
Script 3: diag_log format [%1, finalVariable];
This should work just fine...

opaque topaz
#

in case the event scripts are executing on different machiens for some reason

cerulean whale
#

dude.... he wants to get/set variable so it is local to that objet

#

and scripts

#

if he uses a public variable it is just a pain

tough abyss
#

In this instance, it is all local data

cerulean whale
#

he is doing it the right way

tough abyss
#

He isnt setting a respawn for other units.

cerulean whale
#

He wants it for that unit alone...

tough abyss
#

Exactly.

opaque topaz
#

there is such minimum overhead as well for setVariable and getVariable I don't understand why it's such a big issue. I use setVariable and getVariable to make sure event scripts are using the correct objects

cerulean whale
#

@opaque topaz Is doing it the right way....

tough abyss
#

I wasn't saying it was an issue, I was simply saying for conciseness, it is not needed.

cerulean whale
#

Anyone know about this?; Anyone got an idea why the debug console doesn't work in my mission? I've ran in to this problem before and can't remember how I fixed it.... It opens fine and I can watch variables but I can't execute anything. Anyone know the problem?

tough abyss
#

Never had that issue before ben.

#

What are you trying to execute?

#

even something simple like skipTime 10 doesn't work?

#

Editor? Server? Description.ext debug set correctly?

cerulean whale
#

ye. description.ext does have enableDebugConsole = 1; it's kinda weird

#

And It's server

opaque topaz
#

so you're in MP environment on a dedicated server and debug console isn't working?

tough abyss
#

Are you trying to execute unpacked scripts?

cerulean whale
#

@opaque topaz ye. @tough abyss Nothing works.... testVariable = 1; doesn't even work

tough abyss
#

Interesting, never had that happen before.

opaque topaz
#

so the console UI is up and in front of you but when you execute something in the console it doesn't work?

#

@cerulean whale

cerulean whale
#

ye

opaque topaz
#

what exactly are you inputing into the console and where are you executing? Server, local client, global?

cerulean whale
#

nothing works and all 3 of them dont work

#

e.g. thisVariable =1;.... doesn't write... player setDamage 1; - doesn't work

#

etc

#

I guess I'll just make a custom console dialog lol

opaque topaz
#

try restarting your game and your server. Other than that idk

#

what mods are you using?

#

that could possibly contribute to your issue

jade abyss
#

@cerulean whale Let me guess, you are working with remoteExec(call)?

cerulean whale
#

As in, debug console does not work

#

nothing works

jade abyss
#

+having the FilterList active?

cerulean whale
#

as in... nothing in debugConsole works

jade abyss
#

Thats not an answers

cerulean whale
#

emphasis on the 'nothing' part

#

I execute a command

#

it doesnt work

#

that's the bottomline

jade abyss
#

Are you work with/use RemoteExec(call)?? Yes or No?

cerulean whale
#

@opaque topaz no mids

#

mods*

#

No.... There are remoteExec's in my mission but I'm not executing them

jade abyss
#

Is the Filter setup for it?
(remoteExec "whitelist")

#

Can't remember the name atm

cerulean whale
#

yeah

#

It's all setup

jade abyss
#

Disable that.

#

Then the Console will work again

#

Make it to non-Whitelist thingy (no restrictions)

cerulean whale
#

@jade abyss Sorry that I took ages to reply, I was justing testing a new script. Thanks man, that worked.

tough abyss
#

So is remoteexec better for performance?

#

Significantly?

tough abyss
#

Just functions in general

dusk sage
#

@cerulean whale To be able to use the debug console while having your RE whitelists

#

whitelist call under commands

cerulean whale
#

@dusk sage The last thing worked but thanks for the help, I'll remember that if I do it again in future. thanks

vital onyx
#

Guys, who knows the id of display for displaying chat messages

#

?

#

I would like to disable it completely, like one enabled Stream friendly UI

tough abyss
#

remoteExec is more efficient in terms of the amount of data sent over the network

#

@tough abyss

#

It also has a much more intuitive, system for issuing code to clients

#

You can even use setVariable with remoteExec

#

Now you're probably wondering why would I do that?

#

You can point setVariable to CLIENTS only.

#

Rather than executing globally

dusk sage
#

PVEH ๐Ÿ‘Œ

tough abyss
#

Thanks

dusk sage
#

It's been shown that whitelisting has huge network overhead though

#

Which is saddening

tough abyss
#

Yeah but if you want to.

#

You can use direct message passing.

#

Instead of single functions

#

such as instead of remoteExec'ing an entire function you can simply

#

use [60,1] remoteExec ["setRain",0,false];

#

@dusk sage How exactly does the JIP flag behave?

#

If the code is executes isn't it the JIP call runs everytime a client connects?

#

From the JIP queue.

dusk sage
#

Still subject to whitelisting with commands though, if you want

#

It's no different

#

Yeh

#

It runs on JIPs

tough abyss
#

So if you run 5 different functions

#

They'll be stuck into a queue like this?

#

[func1,func2,func3,func4,func4]

dusk sage
#

Say if you RE'd addAction

#

JIP would receive it yeh

tough abyss
#

then run in sequence?

#

So basically be careful with the JIP flag ๐Ÿ˜›

#

How big can the JIP queue actually be?

dusk sage
#

I've never tested, but I'd assume so

#

It has a unique JIP ID*

tough abyss
#

Is? isServer etc all that even needed?

#

Now that remoteExec is here?

dusk sage
#

Ofcourse it is

tough abyss
#

So if I had say some kind of whether function that requires simple variable synchronisation

#

I could simply

#

[] remoteExec ["simulWeatherSync,player,true];

dusk sage
#

sure, it'd JIP

#

But PVAR is probably more handy for variable syncing

tough abyss
#

I thought PVAR is obsolete as of remoteExec ?

dusk sage
#

Of course not

tough abyss
#

You can use setVariable instead?

dusk sage
#

PVEH is less network overhead than RE

#

IIRC

tough abyss
#

Which is effectively the same as PVAR.

dusk sage
#

Well no

#

You can't be specific with setVar

#

It's public or not

tough abyss
#

Whats the cost of remoteExec'ing?

#

it?

dusk sage
#

it?

tough abyss
#

setVariable

dusk sage
#

Why would you RE it

tough abyss
#

Because you can target explicitly where clients are local among other things?

dusk sage
#

I'd imagine higher than PVAR

#

But if you're using setVariable

#

You're probably on objects etc

#

Not name spaces

tough abyss
#

I actually prefer setVariable etc to publicVariable

dusk sage
#

They both have different uses

tough abyss
#

Doing what ACE3 does made it easy.

dusk sage
#

It's like comparing lemons to potatoes

tough abyss
#

SVAR and GVAR

#

Macro'ing them.

#

@tough abyss Do you know how much AI arma 3 can handle on both dedicated clients and server?

#

I've noticed no real performance improvement with moving AI to the HC's in terms of running more AI.

#

Without tanking everyones FPS below 30

#

The safe limit for ArmA 3's framerate appears to be around 60

dusk sage
#

You're noticed no perf gain from moving AI to the HC

#

Are you positive they actually moved?

tough abyss
#

They did move, I mean the same amount of AI.

#

Client FPS still suffered

dusk sage
#

Well it will

#

It's taking load off the server mainly

tough abyss
#

This was 150 AI.

dusk sage
#

That's alot of AI

#

Depends on the mission though

#

If you're in editor, isn't going to affect you too much

tough abyss
#

Well one current mission I have from soemone else.

#

Runs 144 AI

#

And I said it's an abuse of the engine.

#

The engine just isn't designed to take that much punishment.

#

Yeah I noticed.

#

Yeah.

#

I use debugView

#

to actually see the traffic / msgps

#

You can't because only part of the brain is offloaded to the HCs.

#

๐Ÿ˜ฆ

dusk sage
#

Are all your AI in one place?

#

Cache them etc

cedar kindle
#

PVEH are sent as priority messages, setVar is not

tough abyss
#

Yeah. As I said the mission I've been evaluating from one of our community.

#

Is I counted 100 active units

dusk sage
#

But do make sure you're transferring AI properly

#

It's easy to not correctly do it

tough abyss
#

ALiVE does cache them but his caching clearly wasn't working correctly.

dusk sage
#

And owner won't return anything useful on a client

tough abyss
#

There was way too many AI to run.

#

ALiVE is wierd.

#

The way it creates the AI, is it creates virtual agents

#

then switches those agents to actual AI

#

Thats what I am assuming

#

because of the raw amount of, agents I saw spawn'd

#

Those agents are bunnies that are hidden.

cedar kindle
#

moving AI to HC means it does the calculations and sever fps is kept higher to process updates and messages

tough abyss
#

Yeah

cedar kindle
#

clients still have to consume the AI updates not to mention draw them

#

but I agree 144 is way too many in the same area

tough abyss
#

Isn't a single soldier like 15000 polys?

cedar kindle
#

no idea but it's different depending on range due to LODs

tough abyss
#

Yeah and the LOD transistions are less poppy because of Stochastic rendering

cedar kindle
#

and AI on the other side of the map won't be drawn nor processed as heavily as someone close

#

so keeping them spread out and cached certainly works

opaque topaz
tough abyss
#

@opaque topaz but when is it coming to stable branch?

#

and the 64bit clients / servers?

#

I hope it's before christmas...

opaque topaz
#

hopefully or else we will have to wait until afterwards and usually BI goes on a 2-3 week winter break

#

during late december

native hemlock
#

You will have to wait, there is no way it's going to be on stable. I'm fairly certain Friday is the last day BI is working before their winter break

spring ravine
#

would be a huge risk.

vital onyx
tough abyss
#

The alternative syntax of createSimpleObject is placing as position world and not position ASL as stated in the WIKI?

rancid ruin
#

how on earth are the LOD transitions less choppy cos of stochastic rendering

loud python
#

Can anybody tell me if there is a way to check the type of a variable?

#

I want to find out if an argument to ym script contains a curator or an array of curators

rancid ruin
#

typeName

loud python
#

okay thanks a lot

rancid ruin
#

nah actually i think isEqualType is the 2016 way to do it

#

_array isEqualType [] will be true

loud python
#
    if (not isNil "_curator") then {
            if (typeName _curator == "ARRAY") then {
                {_x addCuratorEditableObjects [[_spawned], false];} forEach _curator;
            } else {
                _curator addCuratorEditableObjects [[_spawned], false];
            }
    } else {};
#

that's the code

#

don't ask why there's an else there

#

also I don't really care about speed as the script is not executed in a loop

#

well, it is, but this branch is only executed at most once every 3 or so seconds

#

but now I feel bad, so I guess I will change it to the faster way

#

ah, it works, thanks a lot ๐Ÿ˜ƒ

little eagle
#

Why is there an else {}; there? ๐Ÿ˜‰

jade abyss
#

Let it be, let it bee, let it bee oohh let it beeee sing

little eagle
#

whisper words of wisdom

jade abyss
#

Not in here sing

little eagle
#

I like aliterations

loud python
#

can anybody tell me why if not isNil {_this select 5} has an error while if not isNil {_this select 4} doesn't?

little eagle
#

because the array "_this" has 4 elements

#

select complains when you pick an element that is 2 out of bounds

#

it's really dumb. if it's only one out of bounds it reports nil without error.

loud python
#

isNil {[1, 2, 3] select 20} runs without problem

little eagle
#

it shouldn't

loud python
#

#justarma3things

#

I want my lua back

little eagle
#

use
param [5]

#

instead of
_this select 5

#

param > select

jade abyss
#

param[5,"bla"] <-- Or seomthing like that

#

(or what was the syntax?)

#

[5,"",[[]]] <- ?

little eagle
#

Dscha, put me off your block list before you embaras youself even more

jade abyss
#

Don't have you on my blocklist turtle

#

Haven't touched .sqf for a while now + memory is bad

little eagle
#

๐Ÿ˜‰

loud python
#

just read about param

#

if only I had known this existed...

#

still

#

in lua this would have been much easier =/

jade abyss
#

But its not. So you have to life with this madness ๐Ÿ˜‰

little eagle
#

select is bugged shit and has been for years. be gratefull param exists and is fixed now

rancid ruin
#

it's bugged? how?

little eagle
#

errors for out of bounds in weird ways

rancid ruin
#

that doesn't sound like arma

little eagle
#

๐Ÿ˜‰

loud python
#

fixed it

#
_new = param [0];
_distance = param [1, 10];
_delay = param [2, 0];
_curator = param [3, []];
_onRespawn = param [4, {}, Code];
#

looks much nicer now

jade abyss
#

Or use params
(with s in the end)

little eagle
#

it will solve everything in one line

#

Damn, the description is awful

#

"similar to BIS_fnc_param"

#

yeah right

loud python
#

apparently code is not a data type

little eagle
#

it is

jade abyss
#

String it

little eagle
#

no

loud python
#

but the game doesn't know it

#

_onRespawn = param [4, {}, Code];

little eagle
#

param [4, {}, [{}]];

loud python
#

oh, okay

jade abyss
#

iirc "Code" should also work

loud python
#

so arma wants an example rather than the actual type

#

thanks obama

little eagle
#

you have to provide an array with examples of that type

#

that is what the wiki says

#

*should say

#

It's the same principle of how you should replace
typeName _curator == "ARRAY"
with
_curator isEqualType []

#

not that you asked for it

#

๐Ÿ˜‰

loud python
#

the thing is, won't that allocate an array just to use it for comparison?

little eagle
#

still faster

#

this is SQF

#

massive overhead for each command use

#

all the type checks

loud python
#

This is SQF! *kicks SQS into bottomless pit*

#

IT WOOOOOOOOOOOOOORKS

jade abyss
#

Of course it works

loud python
#

no

#

it's very rare that code works

#

if your code works the first time

jade abyss
#

Then you made mistakes.

loud python
#

that's a reason to be scared

#

at least that's how it is in C

jade abyss
#

Its Arma, almost everything works, just often not how you want it to be

#

๐Ÿ˜„

loud python
#

well... I mean...

#

even the arsenal is for some reason causing errors

jade abyss
#

Forget every other Language, when you work with SQF

loud python
#

I have no idea why or how

#

fn_arsenal.sqf line 920

#

Error Undefined variable in expression: _display

#

I have learned to just accept it

#

there MIGHT be a reason for that error, but it is most likely beyond human comprehension

little eagle
#

there MIGHT be a reason for that error, but it is most likely beyond human comprehension
Nah, such errors can be found easily if you're experienced.

loud python
#

being experienced == making a pact with the devil?

#

I don't understand arma 3 and I never will

little eagle
#

It's like everything in life. You sink enough time into it and you'll learn.

loud python
#

anyway, here's the finished script

#

no need to point out that I never check if the curator is actually a curator

#

If somebody manages to pass some other object into the script (maybe a tank?) then that's just their fault #itsafeature

little eagle
#

you need a spawn for that sleep

loud python
#

I know

#

it's a function

#

I spawn it

little eagle
#

I mean, you can put into the function header that the function should be spawned

loud python
#

can I?

little eagle
#

function header is just a comment, sure

loud python
#

oh, that's what you mean

little eagle
#

you can write your groceries list in there if you want

loud python
#

I mean, not only the sleep... it's an endless loop, so if you don't spawn it that might lead to some problems

little eagle
#

it's not really a function if it's spawned, which makes it weird

loud python
#
Arguments:
- butter
- milk
- eggs
little eagle
#

if (!cansuspend) exitwith {_this spawn _thisScript;};
What quicksilver wrote

#

that's a nice way to fix it

#

but

#

that would still cause problems if you call the function from a scheduled script

loud python
#

I like that line

little eagle
#

don't do that

loud python
#

it solves the problem without just saying "nope" and quitting

little eagle
#

you can still halt a scheduled script

#

no it doesnt

#

you can still halt a scheduled script

#

_this spawn {
in the first line

#

and
};

#

in the last

#

that would fix it

#

It doesn't really made if only you intend to use it

#

But if it's meant to be API, then might as well make it as safe as possible

loud python
#

SQF isn't a nice language to code safely =/

#

I mean, I want to add the _this spawn {

#

but whenever I think about a script being spawned and then spawning another script...

#

so much overhead...

#

I will know it is there

#

it will haunt me in my dreams

little eagle
#

If you really wanted to avoid overhead then you wouldn't use spawn to begin with, but that's a different story.
Better stay ignorant then. ยฏ_(ใƒ„)_/ยฏ

#

haha ^

loud python
#

I've spent so much time learning all the nice tricks to avoid overhead in lua

#

and now this language forces me to do this kind of thing

#

how tragic...

#

my life is like a work of shakespeare

little eagle
#

But at least you're still alive

#

Shakespeare is everyone dies at the end

#

As opposed to vulgar upperclass art?

rancid ruin
#

you guys should refactor shakespeare to use the new commands

loud python
#

oh oh oh

#

arma 3 should drop SQF

#

And use shakespeare instead

#

and if you think I am bullshitting you right now:

little eagle
#

you guys should refactor shakespeare to use the new commands
๐Ÿ˜„

loud python
little eagle
#

beauty is objective though

rancid ruin
#

it's not really worth doing "to be or not to be" as a switch case, should just put it in an if/else imo

little eagle
#

I can see beauty in lines like this:
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)};

#

Treatable too?

#

I meant subjective btw.

#

And isEqualTo faster than ==
good point, but it needs parenthesis then

loud python
#

beauty is objective though ha ha ha have you tried Java2k?

little eagle
#

I meant subjective btw.

loud python
tough abyss
#

@tough abyss not sure, but how exactly is it faster?

little eagle
#

It just is, cloud

#

don't question it

tough abyss
#

I guess :/

little eagle
#

(it's the type checking overhead)

tough abyss
#

(If script isEqualTo true) then chat

#

Or else some of us might beat the ==

little eagle
#

Yeah, the channel description triggers me too

#

can't compare booleans with ==

tough abyss
#

So for ints it would be better to use isEqualTo correct?

loud python
#

quick question: does apply create a copy of the first array or just modify it?

little eagle
#

yes, cloud

tough abyss
#

๐Ÿ‘

little eagle
#

keep in mind that == is a very low priority command, while isEqualTo is a normal binary command, so you might need additional parenthesis

#

() isEqualTo (_var1 binaryCommand _var2)

#

vs

#

() == _var1 binaryCommand _var2

#

shouldn't matter for left hand side

meager granite
#

@loud python It creates new array without touching old one

loud python
#

that's interesting

meager granite
#

(positionCameraToWorld [0,0,0] distance2d _vehicle) < 100

#

like this?

tough abyss
#

He gave you a Boolean statement that goes True when a player is close enuff.

jade abyss
#

i assume thats beeing executed on every Client, checking the area around the player for vehicles ~150m

meager granite
#

Well just check if player's position is close

#

I wish there was way for server to get player's camera position, server actually tracks it

#

Just enable them locally on client and ask server to enable them globally through pvar

#

Does enableSimulation overrides enableSimulationGlobal ?

#

Give it a try

#

btw did you use server-side getIn?

#

try with client then

#

so that you have simulation enabled instantly to avoid black screen\interface problems of getting into disabled simulation vehicle

#

and then later global simulation arrives from server for everyone else

#

actually you don't even need pvar, just have events on client and server

#

server for global simulation, client for local

#

Is there a way to determine which item you have selected on inventory screen's list box? How do mods like Breaking Point do it where you can double click items to view details and do something with them?

#

I've checked list items, they have no lbData set (expected lbData having item classname), lbValue is just item index

#

Getting control or current selection is not the issue, issue is how to determine which item is selected

#

๐Ÿ™„

#

Nevermind

#

(This wasn't the question how to get index of selected list item, but how to determine class or any other relevant info on selected list item)

meager granite
#

So mystery solved, inventory screens USED to have item classnames in lbData long time ago

#

Not anymore

jade abyss
#

Nope, they still have the Classname in it.

#

At least, some items

#

Just started arma for the first time in month's for it ๐Ÿ˜„

#

Thats what i meant before, some Items do have the Classname, some don't.

meager granite
#

hm, interesting

jade abyss
#

Thats why i wrote you that stuff with localization :/ Its... erm... "interesting"

#

haven't found any clue what the reason for it is

meager granite
#

So apparently it only stores magazine classnames in lbData

jade abyss
#

Items also

#

Try MediKit

#

iirc that works too

#

(already closed Arma)

meager granite
#

Nope, no medkit or other items like uniforms, vests, attachments

#

Nothing, just magazines

jade abyss
#

Ah okay

#

But... aren't FirstAidKit etc counted as magazines also?

meager granite
#

No, they're items

jade abyss
#

thats... stupid

meager granite
#

I guess Breaking Point items were magazines too

#

Well, we should file a ticket requesting inventory containers to have class names in lbData for all kinds of items ๐Ÿ˜ƒ

jade abyss
#

I just watched through some files: I also made all Items "magazines" for 2017.

#

Would be a benefit, if i would still do something for Arma ๐Ÿ˜„

meager granite
#

I needed that for attachments so I'm out of luck for now (or will have to use name comparisons for now)

jade abyss
#

But yeah, should be in it.

#

Yeah + don't forget to localize, when its used. Made me suffer for a few days.

meager granite
#

Anyway, thanks for help, seeing Breaking Point items start with "Item" I assumed these indeed were items and not magazines and thought this feature was available before and removed since.

jade abyss
#

your welcome o7

little eagle
#

I just associate the displayName with a classname

#

I know the limitations, but it was close enough for me

#

oh. displayName+picture apparently

#

probably for reskinned stuff

steep matrix
#

new (array)
b:OBJECT setdamage SCALAR,ARRAY

little eagle
#

now imagine this

#

it now triggers handle damage

#

the optional parameters are stuff like killer, gunner, projectile

#

maybe it's just for this though:

Added: Support for destroying object without effects (e.g. explosion, fire, etc.)

loud python
#

What happens when you do that?

wispy patio
#

Quick question guys, anybody got a clue how I spawn on object on a bridge? It keeps going far above it or under.

loud python
#

any vehicle?

#

Glorious

little eagle
#

who was asking for the 'setDead' command
I was

#

june huh. time flies

loud python
#

the revive system... ha... ha... ha...

#

has arma 3 found the "revive" respawn template yet?

#

or is it still searching?

little eagle
#

What do you mean?

loud python
#

try adding the "revive" respawn template in a mission from description.ext

#

as described in the wiki

#

(looking up link)

little eagle
#

what happens?

#

too lazy to enter my Steam password just to start the game

loud python
#

it doesn't exist

#

i.e. arma doesn't find it

little eagle
#

typo?

loud python
#

typo where?

little eagle
#

idk

loud python
#

The "Revive" respawn template doesn't exist though

meager granite
#

Helicopters have some damage that does not get into HandleDamage (though it checks for allowDamage flag)

#

Namely huge collision damage (which results in insta death) and when your main rotor touches solid objects, it justs sets main rotor damage to 1 and instantly turns off engine with special sound

tough abyss
#

peeewwwwwww, kachunk, kachunk, kachunk

#

rotors vanish into thin air

#

well shit...

vital onyx
#

@loud python the revive settings over Description.ext were deprecated, revive settings moved to mission attributes in 3den

tough abyss
#

switchLight function don't work with Arma 3?

vital onyx
#

on street lamp?

tough abyss
#

@vital onyx yes!

vital onyx
#

@tough abyss afair the light on street lamp can be enabled with animate or animateSource - so you can try your search this way, or even setDamage to lamp 0 for on, or 1 for off. Anyway you can gopogle for scripts which simulate disabling electric stations and disable light in village/town

steel mantle
#

When creating static map edits around the map, do anyone know what performence boost you get when you use CreateSimpleObject instead of the original method?

tough abyss
#

@vital onyx i'm using setDamage right now (0.95 for lamp off), but animate function seens a lot better (at least lamps off will not have 5% health).

#

@steel mantle simple objects help a lot in performance, but you will probably don't want to have some objects as simple objects, like houses with functional doors and street lamps, because animation and lights don't work for simple objects.

#

Also storage don't work with simple objects (a box for example).

#

@steel mantle Safes will also not work and same goes for vehicles

vital onyx
#

storage can be easily added, by

_box attachTo [_my_simple_object];

Also simple object's namespace I bet is coming for 1.68, which adds new possibilities.

rancid ruin
#

what does simple object's namespace I bet is coming for 1.68 mean?

#

@vital onyx

vital onyx
#

@rancid ruin it means you will be able to setVariable for simple object, like:

_simple setVariable ["myvar","some_value"];

where _simple is a simple object

#

@tough abyss they already are, are not they?

tough abyss
#

"Also simple object's namespace I bet is coming for 1.68, which adds new possibilities." This is sad, the most expensive objects can't be simple object because they became useless (like houses with doors), so you need to compare the performance gain from changing more simple objects, like walls, to simple objects... this decrease the performance gain. @vital onyx you believe this simple objects namespace will decrease the gain in using simple objects?

#

I created a custom way to store vars in simple objects, and since they are mostly static objects you really don't need that for more than one or two ocasions.

#

Hope they are doing that without decrease of the performance gain.

#

"Let me store those 10 vars on this chair"

halcyon crypt
#

come on, adding a couple of vars to a simple object costs virtually nothing...

vital onyx
#

simple object namespace is a must have for me, to complete total conversion of inventory system

#

@normal stump

@vital onyx you believe this simple objects namespace will decrease the gain in using simple objects?

I never said that

loud python
#

@vital onyx Why are they deprecating description.ext stuff?

#

in many cases it's much simpler to just copy something into a text file than to search through the interface in the editor

thick lintel
loud python
#

That makes way more sense

#

they should update the wiki though

#

because there it still mentions the template =/

tough abyss
#

The engine will have a bigger nameSpace list everytime it searchs for a specific nameSpace.

#

20K + nameSpaces.

#

Thinking with a "MySql brain".

#

Hope they are indexed lol ๐Ÿ˜›

#

I have seen Jhon Carmack (Id software) says more than one time that one big problem to 3D engines is when the list of "primitives" (?) became so big that is hard to found a specific one, and the engine needs to do that many many times everytime.

#

So some problems on games engines are becaming "database search" problems.

#

But those problems arent in the user level.

warped thicket
#

primitives are simple shapes, like cubes, pyramids, cones, spheres... etc

tough abyss
#

playableUnits is broken at clients?

#

because its an array with players only

#

not AI units

meager granite
#

playableUnits was broken since dawn of time

#

It can randomly miss some players

tough abyss
#

@meager granite it can duplicate units or return AI?

#

Some really strange things happening.

#

@tough abyss ah man, thanks... just now noticed you sayd allPlayers and not allUnits.

tough abyss
#

@tough abyss playable units is working fine since the hotfix

cerulean whale
#

What's wrong with this?

#

{
if (!isNil _x) then {
weps2 pushBack _x;
};
} foreach weps;

tough abyss
#

Is weps and weps2 initialized like so: weps = ["Weapon_Classname_1", "Weapon_Classname_2"]; weps2 = [];

cerulean whale
#

weps is [_Wep,_Wep2]... definded from _wep = PrimaryWeapon player; so yeah, it is...

#

the issue is

tough abyss
#

And weps2 is initialized? Have you checked the value of the variables being passed through? By logging the value of _x?

cerulean whale
#

if there is nothing there it is passing "" and then messing up later inthe script

#

I have

#

essentailly

#

later inthe script I am using addWeaponCargoGlobal

tough abyss
#

So nothing is being passed through?

cerulean whale
#

and if it is like this ["","","Rook_9mm_F"] it adds a NULL object

tough abyss
#

I think you want isNull, not isNil

cerulean whale
#

I was thinking the same thing but it spits out an error

#

nothing is being passed with isNull

#

something is passed with isNil

#

but doesn't go past the '!isNil' part of it

tough abyss
#

Actually, I would just check if _x != ""

#

Because it is a classname, not an object.

cerulean whale
#

true

#

I never though of that xD, I've been using isNil all day

#

thansk

tough abyss
#

lol, no problem.

cerulean whale
#

If I have a variable returning this: [] , How do I tell if it is like that? (empty array) isNil / isNull doesn't work and != "" or !="[]" doesn't work

#

any ideas?

tough abyss
#

If you do count _x will it return an error?

#

Or false?

#

Or 0?

cerulean whale
#

I have an idea, thanks for help anyway though. ๐Ÿ˜ƒ

tough abyss
#

No problem

dusk sage
#

@cerulean whale

#

Don't over think it

#

If your array is just []

#

Then check if it isEqualTo []

#

๐Ÿ˜‰

slim yacht
#

Is anyone here good w/ Zeus?

#

That I can talk to? VC?

indigo snow
slim yacht
#

oh

#

that

#

exists

#

uhh

#

pls no behead

dusk sage
#

๐Ÿคฆ

slim yacht
#

lol

#

Thanks for informing me tho lol

dusk sage
#

I think the fact you posted in so many channels deserves a beheading though.. @yoyr mom pose smel#9030

slim yacht
#

Rip

#

I posted it where I thought it would be relevant

dusk sage
#

in general

#

scripting

#

mission makers

slim yacht
#

General = General(obviously), it may be a scripting issue, and you make missions with Zeus

#

My mindset

#

Although I am retarded

dusk sage
#

Why not just try one channel at a time ๐Ÿ˜‰

slim yacht
#

Rip lol

tough abyss
#

This code:

#

_array = allPlayers;_array deleteAt 0;

#

Will modify allPlayers?

tender root
#

yes

#

if you want to copy allPlayers you have to do this:

tough abyss
#

allPlayers is a function

tender root
#

I know

#

ok yes is not exactly right

#

What do you want to do ?

tough abyss
#

I want to remove local player and dead players from allPlayers

tender root
#

When you want to make an array of allPlayers which you can modify (delete/add Elements) you have to make a copy of the array allPlayers returns

#

_array = +allPlayers;

tough abyss
#

Thanks

tender root
#

np

tough abyss
#

But if i modify allPlayers, it get "broken forever"?

#

or eventually get updated when players change?

tender root
#

idk but i wont think it will change anything

#

i tried it doesn't do anything ๐Ÿ˜ƒ

tough abyss
#

Thanks, just in case i will use _array = + allPlayers;

tender root
#

np ๐Ÿ˜ƒ

#

Is there a way to change accessories of any weapon, which is in a cargospace ?

#

i tried addWeaponItem but it doesn't work ๐Ÿ˜ž

tough abyss
#

@tender root there is some time since i messed up with that, but i can't remember a solution to modify accessories of a weapon in a cargo.

#

Also, the classname of the weapon don't change when you change its accessories.

#

Those functions: weaponsItems and weaponsItemsCargo

#

Are the only way to get detailed weapon info.

#

But they just get info about the weapons, they don't modify it.

dusk sage
#

allPlayers is a command

#

You won't edit it

tough abyss
#

You can however write an algorithm to alter it's output

#

But you can not physically edit allPlayers

tough abyss
#

@tender root the arguments for addPrimaryWeaponItem is a unit and the item, so I am not sure if you can add the item to something that is in an ammobox.

#

You know what I would do though, is in the editor, get an ammobox, name it, put a player unit down with a custom weapon config and when loaded in, place the item in the crate

#

After that, check the value of itemCargo ammobox and see what it spits out.

#

May give some insight as to how you should store it ๐Ÿ˜ƒ

tender root
#

It just returns the normal classname. ๐Ÿ˜ฆ

#

without any attachments

#

the problem is not to get the accessories of the weapon, that just works fine with weaponsItems

#

i actually am convinced, that there is no command / function which allowes you to change a weapon accessory. I just searched the whole internet ๐Ÿ˜‚

#

I made a little "work around" and placed the base weapon (without attachments) alongside the attachments seperatly in the box

#

Thanks for the help tho ๐Ÿ˜ƒ

cerulean whale
#

Anyone got an idea why my remoteExecCall works in the debug console but not in a function?

#

It runs fine in debug console but when I put it into the function it doesn't do anything

tough abyss
#

I believe certain functions need to be whitelisted @cerulean whale but I have not worked with it much. Look up on Google: "CfgRemoteExec"

cerulean whale
#

I was told to remove my CfgRemoteExec and all my other functions work fine..... It is the exact same as an already working function except it runs with getplayerUID from a setVariable instead of just getplayerUID player

#

I just changed _uid getPlayerUID _player to an already defined UID

#

It's like a copy+paste with two added / removed lines of code

#

It was an impounding to garage script that I made about a week ago and I just changed it so a player can impound it if it is left outside for too long

#

Now I edited something, forgot what it was and the whole script doesn't work

#

nice

#

Finally got it working.... sigh

dusk sage
cerulean whale
#

I am having the weirdest SQL issue right now and it is PISSING me off

#

haha

cerulean whale
#

Anyone got an idea why my extDB is fine writing one line to a database but it won't do a second row?

#

it runs the first row fine, can remove and then do again but it won't do a second row

vapid frigate
#

it have a unique primary key?

cerulean whale
#

It only had a unique key... I added a primary key but it's the same as the unique key....

#

Does it need a unique key OR a primary key. or a unique key AND a primary key?

#

@vapid frigate

#

I did this ALTER TABLE garage
ADD UNIQUE KEY id (id);

#

I added my unique key but it still doesn't work

#

In theory if I INSERT a new row it will make the unique key one more right

#

e,g. first one 0, next 1, next 2, etc

#

?

vapid frigate
#

i think a primary key is meant to be unique anyway, but if you try and insert the same key twice it won't accept the 2nd

cerulean whale
#

I got rid of them and only have a unique key now

#

but it still won't write into SQL

vapid frigate
#

i dunno, i haven't used extdb

#

you tried doing the statements in the mysql designer or equivelent?

#

might give you a better error

cerulean whale
#

the issue is... the exact same system works with my users table

#

just not my garage table

dusk sage
#

well show us your query

#

etc

cerulean whale
#

@dusk sage I've found the problem, It is trying to write the unique ID to 0...... How would I make it so the second row writes the ID as a 1?

dusk sage
#

well if you have a primary key

#

It'll auto increment (can adjust that too)

#

no need to specify it

vapid frigate
dusk sage
#

It's automatic

cerulean whale
#

It's using a UNIQUE KEY. Should I delete that and change it to Primary?

vapid frigate
#

example on that page

#

ID int NOT NULL AUTO_INCREMENT

#

(if it's mysql)

dusk sage
#

yep

vapid frigate
#

and i think it should be a primary key, not unique

dusk sage
#

and PRIMARY KEY (ID)

vapid frigate
#

(which is unique anyway)

dusk sage
#

by definition yeh

cerulean whale
#

CREATE TABLE garage( idINT(11) NOT NULL AUTO_INCREMENT, classVARCHAR(100) NOT NULL, userVARCHAR(50) NOT NULL, hit VARCHAR(1000) NOT NULL, PRIMARY KEY (id) ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB ;

#

well the code messed the formatting up lol

#

CREATE TABLE garage (
id INT(11) NOT NULL AUTO_INCREMENT,
class VARCHAR(100) NOT NULL,
user VARCHAR(50) NOT NULL,
hit VARCHAR(1000) NOT NULL,
PRIMARY KEY (id)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
;

#

is that good?

dusk sage
#

use
```sql
//code
```

vapid frigate
#

looks right

dusk sage
#

No need for the collate though

#

if you're on latin1 anyway

cerulean whale
#

It worked! Thanks for the help guys, I've never messed with SQL code in my life before so thanks for the help. xD

#

โค

tender root
#

Is there a proper way to check weather the AI is disabled on the server ? Sure u can use getMissionConfigValue ["disabledAI",0] for the description.ext value but this doesn't take the button in the slot list into a count

meager granite
#

I hate that copyToClipboard stops working after few Alt+Tab's

#

Anybody else notices this?

jade abyss
#

Yep. Thats why i gave up with it. Used diag_log after a while only

#

Might work with WindowMode

peak plover
#

Is there a singular command for replacing a variable in an array

#

Is the best way to just write a function to find the variable, delete it and add the new one ?

indigo snow
#

Arrays contain values. You can set them

jade abyss
#

Yep.
_YourArray set[IndexNumber,NewEntry];

meager granite
#

The problem is that diag_log is limited to 1024 characters

#

while copyToClipboard isn't

#

When you need to get some massive data for quick inspection copyToClipboard is best way

#

(not counting callExtension solutions)

jade abyss
#

Yep, but at least a simple diag_log is enough, most of the time.

#

Have you tried Arma in WindowMode? Can't remember if it occured there also.

loud python
#

does anybody here have any experience with the setrainbow command?

#

it doesn't seem to work for me

tough abyss
#

In this code:

#

{...} forEach GLOBAL_listOfAI;

#

What happens if i change the array GLOBAL_listOfAI, in another thread, while this forEach is running?

earnest coral
#

I have a problem, we have some custom licenses on our server, but poeple are loosing the license everytime they log out, how do i fix this issue

little oxide
#

@loud python When you set raimbow to 1, the rainbow can only appear after rainfall and opposite of the sun when it is low on the horizon.

loud python
#

okay, thanks

cerulean whale
#

is it possible to do nearestObject and search for the nearestVehicle?

tough abyss
#

Yes it is posibly

#

Well logically speaking yes

cerulean whale
#

_car = getpos carSpawn nearestObject isKindOf 'Car' ??

tough abyss
#

nearestObject [_pos, "LandVehicle"]

cerulean whale
#

thx

#

_car = nearestObject [getMarkerPos HRP_vehicleSpawn, "LandVehicle"];

#

That's what I did

tough abyss
#

And?

#

Returned null?

proven crystal
#

hello, im trying to make a little script to restrict players to first person.

#
    {
        if ((cameraview == "External") && (vehicle _x == _x) ) then {
            _x switchCamera "Internal";
        };

    } forEach allPlayers;
    sleep 0.1;
} ```
#

i have just added the cameraview == "External" part because i realised that the game is not fun if you cant use sights ^^

#

but how does cameraview work?

#

i would have thought that there should be something like cameraview player so that the thing knows which cameraview it is about ... ?

#

but cameraview has no arguments?

sharp jay
#

iirc there is a difficulty option that lets you restrict to first person

proven crystal
#

yes i saw that, but a) it diesnt seem to work for some reason and b) id does also restrict 3rd person from vehicles

#

and i only want to restrict for infantry

sharp jay
#

hm

#

i dont know how to help you then, sorry

proven crystal
#

MCC (i think) has a module that allows it only for the drivers even

#

just had to kick MCC

#

but really i like the 3rd person mainly when im passenger and have nothing to look at

#

so anyway, i want to exclude it for infantry

#

i found this :

#

so i think in principle my cpode should work... just unsure about the cameraview...

#

maybe i have to run it on th eclient?

dusk sage
#

You need to run it locally

#

you're trying to execute it on other clients in the forEach, that won't work

#
while {true} do
    if (cameraview == "External" && {isNull objectParent player}) then {
        player switchCamera "Internal";
    };
    sleep 0.1;
} 
proven crystal
#

Ok will try that. Thanks

loud python
#

@dusk sage How did you get that code to be syntax highlighted? Does discord understand sqf? or did you use some other language with a similar highlighting scheme?

proven crystal
#

should i put it in the hasinterface part or would it be good to start it also from the initplayerserver.sqf?

dusk sage
#

initPlayerLocal will be fine

#

@loud python

```sqf
//code
```

loud python
#

interesting, so discord really does understand sqf...

proven crystal
#

hm crap didnt even know that existed....

loud python
#

I didn't expect that, considering it's a very specific thing

#
hint "It's amazing, isn't it?"
proven crystal
#
hint "a thing of beauty"
#

hm :/

loud python
#

it needs to be on the same line as the ```

#

and without any spaces, I believe

proven crystal
#

oรณ

loud python
#

```sqf
hint "stuff" //code
```

tough abyss
#

hint "code"

loud python
#
hint "code"
proven crystal
#

i give up...

tough abyss
#

How do you get the highlighting?

proven crystal
#

just trying to find that out+

tough abyss
#
hint "code";
hint "code";