-
Content Count
121 -
Joined
-
Last visited
-
Medals
Community Reputation
121 ExcellentAbout soldierXXXX
-
Rank
Sergeant
Profile Information
-
Gender
Male
-
Location
Czech Republic
Recent Profile Visitors
1743 profile views
-
AI helicopter pilot rises uncontrollably after landing using unitPlay
soldierXXXX replied to The Zoteboat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
There is. Depends on your needs, simple rotation can be obtained by getDir which will return degrees from 0 to <360. Basically the same as if you look at the compass. And if you need advanced rotation, it can be obtained by vectorDirVisual usually used with combination of vectorUpVisual. That will return vector format of the actual object rotation. You can imagine that like a direction from object model center to the nose of the helicopter for vectorDir and for vectorUp direction from model center to the rotor. That you'd use if helicopter landed in a steep hill or something. Another function might be BIS_fnc_getPitchBank, but I'm not sure if that's what you're looking for. -
AI helicopter pilot rises uncontrollably after landing using unitPlay
soldierXXXX replied to The Zoteboat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, try to combine the trigger with land or flyInHeight command. Since 2.18 there is also another syntax for landAt command. -
Script help please
soldierXXXX replied to major-stiffy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, to do that, you might want to select the fireplaces that are inflamed and then compare it to array which include only correct combination. For example: ([F1,F2,F3,F4,F5,F6] select {inflamed _x}) isEqualTo [F1,F3]; Order is important here. If you'd work in the future on something similar, where you would not know the order, sorting array of unknown object might return wrong order. To solve that you would need to compare strings instead of objects Example here: private _arrFull = [F3,F2,F1,F4,F5,F6];//example of random order that would not be detected with above code private _arrCorrect = [F1,F3] apply {str _x}; private _inflamed = (_arrFull select {inflamed _x}) apply {str _x}; _inflamed sort TRUE; _arrCorrect sort TRUE; _inflamed isEqualTo _arrCorrect; -
Detect player placed mine in trigger
soldierXXXX replied to The Zoteboat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, you could put a simple condition into the trigger, that will check if there are active mines inside the trigger zone. You can customize the amount of mines needed to trigger your task as complete. In this example you need 3 active mines to activate the trigger. count (allMines inAreaArray thisTrigger) >= 3; -
Quick tested the code again, this time with initPlayerLocal.sqf and pasted my code from this page inside, launched multiplayer mode from eden and still got no error on my end. So I guess the cause will be really some invisible character that got into your code when you copied it. Try to delete the code and paste it again. Of course I encurage you to check the code for invisible characters as well. As I said, sometimes it happens unintentionally and error message appear with the same "Unexpected number in expression" error. For your other question, I usually recommend youtube channel Feuerex which helped me the most when I learned scripting. The guy provides deep explanation on how scripts and systems in arma 3 works. Of course the source of all knowledge Introduction to Arma Scripting which will teach you the basics. And then, this forum, where you can look at other people's codes and learn from them. There are usually more ways to do stuff and script from person 1 will be different from person 2, so don't learn it like a poem, but rather try to understand what is happening in the script. Scripting is not easy, especially for beginners and it takes time to understand it...a lot of time, so don't give up when things don't work first time. I recommend to start with simple things, like showing a hint ingame when something happens and then slowly do more and more challenging scripts when you feel like you're ready.
-
Yes, no major change was done on this part. I cannot reproduce this on my own. When the error happens ? Do you have any steps to reproduce ? Sometimes message from rpt file helps us to understand what's happening. To test that I've tried to spawn new unit with group player createUnit ["B_soldier_UGV_02_Science_F",position player,[], 0, "NONE"]; and no error appeared, action was shown as expected. Try to test the script running alone without other scripts. Also try to check for invisible characters in proper text editor like notepad++. Sometimes when you copy from here some invisible characters are added. You can also test that if you try to put the code here into code block. Red circle indicates where it is.
-
Yes, I updated the script and currently works for all AI units that are on player's side, including other player's group AI members. If you need to exclude groups that doesn't include any player I would have to update it again. Well, I have to admit I'm kinda confused by this sentence. Can you explain further, how you expect the script to behave ?
-
Ah, right. I overlooked that :-D. Action was added to all units that were available at the mission start (editor placed). I've edited the script, so now it should be added to only units that are on player's side. By your subordinates you mean all friendly units or your group only? If all units that are moving on the map, which I think it's better approach if you want to send them to defend cities, do you need also restriction to not be able to recruit other player's AI units or that is not necessary?
-
You can put it into initPlayerLocal.sqf , trigger, separate file, init.sqf...basically anywhere you want. But preferably into initPlayerLocal.sqf
-
I gotta ask, have you also tried my script? Seems to me that all issues you have right now are already solved in it.
-
So if I'm right, you need to be able to recruit AIs one by one like in your current function, then assign them a task like move here and then be able to left the group, so AIs are all still together and not each AI in it's own group correct ? Well...I tried to put some code together that would allow this behavior. Let us know if that is what you're after 🙂.
-
Hi, yes. It is simple, you just have to join to non existent group. Group you'll leave will choose leader automatically, so no need to worry about that. [player] joinSilent grpNull; (group player) deleteGroupWhenEmpty true; Since you joined non-existent group, engine will automatically create new group for you. And thus we have to ensure that when you either die or join other group or so, that newly created group will be deleted once it's empty, otherwise you might reach number of groups limit.
-
Button Click event handler works and doesn't work (respawn)
soldierXXXX replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, Your idc for RedeployButton is 2. That is a engine reserved number that simulates "cancel" button. 0-7 are exit codes and 0-2 will always close the dialog/display. What's probably happening is that dialog is closed before buttonclick code. Because control is destroyed, event is automatically destroyed with it, otherwise you'd see your code working or at least returning the hint. So try to change your IDCs to greater number like 1000 or so. Also your script is pointing to display 9500, but in Rsc you defined IDD 9000 and other controls are also different by +500 in the script. That might also be the case. -
Need some help for a code to give non playable units unlimited oxygen underwater to prevent death.AI units unlimited oxygen underwater
soldierXXXX replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@avibird 1 May I ask, where did you put the code ? And have you modified it in any way ? -
Need some help for a code to give non playable units unlimited oxygen underwater to prevent death.AI units unlimited oxygen underwater
soldierXXXX replied to avibird 1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, your code has wrong syntax. Trying to call the code every frame might decrease performance and cause network traffic to be filled with requests. That would certainly cause desynchronization and potentially even game crashes. Try to put this simple code into initServer.sqf [] spawn { scriptName "OxygenSetter"; while {TRUE} do { allUnits apply {_x setOxygenRemaining 1;}; sleep 5; }; };