Arma 3 Editor Theory - While {...} Do {...} - Loop

  Рет қаралды 6,916

Feuerex

Feuerex

Күн бұрын

Пікірлер: 24
@sergranczopl2968
@sergranczopl2968 7 жыл бұрын
Why did I not stumble upon your videos earlier, great videos. This perfectly forms with other tutorials, I understand so much more, thanks feurex!
@Feuerex
@Feuerex 7 жыл бұрын
glad I could help.
@EJayWalker
@EJayWalker 3 жыл бұрын
Is there a way to write a script that applies to several characters in one script? Example: I have a horde of zombies. Can I get them all to move to a players position in one script? or would I need a script for each zombie?
@Feuerex
@Feuerex 3 жыл бұрын
absolutely - and you even have several options to pick from. You can look into arrays, since that's a very convenient method of storing info about multiple objects. Arma also has commands like allUnits, nearObjects, and similar ones, that can create such array for you dynamically. Once you have your selection, you can use ForEach, For...Do, While...Do, or any other kind of command to iterate / loop over the individual objects and execute commands for all of them. You could also use script parameters! If you use a parameter instead of a specific object, and then call the same script multiple times with different objects as parameter, you can achieve the same. it really depends on what exactly you wish to achieve, but you have a multitude of options, so feel free to experiment. I think I have most of these topics covered on my channel in some form, but there's always the official wiki where you'll find everything needed, and much more.
@francoisviljoen9871
@francoisviljoen9871 4 жыл бұрын
Nice Tutorial Feurex, i would appreciate some help as im still stuck with the while do loop, i have two addactions on a generator, if you start it, it starts looping a generator running sound, the second add action is switch off, but im having difficulty making the second script stop the while loop. Any help would be appreciated thanks man :)
@brandfoley
@brandfoley 2 жыл бұрын
2 years late. Did you ever find a solution? I'm using Say3d and objects to produce the sound I can get the sound playing but can't get the loop working :(
@Alpinegremlin
@Alpinegremlin 7 жыл бұрын
So I`m trying to build upon a simple distance script I was working with earlier. I want the game to tell the player when he is close enough to a building to be considered inside it. "distcheck.sqf" is executed via my init.sqf file. _playerPos = position player; _nearestBuilding = nearestBuilding player; _meters = _playerPos distance _nearestBuilding; while {alive player} do { while {_meters < 6.5} do { systemChat format ["%1 is inside, name player]; sleep 2; }; sleep 0.2; }; The message does not pop up however, regardless of how close I am to a building of class "House". No error messages present themselves and when executed via radio trigger, the script works, but I want it to continually check if a player is the given distance. I will keep looking at your examples to see if I`m missing something.
@Alpinegremlin
@Alpinegremlin 7 жыл бұрын
EDIT: I fixed it :P my variables were not placed under the loop so I guess the game didn`t know what I was talking about after the script initialized? Another helpful video though! Great work!
@Feuerex
@Feuerex 7 жыл бұрын
You're never updating the value of your variables. At mission init, you ask for the nearest building to player, but since you are never updating this value, the condition is either always true or always false. I'm guessing you start outside any buildings, which means the condition _meters < 6.5 is false, and you never see the script do anything, since you never tell the game to ask for the distance again. The solution is simple - update the variables with new values. while {alive player} do { _playerPos = position player; _nearestBuilding = nearestBuilding player; _meters = _playerPos distance _nearestBuilding; while {_meters < 6.5} do { systemChat format ["%1 is inside", name player]; sleep 2; }; sleep 0.2; }; With your permission, I'd take this piece of code and use it for a future video about script error types. This is a prime example of a design error, something that people encounter very often, and I'm in need of faulty scripts that don't come from my head.
@Alpinegremlin
@Alpinegremlin 7 жыл бұрын
Yeah man go for it! If my mistakes can help others than I`m glad to make them XD I wish I had waited another minute to ask as I eventually woke up to what my issue was. I decided to change the while...do to an if...then which seems to work just as well. Thank you!
@skylerslack5677
@skylerslack5677 6 жыл бұрын
is there a script that has an object spawn, exist for a while, than delete, and have the entire process loop over and over?
@Feuerex
@Feuerex 6 жыл бұрын
of course. All you need are commands CreateUnit - community.bistudio.com/wiki/createUnit deleteVehicle - community.bistudio.com/wiki/deleteVehicle sleep - community.bistudio.com/wiki/sleep and a simple while.. do.. loop running infinitely.
@skylerslack5677
@skylerslack5677 6 жыл бұрын
think you could ever make a video tutorial on this? i think it would be VERY helpful for beginners like me who have never made scripts before and mission makers who want ambiance
@Feuerex
@Feuerex 6 жыл бұрын
I mean... I already have a tutorial on how to start with scripts, this very video explains while..do.. and nearly all other tutorials, mission / script showcases and experiments all show different scripts and how they are all structured ... I don't think such a tutorial is very needed..
@farzitsarzo7978
@farzitsarzo7978 7 жыл бұрын
how can i stop a loop with a radio trigger ,somthing like : while ( radio alfa is activated = condition ) do (CODE) thanks by advance !! great videos !!
@farzitsarzo7978
@farzitsarzo7978 7 жыл бұрын
name the loop and put terminate nameofloop ; easy as that . Terminate .... in radio trigger
@nob1536
@nob1536 7 жыл бұрын
Heyhey, nice video. Sadly I still have trouble using it. I want an AI to look at a few different objects and loop that. My command is WHILE {alive _2ndunit} DO {this dowatch stone1; this dowatch stone3; sleep 5;}; Any idea where my mistake is? Thanks in advance, subscribed anyway :)
@Feuerex
@Feuerex 7 жыл бұрын
you are either using the unit's init box, in which case _ 2ndunit} isn't defined and doesn't mean anything, or you're using script / trigger and _this_ doesn't mean anything. Change the names so that they correspond to actual soldiers. Also, put another sleep 5; in between the two doWatch commands. As it is right now, the soldier looks at stone1, and in the next 0.0001 seconds he looks at the next one.
@nob1536
@nob1536 7 жыл бұрын
Thx for your reply. I changed {alive _2ndunit} to {true} and added the sleep command. Still no difference
@thedevilonureyes
@thedevilonureyes 7 жыл бұрын
Thanks that helped a lot ! i liked and subbed
@thedevilonureyes
@thedevilonureyes 7 жыл бұрын
I sorted the problem out thanks : ) , i tried to click the link of your if condition tutorial but it said that the video got deleted
@Feuerex
@Feuerex 7 жыл бұрын
Just youtube's abysmal video description system, nothing out of the ordinary. Links have been fixed.
@mieczyslaw4154
@mieczyslaw4154 8 жыл бұрын
Ahoj ty jsi Obi_wan, že jo? Mohl bych tě poprosit, kdybys mi dal tvuj email nebo ja tobe poslal bys mi tam nejake navod na ofp editor? Já jsem to kdysi dělal a vrátil jsemse k OFP a už nevím. jak jsem to dělal ;) Díky
@Feuerex
@Feuerex 8 жыл бұрын
+MIECZYSLAW 41 Můžeš mě kontaktovat na feuerexcz@gmail.com , ale pro OFP už moc materiálů nemám. Je to už skoro 8 let co jsem ty věci psal. Pokud máš zájem o nějaké ucelené informace v češtině, doporučuju Ruprtovu nápovědu pro OFP, spíš než zbytky toho, co jsem kdysi psal já.
Arma 3 Editor Theory - For...Do Loop
17:27
Feuerex
Рет қаралды 3,1 М.
Arma 3 Editor Theory - Variables, Script Parameters I
14:13
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Arma 3 mission making in 15 minutes or less - Layers
6:36
Make AI do as Exactly as You do! - How to Use UnitCapture with Planes!
16:21
Arma 3 - FULL Beginners Guide (2023) - from buying to playing!
56:59
randomshittutorials
Рет қаралды 874 М.
PERSIST | An ArmA 3 Campaign Creation Mod
15:11
Rimmy Downunder
Рет қаралды 132 М.
#1 ArmA 3 How To Create A Mission In Eden Editor - Start & End Mission Triggers Dialogue, BIS End
23:49
HOW TO MAKE AWESOME ARMA 3 MISSIONS! - Editor/Zeus Tutorial
21:04
OperatorDrewski
Рет қаралды 594 М.
Arma 3 Editor Theory - Conditions, If (...) Then {...}
10:05
Arma 3 Scripting for Beginners #1
25:46
Lance Paxton
Рет қаралды 95 М.
Arma 3 Editor Tutorial | MGI Advanced Mod Showcase
27:12
OnlineCombatBN
Рет қаралды 3,1 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.