#arma3_scripting

1 messages ยท Page 248 of 1

tough abyss
#

This isn't my code, I'm just using premade script because I can't be assed to do all this myself.

#

Well, except for the cutscenes, I defined those myself, but that maybe took 15 seconds each.

#

It seems like removing that last bit from blackin didn't do anything

#

But it also seems as if that doesn't have an open string for it

#

Here, let me post my camera_work.sqf. that might help.

meager granite
#

It never gets out of your while {!loopdone} block apparently

tough abyss
#

How do you reckon I can fix it?

meager granite
#

Or not, lack of any human-readable formatting ruins reading it

tough abyss
#

So I'm pretty much SOL?

#

I've tried to reach out to the script author, he hasn't responded.

meager granite
#

Hm

#

Try to remove loopdone = false; between _5thshot and _6thshot

#

I think it will fix it

tough abyss
#

Oh, I already did. My bad.

#

_5thshot = [cam5, cam6, camtar3, 7, 0.5, 0.5, false, 0, 0, 0,"nightvision","black",1,"NoSound"] execVM "AL_movie\camera_work.sqf"; waitUntil {scriptdone _5thshot}; _6thshot = [cam7, cam8, documents, 3, 1, 1, false, 0, 0, 0,"nightvision","black",1,"NoSound"] execVM "AL_movie\camera_work.sqf"; waitUntil {scriptdone _6thshot};

meager granite
#

So did it?

tough abyss
#

How do I get the code formatting? That's just fixed width.

#

no, I've been running it like that.

meager granite
#

upload final code

tough abyss
#

Wait, I think I might've gotten it.

#

Fingers crooooossed!

meager granite
#

You don't need player switchCamera "INTERNAL"; if having loopdone = false was the issue

#

basically how this camera_work script works, if loopdone is false - it creates camera when called, if its true it destroys camera disregarding whatever you send into it

#

Let me know if it worked out

tough abyss
#

Alright, here, let me post this code.

#

This is what I'm trying now

meager granite
#

You don't need switchCamera

#

have no loopdone = false in the middle of a loop should fix it

tough abyss
#

Either way, it's not switching back.

rancid ruin
#

delete the camera

meager granite
#

because you removed piece of code that sets loopdone to true

#

Well just add loopdone = true; instead of switchCamera line

#

Wait you removed while as well

tough abyss
#

Did I?

meager granite
#

on that last pastebin

#

unless you sent only part of the code and not the whole thing

tough abyss
#

Nah, I ripped it out incorrectly.

tough abyss
#

What should I replace with those nil values?

meager granite
#

you don't

tough abyss
#

Oh. Duh.

meager granite
#

camera_work supposed to get rid of camera if loopdone is true

#

you just need to call it with anything

#

What a terrible scripting practices everwhere

tough abyss
#

It worked!

#

Thank you so much, man! I really appreciate the help! ๐Ÿ˜„

jade abyss
#

Anybody knows on the fly, how to disable the SquadRadar and enable the old GPS?

native hemlock
#

@jade abyss On dev branch right? And what do you mean by enable the old GPS?

#
shownHUD params ["_hud", "_info", "_radar", "_compass", "_direction", "_menu", "_group", "_cursors", "_squadRadar"];
showHUD [_hud, _info, _radar, _compass, _direction, _menu, _group, _cursors, false];

That would remove the squad radar

jade abyss
#

In the current build.

#

Just became a note 1-2days ago, that everbody just had the SquadRadar, instead of the normal GPS, when pressing Ctrl+M

#

Ah, i had an old showHUD[] = in the Description.ext

#

Thx @native hemlock

native hemlock
#

I'm confused, squad radar isn't in 1.62

jade abyss
#

currently testing, SquadRadar is still on :/

native hemlock
#

Invade and annex? That's not what the vanilla squad radar looks like

jade abyss
#

Hu? oO

#

Its in a mission i created oO

#

dafuq?

#

Where is that crap coming from oO

zealous solstice
jade abyss
#

Nah, already did that.

#

Description.ext

showHUD[] =
{
    1,    // Scripted HUD (same as showHUD command)
    1,    // Vehicle + soldier info
    0,    // Vehicle radar                                 [HIDDEN]
    0,    // Vehicle compass                                 [HIDDEN]
    1,    // Tank direction indicator
    0,    // Commanding menu                                 [HIDDEN]
    0,    // Group Bar                                     [HIDDEN]
    1    // HUD Weapon Cursors
};```
zealous solstice
#

no that is a extera setting

#

in the Description.ext

#

that is called showSquadRadar

jade abyss
#

Yeah, its already in it

#
saving=0;
disableRandomization[] = {"All"};
showGroupIndicator = 1;
showSquadRadar = 0;
showUAVFeed = 0;
showGPS = 1;```
#

Where is that goddamn thing is coming from oO

native hemlock
rancid ruin
#

is it an event handler left over from some other mission? i did that the other day and it took me ages to figure out

jade abyss
#

hm, Searched through all my files, haven't found anything related to IaA oO

native hemlock
#

Anything from Quicksilver? If I recall correctly he mentioned creating the one I linked a picture of

jade abyss
#

Who?

#

I made that one from Scratch on my own

tough abyss
#

Quicksilver, not sure whether you can help me with this question or others might know. I have the problem that a CSAT fireteam keeps entering the base hunting for the FOB Depot. Is this some setting that I could have activated somehow?

tough abyss
#

also what program can I use to read the bidmp and mdmp after my server crashed?

#

Notepad++ yields: MDMPโ€œยงg &cลพWA  รค ล’  ย * |  D ลฝยฏ  ยจ รค  8 โ‚ฌ  , ยธ  ^  รฐ#  1  GenuineIntelรฃ รฟรปรซยฟ ,  รจ# ร’ย ยW  ยฝ ย
 ย

zealous solstice
#

you should not open it. mdmp and bidmp are crash reports with what you can debug a application if you have the source code.

tough abyss
#

I need some more help with this script, if anyone here would oblige me. I'm trying to set scripts to not play for Zeus, but they still do, despite me directly stating in the code "no don't do this stop it"

#

I am completely baffled.

halcyon crypt
#

perhaps wrap everything inside an if instead of the exitWith?

    // your stuff
};```
tough abyss
#

Like so?

halcyon crypt
#

kind of, I actually meant in place of the exitWIth but that should work as well for now. ๐Ÿ˜ƒ

thin pine
#

In situations like this you debug your variables

#

Use systemChat or diag_log to print the value of that bis fnc is curator call

tough abyss
#

This is what I'm going to try next:

}else{```
#

well, i'll add the quote

thin pine
#

Not what I meant....btw is your Zeus a permanent slot? Aka a logic?

tough abyss
#

Yes.

#

Sorry, I'm still relatively inexperienced with scripting.

thin pine
#

That's okay

tough abyss
#

I think I got it!

#

I need to see if it executes for players now, but this is what I did: if (!(player call BIS_fnc_isCurator)) then { hint "go fuck yourself no script 4 u"}; else;{ playMusic "IntroMusic"; if (hasInterface) then {

#

don't ask me about that else;{

#

i don't know why it works but it seems like it did

thin pine
#

Errors are why

tough abyss
#

lmao

halcyon crypt
#

Seems that BIS_fnc_isCurator only checks whether the object is a curator object.. player == bis_curatorUnit seems to be the way and/or player == getAssignedCuratorUnit (allCurators select 0)

thin pine
#

Rest of your script probably isn't executing

tough abyss
#

You're right, it's not.

thin pine
#

Also I was about to write the above...that's why I - asked about the logic

tough abyss
#

So how should I implement that into my code?

halcyon crypt
#

Sorry ๐Ÿ˜‡

thin pine
#

How many zeus slots?

#

@halcyon crypt no it's good...im on phone and i type slow you saved me time

tough abyss
#

Just the one.

thin pine
#

Use Marcels second code

tough abyss
#

Alright/

#

What should I replace with it?

thin pine
#

Wrap an if around it and replace it with your original exitwith condition

halcyon crypt
#

another possible option is if (player in ([] call BIS_fnc_listCuratorPlayers)) then {};

thin pine
#

Exitwith will work fine as well :)

#

Looks nicer imo and is close to cpps return...but yeah preferences

tough abyss
#

Alright, so... if (player in ([] call BIS_fnc_listCuratorPlayers)) then {hint "This is a test, only Zeus should see this!"}; }else{ playMusic "IntroMusic"; if (hasInterface) then { ?

thin pine
#

That'll do it

#

No

#

Wait

halcyon crypt
#

because I'm not on a phone ๐Ÿ˜›

thin pine
#

Remove that extra bracket before the else and the semicolon

#

Lol

halcyon crypt
thin pine
#

Yeah just follow the pc users code

tough abyss
#

Alright. I'm gonna take five and eat, but I'll be right back.

thin pine
#

I can't keep up lele

#

Good luck

halcyon crypt
#

I'll wait a little bit before I go off ๐Ÿ˜›

tough abyss
#

Back.

#

Both of those scripts are still playing for Zues.

#

Zeus*

halcyon crypt
#

the music and the cutText?

tough abyss
#

Everything.

#

Music, cutText.

#

Cutscenes. Whole shebang.

halcyon crypt
#

how are you calling that script?

tough abyss
#

Through the init.sqf.

#

_handle = [] execVM "introcutscene.sqf";

halcyon crypt
#

does the player in the curator slot start with the zeus interface opened or does he have to press 'Y' before it shows?

#

and how is the Game Master module setup?

tough abyss
#

They've gotta press Y. Let me show you.

halcyon crypt
#

sorry, meant the settings for the module ๐Ÿ˜ƒ

tough abyss
#

One is for myself, one is for the currently logged in admin, and the last is for the slot-in slot.

halcyon crypt
#

but that explains it as well

#

seems like you have to wait until curator has initialized fully

tough abyss
#

Hmm...

#

So can I just make the init.sqf sleep for a few seconds before the script executes?

halcyon crypt
#

try adding this in your init.sqf waitUntil {!isNull (getAssignedCuratorUnit (allCurators select 0))};

#

or at the top of the intro script

tough abyss
#
playMusic "IntroMusic";
if (hasInterface) then {
    if (player == getAssignedCuratorUnit (allCurators select 0)) exitWith {};
    cutText ["", "BLACK IN", 0];```
#

This is what I've got.

halcyon crypt
#

yeah

#

you have 3 modules though, so the select 0 is probably selecting the wrong one ๐Ÿ˜ƒ

tough abyss
#

I could probably dumb it down to one module.

#

But there's really only one zeus who's active, so that won't be an issue.

#

I want to exclude Zeus from this script because the cutscene does some EXCEPTIONALLY fucky stuff with the camera and zeus once it completes.

#

Still plays for Zeus.

#

Perhaps we could try to set it so it only plays for OPFOR?

#

(OPFOR, in this case, are the players.)

halcyon crypt
#

also try a sleep instead of the waitUntil

tough abyss
#

Alright, so, let's just say sleep 10;?

halcyon crypt
#

should be enough

#

do it in your intro script though

tough abyss
#
playMusic "IntroMusic";
if (hasInterface) then {```
halcyon crypt
#

yeah

tough abyss
#

Great scott, it works!

#

The music still plays for Zeus, but that's fine.

halcyon crypt
#

guess zeus still has it's quirks ๐Ÿ˜›

tough abyss
#

Thanks, BI.

halcyon crypt
#

Alright, I'm off. Have fun. ๐Ÿ˜ƒ

tough abyss
#

Thank you so much! ๐Ÿ˜„

tough abyss
jade abyss
#

@native hemlock
showGroupIndicator = 1; = Disables normal GPS and enables that dang thing... -.-

shadow sapphire
#

@tough abyss, what are FOB missions?

#

Link?

covert elk
#

Guys quick question anyone played and got it to work the 1.62 deduction system under multiplayer window? Mine shown me respawn counter but it doesnt deduce the count? Any ideas?

scarlet spoke
#

Are macros case-sensitive?

tough abyss
#

I think so.

scarlet spoke
#

@tough abyss thx

tough abyss
#

You're welcome!

scarlet spoke
#

Does someone know how to eject a vehicle from another one when using ViV-transport? Does the "Eject" action work on these vehicles?

split coral
scarlet spoke
#

@split coral thanks
That's a really weird way of implementing it ^^

split coral
#

Yeah. I wouldn't have known where to look if I hadn't remembered seeing this on the forums.

scarlet spoke
#

๐Ÿ˜„

solar geode
#

There is no way to get/build the actual node map of a buildings AI path lod, just the "posXX" with buildingPos, right?

weary badger
#

Anyone know of how to make an empty vehicle start with engines on?

willow basin
#

Would put something like this engineOn true; in the vehicle init

young current
#

@solar geode not with Arma AI unfortunately. Its the dream though..

solar geode
#

@young current Ha, I'm not insane to actually try to deal with the AI. I'm just interested in the building itself. Getting the data from the Paths LOD, so I know which building pos connects to other building positions. For example, I can get the points where AI can begin their pathing, and where they can path to, but not the connections inbetween. ๐Ÿ˜ฆ

thin pine
#

@solar geode sounds like something that could be requested....like roadsConnectedTo except buildingPosConnectedTo

plucky beacon
#

Question about Boolean for you guys

//initPlayerServer.sqf
_unit = _this select 0;

_unit addEventHandler ["Respawn", 
{
    if (( typeOf _this isEqualTo "B_Helictoper_F") || ( typeOf _this isEqualTo "B_Pilot_F")) then {
        _this setPos (getMarkerPos "Aviation");
    };

    if (( typeOf _this isEqualTo "B_recon_TL_F") || ( typeOf _this isEqualTo "B_recon_F")) then {
        _this setPos (getMarkerPos "Rangers");
    };

    if (( typeOf _this isEqualTo "B_soldier_repair_F") || ( typeOf _this isEqualTo "B_engineer_F")) then {
        _this setPos (getMarkerPos "Vehicles");
    };
}];

This script is designed to respawn players who are in support roles, at a diffrent respawn marker. But I recieve this...
https://i.gyazo.com/97403e6d5d651385f05c89a772fd7c17.png

tough abyss
#

Then again, I'm a huge rookie with scripting.

#

@plucky beacon

plucky beacon
#

forEach where?

tough abyss
#

Let me see if I can pull an example out of my code

plucky beacon
#

for each player?

tough abyss
#

{ script } forEach [array of units];

#

I think

plucky beacon
#

I don't think that's relavent to my intended purpose

tough abyss
#

You want the script to be executed for certain units, right?

plucky beacon
#

I want it to be executed for everyone and anyone who is of a certain unit type

tough abyss
#

Oh. I'd take the easy way and just assign variables with the nomenclature of what class they are

buoyant heath
#

drifting, you need to change _this to _unit

plucky beacon
#

I was following the wiki example 2 because I skimmed it

this addEventHandler ["killed", "hint format ['Killed by %1',_this select 1]"]
buoyant heath
#

err, misread. try _this select 0 or redefine _unit agian inside the eventHandler

plucky beacon
#

ya it makes sense it should already have the unit selected

buoyant heath
#

Wow, my keyboard-fu is miserable today

plucky beacon
#

Discord is freaking out on me today

buoyant heath
#

_unit addEventHandler {"respawn", {params ["_unit", "_corpse"]; ... if (( typeOf _unit isEqual...

plucky beacon
#

My messages are having a huge delay and repeating sometimes

tough abyss
#

It does seem to be going a little crazy

buoyant heath
#

_unit addEventHandler {"respawn", {params ["_unit", "_corpse"]; ... if (( typeOf _unit isEqual...

tough abyss
#

It does seem to be going a little crazy

#

Likewise.

#

Likewise.

buoyant heath
#

Glad it's not just me

plucky beacon
#

Okay

buoyant heath
#

Glad it's not just me

plucky beacon
#

Update discord if you haven't it's fine now

#

PFFT

#

oh my god Discord stahp

buoyant heath
#

Wow, asking nicely really does work!

tough abyss
#

Typically~

plucky beacon
#

Really?

#

oh yay

halcyon crypt
#

@plucky beacon did you get your issue resolved? Kind of hard to spot in the messages above ๐Ÿ˜›

plucky beacon
#

LOL no unfortunately, I'm going to look at how Insurgency did it with their pilot respawns

halcyon crypt
#

replace _this with (_this select 0)

#

in the event handler

#

As mentioned by @buoyant heath

#

also try grouping commands together e.g.:
if (( typeOf _this isEqualTo "B_Helictoper_F") || ( typeOf _this isEqualTo "B_Pilot_F")) then {
to
if (( (typeOf (_this select 0)) isEqualTo "B_Helictoper_F") || ( (typeOf (_this select 0)) isEqualTo "B_Pilot_F")) then {

buoyant heath
#

Also: params ["_unit"] to use _unit instead of _this select 0. A bit easier to read when you look at it tomorrow.

plucky beacon
#

okay thanks.

#

finishing up another script I'll get back to you on it.

#

Awesome it works, thanks @buoyant heath @halcyon crypt @tough abyss

#

Now my only follow up is, how do I write a boolean for if the respawn marker doesn't exist. i.e. if Aviation marker is deleted they respawn at Respawn_west

#

is it if ('name of thing' == null) or something like that?

tough abyss
#

Good!

halcyon crypt
#

if (getMarkerColor "your_marker" == "") then {};

#

or getMarkerType seems a bit more "intuitive"

#

kind of

plucky beacon
#
if ((( (typeOf (_this select 0)) isEqualTo "B_Helictoper_F") || ( (typeOf (_this select 0)) isEqualTo "B_Pilot_F"))&&(getMarkerColor "Aviation" != "") then {
#

Can it still run the script when it doesn't exist?

#

I thought getMarker anything would have to return a value or it errors

halcyon crypt
#

if the marker doesn't exist it will just return an empty string ๐Ÿ˜ƒ

#

no errors

plucky beacon
#

okay

blazing zodiac
#

Does anyone have a reliable way to return the door closest to you?

blazing zodiac
#

@barren magnet You beautiful bastard!

#

Thanks for this, been looking for something like this forever

barren magnet
#

๐Ÿ˜‰

#

Don't thank me, thank tonic for this idea and writing it while beeing drunk

sullen pulsar
#

I'm still loved?

blazing zodiac
#

Didn't know you were active on here Tonic, thanks for this. Gonna be great for cleaning up my breaching system and adding some new functionality to it.

sullen pulsar
#

I'm actually not, I popped in while feeling nostalgic.

blazing zodiac
#

Well shit, great timing then lol.

sullen pulsar
#

Anything building related though involving doors i've pretty much already covered in altis life so if you need certain functionality its more or less in there.

blazing zodiac
#

Yea I never even thought of looking through there to be honest until I saw that tonight. I will absolutely be taking a look through when I get some dev time tomorrow.

#

Off to bed for me though, 6am here. Thanks again, literally been looking for a solution to that for months and just put it on the backburner til I got back around to it, now I can finally clean it up.

#

And no Veteran tag? That's criminal if you ask me!

sullen pulsar
#

I just rejoined the discord, left it awhile ago. Pretty sure Dwarden doesn't love me anyways.

blazing zodiac
#

Ah I see.

open vigil
#

Probably one of the few "life" people that's looked up to.

willow basin
#

Am caramba

tough abyss
#

why is putting [ Reserved Slot ] behind a role selection (Rifleman [ Reserved Slot ]) not enough information for people that they can't use it? And no, they are not assigned to that slot when entering the server

#

any suggestions to make sure they will understand it next time?

indigo snow
#

people

#

dont

#

read

tough abyss
#

do I need to add audio for them then? ๐Ÿ˜›

#

cause they pick that slot, spawn in, get the reserved slot messages, get kicked back to lobby and disconnect

tough abyss
#

Well, let's think about this constructively.

#

A USB port has a max TDP of 500 Milliamps.

#

(Or, half an amp. Obviously.)

#

So if we take into consideration that players typically have three wired peripherals in contact with them...

#

We can, with enough willpower, deliver 1.5 amp shocks to them on a whim.

#

We have the technology.

#

"The zapping will continue until intelligence improves."

#

Anyways, @tough abyss , I'd try to script those slots so it checks against an array of whitelisted PIDs in order for players to be able to play in them.

#

You can probably accomplish this somehow using forEach after defining variables for the PIDs.

#

I already have that, which is why they get the reserved slot messages

#

Ah.

#

they are then kicked back to lobby

#

and leave the server

#

People are just retarded, then?

#

lmao

#

well would prefer people actually playing than complaining and leaving

#

messages like "what is this kind of idiot restriction" or "admin abuse" <- yes one actually thought it was the admin doing that xxD

#

That's kind of an issue with the actual player, not so much you.

#

If they can't read, that's their issue. I don't want people who can't read playing on my servers anyways, personally.

#

Quicksilver, that is what the script does

#

but beause the player doesn't know why it happens, they leave

#

and that's honestly been 70% of those who join in reserved slots

#

but they think it's either that the mission is broken (I presume) or they blame the active admin

#

If you put RESERVED SLOT in big letters and they get kicked, what else should they expect.

#

Regardless, how about letting them slot into it, and then displaying text on their screen once they load in which reads something to the effect of "Hey, this is a reserved slot, you'll be kicked back into the lobby in a few seconds."

#

I think maybe a welcome screen like invade and annex has popping up when they join a reserved slot would help but I'm not that good with the drawing on screen in arma

#

that's what it does

#

'''if ((player in _reserved_units)&& !(_uid in PIDArray)) then
{
titleText ["", "BLACK OUT"];
disableUserInput true;
hint "You are in a reserved slot! You will be kicked to the lobby in 15 seconds!";
sleep 5;
hint "You are in a reserved slot! You will be kicked to the lobby in 10 seconds!";
sleep 5;
hint "You are in a reserved slot! You will be kicked to the lobby in 5 seconds!";
sleep 5;
titleText ["", "BLACK IN"];
disableUserInput false;
failMission "end1";
};
};
'''

#

oh wait

#
    {
   titleText ["", "BLACK OUT"];
   disableUserInput true;
   hint "You are in a reserved slot! You will be kicked to the lobby in 15 seconds!";
   sleep 5;
   hint "You are in a reserved slot! You will be kicked to the lobby in 10 seconds!";
   sleep 5;
   hint "You are in a reserved slot! You will be kicked to the lobby in 5 seconds!";
   sleep 5;
   titleText ["", "BLACK IN"];
   disableUserInput false;
   failMission "end1";
       };  
 };
sullen pulsar
#

You could use a prompt box

tough abyss
#

better xD

#

Tonic could you elaborate?

sullen pulsar
#

sec, haven't touched arma related stuff in 10 months or so... so I have to search for it

tough abyss
#

haha if you find it, send me the link and I'll see if I can make something with it

sullen pulsar
#

There's that and then there is just setting up a custom Debriefing screen explaining why they're being returned to lobby (CfgDebriefing)

velvet merlin
#

Added: A new _thisEventHandler variable containing an Event Handler handle was added to the entity, MP and mission Event Handler types (addEventHandler, addMPEventHandler, addMissionEventHandler)

sullen pulsar
#

Kju lives

velvet merlin
#

not sure if i get this correctly - does it mean you have the handle available in the EH execution context?

#

Tonic lives

#

๐Ÿ˜„

#

whats that fancy Shark icon?

sullen pulsar
#

I don't even know anymore.

tough abyss
#

think the gui message would be more user friendly

velvet merlin
#

its it basically just a convience or is there some actual new functionality/possibilities that way?

barren magnet
#

Well you can remove that specific evenhandler inside itself. if you have 5 eventhandlers for the same thing and want to remove one, didn't you need to remove all 5 and add the other 4 again? This is not needed with this anymore? @velvet merlin

willow basin
#

Okay damn this xD will now make "futuristic" vehicle and tyres shield. Every time I cross a bridge on Tanoa either my tyres pop or my entire vehicle jumps up and explodes.

#

Wonder why not more are complaining about this

tough abyss
#

It's a feature.

wise grove
#

Hello fellow scripters. I am looking for a way to make the wipeout shoot flares when it reaches a waypoint

#

I found this online

#

heli1 action ["useWeapon", heli1, driver heli1, 0];

#

heli1 of course referring to the wipeout, just a variable after all

#

Can anyone advice me on how to get this to work? The flarelauncher is named CMFlareLauncher

plucky beacon
#

Have you tried ForceFire?

#

Flares are technically a weapon that is "fired"

wise grove
#

How do I use that command correctly?

plucky beacon
dull parrot
#

Hey, so I am having some pretty serious issues with my RscTitles.

  ALPHA_STATUS = "west";
  ALPHA_DISPLAY_STATUS = "data\images\rsc\sectorA_blue.paa"; <--- That line sets the image to be displayed.
// I have TRIPLE checked this image, I removed ALL other images, and ALL other lines that would set the image to ANYTHING else.
  ALPHA_POLE setFlagTexture "\A3\Data_F\Flags\Flag_blue_CO.paa";
  systemChat format ["ALPHA STATUS IS NOW OWNED BY = WEST"];
  [] call ff_gui_PointControlStatus;
};```\
#

Yet in game it displays as red.
And larger.
I am 100% sure I removed the red image from that path, I have checks in place the output what the path is set to BEFORE it renders and AFTER it renders, both say it should be the sectorA_blue.paa
I was told it was because I was not using a power of two, the larger image is 100x100, so I reduced it in size to 64 x 64, and the issue is still going on.
I don't know how else to trouble shoot this.

#

The outputted path of my checks is the same as the one I intended to have due to the results, I am forcing the results to be the sectorA_blue.paa path

#

And sectorA_red.paa no longer exists.

#

And there is NO checks, or conditionals that could even possibly set it to that.

#

Yet it still displays.

plucky beacon
#

@wise grove if you google search CFGweapons for arma 3, you can find the class name for the flares. I think there CM_flares or something but look it up first

wise grove
#

CMFlareLauncher is the weaponname

plucky beacon
#

Ya

tough abyss
#

wouldn't be possible to have the feature of locking slots so people can't enter it when clicking on it? Like it does when the mission is being read

velvet merlin
#

@barren magnet was easy to store on the entity via setVar for example already
the only benefit i can see it to assign the EH handle to some other entity supplied by the EH params. not sure if that has any real use though

barren magnet
#

indeed, i did not think about that one. Well BI does alot of things, where do you just dont see the reason, but then some day you need exactly that

plucky beacon
#

@tough abyss probably but I only know of kicking someone out after they get in game on a slot. Not before.

velvet merlin
#

@dull parrot

  1. delete all former pbos of the mission in the various locations
  2. get agentransack
  3. do a mass search in your source folder
  4. use a good console to debug and dynamically apply sqf cmds
#

can one apply setVar on ammo (like flying bullets, shells, etc)?

tough abyss
#

I'm using a bool for identifcation purposes. Do I need to use if(Authentication == true){} or simple if(Authentication)?

indigo snow
#

second

#

BOOL == BOOL will error

tough abyss
#

alright thanks

plucky beacon
#

If you ever want two booleans do bool && bool

tame portal
#

Wait what did I miss since when is Tonic here again :0

tough abyss
#

running the server seemingly makes the authentication fail

#

it's used like this in init.sqf

#
publicvariable "Authenticated";```
#

however the script error thing says that other scripts don't recognise it

#

as undefined

#

should it be in description.ext then?

#
then {``` yields "authenticated undefined"
plucky beacon
#

It should be in Sqf format so not in the .ext

tough abyss
#

it's in the init.sqf but other scripts say it's undefined

#

maybe variable needs to be Variable?

#

That's what I'd wager.

#

Have you tried publicVariable = "Authenticated"; ?

indigo snow
#

bool Authenticated = false; < what?

tough abyss
#

isn't a bool either true or false?

barren magnet
#

yep

#

but you dont write bool

tough abyss
#

publicVariable = "Authenticated"; didn't fix it

#

oh..

#

Yeah.

barren magnet
#

just vafriable name = something;

tough abyss
#

sorry, too much C I guess ๐Ÿ˜›

barren magnet
#

if arma would use datadypes and casting that would be great

#

but it is scripting, so forget about all your programming language, and follow the text files they call scripts

#

aka sqf

tough abyss
#

if ((player in _reserved_units)&& !(Authenticated)) then still gets me undefined variable in expression: authenticated

#

same for any other script using it

#

using Authenticated = false; publicVariable "Authenticated";

#

using @Vaaun's way didn't work either

#

did I miss something in making it accessible for any other script?

#

Oh.

#

if ((player in _reserved_units) && !(Authenticated)) then

#

I don't know if the space would have mattered.

#

Worth a shot though, maybe?

#

well I doubt that would make Authenticated undefined tho

barren magnet
#

white spaces are irrelevant

tough abyss
#

I know that computers completely overlook white spaces, but still.

#

It triggers my script autism

#

lol

#

Uhhm...

#

I want to say you're missing a semicolon but that still wouldn't fix the issue, and that'd be too obvious

#

Try switching these two lines around like this:

Authenticated = false;
#

initplayerlocal: _null = [] execVM "scripts\reserved.sqf"; with reserved.sqf: if ((player in _reserved_units)&& !(Authenticated)) then { titleText ["", "BLACK OUT"]; disableUserInput true; hint "You are in a reserved slot! You will be kicked to the lobby in 15 seconds!"; sleep 5; hint "You are in a reserved slot! You will be kicked to the lobby in 10 seconds!"; sleep 5; hint "You are in a reserved slot! You will be kicked to the lobby in 5 seconds!"; sleep 5; titleText ["", "BLACK IN"]; disableUserInput false; failMission "end1"; }; };

#

I think you need to switch the lines around.

#

Because it's trying to parse authenticated as a variable when it's not defined yet

#

Is parse the right word there? I'm not sure.

#

according to the BI Wiki myPubVar = [123, "456", true]; publicVariable "myPubVar";

#

hmm

#

Can you link the Biki page?

#

sure

#

try publicVariable "Authenticated"; ?

#

without setting it to false first?

#

Follow the example, but I think we forgot to do it without the equals sign but including the capital V.

wooden barn
#

hey is anyone running arma2 servers anymore??

tough abyss
#

It's like that right now Authenticated = false; publicVariable "Authenticated"; and doesn't work

#

I admin an Arma 2 base server.

#

Try switching it around like that, maybe.

wooden barn
#

is it accesable to arma 2 free users? i still have my files from a while ago and was wondering

tough abyss
#

so making an undefined variable public?

wooden barn
#

hmm?

tough abyss
#

Ah damn, I actually can't remember if we ended support for arma 2 free.

#

I think we did.

wooden barn
#

crap...

#

well

#

this is bs lol

tough abyss
#

You're welcome to try it, though. Google "Anzu's War Games"

#

Should tell you everything you need to connect.

#

Anyways, Night

#

Have you tried making the variable local, perhaps? Is that possible?

wooden barn
#

how many servers are currently up cause ima be tryin for a while

tough abyss
wooden barn
#

199.229.249.53:2332

tough abyss
#

if it's local, other script won't know about it for certain

wooden barn
#

thats what i found

tough abyss
#

Ah, that's true.

wooden barn
#

idk what u guys mean by the variable... lol

tough abyss
#

A 'variable' is a really broad term, but in this sense it refers to something we're pointing at.

wooden barn
#

oh lol ok

tough abyss
#

It's just like math, really. Variable Y can be anything, but Y = Y.

#

Variable Y = Y that is

#

It's weird to explain.

tough abyss
#

if (_squad == "160th JSFAR") then { my unit name is called 160th JSFAR, but the condition doesn't change to true

#

using ```_infoArray = squadParams player;
_infoSquad = _infoArray select 0;
_squad = _infoSquad select 1;
_infoName = _infoArray select 1;
_name = _infoName select 1;
_email = _infoSquad select 2;

tough abyss
#

okay forget about that part

#

the variable is finally seen by the scripts, but its status (true/false) does not seem to change

#

using the following piece of code if (_email == "command@jsfar.com") then { Authenticated = true; publicVariable "Authenticated"; } else {}; does not seem to work. The variable doesn't change from false to true. So either there is a problem with the sync of Authenticated or the Invade and Annex hint of Ahoy (the email part) doesn't work, even though it used to

#

You know, I had an issue

#

Where my script wasn't working because it fired before everything initialized.

#

Try adding a 15 second sleep to the script, tell me if that does anything.

halcyon crypt
#

_email is probably not what you think it is.. ๐Ÿ˜ƒ

#

diag_log (str _email) or hint (str _email)

indigo snow
#

did you ever look at the return of squadParams?

tough abyss
tough abyss
#

so initplayerlocal.sqf is executed before init.sqf itself....

#

?

#

that somehow doesn't make sens to me but alright then

#

never trust order when scheduled scripts spawn one after the other

halcyon crypt
#

hmm any known downsides to using varspace getVariable name over varspace getVariable [name, defaultValue] (besides the default value thing that is)?

tough abyss
#

well, I got the squad params back working

#

how do I bind a certain variable to a player and use it in other scripts?

#

like player A joins. He's from the group so his Authenticated gets value true. Player B joins. He isn't part of of the group so his Authenticated stays false. When entering a certain area, player B should be kept out, but player A can join

dusk sage
#

@halcyon crypt Opposite of what you were asking, but the fact it evaluates the default regardless if the variable has been set or not is incredibly annoying, and at times quite bad.

tough abyss
#

yes it works ^^

#

I'm so happy right now xD

#

public variable cannot be used for what I need. Simply making the Authenticated a normal global did the trick

#

it seems I forgot that my reserved script ran before the change of authenticated to true...

#

fixed now

#

the long rocky road of arma scripting

#

it saves so much time

#

used to have a static ID list so whenever a new recruit got in I'd have to edit the mission and put in his ID

tough abyss
#

woops forgot to delete one variable broadcast

inner jay
#

Hi guys does anyone know if there is a command or a way to reduces the friction of a vehicle?

tough abyss
#

what does Waituntil(!Nill player); usually do?

native hemlock
#

That would do nothing, because !Nill isn't a command and waitUntil needs { and }

tough abyss
#

sorry, WaitUntil{!isNull player};

native hemlock
#
waitUntil {!isNull player};

That would waitUntil the player exists, it's sometimes used in inits to make sure the player has actually spawned before trying to add event handlers or other things to the player object

tough abyss
#

alright cause since the following script doesn't seem to work after my implementation of the new idenitifcation mechanic: ``` WaitUntil{!isNull player};
waitUntil {(getPlayerUID player) != ""};
_uid = getPlayerUID player;if(Authenticated) then {
cars = _this addAction["<t color='#ffff00'>Cars and Support Vehicles</t>",VVS_fnc_openVVS,["VVS_all_1","Car"]];
armored = _this addAction["<t color='#ffff00'>Armoured Vehicles</t>",VVS_fnc_openVVS,["VVS_all_2","Armored"]];
};

native hemlock
#

Well where is that being run from? _this is probably undefined

tough abyss
#

it's bound to an object

#

the only difference with the working on is the if-condition

native hemlock
#

I also don't think you are using your Authenticated variable correctly. In one of the previous code snippets you pasted you did publicVariable "Authenticated", that is broadcasting whatever value that client has for Authenticated, so all clients and the server would now have that same value for the Authenticated variable

tough abyss
#

that publicvariable is removed

#

it's just a global variable

#

I guess I'll have to let the script wait with firing until player distance < 5 m

native hemlock
#

What object are you putting that script on?

tough abyss
#

a laptop

native hemlock
#

From the object's init in the editor?

tough abyss
#

yeah

native hemlock
#

_this wouldn't be defined, you would use this instead.

tough abyss
#

strange then why did it work before

#

and it works now without the if statement

#

intercepted the error for some script saying authenticated undefined

#

I'd think init.sqf runs before init player local

native hemlock
#

Here are two options on how to do it

  1. Give the laptop a variable name, for example yourTag_laptop. Delete any code from the object's init in the editor. In the script where you "authenticate" the player add the following.
if(Authenticated) then {
    yourTag_carID = yourTag_laptop addAction["<t color='#ffff00'>Cars and Support Vehicles</t>",{hint "xD"},["VVS_all_1","Car"]];
    yourTag_armouredID = yourTag_laptop addAction["<t color='#ffff00'>Armoured Vehicles</t>",{hint "dx"},["VVS_all_2","Armored"]];
};
  1. Your authenticated variable is not defined yet so you need to wait for it. One thing to note is that you cannot directly use waitUntil or sleep in an object's init, this is because it is run in the unscheduled environment, which does not allow for suspension. To get around that you can use spawn which will execute in the scheduled environment, where suspension is allowed. waitUntil will check the condition at max once per frame, so it doesn't hurt to use a sleep here. You would place the following code in the object's init. Just make sure to set the Authenticated variable to false, otherwise if the player isn't authenticated this waitUntil will never exit.
0 = [] spawn {
    waitUntil{sleep 1; !isNil "Authenticated"};
    if(Authenticated) then {
        yourTag_carID = this addAction["<t color='#ffff00'>Cars and Support Vehicles</t>",{hint "xD"},["VVS_all_1","Car"]];
        yourTag_armouredID = this addAction["<t color='#ffff00'>Armoured Vehicles</t>",{hint "dx"},["VVS_all_2","Armored"]];
    };
};
tough abyss
#

how do I introduce the variable before the init for objects are run?

#

thanks! I'll try that out

#

your 2nd solution doesn't work unfortunately

#

I'll try the first

#
if ([condition left out for privacy purposes]) then {
Authenticated = true;
} else {};``` in initplayerlocal.sqf
#

so if I use your second version, shouldn't it be working?

rocky cairn
#

How would I go about giving an AI units when it enters a trigger area?

#

Giving an AI unit a gun

tough abyss
#

addWeapon and addMagazine I suppose

native hemlock
#

Well I made a mistake, if you want to do the second method you would need to pass this to the spawn, since it appears this isn't defined once you spawn it. So then _this is used since the spawn is being passed a parameter.

0 = this spawn {
    waitUntil{!isNil "Authenticated"};
    if(Authenticated) then {
        yourTag_carID = _this addAction["<t color='#ffff00'>Cars and Support Vehicles</t>",{hint "xD"},["VVS_all_1","Car"]];
        yourTag_armouredID = _this addAction["<t color='#ffff00'>Armoured Vehicles</t>",{hint "dx"},["VVS_all_2","Armored"]];
    };
};
rocky cairn
#

I should clarify,I want it setup so that when any AI unit enters a trigger area just that AI unit gets a gun. then the next AI comes along enters the trigger and gets his gun.

tough abyss
#

yeah already edited it to that xD thanks for the help man! works!

tough abyss
#

bad news tho, only when putting true in the if-condition it actually works

#

somehow Authentication doesn't become true for that particular script because it does for the reserved slot script

tough abyss
#

fixed now

#

[WEST,"HQ"] sideChat "someting". Is it possible to have the abstract broadcaster be called Gaia or something else random?

#

HQ seems to be CROSSROAD

plucky beacon
#

@tough abyss you can call a unit to transmit and it will use name of that unit.

tough abyss
#

ah nice will try that!

#

do I need an actual unit or can I use a game logic?

plucky beacon
#

Correction the name of that group

#

I think it has to be because it uses the group callsign

past inlet
#

is there a way to edit weapons configs in game like editing bullet dispersion?

plucky beacon
#

@past inlet I'm sure there is but it's probably way more lucrative than making a mod that makes an edited version of that weapon.

plucky beacon
#

I set spectator in the respawn templates, and there is a button to go into spectator when in the respawn menu, but it just sits the camera at 0,0 coordinate and can't do anything.

tough abyss
#

Oh man, I just got a new desk, so that means enough space for my second monitor. Everything is incredible. I can script with one window, debug with the other.

plucky beacon
#

amaaaazing

tough abyss
#

noob question maybe but how can I call a script that contains sleeps without stalling the script it's being called in?

thin pine
#

@tough abyss use spawn

tough abyss
#

[] spawn 'script.sqf';ยฟ

#

Woops? *

dusk sage
#

spawn or execVM (the latter for paths)

tough abyss
#

spawn and execVM are the same you're saying?

dusk sage
#

One takes a file path, one directly takes code

tough abyss
#

strange thing here, I have an officer called Gaia in the group Gaia Security Protocol but when I use Gaia sideChat "something" on my dedicated server instead of Gaia it shows "Bravo 4-1" even though it worked perfectly fine when trying the multiplayer in Eden,

#

could it be ZEUS?

#

on the dedicated server even some triggers don't function properly

tough abyss
#

won't even play the sound set on trigger activation

tough abyss
#

only when renaming the unit to Gaia Security Protocol with zeus, the sidechat changes to that name

plucky beacon
#

@tough abyss triggers need parameters to be met on an individual client basis if I remember.

#

"conditions need to be met"

tough abyss
#

they are met

#

always

plucky beacon
#

They are set to True?

tough abyss
#

yes

plucky beacon
#

They don't repeat?

tough abyss
#

it's as simple as thr trigger detecting a CSAT soldier and should then start the alarm sound but refuses to do so

plucky beacon
#

Are you using the drop down menu or scripting it in the on Act.

tough abyss
#

drop down menu

plucky beacon
#

Try scripting it

#

PlaySound "soundeffect";

tough abyss
#

On Act usually works, but whenever I use Gaia sideChat "something" it stops working

plucky beacon
#

Or say2D probably is what you need

tough abyss
#

well the sidechat doesn't show up

plucky beacon
#

What about the radio transmission, like the diolague, does that play?

tough abyss
#

there is no dialogue

#

and no one the server sees the message in sidechat

plucky beacon
#

Are you using SideRadio command?

tough abyss
#

no, I am use Gaia sideChat "something";

#

in On Act

plucky beacon
#

If GAIA ceases to exist for any reason or dies, it won't send.

tough abyss
#

Gaia is always alive

#

it can't die

#

neither ceases to exist

plucky beacon
#

Is it a logic or a unit

tough abyss
#

unit

#

variable name Gaia

#

group name Gaia Security Protocol

plucky beacon
#

So far it's everything I would've done

tough abyss
#

I can send you the mission file if you wanna see the whole picture

plucky beacon
#

Sure, can't hurt to look

tough abyss
#

is there a function I can use that waits until the player is out of loading screen?

plucky beacon
#

if ((!isServer) && (player != player)) then
{
waitUntil {player == player};
};

teal coral
#

initPlayerLocal.sqf

tough abyss
#

Tuomur even then there can still be a loading screen if client side mods are loading in

lavish ocean
#

โ€ขAdded: A new _thisEventHandler variable containing an Event Handler handle was added to the entity, MP and mission Event Handler types (addEventHandler, addMPEventHandler, addMissionEventHandler)
not sure if anyone noticed it yesterday , it's another from the for scripting wishlist https://docs.google.com/spreadsheets/d/13mJqDXAmjzoFRZ0yVOLh9PcATp30xNvX99Uln0mFymU/

Google Docs

Sheet1

command name
, objective
, syntax
, description
, state
, build
, decision
,ย  internal AIII-
, Proof-of-Concept
exampleย  source code
" aPVEH", improve, source of PVEH for aPVEH' s_ this, expand_ thisย  of addPublicVariableEventHandler, WIP, approved, 14081, no, relates to 10589
" aPVEH",...

tough abyss
#

OH MY GOD

#

THIS LIST

native hemlock
#

You've checked quite a few things off that in recent time ๐Ÿ˜ƒ

tough abyss
#

THANK YOU BASED @lavish ocean

torn jungle
#

Im using notepad ++ with the SQF language plugin
does anyone know if there is a way to find or highlight errors made
specifically with stuff like this:

#
            "V_PlateCarrierGL_mtp",
            "H_HelmetB_grass",
            "optic_Aco",
            "acc_pointer_IR",
            "ItemGPS",
            "ItemMap",
            "ItemCompass",
            "ItemWatch",
            "ItemRadio",
            "NVGoggles",
        };```
#

the last item "NVGoggles", should not have a comma. I want to be able to spot things like these without going line by line. is that possible? ๐Ÿ˜ฆ

lavish ocean
#

@native hemlock i'm trying to get as much green as possible ... tho i seen quite some ninjas corpses in countryside around my secret mansion laterly

velvet merlin
#

@torn jungle squint from SBSMac might find it

#

also the SQF IDE based on intellij might be able to

torn jungle
#

@velvet merlin Thanks, will check out both.

meager granite
#

@torn jungle
This is how I started doing it recently, very readable and hard to forget or add extra comma in larger lists

list = [
     "item1"
    ,"item2"
    ,"item3"
    ,"item4"
    ,"item5"
    ,"item6"
];
torn jungle
#

@meager granite Thanks! thats very helpful and ill do that from now on.

#

@velvet merlin squint homepage seems to be having trouble, i cant install it ๐Ÿ˜• got an offline installer?

#

will try out poseidon tools

#

While i try and learn these tools, is anyone here familiar with regular expression? as a shortcut, in notepad++ or any other text editor i may just want to perhaps look for any , followed by } with any possible empty space or empty line in between. Is that possible?

velvet merlin
#

,\s*\r\n\s*}

#

n++ is crap though

sullen pulsar
#

I like my crap..

tough abyss
#

I like N++.

torn jungle
#

@velvet merlin ๐Ÿ˜ฎ apparently thats an invalid regular expression (although i understand what you typed meant). hmmm

#

are the symbols { and } used for something in regular expression? because it seems so.

native hemlock
#

You might need to escape the }, I can't remember if it's that one or { that you need to escape

torn jungle
#

roger that @native hemlock . And thanks to the site @velvet merlin posted i now know what escape means :p. This works now: ,\s*\r\n\s*\}

velvet merlin
#

as said dont use n++ for regex

torn jungle
#

i dont have to use the \r correct? since im not using mac

velvet merlin
#

In computing, a newline, also known as a line ending, end of line (EOL), or line break, is a special character or sequence of characters signifying the end of a line of text and the start of a new line. The actual codes representing a newline vary across operating systems, which can be a problem when exchanging text files between systems with different newline representations.
The concepts of line feed (LF) and carriage return (CR) are closely associated, and can be either considered separately or together...

pliant stream
#

regex is not a god damn regular language parser

#

and if you want to find commas preceding a right brace with nothing in between just do ,\s*\}

#

\s matches any whitespace i.e. it is equal to [ \t\r\n\f]

native hemlock
#

For notepad++ I think you would need to check a specific box for regex wildcards to match new line characters

tough abyss
#

Hey, I'm making a mission soon which involves certain units spawning in props in order to make a dynamic base war mission. I'd like to know what commands might be useful.

meager granite
#

createVehicle Kappa

buoyant heath
#

@lavish ocean: ooh, I needed that handle argument yesterday! Glad to see it's in the pipe.

tough abyss
#

EVERYTHING IN THIS DAMN GAME IS A VEHICLE

#

createVehicle "altis";

#

the map is now a vehicle.

lavish ocean
#

deleteVehicle ... and now you have no world paradox @tough abyss

tough abyss
#

But we forgot to delete the vehicle crew! They'll just be falling for eternity!

lavish ocean
#

eternity of desync and RPT spam ๐Ÿ˜‰

tough abyss
#

the horror.

final sparrow
#

Thanks, will be having nightmares of this from now on! ๐Ÿ˜ƒ

meager granite
#

Speaking of RPT spam, its quite annoying to end up with 1 GB of RPT each server session

buoyant heath
#

Uh...yikes? What's causing that kind of a mess?

meager granite
#

WARNING: SuppressCache::Trace called with huge input. Function exited to prevent program stall inside. tBeg[-14999.962891,21.889187,7448.547363]; tEnd[-14933.364258,21.889187,7314.142578]; ammoHit(0.900000); distance(150.000000)
In last 500 miliseconds was lost another 1 these messages.

#

Repeated nearly each second

#

Also Can't change owner from 0 to 2

#

And usual Object info not found stuff

lavish ocean
#

afaik that's already fixed @meager granite in newest profiling binaries

quiet bluff
#

how do i make when player press ''ctrl+*''(camera.sqs) it says globaly "shame shame"

thin pine
#

I'm liking that script command list..it's good to see that some commands have actually been thought about (enough to put em on the list at least) like 'forget'

rancid ruin
#

list = [ "item1" ,"item2" ,"item3" ,"item4" ,"item5" ,"item6" ];
oh god that looks evil

elfin bronze
#

I have made a dialog with some buttons. I want to know how to save the action from the player, like he's check a button, when he close an re open the dialog the button is already checked

rancid ruin
#

there's a few ways you could do that. i'd set a variable in uiNamespace and check it upon creation of the dialog.

#

might not be the best way, my code is noobish.

west lantern
#

oh god that looks evil
Implying that Russians are evil? :|
I kid, but it does look funky like RTL / opaque writing

rancid ruin
#

satan's comma placement

west lantern
#

instead of that break the config/scripts into smaller pieces and use #include or whatever is used in scripting and you dont have to be worried about typos or need software/regex to check for your syntax errors

#

+=debug alot :^)

meager granite
#

What evil about it? It is readable, it is easily editable, everything benefits towards smoother scripting experience. Its just that you're not used to it.

earnest valve
#

^

west lantern
#

.,the quick brown fox jumps over the lazy doG
Arabic?

rancid ruin
#

it's not literally evil sa-matra, just looks crazy

#

bet you 20 rubles you'll go back to the normal comma placement soon enough ๐Ÿ˜ƒ

open vigil
#

It could just be that the English language is infinitely more confusing than any scripting language. For example: two, to, too or there, their, they're ...

rancid ruin
#

all spoken languages are confusing though

open vigil
#

Though the first time I saw variables declared on the same line, I got confused

#

Too early in the morning ๐Ÿ˜ฆ

west lantern
#

bet you 20 rubles
cheap arse

#

English is sometimes confusing for non natives, gramar is a piss

#

compared to some European languages

jade abyss
#

Try German.

barren magnet
#

+1 for German ๐Ÿ˜ƒ

rancid ruin
scarlet spoke
#

Is it possible to use the #-operator from the preprocessor (the one that converts the following into a string) in plain SQF? So outside of any #define or #ifdef etc?

#

hint #test;

#

Would that be valid?

dusk sage
#

Nope

zealous solstice
#

it is valid you would get hint "test";

dusk sage
#

In plain SQF

zealous solstice
#

you only have 2 way to execute pain sqf

#

execVM and loadFile

#

and he ask about preprocessor

dusk sage
#

Outside of the preprocessor commands*

#

Such as, ```cpp
var = 5;
hint #var;

#

Depends how many errors you enjoy

zealous solstice
#

there will be no error

#

it will only not hint 5 it will hint var

dusk sage
#
hint #var;
#

Is not going to hint anything

indigo snow
#

it would, as long as the SQF is parsed

#

so any of the preProcess commands or execVM

dusk sage
#

I'll load up ARMA and try after my current game, but I guarantee it'll throw an error on the compile

zealous solstice
#

did execVM prase preprocess commands?

dusk sage
#

It does

zealous solstice
#

no why

#

it would not

dusk sage
#

execVM would be fine to use

zealous solstice
#

because hint #var; get parsed to hint "var";

#

what would not throw any thing

indigo snow
#

it will compile as long as you use a preprocess command or execVM

#

so you cant just load it into a CODE type variable in the debug editor or something

#

A = { hint #var }; would error

zealous solstice
#

only if you crate this

#

if this would be in a file that gets proprocessed it would not throw a error

dusk sage
#

I'm loading up now

tough abyss
#

How can I translate the number given to me by _position = getPos (vehicle player); over about five meters in front of the player?

indigo snow
#

my math-fu is weak but something like (getPos player) vectorAdd [cos(getDir player)*5,sin(getDir player)*5,0]

tough abyss
#

Sweet, thanks.

indigo snow
#

it will be a bit more than 5 meters

tough abyss
#

i'm thinking that [_position] vectorAdd [5,5,10]; would work, wouldn't it?

indigo snow
#

no

tough abyss
#

though _position doesn't need to be an array, i don't think

indigo snow
#

that would take into account direction

tough abyss
#

I want it to

zealous solstice
#

(vehcile player) modelToWorld [0,0,5]

#

that should work too

indigo snow
#

isnt that 5 up?

zealous solstice
#

oh no ๐Ÿ˜ƒ

#

or wait

tough abyss
#

Basically, what I want to do, is have a prop spawn in front of a player when they click a button in a GUI.

indigo snow
#

or is that the modelspace yz switch

zealous solstice
#

but yeah that should work modeltoworld is to local

#

yah

native hemlock
#

modelToWorld is x, y, z

zealous solstice
#

sure?

native hemlock
#

Positive

tough abyss
#

_position = player modelToWorld [5,0,0];
?

zealous solstice
#

yeah but modeltoWorld is easyer than the Math from @indigo snow

#

๐Ÿ˜ƒ

native hemlock
#

positionCameraToWorld is x, z, y

indigo snow
#

i knew one of the position formats was wierd

tough abyss
#

Hmm

native hemlock
#

If you want it 5 meters in front of you it would be [0, 5, 0]

tough abyss
#

oh, okay!

dusk sage
#

execVM:

18:50:15   Error position: <#var;>
18:50:15   Error Invalid number in expression

preProc:

18:51:01   Error position: <#var;>
18:51:01   Error Invalid number in expression

Using CfgFunctions:

18:51:30   Error position: <#var;
18:51:30   Error Invalid number in expression
#

Same stuff, but it's not gonna hint a soul

tough abyss
#
_position = player modelToWorld [5,0,0];```
#

This is what I've got.

#

Will that not work, I feel?

zealous solstice
#

than should no macro work

#

๐Ÿ˜ƒ

tough abyss
#

Because I'm defining _position twice? maybE?

zealous solstice
#

if that is true

tough abyss
#

i'm really noobish with scripting~

native hemlock
#

That's 5 to your right

tough abyss
#

Oh, duh.

native hemlock
#

But I have no idea what else you are doing

#

And you are defining position twice

dusk sage
#
_position = (vehicle player) modelToWorld [0,5,0];

If you want infront of the vehicle, not player

tough abyss
#

Yeah, I just want to alter the value _position getPos (vehicle player); gives.

#

Ahh, thanks!

zealous solstice
#

dont getPos

dusk sage
#

my bad

native hemlock
#

modelToWorld's first parameter is an object

dusk sage
#

:>

indigo snow
#

@dusk sage its indeed not listed on the wiki but you're right, # and ## only work inside #define scope

#

learned something ๐Ÿ˜ƒ

tough abyss
#

So if I wanted, say, a prop to spawn in this manner, would it be _position = (vehicle player) PROP modelToWorld [0,5,0];

dusk sage
#

You are forgetting one thing

#

S.Q.F

#

๐Ÿ™†

indigo snow
#

@tough abyss no, btw

tough abyss
#

What'd be the best way to do it?

indigo snow
#

use _position

dusk sage
#
_prop = "propClass" createVehicle ((vehicle player) modelToWorld [0,5,0]);
tough abyss
#

Okay!

dusk sage
tough abyss
#

Yeah, I'm familiar with that command, at least, just wasn't sure where to put it.

indigo snow
#

keep the wiki open always ^^

dusk sage
#

You so far have only generated a position, so you'll want to then create an object at that location

#

^

tough abyss
#

Already ahead of you!

dusk sage
#

Oh god, I CTRL+F that page sometimes

#

Usually end up looking manually due to the amount of results -.-

tough abyss
#

Heh, it narrows it down some.

#

Anyways, I'm trying to find a script that'll make direct chat talk to you.

dusk sage
#

They need to introduce buttons for A-Z, unless I'm just blind

tough abyss
#

Tight, thanks!

dusk sage
#

Not aware of a direct though

tough abyss
#

I can just use vehicle, I suppose.

#

No biggie

dusk sage
#

It's local, so only the client it is executed on will see the message

#

So no stress there

tough abyss
#

Oh!

indigo snow
#

if you just want text to display, i always just use systemChat

tough abyss
#
vehicle player systemChat "Building 20% done!";
sleep 5;
vehicle player systemChat "Building 40% done!";
sleep 5;
vehicle player systemChat "Building 60% done!";
sleep 5;
vehicle player systemChat "Building 80% done!";
sleep 5;
vehicle player systemChat "Building 100% done!";
_prop = "propClass" createVehicle ((vehicle player) modelToWorld [0,5,0]);```
#

That should work, right?

barren magnet
#

use brackets like this (vehicle player)

#

Avoids errors in some cases

dusk sage
#

systemChat doesn't take any arguments

scarlet spoke
#

And use a loop... That increases the readability

tough abyss
#

oh, so it's just systemchat?

dusk sage
#

It doesn't appear to come from any particular unit

indigo snow
#

takes 1 ๐Ÿ˜‰

tough abyss
#

okay!

dusk sage
#

So just ```cpp
systemChat "hi";

#

Etc

#

@indigo snow har har

tough abyss
#

thank you all so much for your help so far. i'll have a lot more questions, but still.

indigo snow
#

had to go for the dig โค

dusk sage
#

#preprocessor

#

๐Ÿ‘บ

zealous solstice
#

@dusk sage yeah you are right ๐Ÿ˜ƒ

#

i remeber there something wrong

scarlet spoke
#

@tough abyss you can use for "_i" from 20 to 100 step 20 do {} ;

indigo snow
#

that would be overcomplicating things

barren magnet
#

or you do from 1 to 5 do {}

#

lol

zealous solstice
#
for "_i"  from 20 to 100 step 20 do {
    sleep 5;
    systemChat format ["Building %1 % done!", _i];
} ;
```
#

why is this "overcomplicated"

dusk sage
#

I'm not even sure on the difference that'll make (performance side)

#

I doubt any

zealous solstice
#

but it is more readable

dusk sage
#

Yep

#

Except the lack of _i in your format

#

Goddamn

#

Goddamn.

zealous solstice
#

yeah i missed that

indigo snow
#

its overcomplicating for someone who just started coding. Ofc people whove been at it longer know the better solutions

dusk sage
#

I saw the blinkering of pixels as I was typing

#

๐Ÿ˜‰

tough abyss
#

Let's see if it works!

dusk sage
#

Also don't forget "propClass" was a placeholder

#

Before you run it ๐Ÿ˜‰

scarlet spoke
#

But that's definitely something one should get used to from the beginning on as the rest is just a mess and absolutely redundant

tough abyss
#

Yep!

indigo snow
#

can do that after youve got workable code

tough abyss
#

Does Bicycle still work as a propclas?

indigo snow
#

but i digress, to each their own

tough abyss
#

Oh.

#

That's a vehicle.

#

Durrrr....

dusk sage
#

All objects in ARMA are vehicles

indigo snow
#

there are no bycicles in A3 though

tough abyss
#

I'm looking in the config viewer.

dusk sage
#

All use the same command, don't be fooled by 'CfgVehicles'

#

etc

tough abyss
#

ah

#

_prop = "CarWreck" createVehicle ((vehicle player) modelToWorld [0,5,0]); Just for testing purposes, will this propclass work?

indigo snow
#

maybe, might be a base class

#

B_soldier_F is the NATO rifleman

tough abyss
#

Right.

native hemlock
#

Something to consider though, that usage of createVehicle won't be guaranteed to spawn the vehicle exactly 5 meters in front of you.

dusk sage
#

I don't think that will work

tough abyss
#

As long as it's reasonably close, and consistent.

#

5 meters was more or less a placeholder.

native hemlock
#

It tries to decide what the nearest empty position is

tough abyss
#

Ah, I see

#

That should be fine.

indigo snow
#

you can simply move them after creating, keep in mind

native hemlock
#

So in theory if there was a vehicle in the way it would try and find the nearest position it could spawn the new vehicle with colliding with what is currently there. It's not fool proof though and sometimes things can go boom

#

But as cptnnick said, "CarWreck" wouldn't work, it is a base class

tough abyss
#

Honestly, with the group I'm making this for, that'd just end up being fucking hilarious rather than something to gripe about.

dusk sage
#
"Land_Wreck_Car_F"
``` @tough abyss
tough abyss
#

Thank you!

dusk sage
#

Give that a whirl

tough abyss
#

Where did you find these in the cfg viewer?

indigo snow
#

generally anything ending in _F

#

has a scope suitable for spawning

native hemlock
#

Ehh I disagree

#

Truck_F

indigo snow
#

fair enough

dusk sage
#

You can find these in CfgVehicles in the Config Viewer, yep, I just happen to have that one on my desktop ๐Ÿ˜‰

tough abyss
#

iT WORKED!

#

Whoops, caps.

#

Thank you guys so much! Now that I know how to do that, it's time to learn how to implement it into a GUI.

#

[Soft crying]

native hemlock
#

I can't think of anything that has the prefix of Land_ that wouldn't work

tough abyss
#

Oh, I suppose I should disable user inputs and make them do an animation too.

#

That shouldn't be difficult at all.

indigo snow
dusk sage
#

Damn, you included the '_', almost had you with LandVehicle ๐Ÿ˜‰

tough abyss
#

Yep.

#

How can I force an animation?

dusk sage
#

'force'?

tough abyss
#

Well, loop an animation until the script is complete.

dusk sage
#

By making them do an animation, in some senses you are forcing that onto them

tough abyss
#

I'm, uh, really kinda new to scripting. How can I make a loop to do that?

#

Well, not really, but compared to you guys.

dusk sage
#
while {true} do {
    if (animationState player != "YourAnimation") then {
        //apply animation
    };
    //If action is done exitWith
};
tough abyss
#

I'd also like this to take the rotation of the player, and make it relative to vehicle player.

#

Also, I'm not quite sure how to implement this loop.

scarlet spoke
#

@tough abyss do you speak German?

tough abyss
#

Nope.

scarlet spoke
#

Bad luck... I know a really good tutorial for scripting but it's in German :/

tough abyss
#

Ahh.

#

The worst! ;-;

#

Also, @dusk sage , is it possible to just have the animation loop for the 25 seconds it takes to build this?

dusk sage
#

Yep, run this in debug

#
endLoop = false;
0 = [] spawn {
    sleep 25;
    endLoop = true;
};
0 = [] spawn {  
    while {true} do {  
        if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
        player switchMove "AinvPknlMstpSnonWnonDnon_medic_1"; 
        player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";  
    };  
    if (endLoop) exitWith {};  
    };
};
#

As to the spawns, suspension is not allowed in the un-scheduled environment (the debug console), and while loops end at 10k iterations, so you'll not notice anything

indigo snow
#

while {!endLoop} ?

dusk sage
#

Indeed

tough abyss
#

This is funky as shit.

#

I'm getting a generic error now with ```sleep 5;
systemChat "Building 20% done!";
sleep 5;
systemChat "Building 40% done!";
sleep 5;
systemChat "Building 60% done!";
sleep 5;
systemChat "Building 80% done!";
sleep 5;
systemChat "Building 100% done!";
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]);

#

Also, the disableuserinput didn't seem to work at all. I suspect I put it in the wrong spot.

dusk sage
#

As per what nick said:

0 = [] spawn {
    _timeStarted = time;
    while {time - _timeStarted < 25} do {  
        if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
        player switchMove "AinvPknlMstpSnonWnonDnon_medic_1"; 
        player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";  
    };   
    };
};
tough abyss
#

It skips all the sleeps, and just spawns the unit.

#

That bit workd fine.

#

Oh!

dusk sage
#

Are you in debug?

tough abyss
#

Yes.

#

Well, I'm using the debug console.

#
    _timeStarted = time; 
    while {time - _timeStarted < 25} do {   
        if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then { 
        player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";  
        player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";   
    };    
    }; 
}; 
sleep 5; 
systemChat "Building 20% done!"; 
sleep 5; 
systemChat "Building 40% done!"; 
sleep 5; 
systemChat "Building 60% done!"; 
sleep 5; 
systemChat "Building 80% done!"; 
sleep 5; 
systemChat "Building 100% done!"; 
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]); 
dusk sage
#

Okay, you cannot suspend in a non-scheduled environment, such as the debug console (sleep, waitUntil etc)

tough abyss
#

Oh!

dusk sage
#

That's why I used spawn (to create a scheduled environment)

#

The same holds for your bunch of sleeps, spawn them

tough abyss
#

It works!

dusk sage
#

Ohh, we're allowed to use ```cpp
[] spawn

tough abyss
#

Alright, so, how can I make it grab the position of the player and apply it to the object, with a possible translation?

#

Just tell me the command, I want to see if I can figure it out for myself.

dusk sage
#

You already have done the same thing

#
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]); 
#

You created a wreck 5 metres (within reason), infront of the player

tough abyss
#

My bad, not position

#

Rotation

dusk sage
tough abyss
#

Thanks!

dusk sage
#

getDir will give you the current direction, as reference for setDir

tough abyss
#

_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0] getDir = _direction player setDir "_direction" ); ?

#

or _direction = "getDir"?

dusk sage
#
Syntax:
getDir object
tough abyss
#

Oh.

dusk sage
#

You should never be use quotations unless it requires a string

tough abyss
#

Alright.

dusk sage
#

So if you wanted it to face the same direction as yourself

#
_prop setDir (getDir player);
tough abyss
#

I see !

dusk sage
#

However, be aware that getDir does indeed get the objects direction, but that might not always be the direction you think it's facing

tough abyss
#

Right, I might have to translate it.

dusk sage
#

Indeed

tough abyss
#

I was thinking about that

dusk sage
#

Models blah

tough abyss
#

_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0] _prop setDir (getDir player));

#

It's yelling at me for missing parenthesis.

#

also land_wreck_car_f has parenthesis

#

Erm, underscore.s.

#

My syntax highlighter isn't showing any errors, either.

dusk sage
#

You have two statements on one line (without a semi-colon)

tough abyss
#

Oh!

#
_prop setDir (getDir player));
```?
dusk sage
#
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]);
_prop setDir (getDir player);
tough abyss
#

Now it's yelling 'missing ) in line 21', which is _prop setDir (getDir player));

#

the script executed fine, though. lol.

indigo snow
#

( ))

#

See the error?

tough abyss
#

Yep.

#

I was actually sending a snapchat of the script to my friend when I noticed it

#

I was like "wait i'm dumb"

scarlet spoke
#

Some times (but only some times) the error message is correct with telling you what's wrong ^^

tough abyss
#

Now the _prop setDir (getDir player); isn't setting the direction. no error, though.

#
    _timeStarted = time;
    while {time - _timeStarted < 25} do {  
        if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
        player switchMove "AinvPknlMstpSnonWnonDnon_medic_1"; 
        player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";  
    };   
    };
};
sleep 3;
systemChat "Building 20% done!";
sleep 3;
systemChat "Building 40% done!";
sleep 3;
systemChat "Building 60% done!";
sleep 3;
systemChat "Building 80% done!";
sleep 3;
systemChat "Building 100% done!";
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]);
_prop setDir (getDir player);
scarlet spoke
#
    _timeStarted = time;
    while {time - _timeStarted < 25} do {  
        if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
        player switchMove "AinvPknlMstpSnonWnonDnon_medic_1"; 
        player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";  
    };   
    };
};
for "_i" from 20 to 100 step 20 do {
    sleep 3;
    systemChat format ["Building %1% done!", _i];
};
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]);
_prop setDir (getDir player);```
#

Believe me you want to use the loop...

tough abyss
#

How come?

scarlet spoke
#

Otherwise you will be curse when changing something

#

Like this you don't type the same bit of code over and over again and if you want to (for example) change the message you have to change it once instead of multiple times

tough abyss
#

Still not properly getting the direction. or, perhaps it's not setting it.

scarlet spoke
#

Yep that was just about the redundancy of your code ๐Ÿ˜‰

tough abyss
#

Even with your script.

halcyon crypt
#

does function recompiling work on stable?

#

I have cba caching disabled but changes don't seem to be picked up

scarlet spoke
#

It worked for me

tough abyss
#

WORKS ON MY MACHINE

#

no but uh

#

hmm

scarlet spoke
#

@tough abyss try logging the direction you're retrieving and the created object to make sure they have actual values and are not some weird null state or whatever

#

Either via hint or via diag_log

tough abyss
#

hint (getDir player); right?

scarlet spoke
#

hint str(getDir player);

#

You have to convert it into a String in order to hint it out ๐Ÿ˜ƒ

halcyon crypt
#

any ideas why "MYTAG_fnc_myFunction" call BIS_fnc_recompile; works but [] call BIS_fnc_recompile doesn't?

#

it doesn't seem to pick up the changes in that specific function on the global recompile

#

:/

native hemlock
#

This is BIS_fnc_recompile

private ["_functionsInit"];
_functionsInit = gettext (configfile >> "CfgFunctions" >> "init");
if (_functionsInit != "") then {
    _this call compile preprocessfilelinenumbers _functionsInit;
    true
} else {
    "Functions Init not found!" call (uinamespace getvariable "bis_fnc_error");
    false
};
tough abyss
#

thanks @scarlet spoke , just saw the message

#

How do I use BIS_fnc_selectRandom to select six random players?

#

_guy = allplayers bis_fnc_selectrandom something like this, right

dusk sage
#

You can use

#

selectRandom array

#

New engine solution

#

Just a FYI

native hemlock
#

Yeah you don't need to use BIS_fnc_selectRandom anymore. So you'd just do

_randomGuy = selectRandom allPlayers;
dusk sage
#

Unless Ofcourse you're on Linux ๐Ÿ˜‰

native hemlock
#

Are the mac and linux branches on 1.58 yet?

dusk sage
#

1.54

tough abyss
#

So @native hemlock , how can I edit that to make it select 6 players?

dusk sage
#

Do it 6 times ๐Ÿ˜‰

tough abyss
#

Oh, okay!

#

Thanks~

#

Wait if that was a joke it went over my head

native hemlock
#

You could theoretically select the same guy twice though

dusk sage
#

Was not a joke, no ๐Ÿ˜›

#

Can't use code tags on my mobile, sigh

tough abyss
#

Rip.

#

How can I make sure it doesn't select the same guy twice?

dusk sage
#

Two seconds

#

private _array = [];
while {count _array < 6} do {
_array pushBackUnique (allPlayers selectRandom);
};

tough abyss
#

Thanks!

dusk sage
#

I'm sure Pennyworth is about to chime in with a more elegant answer though

native hemlock
#

There are so many ways to do it, and BoGuu's is decent. This is actually a fairly common beginner's programming challenge

#

I'm playing siege so I can only type a few words at a time ๐Ÿ˜›

tough abyss
#

Alright, I appreciate you guys helping me so much.

#

Anyways! How can I set those selectd players to have things done to them

dusk sage
#

๐Ÿ˜‰

#

'Things done to them'?

native hemlock
#

Probably easiest to have him explain rather than us

#

He has 3 more parts to that tutorial about arrays as well

tough abyss
#

Thanks!

tough abyss
#
while {count _array < 6} do {
    _opfor pushBackUnique (allPlayers selectRandom);
};
systemChat "You are OPFOR! Kill the INDFOR and VIP! Do NOT hurt civilians!";
_opfor addPrimaryWeaponItem "arifle_Katiba_C_ACO_pointer_F";
_opfor addMagazine ["30Rnd_65x39_caseless_green", 3];
``` does this look good so far?
dusk sage
#

_opfor is an array

#

addPrimaryWeaponItem and addMagazine are looking for an object

#
{
    systemChat "You are OPFOR! Kill the INDFOR and VIP! Do NOT hurt civilians!";
    _x addPrimaryWeaponItem "arifle_Katiba_C_ACO_pointer_F";
    _x addMagazine ["30Rnd_65x39_caseless_green", 3];
} count _opfor;
native hemlock
#

That would result in the server or whatever client is executing the script to spam that systemChat 6 times only for themselves.

dusk sage
#

Just looked again. Can look into remoteExec @tough abyss

#

Got em'

#

My timings are off today ๐Ÿ˜“