-
Content Count
100 -
Joined
-
Last visited
-
Medals
Community Reputation
107 ExcellentAbout soldierXXXX
-
Rank
Corporal
Profile Information
-
Gender
Male
-
Location
Czech Republic
Recent Profile Visitors
-
ldnsmudge started following soldierXXXX
-
Briefing Script - Close window on map marker
soldierXXXX replied to ldnsmudge's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Oh, right. MapAnimAdd only works during mission, my bad ๐. Here is fixed code. player createDiaryRecord ["Diary", ["The Hub"," For the duration of your stay you will based here at <execute expression='player selectDiarySubject ""Map"";if ((findDisplay 37) isNotEqualTo displayNull) then { private _ctrlMap = ((findDisplay 37) displayCtrl 51); _ctrlMap ctrlMapAnimAdd [1, 0.1, getMarkerPos ""theHub""];ctrlMapAnimCommit _ctrlMap;} else {mapAnimAdd [1, 0.1, markerPos ""theHub""];mapAnimCommit;}'>The Hub</execute>,a Joint Operations Centre (JOC) in Mexico.<br/>"+ "<img image='images\theHubsml.jpg' width='329' height='185' title='The Hub' /><br/>"+ "<br/> The..."]]; -
Briefing Script - Close window on map marker
soldierXXXX replied to ldnsmudge's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, it's doable, if you don't mind loosing the blue lines pointing to the marker. You just have to script map animation youself. For that you should use execute tag, which is part of the diary system. player createDiaryRecord ["Diary", ["The Hub"," For the duration of your stay you will based here at <execute expression='player selectDiarySubject ""Map"";mapAnimAdd [1, 0.1, markerPos ""theHub""];mapAnimCommit;'>The Hub</execute>,a Joint Operations Centre (JOC) in Mexico.<br/>"+ "<img image='images\theHubsml.jpg' width='329' height='185' title='The Hub' /><br/>"+ "<br/> The..."]]; -
What am i doing wrong?
soldierXXXX replied to yakiecho's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, and welcome to the forum. So there is a lot of things wrong with this code. Let's get through the code. 1)you're passing only _searchlightman variable to new scope (when you use spawn it creates new scope and all variables needs to be passed or redeclared) 2)_searchlights therefore aren't defined 3)while {alive _searchlightman && alive _searchlights} you're passing whole array of lights there, that should be only one object 4)If you'll use && code will never be run, because while condition exits when condition returns false, you need to change that for || 5)if (!alive _searchlightman || !alive _searchlights) again you're passing whole array of lights there 6)There is no good reason to check the code if searchlight is dead, so you can simplify it to only check searchlight status in a while loop and searchlightman status in if condition 7)_forEachIndex is not defined here, it only exists in forEach loop 8)there is no sleep at the end of the loop which can cause whole game to freeze. While loop is iterated multiple times per frame if there is no sleep inside. Here is good explanation. If I'd followed same logic you wrote it, fixed code should look like this. However I don't really recomment this. If you'll create too many searchlightman units, you might see it on game performance because scheduler will be cluttered with these codes. I suggest to use killed eventhandler for this. It's much easier to use for this situation and also code is called only when searchlightman dies. That means you can have as many units as you want and scheduler is not cluttered. This code should be run only on the server in case it's for multiplayer mission. Either put the code below in initServer.sqf or add condition if(isServer) then {//paste the code here}; -
points for healing in MP
soldierXXXX replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
For peace of mind, I want to share the code I put together for anyone that might come across this thread in the future. This is actually my first time messing with eventhandlers in the multiplayer script, so I spend about three days observing, adjusting and learning how events behave in multiplayer environment. I really wanted to make the event work since it was the original idea of this thread, and I believe, I managed to make it functional. This event is a bit complicated as it has to run on each client and be updated after unit respawns. Learned quite a lot I have to say as previously I only read about multiplayer scripting in theory. Still it's not my cup of tea, so if someone experienced points out something I forgot about, I'll gladly hear it. Otherwise I consider this thread resolved ๐. I tested it with instant respawn, so I hope it works on other types as well. I had one client as player hosted server and other as joined client. Tried both clients in lobby ready to play as well as JIP, and it worked in my tests. Code with debug and description: Cleaner code no debug, no description: -
points for healing in MP
soldierXXXX replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Glad to hear that you got your system working ๐ -
points for healing in MP
soldierXXXX replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well, since remoteExec has JIP parameter filled, when player disconnects, his unit is destroyed and becomes objNull unit dies, but JIP command persists and when new player connects he receives basically objNull deadUnit addEventhandler... not sure if that would trow error or not doesn't trow error, but it's not needed anymore, so I think it will be better to remove that request when player disconnects. That would also need some array of JIP IDs managed by the server. I believe, it's connected to the unit, so when unit dies, eventhandler is bound to that dead unit. After testing respawning seems to work even with respawned unit. So it seems to be persistent...huh...so, if I get it right,if addEventHandler is called with object player, eventhandlers are transfered to player every time from dead unit to new unit when he respawns ? I would need someone to explain it to me how it actually works. Hmmm, strange. I would need more informations. When it didn't work, did the first hint show up, how did you healed other player, was the unit same as you connected or new unit (respawned) and so on. Video might help. tested with respawn instant, so it might also work differently with other respawn types. update2: After further testing, it seems that events added on client PC is persistent only for him after respawning (that's why code above still triggers on self heal but nothing else), and for the other clients it's tied to previous unit as events cease to work on new unit. That might be fixed by removing previous event and reexecuting it when new unit spawns. That's why I don't do multiplayer scripting ๐. -
points for healing in MP
soldierXXXX replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Right, so I tried the code with local hosted MP from Eden, I've put your code into initPlayerLocal.sqf and had two playable characters, one medic (client 1) and other normal soldier (client 2). I noticed that it indeed didn't show the hints, except when injured player healed himself. That is because how the event is designed. It only triggers on PC where healer is local. But in that case initPlayerLocal only added event on connected PC, that caused only self heal to be registered because addEventHandler has local effect-no other client knows that you should be registered for healing. So when I remoteExecuted addEventHandlers with JIP parameter as TRUE, It started to trigger when I used healing on the second client. That is, because client 1 at the moment client 2 connected received information to register HandleHeal event on client 2 selected character (unit), and client 2 also received information to register client1 unit event. That meant both PC had now registered HandleHeal to each other and might start to run the code properly. Eh...I'm not good at explaining this ๐ Here is the code I tried: //initPlayerLocal.sqf [player,["HandleHeal", { _this spawn { params ["_injured", "_healer", "_isMedic", "_atVehicle", "_action"]; [str _this] remoteExec ["hint"]; private _damage = damage _injured; if (_injured isNotEqualTo _healer) then { waitUntil { (damage _injured isEqualTo 0) or (damage _injured isEqualTo 1) }; if (damage _injured isEqualTo 0) then {// give healer points [_healer,1] remoteExec ["addScore",2]; [("giving points to: " + str _healer)] remoteExec ["hint"]; }; }; }; }]] remoteExec ["addEventHandler",0,TRUE]; Also this behaviour might be related to this specific event handler that needs to be registered on all clients (and possibly all the other units if player should get points for healing AIs) that should be able to heal each other. Probably because the local healer condition. Most important information is that healer runs the code on his PC and needs to know the object that he is healing has HandleHeal event registered otherwise script won't trigger. Also, this code has potential to get stucked in program flow on the healer's PC in case that he is not a medic and won't heal injured unit fully. It will wait in scheduler before some other medic heals the injured unit fully or unit dies and only after that it releases. Possibly revarding both healers (intended ?). Problem might be if client heals many units just partially, that will create many waiting scripts on that client PC that might potentially decrease performance of the mission for him. Might be better to have it handled by server as separate function. I also believe that you have to re-register the same event every time a player dies. Transfering the event to new unit. Possibly also remove event from previous unit. Removing should also be done if player disconnects and AI switches in the role. Those are some things to be considered. I'm definitely not sure how your mission is set up, so I just tried what I thought would be best. There are certainly people more experienced with multiplayer scripting than I am ๐. Still, I'm gonna hope that I helped you at least a little bit ๐. And sorry if this explanation is a bit messy ๐. -
soldierXXXX started following Missions made by soldierXXXX, points for healing in MP, help re nearestObjects and and 1 other
-
points for healing in MP
soldierXXXX replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, just a quick notice, you're using [] spawn {}, but that doesn't have any params itself. Try use _this spawn {} instead. That should pass event parameters and code should run. If not, there might be locality problem. Depends how you execute the script. -
Does anyone know how to change spawn rotation on this script?
soldierXXXX replied to doubleniner9's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, welcome to the forum. When you create object with createVehicle, you can see that it returns object. That means we can save the returned value into variable and we will have reference to that object. For this example I'm gonna use global variable and will refer to it as "wall". when you want to set direction to object, you can use setDir command. so full script then looks like this wall = "Land_W_sharpRock_wallH" createVehicle getMarkerPos "marker0"; wall setDir 45; Assigning variables are basic thing to do in every scripting language. You will use it a lot. You can read this article to better understand how scripting works in general. -
help re nearestObjects
soldierXXXX replied to fawlty's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yep, probably would be better to put it between round brackets I tested it with this, {[_x, 2500] spawn {params ["_unit","_number"];systemChat str ("Unit:" + str _unit + " Number: " + str _number)}} forEach (player nearEntities [["O_Soldier_base_F"],51]); So your code should look like this {[_x, 2500] execVM "fn_taskRush.sqf"} forEach (cap0_1 nearEntities [["O_Soldier_base_F"],51]); Also I noticed that you had there empty characters, which also causing errors. If you're satisfied with @JCataclisma's code (which works), there's no actual need to change that. We're talking about milliseconds here, so regular users won't notice the difference anyway ๐. -
help re nearestObjects
soldierXXXX replied to fawlty's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yep, you got this wrong. You can't combine nearestObjects with nearEntities. It's either one or the other. So like this: {[_x, 2500] execVM "fn_taskRush.sqf"} forEach cap0_1 nearEntities [["O_Soldier_base_F"],51]; You can of course change O_Soldier_base_F for SoldierEB,SoldierWB or SoldierGB. O_Soldier_base_F is child of SoldierEB. -
help re nearestObjects
soldierXXXX replied to fawlty's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, if you need to return opfor units + opfor vehicles you can filter them with select command nearestObjects [cap0_1,["O_Soldier_base_F","LandVehicle"],51] select {side _x == EAST}; But if you need only on foot units it might be better use nearEntities which is much faster cap0_1 nearEntities [["O_Soldier_base_F"],51]; -
Behaviour of ceil after 2.18 random "fix"?
soldierXXXX replied to krzychuzokecia's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, as far as I know this change shouldn't affect any script in particular. While scripters use random x with combination floor, round or ceil then the number always returns integer value. In case the script uses pure random, then the autor probably didn't really needed that specific x value to be included. So that means, if you're using ceil for instance with number 5, it might generate any number between 0 and <5 so like 4.73 can be generated and ceil automatically makes it 5. If you seriously need that value to be included you can probably use linearConversion command with clip value true. something like _wantedNum = 5; _randomIncluded = linearConversion [-0.01,_wantedNum,(random (_wantedNum + 1))-0.01,0,_wantedNum,TRUE]; //should theoretically return numbers between 0 and 5 not tested IMO this change might actually help, because when I used for loop with combination of array select _i in older scripts, I always had to account for that particular case that it didn't choose that last number where no value was defined so I had to do like for "_i" from 0 to (floor (random (count _array -0.1))) do {...(Today I'm usually using forEach loop instead) And since 2.18 it could be same thing without -0.1. It's not really good example to show it on but now it will work like in other programming languages. I think that's why they changed it. -
eventHandler for player UI commands? e.g player changes an AI unit colour?
soldierXXXX replied to bendy303's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, Bendy, handling such system through UIEH would be really hard. Fortunately we have also user eventhandlers that can do all sorts of things. I prepared a quick example code that should be able to do what you need. But multiplayer scripting is not my cup of tea if you understand. Maybe you would also need to add functionality that would handle respawning, adding units to your group and so on. I hope that this code could help you at least a little bit. ๐ -
Hello guys ๐, I'm starting this thread in hope, that more people can try out my missions. I'm a guy that creates missions with passion and prefers quality over quantity. Creating a mission usually takes a long time since I have time mostly during the weekends. My missions are so far always singleplayer only and scripts used in game are created from scratch, so I can have full control over what is possible to do in those missions. But enough about me. Here are my currently released missions: ==================== Latest mission: Exhibition of Life and Death This mission is my attempt to create an horror mission in arma 3. Short description: You work as a security guard at Lars Blanken gallery in Amsterdam. Today a new exhibit has been moved in the gallery, and for you and your colleague Frank, this night will become a real nightmare. Features: -Horror themed mission -Highly focused on atmosphere -Fully voiced -Translated in english and czech language -Short linear scary mission -Each item in the gallery has its own history -Optimized scripts and mission to achieve high FPS -No mods or DLCs required Steam workshop page here ==================== My older missions: Silent overwatch Sniper support mission Short description: Fia is hiding weapons in one of their camps on Altis. You were send together with Tango 6. Your task is to protect Tango before they destroy these weapons. Features: -Intro -Fully voiced -Fully localized in EN and CZ language -High FPS -Possible replayability -Compactible with ACE3 -Hidden easter eggs -Different experience if you join Tango 6 -Possibility to take different weapon Requirements: RHSUSAF mod Steam workshop page here Windbreakers Air combat mission with customizable parameters. Short description: NATO launched an airstrike on Altis airfield controlled by CSAT forces. Your task is to secure the airfield. Features: -Mission Parameters system -High replayability potential -More mission endings -ACE3 compactible scripting -Hidden easter eggs -Mission won't end if you crash your jet -Fully localized in EN and CZ language -Fully voiced -Custom music Requirements: Jets DLC or any aircraft mod that is capable to launch from USS Freedom Steam workshop page here ==================== That's it for now ๐. Hope you'll like it. I'll gladly read your feedback ๐.