#arma3_scripting
1 messages ยท Page 248 of 1
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.
It never gets out of your while {!loopdone} block apparently
How do you reckon I can fix it?
Or not, lack of any human-readable formatting ruins reading it
So I'm pretty much SOL?
I've tried to reach out to the script author, he hasn't responded.
Hm
Try to remove loopdone = false; between _5thshot and _6thshot
I think it will fix it
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};
So did it?
How do I get the code formatting? That's just fixed width.
no, I've been running it like that.
upload final code
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
You don't need switchCamera
have no loopdone = false in the middle of a loop should fix it
Either way, it's not switching back.
delete the camera
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
Did I?
on that last pastebin
unless you sent only part of the code and not the whole thing
Nah, I ripped it out incorrectly.
What should I replace with those nil values?
you don't
Oh. Duh.
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
Anybody knows on the fly, how to disable the SquadRadar and enable the old GPS?
@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
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
I'm confused, squad radar isn't in 1.62
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
};```
no that is a extera setting
in the Description.ext
that is called showSquadRadar
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
It looks just like the squad radar used on an Invade and Annex server https://gyazo.com/fdf18e70a40e1f3c2b9f0ff8d23ece25
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
hm, Searched through all my files, haven't found anything related to IaA oO
Anything from Quicksilver? If I recall correctly he mentioned creating the one I linked a picture of
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?
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 ยฝ ย
ย
you should not open it. mdmp and bidmp are crash reports with what you can debug a application if you have the source code.
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.
perhaps wrap everything inside an if instead of the exitWith?
// your stuff
};```
kind of, I actually meant in place of the exitWIth but that should work as well for now. ๐
In situations like this you debug your variables
Use systemChat or diag_log to print the value of that bis fnc is curator call
Not what I meant....btw is your Zeus a permanent slot? Aka a logic?
That's okay
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
Errors are why
lmao
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)
Rest of your script probably isn't executing
You're right, it's not.
Also I was about to write the above...that's why I - asked about the logic
So how should I implement that into my code?
Sorry ๐
How many zeus slots?
@halcyon crypt no it's good...im on phone and i type slow you saved me time
Just the one.
Use Marcels second code
Wrap an if around it and replace it with your original exitwith condition
another possible option is if (player in ([] call BIS_fnc_listCuratorPlayers)) then {};
Exitwith will work fine as well :)
Looks nicer imo and is close to cpps return...but yeah preferences
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 { ?
and if http://pastebin.com/Sd3NnHm8 doesn't work then try http://pastebin.com/tcUfZzzt
Yeah just follow the pc users code
Alright. I'm gonna take five and eat, but I'll be right back.
I'll wait a little bit before I go off ๐
the music and the cutText?
how are you calling that script?
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?
sorry, meant the settings for the module ๐
One is for myself, one is for the currently logged in admin, and the last is for the slot-in slot.
but that explains it as well
seems like you have to wait until curator has initialized fully
Hmm...
So can I just make the init.sqf sleep for a few seconds before the script executes?
try adding this in your init.sqf waitUntil {!isNull (getAssignedCuratorUnit (allCurators select 0))};
or at the top of the intro script
playMusic "IntroMusic";
if (hasInterface) then {
if (player == getAssignedCuratorUnit (allCurators select 0)) exitWith {};
cutText ["", "BLACK IN", 0];```
This is what I've got.
yeah
you have 3 modules though, so the select 0 is probably selecting the wrong one ๐
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.)
also try a sleep instead of the waitUntil
Alright, so, let's just say sleep 10;?
playMusic "IntroMusic";
if (hasInterface) then {```
yeah
guess zeus still has it's quirks ๐
Thanks, BI.
Alright, I'm off. Have fun. ๐
Thank you so much! ๐
anybody know if array overhead has been resolved? https://feedback.bistudio.com/T73750
@native hemlock
showGroupIndicator = 1; = Disables normal GPS and enables that dang thing... -.-
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?
Are macros case-sensitive?
I think so.
@tough abyss thx
You're welcome!
Does someone know how to eject a vehicle from another one when using ViV-transport? Does the "Eject" action work on these vehicles?
@scarlet spoke https://community.bistudio.com/wiki/setVehicleCargo
@split coral thanks
That's a really weird way of implementing it ^^
Yeah. I wouldn't have known where to look if I hadn't remembered seeing this on the forums.
๐
There is no way to get/build the actual node map of a buildings AI path lod, just the "posXX" with buildingPos, right?
Anyone know of how to make an empty vehicle start with engines on?
Would put something like this engineOn true; in the vehicle init
@solar geode not with Arma AI unfortunately. Its the dream though..
@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. ๐ฆ
@solar geode sounds like something that could be requested....like roadsConnectedTo except buildingPosConnectedTo
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
https://community.bistudio.com/wiki/forEach I'm pretty sure forEach would fix that issue.
Then again, I'm a huge rookie with scripting.
@plucky beacon
forEach where?
Let me see if I can pull an example out of my code
for each player?
I don't think that's relavent to my intended purpose
You want the script to be executed for certain units, right?
I want it to be executed for everyone and anyone who is of a certain unit type
Oh. I'd take the easy way and just assign variables with the nomenclature of what class they are
drifting, you need to change _this to _unit
I was following the wiki example 2 because I skimmed it
this addEventHandler ["killed", "hint format ['Killed by %1',_this select 1]"]
err, misread. try _this select 0 or redefine _unit agian inside the eventHandler
ya it makes sense it should already have the unit selected
Wow, my keyboard-fu is miserable today
Discord is freaking out on me today
_unit addEventHandler {"respawn", {params ["_unit", "_corpse"]; ... if (( typeOf _unit isEqual...
My messages are having a huge delay and repeating sometimes
It does seem to be going a little crazy
_unit addEventHandler {"respawn", {params ["_unit", "_corpse"]; ... if (( typeOf _unit isEqual...
Glad it's not just me
Okay
Glad it's not just me
Wow, asking nicely really does work!
Typically~
@plucky beacon did you get your issue resolved? Kind of hard to spot in the messages above ๐
LOL no unfortunately, I'm going to look at how Insurgency did it with their pilot respawns
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 {
Also: params ["_unit"] to use _unit instead of _this select 0. A bit easier to read when you look at it tomorrow.
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?
Good!
if (getMarkerColor "your_marker" == "") then {};
or getMarkerType seems a bit more "intuitive"
kind of
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
okay
Does anyone have a reliable way to return the door closest to you?
@barren magnet You beautiful bastard!
Thanks for this, been looking for something like this forever
I'm still loved?
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.
I'm actually not, I popped in while feeling nostalgic.
Well shit, great timing then lol.
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.
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!
I just rejoined the discord, left it awhile ago. Pretty sure Dwarden doesn't love me anyways.
Ah I see.
Probably one of the few "life" people that's looked up to.
Am caramba
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?
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
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";
};
};
You could use a prompt box
sec, haven't touched arma related stuff in 10 months or so... so I have to search for it
haha if you find it, send me the link and I'll see if I can make something with it
https://community.bistudio.com/wiki/BIS_fnc_guiMessage
You can rig it up to say hey you're in a reserved slot and are not authorized to use it blah blah blah and then once they press OK or w/e you name the button as you can then have it boot them out to lobby
There's that and then there is just setting up a custom Debriefing screen explaining why they're being returned to lobby (CfgDebriefing)
Added: A new _thisEventHandler variable containing an Event Handler handle was added to the entity, MP and mission Event Handler types (addEventHandler, addMPEventHandler, addMissionEventHandler)
Kju lives
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?
I don't even know anymore.
think the gui message would be more user friendly
its it basically just a convience or is there some actual new functionality/possibilities that way?
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
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
It's a feature.
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
How do I use that command correctly?
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.
@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
CMFlareLauncher is the weaponname
Ya
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
@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
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
@tough abyss probably but I only know of kicking someone out after they get in game on a slot. Not before.
@dull parrot
- delete all former pbos of the mission in the various locations
- get agentransack
- do a mass search in your source folder
- use a good console to debug and dynamically apply sqf cmds
can one apply setVar on ammo (like flying bullets, shells, etc)?
I'm using a bool for identifcation purposes. Do I need to use if(Authentication == true){} or simple if(Authentication)?
alright thanks
If you ever want two booleans do bool && bool
Wait what did I miss since when is Tonic here again :0
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"
It should be in Sqf format so not in the .ext
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"; ?
bool Authenticated = false; < what?
isn't a bool either true or false?
just vafriable name = something;
sorry, too much C I guess ๐
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
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
white spaces are irrelevant
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.
hey is anyone running arma2 servers anymore??
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.
is it accesable to arma 2 free users? i still have my files from a while ago and was wondering
so making an undefined variable public?
hmm?
Ah damn, I actually can't remember if we ended support for arma 2 free.
I think we did.
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?
how many servers are currently up cause ima be tryin for a while
You might have better luck asking in #looking_for_game .
199.229.249.53:2332
if it's local, other script won't know about it for certain
thats what i found
Ah, that's true.
idk what u guys mean by the variable... lol
A 'variable' is a really broad term, but in this sense it refers to something we're pointing at.
oh lol ok
It's just like math, really. Variable Y can be anything, but Y = Y.
Variable Y = Y that is
It's weird to explain.
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;
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.
_email is probably not what you think it is.. ๐
diag_log (str _email) or hint (str _email)
did you ever look at the return of squadParams?
Here you guys go: https://community.bistudio.com/wiki/Initialization_Order
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
hmm any known downsides to using varspace getVariable name over varspace getVariable [name, defaultValue] (besides the default value thing that is)?
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
@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.
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
woops forgot to delete one variable broadcast
Hi guys does anyone know if there is a command or a way to reduces the friction of a vehicle?
what does Waituntil(!Nill player); usually do?
That can be changed easily in a config, but without mods I can only think of changing the mass https://community.bistudio.com/wiki/setMass
That would do nothing, because !Nill isn't a command and waitUntil needs { and }
sorry, WaitUntil{!isNull player};
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
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"]];
};
Well where is that being run from? _this is probably undefined
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
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
What object are you putting that script on?
a laptop
From the object's init in the editor?
yeah
_this wouldn't be defined, you would use this instead.
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
Here are two options on how to do it
- 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"]];
};
- 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
spawnwhich will execute in the scheduled environment, where suspension is allowed.waitUntilwill 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"]];
};
};
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?
How would I go about giving an AI units when it enters a trigger area?
Giving an AI unit a gun
addWeapon and addMagazine I suppose
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"]];
};
};
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.
yeah already edited it to that xD thanks for the help man! works!
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
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
@tough abyss you can call a unit to transmit and it will use name of that unit.
Correction the name of that group
I think it has to be because it uses the group callsign
is there a way to edit weapons configs in game like editing bullet dispersion?
@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.
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.
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.
amaaaazing
noob question maybe but how can I call a script that contains sleeps without stalling the script it's being called in?
@tough abyss use spawn
spawn or execVM (the latter for paths)
spawn and execVM are the same you're saying?
One takes a file path, one directly takes code
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
won't even play the sound set on trigger activation
only when renaming the unit to Gaia Security Protocol with zeus, the sidechat changes to that name
@tough abyss triggers need parameters to be met on an individual client basis if I remember.
"conditions need to be met"
They are set to True?
yes
They don't repeat?
it's as simple as thr trigger detecting a CSAT soldier and should then start the alarm sound but refuses to do so
Are you using the drop down menu or scripting it in the on Act.
drop down menu
On Act usually works, but whenever I use Gaia sideChat "something" it stops working
Or say2D probably is what you need
well the sidechat doesn't show up
What about the radio transmission, like the diolague, does that play?
Are you using SideRadio command?
If GAIA ceases to exist for any reason or dies, it won't send.
Is it a logic or a unit
So far it's everything I would've done
I can send you the mission file if you wanna see the whole picture
Sure, can't hurt to look
is there a function I can use that waits until the player is out of loading screen?
if ((!isServer) && (player != player)) then
{
waitUntil {player == player};
};
initPlayerLocal.sqf
Tuomur even then there can still be a loading screen if client side mods are loading in
โข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/
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",...
You've checked quite a few things off that in recent time ๐
THANK YOU BASED @lavish ocean
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? ๐ฆ
@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
@torn jungle squint from SBSMac might find it
also the SQF IDE based on intellij might be able to
@velvet merlin Thanks, will check out both.
@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"
];
@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?
At Regular-Expressions.info you will find a wide range of in-depth information about a powerful search pattern language called regular expressions.
,\s*\r\n\s*}
n++ is crap though
I like my crap..
I like N++.
@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.
You might need to escape the }, I can't remember if it's that one or { that you need to escape
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*\}
as said dont use n++ for regex
i dont have to use the \r correct? since im not using mac
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...
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]
For notepad++ I think you would need to check a specific box for regex wildcards to match new line characters
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.
createVehicle Kappa
@lavish ocean: ooh, I needed that handle argument yesterday! Glad to see it's in the pipe.
EVERYTHING IN THIS DAMN GAME IS A VEHICLE
createVehicle "altis";
the map is now a vehicle.
deleteVehicle ... and now you have no world paradox @tough abyss
But we forgot to delete the vehicle crew! They'll just be falling for eternity!
eternity of desync and RPT spam ๐
the horror.
Thanks, will be having nightmares of this from now on! ๐
Speaking of RPT spam, its quite annoying to end up with 1 GB of RPT each server session
Unrelated to #arma3_scripting though
Uh...yikes? What's causing that kind of a mess?
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
afaik that's already fixed @meager granite in newest profiling binaries
how do i make when player press ''ctrl+*''(camera.sqs) it says globaly "shame shame"
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'
list = [ "item1" ,"item2" ,"item3" ,"item4" ,"item5" ,"item6" ];
oh god that looks evil
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
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.
oh god that looks evil
Implying that Russians are evil? :|
I kid, but it does look funky like RTL / opaque writing
satan's comma placement
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 :^)
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.
^
.,the quick brown fox jumps over the lazy doG
Arabic?
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 ๐
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 ...
all spoken languages are confusing though
Though the first time I saw variables declared on the same line, I got confused
Too early in the morning ๐ฆ
bet you 20 rubles
cheap arse
English is sometimes confusing for non natives, gramar is a piss
compared to some European languages
Try German.
+1 for German ๐
on the topic of german, i have a question in #offtopic_arma
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?
Nope
it is valid you would get hint "test";
In plain SQF
you only have 2 way to execute pain sqf
execVM and loadFile
and he ask about preprocessor
Outside of the preprocessor commands*
Such as, ```cpp
var = 5;
hint #var;
Depends how many errors you enjoy
I'll load up ARMA and try after my current game, but I guarantee it'll throw an error on the compile
did execVM prase preprocess commands?
It does
execVM would be fine to use
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
only if you crate this
if this would be in a file that gets proprocessed it would not throw a error
I'm loading up now
How can I translate the number given to me by _position = getPos (vehicle player); over about five meters in front of the player?
my math-fu is weak but something like (getPos player) vectorAdd [cos(getDir player)*5,sin(getDir player)*5,0]
Sweet, thanks.
it will be a bit more than 5 meters
i'm thinking that [_position] vectorAdd [5,5,10]; would work, wouldn't it?
no
though _position doesn't need to be an array, i don't think
that would take into account direction
I want it to
isnt that 5 up?
Basically, what I want to do, is have a prop spawn in front of a player when they click a button in a GUI.
or is that the modelspace yz switch
modelToWorld is x, y, z
sure?
Positive
_position = player modelToWorld [5,0,0];
?
positionCameraToWorld is x, z, y
i knew one of the position formats was wierd
Hmm
If you want it 5 meters in front of you it would be [0, 5, 0]
oh, okay!
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
_position = player modelToWorld [5,0,0];```
This is what I've got.
Will that not work, I feel?
Because I'm defining _position twice? maybE?
if that is true
i'm really noobish with scripting~
That's 5 to your right
Oh, duh.
_position = (vehicle player) modelToWorld [0,5,0];
If you want infront of the vehicle, not player
Yeah, I just want to alter the value _position getPos (vehicle player); gives.
Ahh, thanks!
dont getPos
my bad
modelToWorld's first parameter is an object
:>
@dusk sage its indeed not listed on the wiki but you're right, # and ## only work inside #define scope
learned something ๐
So if I wanted, say, a prop to spawn in this manner, would it be _position = (vehicle player) PROP modelToWorld [0,5,0];
@tough abyss no, btw
What'd be the best way to do it?
use _position
_prop = "propClass" createVehicle ((vehicle player) modelToWorld [0,5,0]);
Okay!
Yeah, I'm familiar with that command, at least, just wasn't sure where to put it.
keep the wiki open always ^^
You so far have only generated a position, so you'll want to then create an object at that location
^
Oh god, I CTRL+F that page sometimes
Usually end up looking manually due to the amount of results -.-
Heh, it narrows it down some.
Anyways, I'm trying to find a script that'll make direct chat talk to you.
They need to introduce buttons for A-Z, unless I'm just blind
Take a look at this and the suggested commands: https://community.bistudio.com/wiki/sideChat
Tight, thanks!
Not aware of a direct though
It's local, so only the client it is executed on will see the message
So no stress there
Oh!
if you just want text to display, i always just use systemChat
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?
systemChat doesn't take any arguments
And use a loop... That increases the readability
oh, so it's just systemchat?
It doesn't appear to come from any particular unit
takes 1 ๐
okay!
thank you all so much for your help so far. i'll have a lot more questions, but still.
had to go for the dig โค
@tough abyss you can use for "_i" from 20 to 100 step 20 do {} ;
that would be overcomplicating things
for "_i" from 20 to 100 step 20 do {
sleep 5;
systemChat format ["Building %1 % done!", _i];
} ;
```
why is this "overcomplicated"
but it is more readable
yeah i missed that
its overcomplicating for someone who just started coding. Ofc people whove been at it longer know the better solutions
Let's see if it works!
But that's definitely something one should get used to from the beginning on as the rest is just a mess and absolutely redundant
Yep!
can do that after youve got workable code
Does Bicycle still work as a propclas?
but i digress, to each their own
All objects in ARMA are vehicles
there are no bycicles in A3 though
I'm looking in the config viewer.
ah
_prop = "CarWreck" createVehicle ((vehicle player) modelToWorld [0,5,0]); Just for testing purposes, will this propclass work?
Right.
Something to consider though, that usage of createVehicle won't be guaranteed to spawn the vehicle exactly 5 meters in front of you.
I don't think that will work
As long as it's reasonably close, and consistent.
5 meters was more or less a placeholder.
It tries to decide what the nearest empty position is
you can simply move them after creating, keep in mind
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
Honestly, with the group I'm making this for, that'd just end up being fucking hilarious rather than something to gripe about.
"Land_Wreck_Car_F"
``` @tough abyss
Thank you!
Give that a whirl
Where did you find these in the cfg viewer?
fair enough
You can find these in CfgVehicles in the Config Viewer, yep, I just happen to have that one on my desktop ๐
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]
I can't think of anything that has the prefix of Land_ that wouldn't work
Oh, I suppose I should disable user inputs and make them do an animation too.
That shouldn't be difficult at all.
Damn, you included the '_', almost had you with LandVehicle ๐
'force'?
Well, loop an animation until the script is complete.
By making them do an animation, in some senses you are forcing that onto them
Run the animation, make a loop checking their animationState (https://community.bistudio.com/wiki/animationState), then reapply
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.
while {true} do {
if (animationState player != "YourAnimation") then {
//apply animation
};
//If action is done exitWith
};
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.
@tough abyss do you speak German?
Nope.
Bad luck... I know a really good tutorial for scripting but it's in German :/
Ahh.
The worst! ;-;
Also, @dusk sage , is it possible to just have the animation loop for the 25 seconds it takes to build this?
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
while {!endLoop} ?
Indeed
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.
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";
};
};
};
Are you in debug?
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]);
Okay, you cannot suspend in a non-scheduled environment, such as the debug console (sleep, waitUntil etc)
Oh!
That's why I used spawn (to create a scheduled environment)
The same holds for your bunch of sleeps, spawn them
It works!
Ohh, we're allowed to use ```cpp
[] spawn
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.
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
Thanks!
getDir will give you the current direction, as reference for setDir
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0] getDir = _direction player setDir "_direction" ); ?
or _direction = "getDir"?
Oh.
You should never be use quotations unless it requires a string
Alright.
So if you wanted it to face the same direction as yourself
_prop setDir (getDir player);
I see !
However, be aware that getDir does indeed get the objects direction, but that might not always be the direction you think it's facing
Right, I might have to translate it.
Indeed
I was thinking about that
Models blah
_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.
You have two statements on one line (without a semi-colon)
_prop = "Land_Wreck_Car_F" createVehicle ((vehicle player) modelToWorld [0,5,0]);
_prop setDir (getDir player);
Now it's yelling 'missing ) in line 21', which is _prop setDir (getDir player));
the script executed fine, though. lol.
Yep.
I was actually sending a snapchat of the script to my friend when I noticed it
I was like "wait i'm dumb"
Some times (but only some times) the error message is correct with telling you what's wrong ^^
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);
_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...
How come?
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
Still not properly getting the direction. or, perhaps it's not setting it.
Yep that was just about the redundancy of your code ๐
Even with your script.
does function recompiling work on stable?
I have cba caching disabled but changes don't seem to be picked up
It worked for me
@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
hint (getDir player); right?
hint str(getDir player);
You have to convert it into a String in order to hint it out ๐
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
:/
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
};
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
Yeah you don't need to use BIS_fnc_selectRandom anymore. So you'd just do
_randomGuy = selectRandom allPlayers;
Unless Ofcourse you're on Linux ๐
Are the mac and linux branches on 1.58 yet?
1.54
So @native hemlock , how can I edit that to make it select 6 players?
Do it 6 times ๐
You could theoretically select the same guy twice though
Two seconds
private _array = [];
while {count _array < 6} do {
_array pushBackUnique (allPlayers selectRandom);
};
Thanks!
I'm sure Pennyworth is about to chime in with a more elegant answer though
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 ๐
Alright, I appreciate you guys helping me so much.
Anyways! How can I set those selectd players to have things done to them
Probably easiest to have him explain rather than us
He has 3 more parts to that tutorial about arrays as well
Thanks!
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?
_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;
That would result in the server or whatever client is executing the script to spam that systemChat 6 times only for themselves.