#arma3_scripting
1 messages · Page 310 of 1
in the config there is no entry as far as I see (https://configs.arma3.ru/154.133741/configfile/CfgVehicles/ArrowDesk_L_F.html)
Or you can create your own arrow I don't think it it especially difficult
It seems all the colors and textures are hard coded in the p3d
hmm yeah
I think you can find a lot of arrow models for free on the net, it won't be like a car model which are often ripped
- You can then use this model directly in the mission with createSimpleObject and don't require any mod
thats pretty neat I'll try that later on, thanks
Is it any way possible to take the lightbar from a Repair Offroad and attach it to a SUV?
@rotund cypress As it is in the model itself, no
but
I think you can find a lot of arrow models for free on the net, it won't be like a car model which are often ripped(édité)
+ You can then use this model directly in the mission with createSimpleObject and don't require any mod
Applicable to a lightbar model
But what I say is always 🍿 time so :/
:>>>>>>>>>>>>
What I meant was doing it natively without modding
can someone point me in the right direction? I have a script I want to run on specific objects xcam_runway_main in this case. Is there a way to do that? Because I don't want to name every object and don't want to use a marker. My actual approach atm is this: ```sqf
params["_marker", "_size"];
_pos = markerPos _marker ;
{ _x hideObjectGlobal true } forEach (nearestTerrainObjects [_pos,[],_size]);``` but as said I want to get rid of the markers 😄
Just put the needed positons in the script instead of using markerPos
yeah but need to get them. I was thinking of something like getPos xcam_runway_main or so so I don't need to grab them manually
@little eagle In 3DEN I would now need to right-click on every runway with classname "xcam_runway_main" and log the position. Manually. I tought there would be a automatic way where Arma just fetches every position of an object with classname "xcam_runway_main" and returns them maybe into an array?
Is xcam_runway_main an object? Or a location? Or what is it
a the classname of an object
?
What would be the best way to simplify this if any: Server_Fnc_HandleTeamPoints = { params ["_team","_command","_points"]; if(_team = "NATO") then { switch(_command) do { case "Add": {team_nato_points = team_nato_points + _points}; case "Remove": {team_nato_points = team_nato_points - _points}; case "Set": {team_nato_points = _points}; }; } else { switch(_command) do { case "Add": {team_anf_points = team_anf_points + _points}; case "Remove": {team_anf_points = team_anf_points - _points}; case "Set": {team_anf_points = _points}; }; }; };
Oops classic mistake 😛 - And it should be, haven't had the time to test it.
looks simple enough, but you make _command case sensitive with this, which I wouldn't like.
["NATO", "Add", 100] call Server_Fnc_HandleTeamPoints; // works :-)
["NATO", "add", 100] call Server_Fnc_HandleTeamPoints; // doesn't work :-(
is it possible to move where the player is looking at on the map with scripts?
Is it possible to use macros (#define) in functions that are defined using cfgFunctions and not preProcessFile?
Yes, CfgFunctions are a framework that is preprocessFileLineNumbers'd internally.
Oh, nice.
@mortal bobcat You mean like a map teleport? If so there are posts are using onMapSingleClick or something
True, I count that as an internal framework, but it's still SQF based and not internal internal as in hard coded.
Well it kinda is hard coded... But not C++ land.
i mean like when you click on a link in a briefing and it focuses on a position on the map
guessing https://community.bistudio.com/wiki/mapAnimAdd is the equivelent for the main map
excellent, thank you!
Anyone know of a way to reliably return the currentMagazines ammo count with currentMagazineDetail? Also why the hell does that command return a string and not an array??
np
Ah, makes sense
would just be a whole hell of a lot easier if it returned an array
right, you would still have to trim it down with splitString to display to 30/30
just seems odd to me in general, takes an otherwise useful command and makes it annoying to work with
not sure currentMagazineDetail is the best tool for that job
oh you're gonna use magazinesAmmoFull never mind
The question then becomes, what the hell are you supposed to use it for
i guess it's sort of a unique ID for the mag? (because it has that [id:0] bit at the end). still not sure what you could use it for though
probably mainly for debugging
it was added in 0.5
and yeah fuck knows why it's a string
does anyone off the top of their head know if all of the A3 weapons stick to the naming format for mags?
shit
nevermind
they don't, making that command basically useless for getting ammo count
_magazine = currentMagazine player;
_fullCount = getNumber(configFile >> "CfgMagazines" >> _magazine >> "count");
_count = player ammo (currentMuzzle player);
that's what i used in an ammo HUD thing
was making a little UI which displayed all your ammo, like the old CODs
Oh, perfect
like having 300 little rectangles in the corner of your screen which change colour as they're fired
not sure that code is the best way to do it, mind. but it works
I actually only need the current ammo count so that last line is all I needed
So thank you very much
I truly do love this place
no problem
@little eagle I meant that the array thats returned is empty. I have a T-80UK of RHS on the map aswell (Classname: RHS_T80UK). If I enter that instead of the runway classname I get a filled array with data. I also tried it with CUP runways (I actually use them now because the Map is from CUP Terrains anyway)
I remember seeing a video years ago in ArmA 2 I think with a shooting range and pop up targets and a HUD element of the pop up target that showed where your bullets were impacting. Does anyone remember/have a link to/know how this was accomplished?
Like a (pip , picture in picture) type element? Or like visible bullet trajectories?
like a pip type element
Oh I didn't think of doing it with a live cam, this one was a 2d image of the target popup with x's for the impact positions
i made one ages ago.. but it's a bit broken http://asor.com.au/wpdm-package/asor-shooting-range/
its just a script.. will likely need to be modified (at least the actions on the shelf things)
can see it in use here https://youtu.be/4U33ngzLRRs?t=684
@hollow lantern
Xcam_blah is probably not an objects, but something else
This is exactly what I'm talking about lecks, thanks.
np.. the script is a bit complex because it builds the whole stand and stuff.. but should be able to extract what you want if you don't want that part
@little eagle well I also did it with a cup "road" CUP_A2_RUNWAY_MAIN that is also not working. I guess these roads are not real objects as a vehicle might be
How do you even find them in the editor?
I mean. There are other ways to get the map position of the airports.
search for them? They are available in 3DEN like any other normal object
its not a normal airport because I built a runway with these objects
so there is none on the map originally
thanks commy2 that actually worked
yw
[1c0d2af5600# 428891: runway_main_ep1.p3d,1c0d2af6080# 428890: runway_main_ep1.p3d,1c025756080# 428477: runway_main_ep1.p3d,1c0c6a04100# 428462: runway_main_ep1.p3d,1c0c6a04b80# 428461: runway_main_ep1.p3d,1c0c6a05600# 428460: runway_main_ep1.p3d,1c0c6a06080# 428459: runway_main_ep1.p3d,1c0c6a06b00# 428458: runway_main_ep1.p3d,1c0c6a07580# 428457: runway_main_ep1.p3d,1c0cc40ab00# 428455: runway_main_ep1.p3d,1c0cc40b580# 428454: runway_main_ep1.p3d,1c0bf07c100# 428453: runway_main_ep1.p3d] hmm not sure what exactly I need to select from the array in order to get sqf { _x hideObjectGlobal true } forEach (nearestTerrainObjects [allMissionObjects "CUP_A2_Road_OA_runway_main_ep1",[],_size]); working. BIKI tells me thatI need PositionAGL or Position2D but in the array above I just see id's
{
} forEach allMissionObjects "CUP_A2_Road_OA_runway_main_ep1";
???
but I don't want to hide the runway I want to hide nearestTerrainObjects near them
and normally the command gets a position or object (via variable name) and then removes stuff
but I would need to give every runway section a name then
which I try to avoid atm
Which terrain objects?
You definitely need two forEach loops then.
hide each terrain object around each airport.
I stated [] which includes everything. But the most common would be "TREE", "SMALL TREE", "BUSH", "HOUSE", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "CROSS", "ROCK", "FENCE", "WALL", "HIDE", "BUSSTOP", "ROAD", "FOREST", "ROCKS", "POWER LINES", "RAILWAY", "SHIPWRECK", "TRAIL
ah I get
it
n1 thanks commy2 ```sqf
{
{ _x hideObjectGlobal true } forEach (nearestTerrainObjects [_x,[],_size]);
} forEach allMissionObjects "CUP_A2_Road_OA_runway_main_ep1";
I would like to ask about publicVariabless
are they sent sequentially or in random order?
so if i send someVariable and then I send SYNCHRO_DONE
can I be sure that if SYNCHRO_DONE is set then someVariable is set too?
@rugged basalt If you have small values you'll not notice any delay with the syncing aka its basically instant
Both would be set
hmm
so I need to check isNull for every value?
a lot of work
@turbid thunder It's a multidimensional array 3*8
@rugged basalt just check if the client has a variable in the array name
yeah but there's also the other array
and the other one
so 3 in total.
what If I would have 10?
lol
Pack it all into one big array
that's simple elegant solution
thanks for the idea
you may wonder why im doing this
Dont spam sync though
it's only synced on init
Then its ok
im working on bomb defuse script
code and sequence to defuse the bomb is random. I need that randomized on server then sent to all clients
because if I would randomize it on clients then every client would have other combination 😄
init the bomb when server sends code/seq
Randomize it on server only --> publicVariable it
isNil becomes obsolete unless you need that array instantly
Even better
that may be even better idea
Only do smth with the variable when the player is actually interacting with the bomb
Yeah, then just countercheck the Var, set by the Server via missionNameSpace setVariable["var",VarEntry,TRUE];
Done
So, anything else? Otherwise i am back at watching Dwarf Tossing.
tbh... i always forget what the difference was. I prefer SetVar True, instead of PubVar. Easier to write/handle/Target
looks like PubVar uses already set value
PubVar = sends to everyone
setvar creates new one
setVar = Can be targeted to Obj, nameSapce, can be send to all or not etc
SetVar creates a new "what"?
variable*
It can, it can also alter existing ones.. but... erm... yeaht, thats just normal^^
"Grandmaster" or "Halfgod in black" is enough
it's heavily modified version of cobra4v320 script. Gonna make it publicly available after mission release
So i've been looking through some documentation and I can't find much about displays. It seems like using display 46 is a pretty common thing and I'm trying to find more information on that but the documentation is either not there or really hard to find. Can anyone help me with this?
display 46 = MainScreen you see, when you are ingame.
The one where you see Ammo, Stamina, GPS etc.
Yeah so I've seen that around but I'm curious to what the other displays are and if there is any documentation on this?
I don't think anyone has documented them all, there is some small lists scattered at the wiki though
(findDisplay 602) = Inventory (another example)
ah okay, one other question. I notice also that it seems to be common practice to add eventhandlers for keyup keydown to display 46. Is that just common practice or is there a reason for it?
You have to search for the desired names for yourself 😉
Its one way to get rid of the ActionMenu
e.g.: Adding a Function to a button, instead of an addAction (ScrollwheelMenu)
hm, so am i understanding this correctly, if i add an eventhandler for keyup/down to display 46 it will only function when i am on the main display. For instance if i add an eventhandler to display 602, then it will only function when I'm looking at the inventory?
Yep
ah k ty
So basicly... add a KeyDownEH to Display46 (for example Button W will execute a hint msg) -> won't be executed, when Inventory is opened
@tough abyss what do you mean by activate mine?
I guess its new. Check out the last couple comments https://github.com/A3Armory/A3A_A3Wasteland.Altis/issues/24
hmm intresting
Trolls are having fun with it at the A3W stores
fix it
mines are still bitches and just a new thing to consider fucking with them...
Yeah had to walk away for a bit. Need to find what the action is
No, I guess its new. AgentRev would have noticed that I think
didn't mines active the "Put" EH, when placing?
I'll know for sure later tonight when I test the ```systemChat _action
Well if it's a custom action, I would just add "not in gun store" to the condition instead of doing tricky hacks.
yerp
No custom actions
So it is the vanilla action after all
I'll know for sure later tonight when I test the systemChat _action
I mean, you will use ScrollMenu EH, should be easy to filter/blacklist/whitelist everything except the needed stuff.
TouchOff
TouchOffMines
SetTimer
StartTimer
Deactivate
Must be put then
PutWeapon
Also doing a text search in the code for "Activate mine" came up with nothing. From what Agent said and my guess its a new action. Not sure why they wouldnt use activateMine when deactivateMine has been there
wasn't it "place mine"?
No It was already on the groundsimulator
Ah, kk
once you active it you can use the action timmer and touch off
TakeMine
DeactivateMine
But doesn't Mines activate automaticly?
DeactivateMine mine worked when I tested it
thought they would just make it activateMine.
¯_(ツ)_/¯
TouchOff
TouchOffMines
?
If you place them on the ground they dont activate automaticly
Thats blowing up, Commy
Uhm.
Yeah I'll try that. Im away from the test box
Packing my Prototypethingy here, gonna start Arma after that
Don't forget
SetTimer
StartTimer
otherwise they can use the timer I think
will do. thank you
Any specific mine?
@tough abyss
"UseMagazine"
Tested with: Satchel, Apers Mine, Apers Bounding Mine and Claymore.
We are using that now to block place mine/charge. https://github.com/A3Armory/A3A_A3Wasteland.Altis/blob/dev/client/functions/fn_inGameUIActionEvent.sqf#L12-L115
You can bypass it now by just puting it on the ground and "Activate mine" to get the actions placed would give
Yeah
Oh, i didn't knew thats working
It must be new... I think
Oh yeah, it works
Would have caught that awhile back
Nah, if you have 2 charges in it -> No Action (since it doesn't know wich one)
wait we need that for people to put things on the ground and trade at the stores, I think
nice
I mean... if it would be possible to remove SingleItems from a Container/Vehicle, without deleting and refilling everything in it... it would be easier
*pokes BIMinions*
lol
Missing Command since OFP - No adding in sight 😄
player setVelocity [0,0,1e38]; - Theres no limit on this command?
I meant as in a limit to stop game crashing from hard velocity changes like that: https://github.com/A3Armory/A3A_A3Wasteland.Altis/blob/dev/client/functions/quit.sqf
I can only imagine going that fast would crash a game atleast.
It does crash, yeah. Whats your point?
The velocity would be just "too fast".
But speed like player setVelocity [0,0,500]; do works.
Just saying it probably isn't the best thing having that even possible. I can understand anti-hack reasons. But imagine a hacker just unleashing this on a server full of people.
Some of my former Teammates reported about some strange overall behaviour, when a Planes was flying faster then Speed of Sound (can not confirm).
iirc they mentioned faster Anims etc. no clue anymore. too long ago.
Hmm
If a "hacker" is able to execute that command... nah.. i think he prefers to do other stuff, then just letting player crash. That would be boring.
I mean... he would kickout the ppl out, he wants the attention.
¯_(ツ)_/¯
Indeed
The setpos limit in your beconfig might help that but yeah that would be bad. Think A3Wasteland used somthing like that to kick hackers flagged (crashes the client) but it broke a couple Arma updates ago
huh I'll try that.
How would I pull the ammo count as a integer from: currentMagazineDetail?
Can't you use a different command?
To get ammo from the current magazine?
Currently loaded mag?
Check Example 3 on the wiki page for the command
player ammo currentMuzzle player
There is no point in using currentMagazineDetail for this
¯_(ツ)_/¯
something like this should also work
_AmmoCount_Mag =
{
if((_x select 4) IsEqualTo (currentWeapon player) )exitWith
{
_x select 1;
};
}forEach (magazinesAmmoFull player);```
xD
what exactly does a Grass cutter on the scripting side? Do I really need that object for removing grass or will a setDamage on the grass class also work?
grass cutter 😄
cut grass
It does no scripting. It's just a plane that pushes down the grass, but is invisible and can be walked and fired through.
ah
More or less just for "cutting the grass". Nothing else. Cleaning up the ground, where needed.
@jade abyss @little eagle It was UseContainerMagazine 👍
💰
It's not in CfgActions. Custom? Or is it new
So it's a new thing in 1.68
isClass (configFile >> "CfgActions" >> "UseContainerMagazine")
true
@jade abyss http://i.imgur.com/rpboeOR.png
Thx
@tough abyss There it is:
http://i.imgur.com/rpboeOR.png
😂
hideOnUse = 1;
priority = 9;
shortcut = "";
show = 1;
showWindow = 1;
text = "Activate mine";
textDefault = "<img image='\A3\ui_f\data\igui\cfg\actions\ico_ON_ca.paa' size='1.8' shadow=2 />";
textSimple = "";
Okay, so for Mines Only
[bin\config.bin/CfgActions/UseContainerMagazine,bin\config.bin/CfgActions/ActivateMine]
There are two actions with exactly the same string.
ActivateMine and UseContainerMagazine
I tried that. Doesnt work... ActivateMine
Yeah, because BI added another one in 1.68 - UseContainerMagazine
maybe they are saving it for later lol
Who knows for what
oh boy
Some stuff like Interaction with Items, without using addAction to stuff etc. blablub
_newPos = [(_position select 0) + floor random(3) , _position select 1, (_position select 2) + floor random(3)];``` would this work to add a random number to x and z? Not entirely sure if it would work(dont have time to test)
(dont have time to test) <- ?
The time you used, to write that post could have been the time, you copy that in the DebugConsole 😄
As in the ingame debug console? I suppose, but that would require me to launch steam and proceed to launch arma 😛
Thats what you usualy have open, when writing code 😉
I guess 😉 - Im just writing a few small bits and pieces i've been too lazy to write.
Not a big thing (means it should work)
(_position select 0) + floor random(3)
->
( (_position select 0) + floor (random 3) )
Gotcha.
Or you could use getrelpos + random direction + random distance.
Although i do wonder why you want a respawn position that may spawn unit in the air 3 meters 😃
edit: nm you need to past it an object
Why? Wanna kill the Server quickly?
while{}do <-
(don't know why you need something framePrecise on the Server, but okay)
diag_TickTime -> Comparing them to other times
uisleep
diag_TickTime
@tough abyss I remember old issues like that back last summer when I played on your server alot. On defense missions or something where they would last 5x longer then they should have 😛
_StartTime = diag_TickTime;
waitUntil{diag_TickTime > (_StartTime + 10); uisleep 0.1;};```
It was invigorating. Shooting AI and getting shot back for 50minutes 😄
Probably. Did you add CAS back? Or you leaving that out for longer.
Ah. Im debating on buying that bundle. Not entirely sure if its worth it yet.
smh..
Is there a best practices discussion anywhere for preventing script exploits?
Any. I've noticed a number of mission makers putting in specific lines to prevent script exploits and curious if there is anywhere to research them more to prevent them.
as an axample // block script injection exploit inGameUISetEventHandler ["PrevAction", ""]; inGameUISetEventHandler ["Action", ""]; inGameUISetEventHandler ["NextAction", ""];
uh, wut?
That is what I am looking for. Information regarding exploits, current exploits to watch for etc.
Poor programming issues etc?
poor scripting issues mostly
like leaving the DebugConsole enabled in the ServerConfig
or having no SignatureFilecheck...
¯_(ツ)_/¯
Seams like a lot of that would be common sense
Thats what you loose pretty quickly.. many many ppl just don't have common sense
Or beeing able to connect 2 simple thoughts/hints together
Push button to sell car being spammable is something that I didn't know
This is the issue of working on a mod and scripting for two years but in issolation.
Theres still a few major exploits going around with Arma 3 Addons. In fault of signature scanning.
Indeed. It's sad but true.
Checking actions for an antihack wouldn't be hard I suppose(as in a server script). Removing most action menu type hacks.
lol
those addActions are Clientside. So must be run on client.
```sqf
CODE (starts in the next line)
```
sqf -> Next line: Code
exactly Nom
yepyep
I don't mind it, was just curious if there were any resources for it. I work in a place where I have hours with computer use to browse so I can research
I dont really trust infistar too much. Dont get me wrong its a great AH, but its past scares me(from old exploits as in backdoors)
Indeed. As well as their UID's in the code so atleast they allow that 😛
Quiksilver - Today at 3:49 AM
well its open source,
Since when?
🤦
Just because you can edit it, doesn't mean its "Open Source"...
🤦
Obfuscated code is not really source code... Even by definition it isn't
Does anyone have a consistent way to force an ai to move to a position even when it's in combat, only way I've been able to do it is with a combination of disableAI flags, setBehaviour, forceSpeed, and doMove
and even then it doesn't work once the AI has engaged for the first time
does disabling FSM on ai help? or would they just not move at all then?
ok, wiki note says
FSM: Essentially makes the enemy "dumber". Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM, can give the impression of untrained units as they react slower and are more disorganized than when FSM is enabled. Good for rebel fighters and when enabled better for professional armies.
if people have 3 monitors in arma, are they always the same resolution (or UI size)?
so safeZoneX - safeZoneW = safeZoneXAbs in those cases?
check killzone kid's article on safezone, it explains it well and in more detail than someone can do in chat really
it doesn't really say either way, but going to just assume they'd all be the same size
if not, they'd probably be used to things looking wrong anyway
hahaha brutal
ArmA 3 on a 75 inch 720p TV looks weird ^^
Any recommendations for IDEs for ArmA scripting? I'm getting tired of Np++
I use Intelij IDEA Ultimate but most of the guys here use Atom I think
Sublime Text 3
what's wrong with np++?
either that or sublime is the best choice imo...atom, brackets, vs code are quite slow
I tried opening the AllInOne config with NP++, but it took twice as long as it does with ST3, so I de-installed it.
- Great plugins
If you want to replace NP++ you can try ST3
It would be the best choice imo
The best syntax checker is in my head and the only debugger is "Play Mission".
😄
I'd rather winning some time with a syntax checker
I guess it depends on what you like
🤷
i stick with np++ cos i've used it for years and have learned it's shortcuts etc
don't see the point in switching editors all the time, although i tried
Good attitude
^
Thanks for the suggestions guys. NP++ is good, I'm just checking what's out there with SQF support, keeping an open mind
use atom on my linux machine cos it's the best native editor imo, but is a bit sluggish
Stick with what you know unless you feel the need of smth else
How is the best editor "sluggish"?
Slow af
That disqualifies it imo.
someone made a 1.60 syntax highlighter for np++, i just update that whenever new commands are added
ST3 syntax highlighting is at 1.68
i mean in terms of features, it does what i want. but it could be faster.
And it's also used by Github.
ye but i don't know any shortcuts on ST3 😄
i kinda like the native windows UI of np++ too, ST doesn't really fit in with other native apps visually
same with atom
i just called desktop programs apps, brb killing myself
@little eagle What's the main difference between Poseidon and just using the actual sublimetext?
No idea. Never used Poseidon.
So just plain sublimetext with support for SQF
poseidon has a hammer and sickle icon, that's it's main selling point
I found the lack of tree view file-structure in NP++ disturbing, but I just found out they added that since 6.9. Amazing
Plain ST3 with https://github.com/JonBons/Sublime-SQF-Language
nice, just realised i haven't updated in 3 years
poseidon has a hammer and sickle icon, that's it's main selling point
🤦
Is the Sublime Text Plugin still being updated?
just updated np++ and it closed the 100+ files i had opened and reset my theme, nice nice
anyone know a good new IDE?
You can always try VS Code + SQFLint if you aren't happy with the other ones https://marketplace.visualstudio.com/items?itemName=Armitxes.sqf
Why did you have 100 files open? 😄
we won two world wars so people can have hundreds of tabs open in their web browsers and text editors bro
@thin pine I've switched to Atom with the plugin made by the ACE guys. Works like a charm! 😄
Does anyone know if its possible to attach an object to a characters head so that it rotates when you free look with your heads movement?
without a per frame handler/loop it is not possible unfortunately
https://img.knight-industries.org/2017-04-10_06-00-12.png IDEA all day long lol. Works n1
bb_tankflip
👍
Can a SQF dev message me
yep the BaerMitUmlaut is strong with this one
its called by the headless client (automaticlly)
if you want some scripts to be run on the hc put them there
like the initServer.sqf but for the headless client
You sure it isn't called manually?
yes, maybe our Mission-Framework does this automaticlly, I'm gonna check that
but since I never used it without its almost automatic for me
but lets see
looked up in our framework serverside mod but nope its not called there in any way so I guess its automatic loaded
Looking for a SQF Dev to teach me how to script will pay for said time 😃
I don't think any initHC is called automatically
Maybe it isn't loaded at all. Placebo file
Where did you see it?
screenshot
Can you link me Boguu?
Where would i be looking in the WIki?
That depends on what you're looking for I guess.
Scripting
im having mad trouble trying to teach myself how to script
and no one on here is being much help which is fustrating
@dusk sage theres not much info on that area
and i have a base understanding on io
it
There is many links at the bottom of that page
im more or less looking for custom sfcripting ect
What?
Like learning how to create custom scripts
im looking at that
That teaches you language syntax etc. The wiki contains documentation for practically every command
And a large amount of BIS functions
Yeah im looking mainly looking for SQF for altis life
Altis Life is a mod and you won't find any info about that specifically on the wiki.
Altis Life isn't special, it uses the same SQF as everything else
True, but the wiki is generally about SQF and not about specific missions.
Well yeah but i would rather who is experienced just teach me
Nobody wants to teach somebody who doesn't want to learn
Cause my server cant wait 6 months while i wait
while ill learn
and also ive spent 1-2 years trying to learn
so im trying to learn
And you've got nowhere :/?
2 years is enough to know everything there is to know.
I have a basic understanding but custom scripts are the issue
You can become proficient in a matter of weeks just reading the wiki
Nobody is exempt from that, there isn't that much to know to do your own thing
Anything you write in SQF is a 'custom script'
well yes but i want to learn how to build my own script
Essentially.
You seem to think there is some secret that people aren't telling you, there isn't unfortunately
I have all the secrets, but I wouldn't tell BoGuu.
Well sorry that i have 5 disabilities and im having trouble understanding a few things
Trying to work with dialog boxes, is there something I borked in this?
TAG_fnc_DisplayText =
{
_text = ctrlText 1400; //grab the text entered into resource 1400 (our edit box).
Hint format *“%1”,_text+;
};
It looks normal to me but I feel I might have borked something.
@little eagle @dusk sage yep, InitPlayerLocal.sqf with
if (isHC && !didJIP) exitWith { [localHC] execVM "initHC.sqf" };
if (!isMultiplayer) then { [localHC] execVM "initHC.sqf" };``` thats howwe run the initHC.sqf
Called it ;)
@bitter bough you need a reference to the control before ctrlText
format *“%1”,_text+;
@fallen moss I don't want to be rude to you, and that's unfortunate. But please don't say that and expect a response, were giving you advice whether you choose to accept it or not
this looks wrong
im accepting it but what ever thanks
erro sorry, after it
Sorry, somewhat new.
How would I go about referencing it?
I've got like 3 other files working together to get this UI to work xD
ill go read all that Wiki ect and KK's blog stuff and see how i go
actually that might work if your IDC is 1400.. but sure how it knows which dialog though
That's all you really need to write your own things, yep
Alright, so how would I go about specifying which Dialog?
He wants to write his own scripts
usually i would use _control = (findDisplay _IDD) displayCtrl _IDC;
i would suggest pulling apart smaller missions. don't rip apart something big and fucked like altis life. look at small scripts and mods, figure out how the author made them. rinse and repeat.
The problem is not ctrlText, it's the fucked up format
then _text = ctrlText _control .. but as commy2 said, somethings definitely wrong with that format too
also hardly anyone will help you with altis life. anyone already in the life scene will view you as a competitor. anyone not in the life scene will view you as a scrub.
@little eagle what is wrong with the format space?
format ["%1",_text];
That is not true no @rancid ruin
which bit boguu?
also hardly anyone will help you with altis life. anyone already in the life scene will view you as a competitor.
But, not today
Also careful with those quote marks
“ and ”
are not
"
wait, there is a diff?
i mean knowledgable life devs, if any exist. rarely do you see life devs helping each other.
Whew alright
french keyboard?
You may not, but they do, yes
I think we should get some SQF trigraph support for funny syntax ;)
Nah, american. I'm trying to follow a simple tutorial and it's ended horribly
oneoh just called BoGuu not knowledgeable.
🔥
quotes are wrong again, but other than that, yeah
is that the "
No, wrong quote marks
time for a mass replace
that's quite confusing
sounds like probly the web site you got the tutorial off
Is that some copy paste fu
text editors don't generally type those
I agree. Those weird sideways quote marks should've never been introduced.
Always happens with quotations
hey at least it doesn't include line numbers like some shitty code sections on websites
I've seen people copy the + and - from Git diffs
Reminder that
2 +++ 2
is valid SQF
wut
2 +++ 2
2 ++ (+2)
2 ++ 2
2 + (+2)
2 + 2
4
Well good news. No errors, but my box doesn't show up.
getting somewhere
'Poo' + + 'bar' will produce PooNaN in JS. Stupid fun fact for the day. Atleast we're not using JS
@bitter bough there's likely a bunch of quotes in your config too
I've looked
Nah, simple script error, because unary + STRING doesn't exist
sadly nothing was there that was wrong
at least you can increment something in JS without going var = var + 1
Not to mention I don't have any configs.
Unless the diag.hpp is a config, then I suppose?
It is yes
The description.ext is a config
And the mission.sqm technically too
Although rarely edited by hand
have you added the #include "diag.hpp"?
yeah
can you access the mission SQM config via SQF?
.....
lol
I'm gonna kill these things
editing sqm is a sure fire way to have a bad time
getMissionConfigValue, Lecks
I control F'd every one
nice, tnx
Ugh, I don't like how hard those are to find in N++
does the import need a semicolon?
I don't think it does but I could be wrong
No
alright thought so
kinda over this Arma 3 discord
ill just do everything myself and fuck these big top notch Devs
- that guy 5 mins ago who wanted to learn scripting
well done guys you tilted him
i told him that's a sure fire way to get scammed, but he wasn't having any of it
sad people have that outlook 😦
Professional developers that have degrees in coding and that have worked on assassin's creed
That also know and can teach SQF
That's handy
maybe i'm wrong but trying to go from 0 to modifying and customising a full blown complicated mission like Life is totally the wrong way to do shit in my opinion
He said he's been learning for 1-2 years. I don't really know what. But if he thinks the wiki lacks information (as he said), then unfortunately IMO, maybe game development isn't the right route
well, the wiki is pretty shit for a newcomer to be fair
The introduction to scripting and syntax pages are a good start, and KKs blog furthers that
if you can use google well and have the drive to actually LEARN this shit though, it can be done. that's how we all ended up here right?
yeh there's a lot on there.. but half of it only seems to be accessible via google
👍
KK's blog isn't even amazing, it's just a good resource cos he's one of the only people who actually blogged/blogs about SQF
For a beginner it's amazing. Some of the info on there, especially about execution environments etc, is invaluable for a beginner to learn
Maybe once matured a bit not so much, but gotta start somewhere 😋
He teaches it in a very simple way
a lot of stuff he does yeah, but he also does some weird and confusing stuff imo
but it's always fun to see how other people solve problems
shame he doesn't post more tbh
I feel like this is an error I shouldn't be missing so easily. And shouldn't be those pesky quotes cause I replaced all
http://i.imgur.com/LogPfJJ.png (error)
https://gist.github.com/BSherb/c06d0721da1ca3eb291ced2f63d1b6a2 (.ext)
OnLoadName = "Operation Dune Buggy;
hah
look at that.....
i'm more concerned that your user name is spazz tbh
i would guess it's complaining about line 2 because the #include are ignored when the file is preprocessed
so line 2 minus the includes is accurate
Would make sense
huh, and now apparently my init.sqf has an issue.
this is such a fun time
well you seem to be Mr. Fucked Up Quotes so i'd check all your strings in init.sqf right away
kinda over this Arma 3 discord
ill just do everything myself and fuck these big top notch Devs
lol
the only 2 quotes are normal o.o
TAG_fnc_DisplayText =
{
_control = (findDisplay _IDD) displayCtrl _IDC;
_text = ctrlText 1400;
Hint format ["%1",_text];
};
wants to learn but can't even read an introduction tutorial > 🗑
lemme fudge around with it a bit
the quotes are right in that one?
yeah
both different characters according to my notepad++
it's giving me invalid number in expression
oh.. where i wrote _IDD and _IDC
u need to actually put the IDD and IDC of the controls
and you're not using _control anyway, so can probly just delete that
{
_text = ctrlText 1400;
Hint format ["%1",_text];
};```
Yeah, getting the same error with that alone
i dunno, i don't think the error is in that code
that's the code where you're calling it
looks like your [s have become *s
and your ]s have become +s
Ugh, this tutorial is becoming more and more of a pain each minute
can you link it?
ah ok it is in word
who does this
Alright, so I need to find where the brackets are borked?
yeh, it looks right in the word doc
but yeah copying out and it becomes onButtonClick = “*+ call TAG_fnc_DisplayText”;
lemme find that
i knew this would come back to microsoft word somehow
yeah you called it
this just brings back my question
who uses word for scripting
i guess he used it for a tutorial, not scripting
if you printed/typed it, it'd work
ppl usually make pdfs out of word
I'm using chrome to read it. so I dunno
so it'd likely have the same problem
just re-write all that shit from scratch imo
it will help you learn it for next time too
onButtonClick = "[] call TAG_fnc_DisplayText";
is this at least proper?
or does the call go inside the brackets?
Ohhh.
'call' is the scripting command, [] and TAG_fnc_DisplayName are the args
like you could do
onButtonClick = "['B. Sherb'] call TAG_fnc_someFunction";
to send your name to a function
SQF uses the 'interesting' syntax of ARG1 command ARG2, or command ARG1, or command [ARG1, ARG2...]
just to keep life interesting
that worked beautifully
thank you all xD
So, I could set it to send just about anything to a function?
neat
yeh, and any number of things
['B. Sherb'] goes into your function as _this
most commonly read with params ["_name"];
(_name could be anything you want)
It's going to be a long road of dealing with this.
I'm trying to create a semi-ambient system with a shop
though my first few hours make me want to stab things
TAG_fnc_hello = {
params["_name", "_age"];
systemChat format["Hi my name is %1 and I am %2 years old", _name, _age];
};
["B. Sherb", 20] call TAG_fnc_hello;
// in chat: Hi my name is B. Sherb and I am 20 years old
untested
but yeah, dick around making your own functions, it's fun
that would make sense.
That's fairly neat
you can set default values for arguments too
it's basically zombo.com, anything is possible
does anyone else think that it might be useful to know the sender in serverside public variable event handlers?
I've been wanting that for a very long time, as well as for RE
gunner_1 disableAI "AUTOTARGET";
gunner_1 disableAI "TARGET";
nig_shoot_sky = {
_gun = _this select 0;
_t1 = _this select 1;
_t = selectRandom _t1;
gunner _gun setSkill ["aimingAccuracy",0.05];
waitUntil {
_gun setVehicleAmmoDef 1;
sleep 10;
[_gun,_t] spawn {_gun = _this select 0; _t2 = _this select 1;for "_i" from 0 to 250 do {sleep 0.1;_gun lookAt _t2};};
sleep 10;
for "_i" from 1 to 10 do {
sleep random 1;
_gun fire (weapons _gun select 0);
_gun lookAt _t;
};
sleep random 10;
!(alive gunner _gun)
};
};
[zu_1,[skeet_1,skeet_2,skeet_3,skeet_4,skeet_5]] spawn nig_shoot_sky;```
Someone gave me that script.
I am just not sure where to...put that?
I named the skeets and the gun in init variable.
wherever you want to really 😄
If you define the function on init, you can run [zu_1,[skeet_1,skeet_2,skeet_3,skeet_4,skeet_5]] spawn nig_shoot_sky; whenever you choose
I am obviously doing something wrong tho.
To give a thing a variable I use the variablename under init, right?
Oh wait, does the script spawn the skeets itself or do I have to do that?
looks like that will just make an ai shoot at 1 random skeet till he dies
u got a guy (gunner_1) in a vehicle (zu_1) ?
and something to shoot at named skeet_1, etc
Yeah.
I switched to another script tho.
[zu_1],
[[0, 4500], [7000, 8000], [1000, 500]],
20 + random 100,
0,
{alive zu_1}
] spawn GKB_fnc_randomAAFire.sqf;```
But it tells me that a ; is missing
In the last line
player addEventHandler (["Fired", {call FUNC(handleFired)}] call CBA_fnc_serverEvent);
Is this physically possible or am I just 200% wrong?
Using Macro?
+i guess, you have to include that macro all the time (no idea if its even possible)
Well, I'm helping my community owner add compatibility to Mars (Zeus Replacement Mod)
And I'm trying to add modules but everything is shortform. which I'm not used to
that looks fucked up
Yeahhhhhh
I got lost
^ he's very lost
QUOTE([ARR_2(QQGVAR(spawnArsenal), _this)] call CBA_fnc_serverEvent);
Original
That looks right although ugly
That's from Kingsley
^
Sherb is looking at Mars
I can't even tell what this 200% line is supposed to do.
Do I just put SQF files into the mission folder to make em work, or do I have to do something else?
Nothing yet, I'm trying to add a module to Mars from Achilles, which means getting the function from Achilles
Files have to be preprocessed into a SQF string, then compiled into executable code and then executed via call or spawn or something similar
addEventHandler ["Fired", {call FUNC(handleFired)}];
Or is this the better way?
way to do what?
I'm trying to pull a module/function from another mod to use it as a module on another mod
compatibility of sorts
All I see is a fired eventhandler
So...
call compileFinal preprocessFileLineNumbers "GKB_fnc_randomAAFire.sqf";
This in my init.sqf?
Just use compile and not compileFinal, but yes
Sweating from writing one line already?
Reminds me of the indent hadouken.
Now I don't know where to actually call the script.
If I put it into the init of a random unit it just tells me that a ; is missing
Parameters:
1st Objects in Array AA-units
Just init.sqf, not the init box of an object
And you need to pass the parameters
Ohhhhhhhhhhhh,
Yeah parameters I understand,.
So I just put it on the bottom of the init.sqf?
That makes...sense?
Example:
[
[GKB_aa1, GKB_aa2, GKB_aa3],
[[0, 4500], [7000, 8000], [1000, 500]],
20 + random 100,
0.1,
{alive GKB_radar}
] spawn
bottom, to, doesn't matter
But apparently you need to use spawn and not call
so, say I have the macro _generalMacro = "Achilles_Set_Weather_Module";
Could I somehow toss this into here to make it use the Module?
class GVARMAIN(modules) {
class ADDON {
displayName = "Miscellaneous";
class Arsenal {
displayName = "Spawn Arsenal";
tooltipText = "Spawn a virtual arsenal box containing everything";
action = QUOTE([ARR_2(QQGVAR(spawnArsenal), _this)] call CBA_fnc_serverEvent);
};
};
};
^^ wat?
I knew this would be a bit much.....
@little eagle Well it is loading now, but Arma tells me that a ; is missing
] spawn GKB_fnc_randomAAFire.sqf;
Still here
... and?
@dusk sage i actually ended up patching in the PV owner in EHs for A2OA... i can't believe bis haven't done it for a3 themselves
Okay, how do I preprocess the file?
preprocessFileLineNumbers "my/file/path"
This is my init so far
It still gives me the error on line 24
The part on the top is from our modpack
spawn GKB_fnc_randomAAFire.sqf;``` you should use ```sqf
spawn GKB_fnc_randomAAFire;```
compile preprocessFileLineNumbers "GKB_fnc_randomAAFire.sqf";
[
[zu1],
[[0, 4500], [7000, 8000], [1000, 500]],
20 + random 100,
0,
true
] spawn GKB_fnc_randomAAFire.sqf;
should be
GKB_fnc_randomAAFire = compile preprocessFileLineNumbers "GKB_fnc_randomAAFire.sqf";
[
[zu1],
[[0, 4500], [7000, 8000], [1000, 500]],
20 + random 100,
0,
true
] spawn GKB_fnc_randomAAFire;
@hollow lantern Undefined variable expression
Ahhhh...
Now it is starting to make sense
: )
good
😮 I soo need that.. But !isEqualTo also kinda does it
#define xor isEqualTo !
Thats two commands tho. Think of your frames! :D
Yeah.. I do.. That's why I need xor ._. I need all the VBS script commands
str parseNumber (random 30 toFixed 1)
This is all you need.
I will use that when I have my Dev-env back
What did you do?
Vacation
if i attach a turret to a car, then call attachedTo on the car, would it return null? or would it return the turret
cheers
thanks
and if i did attachedObjects on the turret that would return null?
cheers
Hows the scripting going.
not enough macros
I wish I was doing scripting instead of calculus
Ya I'm only 4 weeks away from having it finished
I have a function that runs from initServer. It sets up missions based on map locations. Everything working fine but I'm trying to shave some time off the initial load time. If any of you could take a look at tell me what you think, I would be grateful.
https://pastebin.com/PvbZ7PND
Is this a function?
rn it's just initServer
The whole thing is all of initServer.sqf?
yeah
try this:
isNil {
< rest of the file >
};
Won't work if you use any sleep or waitUntil, but it doesn't look like you do
so all that code inside the brackets? Could you explain what it does?
yes and it makes sure that the code is executed in unscheduled environment.
otherwise the function can only be executed in 3ms packets. that is what the scheduler does and initServer.sqf uses the scheduler by default.
If you wrap it in isNil, the whole code will run in one long frame... which is way faster.
I see, thank you
Is there anyway to use #include from a sub directory?
#include "sub\directory\file.hpp"
https://community.bistudio.com/wiki/PreProcessor_Commands#.23include like the wiki says
#include "..\directory\file.hpp" also like the wiki says
If you enter the correct path then they will work
have you tested it?
or use pboprefix and use the full path
I also saw killzonekid claiming that was incorrect somewhere while looking
nevermind I didn't notice the one added in 1.49, I'll try that one out
What? Which other one is there?
They definitely work
but thats the same? Just a different path. And you have to change that anyway
the one you posted above, the ..\ one
100% works 😃
yea thats the one I needed BoGuu
the forum posts I was reading about it with KK were from pre 1.49
Wiki is generally a better information source than old forum posts 😉 I suggest always starting at the wiki
I agree but looking at it last night at 7 in the morning I missed the one added in 1.49
do anyone know how to restart (press esc -> Restart) a mission in the editor via sqf?
"serverPassword" serverCommand "#restart"; I would be careful using this, as SQF files can be accessed.
Is there an easy way to stop people from picking up weapons from downed enemies?
delete them on killed eventhandler
Or you could add an eventhandler to the Inventory and always close it when player tries to access a downed enemies inventory... But.. Hard stuff
I found a script.
_deadlist = [];
{ if !(isPlayer _x) then {_deadlist = _deadlist + [_x]} } forEach allDead;
~5.0
{_x removeallweapons; removebackpack _x} forEach _deadlist;
goto "start";```
yeah.. that.. kinda removes.. the weapons....
Well all members of my unit are twats so they deserve it.
Just delete weapons on killed EVH, like Dedmen suggested
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#EntityKilled
Serverside
addMissionEventHandler ["EntityKilled",{
params ["_killedUnit"];
_killedUnit removeAllWeapons;
removeBackPack _killedUnit;
}];
You don't have to remove the backpack if you don't want to
Does that go to init.sqf?
As I said Serverside. so... InitServer.sqf or in init.sqf with isServer check
addMissionEventHandler ["EntityKilled",{
params ["_killedUnit"];
_killedUnit removeAllWeapons;
}];
};```
I just copied it from the code above ^^
It's not that Emo.
icon on gui that spining how it made
@tough abyss if getposASL is below 0
With getposATL having a height of 0
Basically you getposATL your current position, change the height coordinate to 0 and use the command to convert ATL to ASL anf check if the height is < 0
@tough abyss haven't tried, but maybe you could use https://community.bistudio.com/wiki/terrainIntersectASL
would make it so you can check the start + end, and then the line between at sea level
icon on gui that spining how it made > how it do?
@tough abyss theoretically if there's no intercept between the 2 points at sea level
then either whole line is above sea level or below it
but depends if it just intercepts the terrain surface or counts everything underground as 'intercepted'
sorry i meant 'above ground level or below it'
sorry doesn't work.. just tested terrainIntersectASL [[(getpos veh1) select 0, (getpos veh1) select 1, 0],[(getpos veh2) select 0, (getpos veh2) select 1, 0]]
true when the vehicles are next to eachother on land
oops had all select 0.. will test again
yeah same.. doesn't work
it's the same with all intersect commands
count (thisList unitsBelowHeight 2) > 0;``` Not sure about your initial question
but maybe that could be something
would activate a trigger or script only for Land Units
@hollow lantern initial question: Checking if smth is on water
Or better said if surface of position is water
@tough abyss so like, you have two different positions and you want to check if there is water between tge way from pos a to pos b?
Some sort of line intersect terrain at sealevel might work
Like if it never intersects with the terrain then it means that the terrain never got deep enough for water to appear
Atleast in theory
I dont know if it counts as intersect if it leaves the terrain or if it is checked with a starting pos directly inside it
Whats it for though?
Does anyone know if there's a fix for flyInHeightASL not working with loiter type waypoints?
I know I reported the issue originally to Dwarden a while back and they fixed it but the next update it was broken again
yea
Just broken for loiter type waypoints
Making UAVs incredibly frustrating
The loiter waypoint has a custom setting in the waypoints menu for height and loiter direction and distance
I know, that also doesn't work
it was added in the update I reported the issue
And worked for exactly one update
And then was broken again...
Bad merge is my guess
17-06-2016
Tweaked: The flyingHeightASL command now works also for loitering airplanes
That was from the dev branch after I reported it
So whatever version that was
@tough abyss what if there is a land route but just not a direct one? :D
Wasn't there something about rsc table new control type in 1.68 or did I dream this?
What I'd need is a listbox, but with the list items being control groups.
that exists now? Pls tell me yes