#arma3_scripting
1 messages ยท Page 365 of 1
yeah six and armaholic both take the piss with mirroring content - 0 respect for authors tbh
Which is why stuff like Intercept-Python.
You won't need whitelist for textfiles in your pbo's. But can still harness most of the Performance
Disable sim Rogue
disableSimulation
What does it take to get whitelisted by BE?
the only "correct" system which doesnt really exist on a community wide basis is a
Select server>> Click = update all addons the server uses
...... anything else is a bodge job
Do they have criterias of what your module should not do or is source code and a promise not to do anything bad is good enough
Request BE to whitelist your extension.. Or.. Just give it to a couple dozen people and let them try to load it everytime they start Arma over about a month.. Then BE will whitelist automatically
You send them your binary. And they whitelist it. That's it
I'd guess they test it.
Figures
already did, it still can select it
Huh, I thought it would be harder
Spawn a vehicle over it
Definitely hard to pick it up then
Or even better
A building
Or
Infinitely delete it
A couple months back.. BE whitelisted my script Debugger. Which is basically a Hack. No one asked for it and they just whitelisted it
Pretty sure it's automatic Dedmen
has it been removed?
If they would've joined MP with that loaded BE would probably have detected the hacking stuff and would've banned innocent people.
Yes it is automatic.
Yes it has been removed after a few days after I contacted BE about it
but if people launch Arma with BE the dll will blocked and unable to use for a player
you have to disable BE for it to work
And what if I use a loader and a separate dll containing my program logic, do I have to send both binaries?
Gotcha, thanks for the info
so BE is always listening even if I turn it off :D
READ
Well... I better won't get into what BE is listening to
๐
THE ... ?
UELA?
Thanks!
๐
I was about to give up on you guys
EULA?
@rancid ruin "these are all wishlist features though. as it stands SW is miles ahead of any other solution" no. Steam workshop lacks many critical features that existed with previous solutions.
Sorta like discord vs. IRC.
i think he's talking about that battleye knows your deepest darkest secrets
Just like discord, but they'll sell them too
At least make the text not grey.
can someone smart explain to me why we don't just have a descriptive file in some weird ass implementation of an html/xml markup language (cause thats how BI rolls) that goes like <mod name> <mod description> <mod version> <mod download source(s)> <required dependencies> <optional dependencies (compats)> and package that with every mod. Server distributes that file to the client connecting, client launcher shows it to the client and offers automatic download from whatever sources the mod author specified. requires zero external infrastructure (except a place to host mods, which could be armaholic, steam workshop, private mod-author owned website) and would be low hassle for mod authors, server admins and players ?
Because that is not how arma works
many things could be simpler.
Make it a mod!
a mod for mod management?
Problem with that idea would be: only scripts are possible to be transferred with inbuilt methods
you can make your own repository using armasync, great tool, very user friendly and very easy once youve set it up, add to thyat a bit of batch coding and the entire system becomes automatic
i'm talking about BI adding this functionality to arma.
@still forum can one modify the config tree with intercept?
BI wont do anything when the community does it for them
There are a couple of issues of how arma forms it's internal fs and parses config
i mean having the server send a few bytes of XML to a client on connect can't be rocket science.
and how that operation is done at startup
but the arma launcher does already?
the only problem is, it only offers to search the workshop for mods or select local files, no automatic "oh i'll fetch that for you from this random http server"
sure, but if what i described worked like workshop mods work (maybe a tad better) then it would solve all issues, no?
I mean, some sort of package manager would definetly be nice
But that can be done within the launcher
well, i find a way to make a weapon a true prop
just remove all its healt and the take action gone, lol
you could even just add a flag in the description file that mod authors can set to allow direct download from the arma server. this way whoever hosts an arma server with mods helps out a bit with distributing the mod download traffic by playing mirror.
if you want an automated system, like an auto addon downloader, you need to be aware of some of the issues this may cause
- Where will the files for download be hosted (Most likely you think on the arma server)
- Who will pay for the cost of 100 players downloading 20GB of data (Most likely you will expoect the server host to pay for this)
.... if you think these addons will be hosted on something like steam, how will you implement version control and stop players downloading for example the latest RHS which may break something
There are a lot of other issues to think about as well
Very few servers have their own dedicated box and even less a filehosting solution offsite, these things are costly, so for a lot of guys who run servers, this is simply not doable
Look at npm
Either mod author provides hosting, the platform provides hosting or server owner provides hosting, version control can simply be added as a download filter
- no. some mod authors prefer to host themselves, some leave it to armaholic, and some use the workshop. some refuse the workshop due to steams policy, and i get that. so with just having a field in which you can enter any download source, you have maximum freedom. you can host the files anywhere you want, the only important thing is: the client gets the download info to download the files.
e.g. you specify that server requires version "1.0" and client downloads 1.0
so you want as guy who sweats over his mod to then pay for the hosting.... this would stop a lot of them doing it
- the same people that paid for it before. i'm not talking about changing the hosting, i'm talking about changing how to get the information to the client in an automatic fashion so zero user interaction is required
it all costs money someone has to pay, nothing is free
Terox no offense but you're totally missinterpreting what i said.
People host mods today, don't they? People install them on servers, people install them on clients, and people play these mods. They ARE already hosted. They're just hard to access in some ways (armaholic...)
i'm talking about adding a few bytes of organisational description to automate things, not to change anything about hosting itself.
i understand your point m8, i run an arma community i have my own dedi box colocated and i also run a file hosting server for our 20+GB addon pack and we host it via an armasync repo.... there are not many communities capable of doing this, most of them simply give you links to steam workshops or armaholics
yeah well i'm doing the same thing for years now but it is a horrible idea.
we shouldn't be doing it.
did you go around and ask every single mod author for permission to host his mods on your http/ftp to offer an armasync repo to players? i doubt it.
so the issue isnt really "heres a link to grab the addon pack" ITS MORE TO DO WITH WHO IS GOING TO MANAGE , HOST AND PAY FOR THE BANDWIDTH FOR THAT ADDON PACK
oopsa sorry for caps
writes Terox a ticket for excessive caps usage
lol
asdfghj is right. This process should be automated and handled by the game.
Eh?
npm for arma is the thing
i see 4-5 solutions. 1) point to steam WS as download source 2) point to armaholic/six/whatever as download source if they feel like doing it 3) point to the website of a mod author if they feel like hosting it (RHS still hosts on http?) 4) allow mod authors to set a flag so arma server hosters can act as a mirror if they want to 5) organise a public arma repo where people can dime in with a buck a month on patreon or w/e for mods from authors who don't find anyone willing to host their stuff
the neat thing is: if you set up your infrastructure flexible, with a descriptive file, you don't hardcode your source. you can multi-source.
the entire server management system should be inmcorporated into some form of tool created by BI, that would include server management, ,mission management and addon management, but that requires time and effort and money. this has to be paid for and time found to spends resources developing it, personally i would prefer BI to develop the game better and improve their netcode before adding nice things like that, so its not about a wish list its about practicality
Too bad we're now stuck with subpar SW and since it sorta works, no one will improve it.
wait wait wait. Terox, before you drift off into stating lots of generic unspecific stuff, boil it down to me: What else would bohemia have to do then to implement a trivial function into the arma launcher&server to send a tiny XML file from the server to the client, an XML file defined by the mod author? How would that be a massive task for BI? I don't see it.
Please everyone ignore the comment about "netcode". The weekend just started...
well granted, the launcher would need to be able to fetch files over html. and the steam workshop (but thats already implemented)
the steam workshop is an arse, its not that friendly, its certainly very restrictive meaning you cannot create your own custom server repo based on others mods, which for us is a problem because we resign every addon with a date stamped key to help with version control, leaving us with only the option to host our own repo
@waxen tide what critical features, and why aren't people using these old "solutions" if they're so critical??
okay so what about "Where arte the files hosted" ?
@rancid ruin 1) steam workshop requires mod authors to hand over rights over their work to valve.
2) steam workshop version control is: force update to newest version regardless of anything with no option to block that
3) steam workshop, as implemented in the current arma launcher, fails to do dependencies correctly
- fails to handle compatibility mods in a sane fashion
- quite often simply loads the wrong mods despite the server clearly reporting what is required
(like adding some ace rhs gref compat mod despite the server not even running gref, but running ace, so it thinks HEY asdfghj why don't you load that mod that will lead to the server refusing you!)
Steam WS could act as main hosting platform, while ALSO giving mod publisher the option of specifying his own\external hosting
if all BI have to do is allow some way of linking to a file repo, then there needs to be files hosted somewhere by someone, who is going to pick up the bill for that ? that to me would be a major factor in designing such a system
or we could skip integrating such thing into WS and just use launcher based solution, where package hosting can be set to either point to ws, external host, repository, whatever
Terox, you are aware people played on modded arma servers before steam workshop? Who picked up the hosting bill then?
- overblown. valve isn't going to steal anybody's mod, they don't even make games these days.
- not a huge problem imo, think of the extra complications if they were to implement version control
- that's arma/BI's problem, not steam's
But that brings us into a problem that if Steam WS doesn't improve, we're stuck with non-existant versioning on that host
- is because steam want to cover their ass, nothing more, i think that's pretty clear
right so lets say for example someone created a very nice custom island, what sort of size would that be, 2 to 8Gb perhaps, now times that by the number of folks worldwide that will download that, then add any pqatches to that addon that again required downloading, if you look at it from that perspective there is a lot of cost involved there
and thats just 1 addon
global A3Sync
and then add CUP to the equation
- leads to authors NOT uploading their mods to the workshop, leads to players/admins uploading them, leads to a massive bitching channel in this discord called ip_rights_violations which is a massive waste of everyone's time since it triggers human stupidity by lack of technical infrastructure.
- is a huge problem because there are incompatibilities between different versions and generally people should have fucking control over the software versions they run. steams implementation is bad.
- true, so it shouldn't be handled by BI but rather by people who care enough to implement it properly (mod authors)
@queen cargo Intercept is not a Hack... Well... Atleast not... Well... Uh... No. it can't.
with some zsync implemention, bandwidth could be saved up
You're a hack.
inb4 dedmen gets banned
I like our torrent launcher thing
@slim verge i think you are either trolling me or you have some sort of mind control chip in your brain.
Wouldn't it be nice if the Steam workshop API was kinda usable and open? That way we could just add what's missing
well in summary i do agree that SW could be improved in some ways, but i still know it's the best solution for everybody. that's why everyone uses it rather than some half baked shitty thing like six or maintaining their own launchers and servers and version control and....
@still forum is modifying config runtime considered hacking?
That is BI's approach anyway. Open it up and let the community do
Not really.. But you can only do it with a Hack soo....
Well.....
Well... yes? ๐
So to conclude. The only good thing about SW is the free hosting. The rest is garbage.
i think the BI approach is sitting on an office chair and being spun by an intern in a circle all day.
Either open it up or let the community open it forcefully
+1 @little eagle
delta patching should be a given
from the perspective of a server host and having run a community since 2003, and having hosted addons for all that time, here are my thoughts on it
- I want total control of the files that are offered to the clients who connect to our servers
- I want a 1 click sync, so thyat the clients cant screw it up
WHY?
Because i dont want nor havew the time to spend dealing with user support for complicated systems and having to keep some administerial list of links for folks to go and manage their own addons
After many years of trying various systems, the one i have now which is almost fully automated works for me very well.
I do not trust this with BIS, because I know they will not get it right even if they tried
ezz
decrypt them, delta patch, encrypt them
what do they use for encryption, XOR was it?
ofcourse it can be done
tbh I think hoping for a 100% plug and play solution for anything with arma is a pipe dream. this game is complicated as fuck, as is modding, and everything else that goes with it.
but its not a given (unfortunately)
@slim verge https://github.com/overfl0/Bulletproof-Arma-Launcher ๐
i'm quite annoyed by people obfuscating the issue. @rancid ruin why do you think it would be complicated to download a bunch of files in a sane way?
He's on Valve's pay list.
ah.
i am gaben yes
@still forum hack as in trying to mess with the memory? or hack as in trying to re the config loading process
@rancid ruin I think you're acting morally irresponsable by being employed by valve. Once the great purge comes, i'll personally ensure your public whipping.
the syncing and downloading of files isnt really the issue, its how you manage it thats the real issue
These things have been solved 20 years ago.
@slim verge Well i explained in detail how i would solve it and i heared lots of general "ahh that will never work" but not even one remotely reasonable argument as to why.
in our case you can create a modset by entering the mod names into a json file, that'll get used to make torrents with, upload and make it the required modset for a server
Too bad this game is from 1997.
if torrents were involved that should only be as a support mechanism to ease the traffic, it shouldnt be as a major solution
well that's where you get into the bandwith issue that you mentioend before.
obviously that would be different for a BIS (Or valve)
but random modders? Meh
@tough girder mess
but for a torrent to work requires clients to be connected and working as hosts feeding the data, this aint gonna happen reliably
That's where seedboxes come into play
i used to have all RHS torrents on my seedbox cos i'm a #good_guy
Our main bandwidth comes from some very cheap ones
Which you can turn on and off quite easily if needed
Who should pay for mod download costs? The people who download and play the mods. How do you arrange that? 1) let steam handle it, people pay steam for the game. or 2) let server admins help out with mirroring and let server admins accept reasonable donations to finance server cost in a non-profit manner without discriminating non-donating players by offering donation perks. (bit messy, but thats how it works out in many big arma communities anyways). I don't think anything else would actually work?
what we really need is a community wide accepted tool for addon management, six tried that but although sickboy is a very good coder, he lacked the insight of creating a user friendly UI, so it failed
Anyway it's obviously not ideal, but its that there are options outside worksshop
there's Swifty
but that's also private repos i think
arma3sync (also private repos)
Man you guys are writing too fast.. Can't even make a pizza without you writing a dozen messages
and then another torrent based launcher i think (Cant remember the name)
i think the tool does not only need to be community accepted, it should be shipped inside the arma launcher by BI.
forget torrents, not really an ideal solution and useage of torrents is dying
why not just burn your addons to CD and post them to each player?
well BIS is doing the arma launcher
eats Dedmens pizza so he can read
wow
๐
@rancid ruin, you can have that job
I'm a nice guy, what can i say.
i am already gaben i don't really need another job
i'm just trying to help cos you guys clearly don't like my workshop
@rancid ruin gaben get your shit together or i will rant about valve on the internet.
oneoh is a contrarian.
the arma launcher is also not very good for our community we still highly recommend desktop shortcuts for each server we run, the user support calls that reduces is tremendous
commy is also a contrarian...
Factually wrong. I don't disagree with people that agree with me already.
damn
agree with these nuts 8===D
Custom launcher is always the best you can get. Because it will have everything you need
Penis.
it's a good job nobody moderates #arma3_scripting really
the best interface for such an addon management system woulkd be the server browser, all it really needs is a html page that the server host configs, and this details where to grab the addons and any other useful info like teamspeak address, thats simple, easy and gives total control to the server host
@rancid ruin you better be quiet
actually someone got banned here for talking about hacks didn't they ๐
That was dedmen
I linked a hotfix for a Teamspeak clientside RCE in #general_chat_arma that was why I was banned
Dedmen should be banned imo.
The hotfix was hosted on a known hacker forum.
nah i'm sure FM banned someone else for talking about hacks in here?
was it really dedmen?
@still forum custom launchers, eh? https://i.imgur.com/dAPaxnU.png
@waxen tide pls download frontline launcher too, need more
i recognised his name but i can't remember it now. think it was someone useful
Did someone say custom launcher? https://wolfcorps.de/#mods
I hereby demand the death penalty for the creation of custom game launchers.
I'm quite sure it was a troll
This is the best channel.
scripting channel is the elite, no need for moderation.
Useful people usually don't get banned cough cough
Need to find a reason to get Dedmen banned now just to prove him wrong.
i started this discussion in 3 other channels, and not only was i banned, people pooped on the hood of my car, too.
Why do you sell TS hacks, Dedmen?
Why do people use TS tho
TS great tool
I like TS
Was already banned Flax ^^
I don't.... Well... Uh... You can't call that a hack.. technically that is not categorized as a Hack
ts > discord come on bro
mumble > both
TS easily
pff
mumble's alright but so is TS
Mumble... urghh
Someone turn the heater on
i use TS cos i have a server hosting TS, it was an ez choice
I just hate ts license
mumbler
you hate free licenses ?
TS license is free?
with slot limitation, yes
if you hate any software license you need to get out more
Non-profit for everyone
NPL?
I hate paying taxes way more than any software license other than wiondows server licenses
Non profits get a 500 slot
Is npl reasonably hassle-free to acquire tho
Not enough tbqh.
@tough girder I also hate it.. That's why I do stuff so I don't have to hate it anymore
i think the standard TS server is 32 clients, that's alright tbh
Or even more at some times, depending on license agreements iirc
@slim verge buying licences for microsoft is unethical
NPL is friggin hard to get lately
Takes about a week to get NPL
i never mentioned money now did i ? ๐
compared to how easy it was before
Yea true.
NPL requires web site, and proof of an active community
fair enough surely
and NPL forbids any kind of donation button on that website
Meaning more than just a people saying "i belong here"
Yeah you can't make money off of it
which is why my group flew out. We had a donation link so that members can help pay for the servers
Agreed - NPL is exactly for that. Non profit community. The per slot cost is not that bad.
yeah.. non-profit.. Taking donations doesn't mean you get profit
^
you didn't even think this through properly dedmen, i have no sympathy
Yea keep the donate on the private part?
Onoeh, that's still violating the license agreements
fuck the license agreement, this is the wild west
I don't need a NPL license anyway..
HA
every time you get in a car and drive you break the license agreement but it doesnt stop u from driving
do you read EULAs as well or something? come on bruh
๐ค ๐ซ pew pew
Yeah i'm sure Dedmen hacked the ts server to allow infinite connections the second he noticed there is an limitation.
READ
I don't hack things
Don't you also have to renew NPL
alright just host mumble then, jesus christ
I redefined the meaning of the word "hack".
no NPL doesnt need renewing
- be gone for five minutes
- see โ new messages
- see it's about licencing
- click "mark as read"
- profit
I don't hack things
That's exactly what a HACKER would say.
^^
White hat hacker ๐ค
Dedmen used the swing of a butterfly wing to flip a bit in a specific part of his server's hard disk.
๐
a hacker wouldnt say anything, you wouldnt know he was there, and if you did, he wouldnt be a hacker he'd be a kid trying to be one
I see you like some of the things I like too
please don't mention it, too mainstream to be cool anymore.
a real hacker would talk in russian or chinese
ััะฒ ัะพั ัะปัะปั ััะพะบะณั?
@rancid ruin I'm not trying to convert people to mumble, was geniunely interested in why teamspeak was chosen as voip client in the community
ะฐัะดะฐะดัะฐั
:ghost:
ACRE and TFAR support. @tough girder
It was because the API is very easilly useable and Teamspeak was already wildly used among gamers. Which is why TFAR/ACRE use it.. and now there is no alternative
Mmm, rather why ACRE and TFAR decided on TS API then
@tough girder i think it might be the combination of being there early and not sufficiently annoying people to make them switch is what leads to these things.
Damn Germans, they know it all. Mandarin, Russian.
besides ACRE Omnibus which kinda failed..
And TFAR's plan to rebuilding something similear which was pushed back
it's like when porn choose Bluray over HD-DVD
aka failed
well before we had ACRE we used to use the channel commander fgeature and bear in mind OFP was 2002, there want really any other viable option then, so nearly every one went TS, some tried oh i forget the name, Battle****
germans don't know everything, they haven't figured out how to invade russia yet
You can't fail something you didn't even start
i remember hosting TS2 servers when scriptkiddies were hacking them left and right and even escallating privs to root due to horrible bugs in it.
You failed to start?
Oh yeah... ๐
@rancid ruin how much you wanna bet Dedmen rigged the election?
๐
That oh yeah was to @waxen tide ๐
Hey I can't join channels. Can you please press CTRL+H for me?
good old times.
Oh thanks for giving me Admin rights
๐
How did Omnibus fail?
isn't mumble still an alternative?
i haven't used it in years, but it always looked okay
thats what BF2:PR does still
people who use mumble are .... weird.
obviously the other option would be having good in-game comms
mumbler
Mumble doesn't have tfar\acre support which is a stopping point for a lot of people
Mumble is still alive as an voice api i am pretty sure. Not sure about the client
i unfortunately do
Ventrillo is still active
I don't, thankfully
such a horrible pile of garbage.
Yeah. Vent sounded better than TS2, but I think TS3 killed it.
mumble and ventrilo all had issues when it comes to runnin g good comms, TS has nearly always been a very reliable and decent quality comms package, thats why it became so popular, this is back in TS2 days when OFP was first released, i guess its old habits die hard
i think ventrillo was a troll project of someone going "how do i re-implement TS and make it worse in as many aspects as possible"
Omnibus essentially failed because lack of time and skilled people
Yeesh. So why are we all using nasty discord then?
or maybe i'm confusing this with raidcall.
Yeesh. So why are we all using nasty discord then?
Good question.
also vent and mumble requires a lot of user support so not a great choice from a server admin perspective... you want something that is easy and causes you minimal hassle
Because it's easy
Because BI decided
But is there still interest in continuing omnibus\tfar thing?
anyone remember allseingeye
In any other discord i would vent that discord is for lamens and pubg players
But uhhh...
Anyone use Mattermost?
I'm still offended by TS3 still. I mean have you installed it lately? Still sort of a clusterfuck with little regards to linux structures. "Eh throw this in your home folder and unzip it, there is a startscript somewhere. i think. and maybe don't run it as root, but whatever"
TFAR still has it on it's todo list. And I'm sure ACRE has too
that program was the absolute shit back in the day
- pirate a game
- get allseeingeye
- lose childhood
@waxen tide user error mainly
nahh what i'm talking about is 100% failure of software packaging
but linux distros are very messy in that regard so i can relate
Mehh. Community developers ride the ass of templates
For TS3 that is
Look at how many reskins there are
Some of them only replace the main background
Some of them have a lot of work put into them, i have this plugin that automatically sorts the 3d audio.
Reading more into Omnibus, that's a fully fledged voip client/server, damn
the mass mover plugin is good, but would be nice if the dev added a "move all players in this channel family to......."
"There is a plugin for that"
TFAR has one gigantic flaw btw
It existed even before myTeamspeak
you can't mute idiots
yes and it works too funnily enough
You can on newest version, can't you?
-30DB
no TFAR unmutes everyone
I thought it was -50?
but you can still hear them mumbling on
the TFAR TS plugin should have an option to mute idiots.
I once had to mute a guy to about - 20dB to not get my ears blown. If not more
if i were to mute idiots, then most channels would be silent
well, you missspelled community in your nick.
I can also guarantee you that feature will never be added
๐ฅ
i did well spotted, you need to get out more
Can't you silence everyone in a channel once it hits a certain db level?
get out more?
You misspelled "misspelled"
well if your checking spelling ๐
i did well spotted, you need to get out more
I would but its such a hassle with the thick snow suit and the rifle for the bears
@still forum would that feature be hard to add?
yes. very.
why do you arm bears ? arent they tough enough ?
I think my sarcasm detector is broken.
That's more self-protection than sarcasm
that would shock hunters wouldnt it a great bear with a minigun
@slim verge i demand that you fix your nick its ugly to look at.
As opposed to unfree choice?
yeah aint that a eastern block thing
maybe discord is like arma and doesn't care about extensions.
trying to fill a boat with passengers when it respawns. Wrote this but it seems like it is a bad approach or I made some misstake, my FPS goes down below 1.. =/ any idea?
_totalSeats = [typeOf _newBoat, true] call BIS_fnc_crewCount;
_crewSeats = [typeOf _newBoat, false] call BIS_fnc_crewCount;
_cargoSeats = _totalSeats - _crewSeats;
while {_cargoSeats > 0} do {
_man = "fow_s_us_rifleman" createVehicle getMarkerPos "tempSpawn";
_man moveInCargo _newBoat;
_cargoSeats = _cargoSeats -1;
};
};```
Why are you using while where a for loop would be more appropriate?
forgot the syntax for the for loop in sqf so used while for my test only, performance should be the same anyways right?
foreach should be fine, no?
i think his while loop equals true always and just spams units immediately which leads to 1 fps btw.
which the while immediatly screams at me
hides his mindreading device
I don't know why it doesn't work.. code looks good
_newBoat... Is that code running right after you createVehicle?
you might have to wait for atleast 1 frame
_newBoat is the param passed from the respawnModules expression field
I rewrote it to a for-loop and it seems fixed, I guess that it for some reson never broke out of the while loop.
_totalSeats = [typeOf _newBoat, true] call BIS_fnc_crewCount;
_crewSeats = [typeOf _newBoat, false] call BIS_fnc_crewCount;
_cargoSeats = _totalSeats - _crewSeats;
for [{private _i = 0}, {_i < _cargoSeats}, {_i = _i + 1}] do {
_man = "fow_s_us_rifleman" createVehicle getMarkerPos "tempSpawn";
_man moveInCargo _newBoat;
};
};```
thx!
That version of for is hideous.
why not use private?
I'll test if it makes sense here. I'm not used to this syntax.
Logically.. it makes _i private.
im not 100% sure tbh when it comes to sqf, just pulled that from the wiki as the "good example"
why ImageToPAA never works for me?
if there is some other better way I'd rather re-learn that
i dont get that for
for "_i" from 0 to (count _whatever -1) do { call hackerman; };
I kinda like it, reminds me of more familiar languages ๐
perfect sense
{ call hackerman; nil } count _whatever; best
{ _x call hackerman; } forEach _cargoSeats is probably what you want
because easy
the count is slightly quicker because it doesnt keep index
nvm, the above code still wont work well. still get the same low FPS, I forgot to uncomment the actual spawning code -.-
I guess createVehicle is kinda expensive?
@still forum
_i = -1;
for [{_i = 0}, {_i < 3}, {_i = _i + 1}] do {};
_i
3
_i = -1;
for [{private _i = 0}, {_i < 3}, {_i = _i + 1}] do {};
_i
-1
but inside the for loop?
what about for "_i" ?
figured. i only ever use that one and never noticed needing to private it
The magic variables are all private. _x, _forEachIndex, _this.
_i is not a magic variable
you are setting it to private in that code block..
But the engine calls into the codeblock.. codeblock exits again.. variable is undefined
Example?
no
๐ค
No you cannot take them
Are you talking with someone on my banlist?
Cookietoken
Yeah that'd be pretty cool if they did that
Well you could always try the alternative method
Now you're just teasing me.
Haha :)
took awhile to read through the conversation over the past 7 hours. So question....I looked at the Intercept-Python I had a few questions(Warning I'm not familiar with Python.):
1.Is Pythia the project that will make it possible?
2.What is the advantage of this method vs creating a custom dll?
3.What type of server features would most benefit from using python vs sqf?
4.Any other pros/cons to this?
Pythia is not Intercept-Python. Intercept-Python is called Intercept-Python.
Intercept's interaction with SQF scripts is far more direct than the normal Extensions.
Everything. No.. Literally.. Everything.
Pros. Performance, more standard code (programming language that is more wildly used) and thus easier to understand for non-sqf writers.
Plus you get every Python feature as a nice bonus
Using Intercept you are essentially right inside the Engine.
A normal Extension is a thingy next to the engine that needs to communicate through a very restrictive interface
how does it compare to Intercept C++? same thing just in python?
python is a additional layer on top.
I'm all for coding in something other than SQF ๐ I just want to make sure I switch to the Best platform available.
It is still very performant. But ofcause not as fast as C++ directly.
also not really useable yet. We will probably have the first experimental and very feature slim Intercept-Python version next weekend..
@austere granite Really......?
/s
It wasn't a question of sarcasm, but a question of why you chose the gamecube. Doesn't even relate in the slightest
I meant environment when I said platform
Different from console /\ pc platform
Intercept C++ also has the highest development priority. Because everything depends on it. If anything breaks the C++ one will get fixed first. But most likely that will automatically fix all other languages built ontop of it
@tulip cloud OOS allows you to use different language while maintaining that your code is compatible with vanilla arma
there is also other side-languages that generate usable SQF
which do not come with such an overhead as OOS
I didn't read anywhere that he asked about OOS
but change the syntax completly
I'm all for coding in something other than SQF :wink:
that other option is for example ASL which also has a nice syntax and compiles to native SQF code
X39 that is a true statement but the context is pointed towards working in the most native language for Arma 3. Which appearantly is C++. I just have to learn how use it properly with the game engine. The limitations of SQF have been driving me up a wall.
which limitations gamewise?
there barely are any
extensions just provide access to new stuff eg. SQL which, indeed, is not in SQF itself available
Intercept is as native as you can get.
In SQF when you call a script command. It calls a C++ function in the backend. In Intercept you are on exactly that C++ level. You can even define your own SQF commands if you want a Intercept/SQF hybrid
Intercept-Python will someday support that to. Being able to call directly to python code from SQF.
Could I potentially push code to a client?
Something like this:
https://github.com/ocornut/imgui
and initialize it?
No
That would wreck security
And with Battleye running you can't do anything like that clientside.
We plan to integrate imgui somehow into Intercept. But that's really complicated.
basically, possible but would be considered "malicious".
If you have a clientside extension.. That explicitly exposes this functionality.. Then you could theoretically do that
Instead of adding the functionality to push what you want.. Just put it directly into the clientside plugin. Instead of sending it over.
Personally, I refuse to touch the arma GUI tool it is so poorly designed. I'll have to learn more about the process with c++ injections and writing my own functions that could potentially be pasted from server to client-side. Trying to overcome the barrier of working in Vanilla without requiring the WS or 3rd-party mods.
I can only strongly advise against doing that. That is a huge security risk.
Is there a discord channel or server that is focused towards intercept-c++?
There is Intercept Slack
You can't push C++ code from server to client. Without the client running a 3rd Party mod made by you.
You need a clientside plugin that exposes this huge security risk...
And if your users are using Battleye you need it battleye whitelisted. Battleye won't let something like that through.
well yeah, you would need a client side "downloader" for it, but if you have that, its possible
then again, as dedmen said.. with battleye it would luck to get it whitelisted
Even if you get it whitelisted... Injecting code like that will get you a permanent Battleye ban for hacking
Or.. Whoever client you push that to
Thanks for the link Dedmen, you'll probably see me asking a lot more questions over there.
@tough abyss I'm planning for a future project.
still working primarily in sqf. But, my goal is to move into an environment that will be more robust. It'll be interesting to see the potential using Intercept.
Quiksilver, we're primarily focused on vanilla based game modes. I believe the current mod system is terrible and restrictive for using in public environments. (Can't subscribe to a mode directly in game and load it after arma 3 has started.) Unfortunately, we'll probably be creating a mod to support the core game modes. We'll see...
you can quite easilly deliver scripts from server to clients
alot harder with Intercept. Actually impossible without clientside mod.
And Intercept won't change anything on that
Hey I have a quick question: I want to change the weapon sway with this code:
player setCustomAimCoef 0.34; player setUnitRecoilCoefficient 0.50;
Do I have to put it into the initPlayerLocal.sqf when I want to run the code in a multiplayer campaign?
yes
User error
Maybe a better approach is to make all mods optional and the game mode can run vanilla but will use mod content if available
For instance, the game would have a vanilla interface but with a mod it would load the imgui interface instead.
^That is the problem
what kind of UIs are you trying to create? arma 3's UI system is painful but it's not that bad once you get used to it
Basically, you get everyone engaged without the content and then they can download the additional content for enhanced experience. (Almost like the watemark effect BI uses for DLC...but for mods.)
when I would put this into the onPlayerRespawn.sqf will the Aim get lower on every respawn?
no because you're setting it to an absolute value @muted parcel
oneoh, you can say that about almost anything. Even punch card programming
no to a coefficient
yeah I ctrlCreate my GUIs in script, it's way easier than doing it all in a massive class file imo
and kinda more tightly integrated with your scripting
although technically probably a bit messier overall, but gets results faster
the visual GUI creator things are all shit imo
i tried x39's one for a bit, and i respect the work but it just isn't fun to use
and BI's one is dogshit
Get ready for Arma 1 then.
Help !!
I'm new to this part, can anyone help me? BIS_fnc_AircraftCatapultLaunch http://prntscr.com/grd4w4
No.
You can stop posting meaningless screenshots now
Screenshots? From code? Why???
You should maybe start telling us what's wrong or not working for you
to show what I've done
sorry
Right now. I can see that you placed a plane onto a carrier deck.
yes
And I have no Idea what you are trying to tell me with that
TeTeT Help me too.
So.... .... whats the issue?
I do not understand how to use fuctions correctly BIS_fnc_AircraftCatapultLaunch
The file you have open in Notepad++ should have an example at the bottom
No wait
It is right there
3 lines above your cursor.
I created one the files with this script
fn_aircraftCatapultLaunch
Why?
Fuctions Arma 3
You don't answer my question.
Line 11 in that file tells you how to use the BIS function. No need to copy the file to anywhere.
ok
I can not understand how this script should be used
sorry
2 days trying to do something without success
@still forum I'm going to work for this one now. thank you
Dumb question: how can I test if a classname is a UAV?
Would something like this be a step in the right direction?
_classname = "B_UAV_02_dynamicLoadout_F";
if (_classname isKindOf "UAV") then {
//do stuff
}
isKindOf is meant for objects, and I have a string, so...?
isKindOf checks for classnames.
๐ค Yes
You can use the ingame config viewer to retrieve the common parent of object classes.
If there is one.
I'd just use this though:
unitIsUAV _vehicle
Or if you really need classnames:
getNumber (configFile >> "CfgVehicles" >> CLASSNAME >> "isUAV") == 1
So should I use the ship's class name?
I wasn't talking about your thing.
I do need classnames because I'm taking a list and sorting it, sort of...
But I'll take door number 2, monte
thanks
@jolly echo I am etlling you you need to provide the plane as object as a parameter. And you are asking if you need the ships classname? That's like completly the opposite
ah right ๐
Sorry
But still.
If only we had Threads... Slack > Discord
Generally, anyone who feels addressed to.
no I did not see your unitIsUAV thingy, my bad ๐
Threads are terrible though.
is it possible to modify vanilla or mod UI dialogs by redefining them with the same classname in description.ext?
Yay learning :D
_classname = "B_UAV_02_dynamicLoadout_F";
switch (getNumber (configFile >> "CfgVehicles" >> _classname >> "isUAV")) do {
case 1: {player sideChat "yep";};
default {player sideChat "nah";};
};
so how can I test changes made to dialogs from a mod ingame?
aside from restarting the game every 10 minutes
Can't you put all the dialog code into the description.ext?
Yes.
But not modify existing
Get dev branch. with the diag executable you can reload the config with filePatching and via a script command
Interesting and even more interesting
For dialogs what do shortcuts = {} ; and shortcutsAction = ""; do?
no documentation for those parameters
How lucky that I have time to check now..
shortcuts is array of numbers
Keycodes
do you set these shortcuts on the dialog or on a button for example?
confirmed. dikCodes
figuring out what does what
Is the spelling of shortcutsAction correct?
that's what it says
most of them point to "CommandingMenu1" with various numbers. Not sure where these are defined though
yep. That info is useful. Just found that out myself
Ah ๐
logical thinking is sometimes easier than reading up on stuff
You know the AI commanding menu on the number keys right?
The combatMode menu. Specifies shotcut 2 which is number key 2.
and shortCutsAction CommandIngMenu1.
Pressing that shortcut switches to CommandingMenu1
Script command commandingMenu
can "any" be used for types in nearestObjects?
try it out
any is no class
hmm
luckily "All" is
woo!
Or you just leave the array [] empty.
Same thing, probably faster to do for the game.
I figured leaving the array empty would always return 0 objects. Thanks again
For the future.. Stop figuring and just read wiki.
Passing an empty array to define the types will also return objects with no class at all (such as trees, bushes, stones, ...). Example:
_objects = nearestObjects [_position, [], _radius];
Passing the array ["All"] is not the same and will only return objects that have some sort of class.
sometimes the wiki seems to expect you to just figure things
Add it to the wiki if it's not detailed enough
Hmm... Again...
18:55:49 Error in expression <getConnectedUAV player in nearestObjects [this, [], 20]))>
18:55:49 Error position: <nearestObjects [this, [], 20]))>
18:55:49 Error 0 elements provided, 3 expected
Perhaps nearObjects would be better
Nope, nevermind. Going to do something else entirely
@rose hatch this isn't a position...
Read it. Didn't help
this undefined?
no
Am an idiot today...
OK, goal here is to display an addAction on the condition that the player's UAV is within 20m of the object the addaction is placed on
wiki says nearestObjects takes position. you give this. Wiki says this can never be a position.
Then I'll have to name the object with the addaction and use that name
a object will also not be a position
Right then...
getPos will give you a position in combination with a object
position: Object or Array in format PositionAGL or Position2D - where to find objects, center position.
You can use objects here.
:>
(getConnectedUAV player in nearestObjects [getPosATL this, [], 20])
Disclaimer: I'm trying that code now, haven't yet
ouh man...
Pls don't be mad
But.. I just man'ed
and I'm a Man.. I think
where is that code?
trigger activation?
Nope. In the condition field of an addAction
don't use getPosATL for PosAGL.
k
"ATL" != "AGL"
ATL != AGL
๐
dammit
But object should work.. so why did this not work before.. this is object
addAction condition he just said
Wow.
Again READ WIKI. _this is the "caller/executing person"
You could have saved yourself from all of this by reading
Are you adding that action to the player? or a specific object?
yes. that's correct.
Therefore, I should be able to use this when getting the position of the object which the init belongs to
Then I don't see the problem there
again. how is this related to the addAction condition?
That does not apply to the addAction condition and statement scopes.
I need to test whether the player's UAV is within 20m or so of the object which the addaction was added to
You could pass it as argument though.
"addAction Condition" and "init line"
There is a very subtle difference between these. You can probably see it..
I just told you how to do it
you just have to read what I/we tell you
or read the Wiki. It also tells you what to do
read the description of the "condition" parameter
It is exactly what you are doing right now. So you should read what that thing is that you are handling.
"script code that must return true for the action to be shown. "
And I don't want the action to display if the uav isn't within 20m
Your code is almost correct
The answer is in the next sentence
you shouldn't stop reading after the first sentence..
lol
Congratulations. You just learned a very important part of learning how to script in Arma.
I've read the addaction page several times when checking syntax, never noticed that
As info. Object init line refers to the init script. The script box you get in editor when you doubleclick an object
The addAction condition is not code inside the init line. It's code inside the Action.
Also when you are stuck on something for a long time. Take a pause. Or do something else and then come back later.
Your brain will be full of "No I checked that twice that can't be it"
As in, the this from the init isn't usable as the this in an addaction.
I'm a brute force kind of guy. It happens
Scopes are the bane of SQF beginners.
truth
generally every variable is only there right here and right now.
The condition from the Action is not exected right here and right now.
It is executed later when the condition is checked. Whereever the player is at that point in time
Curly brackets are glorified quote marks.
So if you go logically about it. A variable that you only have right here in that init box. Can't be there half an hour later on a piece of code somewhere else
same with spawn and addEventHandler and addAction and some others.
If the code doesn't get executed right now. Then your local variable will not be available in there
a lot of people get that wrong
In all scripts also @still forum There is the nice feature
of the _thisScript and _thisEventHandler
Magic variables that live inside the script
or EH
_local variables are always going to stay local unless you explicitly change their scope
from local to global @rose hatch
Thanks everyone, I learned a thing today
Good way to see if a script is finished using _thisScript
when executed from "scheduled origin"
@little eagle Silly question
How do I convert a multi-nested array into a flattened array?
Hm.
Guess I'll have to work this out.
@tame portal Not useless
Works well with SelectBestPlaces
Ha nvm
Found out how.
So this is what is inside getAllEnvSoundControllers.
["rain","night","wind","daytime","distance","meadows","trees","houses","forest","sea","coast","altitudeGround","altitudeSea","shooting","deadBody","fog"];
Exact same syntax for selectBestPlaces.
@tough abyss Did ya finish ur IED script?
[]apwn { _thisScript = {private "@tough abyss "; _share = false; waituntill {sleep 180000000000; _share};};};
Hmm, getting lots of errors but looks like it working to some extent. How can you disarm them if you can't get close enough or is that not intended?
Sometime there is a marker but no ieds
No no.
Markers IEDS are near them.
Not on them.
Because I used your 2M displacement
If I set it 0
They'd go right on the marker
well markers for debug right? marker pos should probably be on ied? on mine maker is set on get pos of ied after random displacement.. but still walking around maker and no mine detector beep.
probably selectbestplacessometimes is not returning your expected value or data type..
cool well thx for sharing.
this setObjectTextureGlobal [0, "images\briefing.paa"];
this does work on my side but a player that joins get a error
a not found and gives the path of my computer
any ideas?
@cloud thunder You can use SelectBestPlaces and yeah
@astral tendon they must have the .paa file too
try setObjectTexture + remoteExec with JIP flag set to true?
im sorry?
look those commands up on wiki, it'll make sense
if its a static image then just wrap in in an isserver check..
something like
[_unit, [0, "\a3\characters_f\BLUFOR\Data\clothing_wdl_co.paa"]] remoteExec ["setObjectTexture", [0,-2] select isDedicated, true];```
i put that on the object that the texture must load?
its a breifing image or sign?
billboard object init exampleif (isServer) then {this SetObjectTextureGlobal [0,"images\onions_logo.paa"];};
with that, any player that joins the server will see it?
(i don't trust setObjectTextureGlobal to work correctly, but you can try)
is there a way to i test my mission as a client instead of a server?
so i can see those erros?
run the mission using dedicated server
^ youll need to set up a server.cfg. and run arma3server_x64.exe from bat file or maybe directly. then connect with you client.
!('Medikit' in (items player1))
question, is that executing global or local?
im afraind that this will not work in MP
player1 is the name of one of the characters
also, the "player" does not apply to every player in the server?
i image that is too broad
lets say, if i do a command like "Player setDamage 1"
and there is 2 players in the server
how does that will work? will do that damaga to all players or will not work at all?
because he not know "how is the player"?
@astral tendon It always depends where the code is executed
Each client has its own environment
The server has also one, logically speaking the server thus returns null for player because he doesn't have a player
And on each client you always get the player depending on what physical computer the code was executed on
if i put that on a trigger for exemple, how does that work?
The trigger always runs on all clients
So that when I run into the trigger, the on activation code is executed on my computer
Oh that message might have been a bit confusing :P
so, if is you and me playing and you hit the trigger you gonna die?
and activate "Player setDamage 1"
what if a IA hit that trigger?
Hm okay let's explain it like this
Each trigger has a condition which it checks multiple times per second
Each client and the server do that on their own
So if the condition is "5 Ai units in that area" and 5 Ai units eventually run into that area, everyone will run the on activation code on their PC
Because all checked for that condition and it went to true, so the code got executed
However when you put in a condition like
player distance position < 50
It will only run the code on the client, which actually ran into that area
Because while everyone runs the same condition again and again
Player is always different on each machine
So when I do my check "Is player in 50 Meter radius of location x?"
Player will be myself
So I only do the check for myself, and.only when I run into that area, it's gonna execute the code on my machine
It will not run anywhere else because for example your friend B will also check the condition for the trigger occasionally
But player on his pc does not refer to the same physical object ingame like on my pc
So when I run into the trigger, my own check will say "Yes, player is inside the circle"
And on his pc (given he is standing outside of it) it will say "No, player is not inside the area"
so if a IA hit that trigger, nothing going to happen to us?
It depends on the condition
this
would save a lot of time and solve most riddles if you would set yourself up a dedicated enviroment to test on. Even after all these years I know about most the locality stuff, but It still helps to test run before you release your mission or set up something new for your friends to try out and it doesn't work..
it cost nothing
3 people sit inside a room, everyone has a ball infront of them and each one calls their ball "myBall". If you ask each person, "what's myBall for you?", they are going to point at their own ball, but not someone else's. This is what player is for them.
Now you put one cube into the middle of the 3 men. You tell everyone "that cube there is theCube". Now if you ask anyone of them "what is theCube?" they will point at the same object. This is what for example an AI unit is like which you named "aiUnit1" in the editor.
well, i tried to set a server to test it but i failed really hard
There are names that point to the same object, and there are names that have different meanings depending on who you ask
I sugest to focus on that.
Like he said, it's best to test stuff
Otherwise you won't get the questions answered you're asking yourself
i know, in MP my mission go sideways
just add another player into acount and the AI seens to freaks out
@astral tendon
This is all you need to run a local dedicated testing server.
- A server config file
https://pastebin.com/gX6tXjmh - A file to launch the server wich specifies parameters a .bat file
https://pastebin.com/mzpy2FmV
Create Server.cfg in game root installation folder
Change template = "BMR_Insurgency_v1_47.Malden"; to reflect the name of your mission. Make sure the mission is in MPmissions folder of game root. Save the file
Create a somename.txt in game root.
Paste these launch parameters in the file. Edit the game install path if needed. This is a no mods example. Save the file.
Right click the file and change extension from .txt to .bat
Double click the somename.bat file to launch the server.
Find your local ip adress so you can direct connect to your server.
To find IP run cmd
Type command
ipconfig /all
It will probably some number like 192.168.0.xx
Open Arma launcher, unload all mods and start Arma.
Go to quick play, direct connect. Enter your ip and port 2302
You will see your server in the list. Join and learn you mistakes.
Login as admin using the admin password set in Server.cfg.
If you mission allows debug console which is set in description.exe then you can trouble shoot your mission further.
When your ready to test with other players you will need to login to you modem/route and allow port forwarding so that you server can be seen out side of your local network. I will not cover that here because its different for each router/modem.
Does anyone know a way in ArmA 2 to convert a String to an array? The only way I know is compile so like
_string = "[test]";
_array = compile _string;
But this is actually creating a code, after using this, the output would be:
{[test]}
I mean it's no string anymore but also no array.
call compile
I tested this aswell but then the array was just filled with any
So the output was [any]
because test is nil
Do you mean because it has no datatype?
test doesnt exist
so its nil, yea
define test before u compile it and itl show something other than any
Okay, I'll give that a try, thanks for the fast reply :)
Worked, thanks
@tough abyss Flattening arrays with what inside of them? numbers and strings? Just to string. remove all [] and then parseSimpleArray
Is switch more efficient than multiple IFs?
then I don't care
well it kinda is..
If you compare numbers for example.. you do _myVar == number.
But switch does that comparison in engine
im using >
instead of calling hte == operator inside script
then switch wouldn't work that well for you anyway
yeah
the elseif condition is evaluated before it knows if the first if is true
so that's kinda shit for perf
if (getDammage player == 0) then {
hint "no damage";
} elseif (getDammage player < 0.3) then {
hint "damage is less than 0.3";
} elseif (getDammage player < 1) then {
hint "player is not dead yet";
} else {
hint "player is dead";
};
im doing same thing
but
if (damage player > 0) then
{
if(damage player > 0.8) exitwith {
_message = "<img size='2.5' image='health6.paa'/>";
};
if(damage player > 0.6) exitwith {
_message = "<img size='2.5' image='health5.paa'/>";
};
if(damage player > 0.45) exitwith {
_message = "<img size='2.5' image='health4.paa'/>";
};
if(damage player > 0.3) exitwith {
_message = "<img size='2.5' image='health3.paa'/>";
};
if(damage player > 0.15) exitwith {
_message = "<img size='2.5' image='health2.paa'/>";
};
if(damage player > 0) exitwith {
_message = "<img size='2.5' image='health1.paa'>";
};
}
like that
is elseif better for that?
maybe.. not much
The last if is not needed.
It's not ๐
Nope, still not needed.
๐ค
_damages = damage player;
_message = switch (true) do {
case (_damages > 0.8): {"message"};
case (_damages > 0.6): {"message"};
something like that ?
compact
well if something is 0.9
Post your code I post mine. And you tell me the difference.
ho yeah, didn't realize that...
if (damage player > 0) then {
if(damage player > 0.8) exitwith {
_message = "<img size='2.5' image='health6.paa'/>";
};
if(damage player > 0.6) exitwith {
_message = "<img size='2.5' image='health5.paa'/>";
};
if(damage player > 0.45) exitwith {
_message = "<img size='2.5' image='health4.paa'/>";
};
if(damage player > 0.3) exitwith {
_message = "<img size='2.5' image='health3.paa'/>";
};
if(damage player > 0.15) exitwith {
_message = "<img size='2.5' image='health2.paa'/>";
};
_message = "<img size='2.5' image='health1.paa'>";
} else {
_message = "";
};
thats better
Or, what I'd do:
private _message = "";
if (damage player > 0) then {
if(damage player > 0.8) exitwith {
_message = "<img size='2.5' image='health6.paa'/>";
};
if(damage player > 0.6) exitwith {
_message = "<img size='2.5' image='health5.paa'/>";
};
if(damage player > 0.45) exitwith {
_message = "<img size='2.5' image='health4.paa'/>";
};
if(damage player > 0.3) exitwith {
_message = "<img size='2.5' image='health3.paa'/>";
};
if(damage player > 0.15) exitwith {
_message = "<img size='2.5' image='health2.paa'/>";
};
_message = "<img size='2.5' image='health1.paa'>";
};
even better!
thanks!
will this work if I have an another one above that for stamina?
same construct
and the private var is still _message
Uhm.
private _message = "";
if(getFatigue > 0) then {
//same ifs as for damage
};
_stamina ctrlSetStructuredText parseText _message;
_stamina ctrlCommit 0;
_message = "";
if (damage player > 0) then {
if(damage player > 0.8) exitwith {
_message = "<img size='2.5' image='health6.paa'/>";
};
if(damage player > 0.6) exitwith {
_message = "<img size='2.5' image='health5.paa'/>";
};
if(damage player > 0.45) exitwith {
_message = "<img size='2.5' image='health4.paa'/>";
};
if(damage player > 0.3) exitwith {
_message = "<img size='2.5' image='health3.paa'/>";
};
if(damage player > 0.15) exitwith {
_message = "<img size='2.5' image='health2.paa'/>";
};
_message = "<img size='2.5' image='health1.paa'>";
};
_health ctrlSetStructuredText parseText _message;
_health ctrlCommit 0;
ok, thanks ๐
why not RscPicture ? it deals with UI scale
if you only have image in your control and no event handler i would recomand RscPicture, ran into UI scale issues yesterday with RscStructuredText
_pictureCtrl ctrlSetText "x\my_mod\addons\data\icon_ca.paa"
Because I' bored:
private _message = "";
private _damage = damage player;
if (_damage > 0) then {
private _textures = [-1, 0.15, 0.3, 0.45, 0.6, 0.8, _damage];
_textures sort true;
_message = format ["<img size='2.5' image='health%1.paa'/>", _textures find _damage];
};
@little eagle won't work. Damage 0.4? What image will that display?
3
You can't argue with this code and it's probably as quick as you can get with SQF.
class health
{
type=3;
fadein=1;
fadeout=1;
idc=444440;
style=ST_LEFT;
x = 0.967 * safezoneW + safezoneX;
y = 0.35 * safezoneH + safezoneY;
w = 0.75;
h = 0.5;
sizeEx=0.035;
size=0.035;
font="PuristaLight";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=false;
text="";
};
@slender halo how would I go about having it as RscPicture?