-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by jshock
-
[SOLVED] Howto compile and preprocess a bunch of functions in one file?
jshock replied to sarogahtyp's topic in ARMA 3 - MISSION EDITING & SCRIPTING
https://community.bistudio.com/wiki/Function#Inline_functions- 21 replies
-
- 1
-
- compile
- compileFinal
- (and 6 more)
-
Syntax problem difference between editor and sqf files ?!
jshock replied to doomnet's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Damn brain autocorrect.... -
Second set of eyes needed for optimization.
jshock replied to Fiddi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Most everything said here can be found on this page plus a lot more stuff to chew on for the future. https://community.bistudio.com/wiki/Code_Optimisation -
Syntax problem difference between editor and sqf files ?!
jshock replied to doomnet's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Can you screenshot the error? Or paste what it says here. -
Syntax problem difference between editor and sqf files ?!
jshock replied to doomnet's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Have you tried: if (isServer) then {this hideGlobalObject false;}; -
How to import Mission in 2d editor to editor Eden 3d Help
jshock replied to exevankeko's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It should auto import to configure the mission for the 3D editor, idk why it would leave it blank. -
[SOLVED] How to detect if player has killed enemy
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Bran-spankin new as of 1.55, I just happened to stumble on it one day when answering another thread, now I've been posting the hell out of it, probably posted it in a handful of threads by now :p. Really does allow for a "one and done" EH in the scope of dynamic missions and scripts. -
[SOLVED] How to detect if player has killed enemy
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's a mission event handler. doesn't rely on attachment to any particular unit, so you can check to see if the unit is from side EAST and if it was killed by a player, or any other combo, but you don't have to add an EH to every unit, dynamically spawned or not. I would assume somewhere in EOS you could find where that information could be placed, but I'm not too familiar with the system. -
[SOLVED] How to detect if player has killed enemy
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm going to put this here: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#EntityKilled -
Very true, problem being you have to attach this to the helicopter, so you would need a system to reapply the EH, and just sleeping til you know for certain that all ropes are broken may have unforeseen complications.
-
If I remember correctly I used get/setVariable on the object being dropped (_this select 2 within the EH), but I also seem to remember that may not have been a fast enough solution considering the EH fired 4 times nearly at the same time, but like I said I can't find the damned script and don't remember if I found a solution to that or not.
-
TFAR Classname is wrong?
jshock replied to soundblaster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You'll probably have to iterator through the assigned items of the player and use inString to check the classes (I'm assuming the TFAR radios are returned in assignedItems). Something like this: _radio = []; { if (["tf_anprc152",_x] call BIS_fnc_inString) then { _radio pushBack _x; }; } count assignedItems player; If you sell just the "tf_anprc152_1", every player will have the same radio ID, therefore, any time someone changes their settings/channel/frequencies, it will change everyone elses along with it. -
Putting units on vehicles ?
jshock replied to 3l0ckad3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's a config (aka mod) thing. -
How to make part of init line repeat like a trigger condition?
jshock replied to hatbat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The first line will throw an error I believe, so remove that and it shouldn't be a problem. -
A few questions about Tasks and End Mission in Multiplayer
jshock replied to a topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's about when player is actually available, in other words, sometimes in the init.sqf, player may not be fully initialized when you try and use "player" in the code, that's what the new event scripts are for (they handle all that internally so you don't have to use waitUntils and such in the init.sqf), so you waitUntil the "player" variable exists, and client mission time is greater than zero (this makes the assumption that the client is actually loaded into the mission, you could get away with doing one or the other, you don't have to use both. I don't know if it's necessary to end the mission on the server itself, but that may be a situational thing, and you happen to be one of those situations, endMission is local to a client (I believe) and endMissionServer executes on all connected computers including that of the server, so if you want all clients and the server to end mission, then you should only have to execute endMissionServer one time when you deem the mission to be over. As far as the debrief goes, I get what your saying, but I don't know what would cause that or how to fix it. -
A few questions about Tasks and End Mission in Multiplayer
jshock replied to a topic in ARMA 3 - MISSION EDITING & SCRIPTING
With taskCreate, you can set the first parameter to be true, therefore creating the task for all playable units, so you don't have to worry about locality, then you can use taskSetState as you have it there, and it should set it for everyone (if I remember correctly). Yes. I'm not quite sure what you mean here, if you want to be safe to make sure all the client's missions have ended then end it on the server, I guess it makes sense. if (IsNil "TaskOneStatus") then {TaskOneStatus = 0;}; //You may want to put this line in the initServer.sqf (you can also use the "side" of the players as a param) [true, "Tsk_Clear", ["Remove the presence of enemy forces at the <marker name='Town'>Town</marker>.", "Clear The Town", "Town"], "Town", true] call BIS_fnc_taskCreate; //================= if (!(isDedicated)) then { waitUntil {time > 0 && !isNull player};//need this if your are working in the init.sqf player createDiaryRecord ["Diary", ["Clean Sweep", "Clear the Town of Enemies"]]; //little cleaner loop code _handle = [] spawn { waitUntil {TaskOneStatus == 1; sleep 1;}; ["Tsk_Clear", "Succeeded"] call BIS_fnc_taskSetState; sleep 3; "END1" call BIS_fnc_endMission; }; }; if (IsServer) then { //same here, a bit cleaner looking code _serverHandle = [] spawn { Sleep 3.5; waitUntil {count (list TriggerA) < 1; sleep 1;}; TaskOneStatus = 1; PublicVariable "TaskOneStatus"; if (isDedicated) then { Sleep 25; ["Won"] Call BIS_fnc_endMissionServer; }; }; }; -
if (is server) then question
jshock replied to mxstylie's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It shouldn't make a differnce, however, I recommend putting anything that needs if (isServer), into the initServer.sqf. https://community.bistudio.com/wiki/Event_Scripts -
Scripting Introduction for New Scripters
jshock replied to Ranwer135's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This, plus this thread is intended to teach on and summarize basic scripting subjects, not provide project help, those types of requests can be put here: https://forums.bistudio.com/forum/200-arma-3-find-or-offer-editing/ That is if you really want an extra hand, but if you want to actually learn, saroghtyp covered it.- 97 replies
-
Vehicle fired Event Handler
jshock replied to raptor2x's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not sure if this will work, but put a WeaponAssembled EH on the player, check to see if the assembled weapon is a mortar, if it is, add the fired EH to the mortar (weapon = (_this select 1), in the EH): https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WeaponAssembled -
[SOLVED] Predict Target Position - Need some help with code optimization
jshock replied to sarogahtyp's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, yea, then since it's more of an "on/off" type thing it really shouldn't be too bad of a hit, people may experience a bit of an FPS drop while in use, but they can simple deactivate it after a while, I thought you would be constantly tracking the cursor target of the player for the duration of the mission (or whatever). I mean, look at ACE3 (if you've messed with it), they have a speed delimited (similar to a cruise control), anytime I activate that in my vehicle my FPS immediately takes a dump as I'm sure the function behind that is forcing the vehicle to maintain below a certain speed on each frame while the delimited is enabled, so hopefully your function doesn't have that much of an effect, but people do deal with the speed delimited FPS drop, therefore I think they can live if yours has a bit of a drop (if any :)). Your description at the top of the function didn't give me that impression (and I've read zero of the other thread you linked), so I was probably missing a bit of context -
[SOLVED] Predict Target Position - Need some help with code optimization
jshock replied to sarogahtyp's topic in ARMA 3 - MISSION EDITING & SCRIPTING
FPS is probably one of the best identifiers of it, best way to absolutely ensure that it doesn't cause too much of a hit would be to play a mission/game with that running in the background, not just in the editor "testing" it, cause when it's just you and your script, most of the time the weight is transparent, but once you throw a mission and other scripts on top of that it may show to be more of a hit, and like you said it's dependent on the client's computer, as it is a local script. What is the practical use for this script? I may be able to answer a bit clearer if I had some context as to why and what this is used for. I understand what it does, just need to know why you need it. May as well throw the whole thing through code performance and see how fast it runs. -
Fire Can't Hurt Player?
jshock replied to thecoolsideofthepillow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not sure if it'll be too helpful here but could be something :p: https://community.bistudio.com/wiki/isBurning -
Simple way to put it, within the braces ({ }), any and all code there is executed, however, only when there is a true value returned at some point will count increment itself for its return value.
-
Problems with my mission, help requested!
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Or set the alpha (transparency) of it.