ayser
Member-
Content Count
56 -
Joined
-
Last visited
-
Medals
Everything posted by ayser
-
Locked vehicle, AI still gets out and in
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ahh, thought it got the name automatically from "veh". Changed it to "{_x in Bird1} count units Drop1 == count units Drop1". Now, it goes to the waypoint, lands, and then takes off a second later even if the group is still in it. Do I have to mess with the second waypoint, making it say "If drop1 in bird1, wait" or something along the lines? -
Locked vehicle, AI still gets out and in
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
That fixed some of my problems :P But I am switching it to 3 Birds landing, then taking off when no groups are in it since it suits what I need to do more. I'm having trouble though... I've made the waypoints, and i've got this Doesn't that mean: If there is 0 units from group "Drop1" then do Act? That's what I think atleast... If I have that to != instead of ==, it will not land, but instead hover over the waypoint. Is there a problem i'm doing here? Edit - Ignore the "ParaDrop.sqf", I deleted it later and made no difference" -
Locked vehicle, AI still gets out and in
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Fixed it, not even sure how, was just messing with settings... I've set it so 3 squads spawn into the C-130, and when they get over the marker, they para out. Only 1 squad Ejects, while the other 2 sit in there. They're all in the same group, so i'm not sure what's wrong.. My waypoint on Act is: {_x action ["EJECT", Chinook]} foreach units Drop2 And for each and every unit on the side that goes into the C-130, they've got: this moveInCargo C130; Drop2 = group this; Is this normal, or should I just use 3 blackhawks? -
Choose random anim from list not working
ayser posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So basically I want this script to choose an animation from a list at random, then play it on _man (this). I'm getting errors on line 7 "Switch ( _Anim ) do {". I'm still fairly new to this type of scripting. Can anyone lead me in the right direction? _man = _this select 0; _Anim = _this select 1; _RandomAnim = (random 4); _PlayingAnim == 0 Switch ( _Anim ) do { Case "Random": { If ( _RandomAnim == 0) then { _Anim = "AidlPercMstpSlowWrflDnon_i02"; }; If ( _RandomAnim == 1) then { _Anim = "AidlPercMstpSlowWrflDnon_i04"; }; If ( _RandomAnim == 2) then { _Anim = "AidlPercMstpSlowWrflDnon_i05"; }; If ( _RandomAnim == 3) then { _Anim = "AidlPercMstpSlowWrflDnon_i06"; }; }; }; While { _PlayingAnim == 0 } do { _PlayingAnim = 1; _man playMove _Anim hint "PLAYING MOVE"; sleep 3; _PlayingAnim = 0; }; -
Choose random anim from list not working
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Just looked at this thread and saw a animation loop method. Tried the waitUntil that was there, and it works pretty well! private["_man"]; _man = _this select 0; While { alive _man } do {// && !(animationState _man == _Anim) _Anim = [ "AidlPercMstpSlowWrflDnon_i02", "AidlPercMstpSlowWrflDnon_i04", "AidlPercMstpSlowWrflDnon_i05", "AidlPercMstpSlowWrflDnon_i06", "AidlPercMstpSlowWrflDnon_i07", "AidlPercMstpSlowWrflDnon_i08", "AidlPercMstpSlowWrflDnon_i09", "AidlPercMstpSlowWrflDnon_i10", "AidlPercMstpSlowWrflDnon_i11", "AidlPercMstpSlowWrflDnon_i12", "AidlPercMstpSlowWrflDnon_i13", "AidlPercMstpSrasWrflDnon01", "AidlPercMstpSrasWrflDnon02", "AidlPercMstpSrasWrflDnon03", "AidlPercMstpSrasWrflDnon04", "AidlPercMstpSrasWrflDnon05", "AidlPercMstpSrasWrflDnon06", "AidlPercMstpSrasWrflDnon_i01", "AidlPercMstpSrasWrflDnon_i02", "AidlPercMstpSrasWrflDnon_i03", "AidlPercMstpSrasWrflDnon_i04", "AidlPercMstpSrasWrflDnon_i05", "AidlPercMstpSrasWrflDnon_i06", "AidlPercMstpSrasWrflDnon_i07", "AidlPercMstpSrasWrflDnon_i08", "AidlPercMstpSrasWrflDnon_i09", "AidlPercMstpSrasWrflDnon_i10", "AidlPercMstpSrasWrflDnon_i11", "AidlPercMstpSrasWrflDnon_i12", "AidlPercMstpSrasWrflDnon_i13" ] call BIS_fnc_selectRandom; if !(animationState _man == _Anim) then { hint "!= _Anim"; _man switchMove _Anim /**_man switchMove "AidlPercMstpSrasWrflDnon_i13"*/}; if (animationState _man == _Anim) then { hint format["Playing animation %1", _Anim]; waitUntil {!(animationState _man == _Anim)}; }; //hint format["Playing animation %1", _Anim]; sleep 0.2; }; I'm almost done.. Is there a way to find the behavior of a unit? I tried using " "CARELESS" = Behaviour _man ", but it wasn't working. Sorry for all the questions, still trying to grip on this Edit: Just saw your post muzzle, gonna try it now! -
Choose random anim from list not working
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I know that now :P I'm a messy scripter and usually do without thinking. I've got the following so far, since I deleted my bit of code yesterday and started using kylanias. Still getting the animation repeat. Is there a way to grab a animation from the animation list instead of using "call BIS_fnc_selectRandom;"? I think that's whats causing the problem for looping.. private["_man"]; _man = _this select 0; While { alive _man } do {// && !(animationState _man == _Anim) _Anim = [ "AidlPercMstpSlowWrflDnon_i02", "AidlPercMstpSlowWrflDnon_i04", "AidlPercMstpSlowWrflDnon_i05", "AidlPercMstpSlowWrflDnon_i06", "AidlPercMstpSlowWrflDnon_i07", "AidlPercMstpSlowWrflDnon_i08", "AidlPercMstpSlowWrflDnon_i09", "AidlPercMstpSlowWrflDnon_i10", "AidlPercMstpSlowWrflDnon_i11", "AidlPercMstpSlowWrflDnon_i12", "AidlPercMstpSlowWrflDnon_i13", "AidlPercMstpSrasWrflDnon01", "AidlPercMstpSrasWrflDnon02", "AidlPercMstpSrasWrflDnon03", "AidlPercMstpSrasWrflDnon04", "AidlPercMstpSrasWrflDnon05", "AidlPercMstpSrasWrflDnon06", "AidlPercMstpSrasWrflDnon_i01", "AidlPercMstpSrasWrflDnon_i02", "AidlPercMstpSrasWrflDnon_i03", "AidlPercMstpSrasWrflDnon_i04", "AidlPercMstpSrasWrflDnon_i05", "AidlPercMstpSrasWrflDnon_i06", "AidlPercMstpSrasWrflDnon_i07", "AidlPercMstpSrasWrflDnon_i08", "AidlPercMstpSrasWrflDnon_i09", "AidlPercMstpSrasWrflDnon_i10", "AidlPercMstpSrasWrflDnon_i11", "AidlPercMstpSrasWrflDnon_i12", "AidlPercMstpSrasWrflDnon_i13" ] call BIS_fnc_selectRandom; if (animationState _man != _Anim) then { hint "!= _Anim"; Sleep 2; _man switchMove _Anim }; if (animationState _man == _Anim) then { hint "== _Anim"; sleep 1; }; hint format["Playing animation %1", _Anim]; sleep 1; }; -
Choose random anim from list not working
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Still need a method for the above :( -
Choose random anim from list not working
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Works as intended, nice one :) Now adding a little thing. I want the animation to play only when _man's behavior is CARELESS/SAFE, and when he's not already doing an animation that's in the list... I've tried Behavior, but I think that's not what i'm supposed to use.. Basically - If Safe/careless/no animation being done, do an animation. This is what i've tried, with no success: while {(animationState _man == _Anim)} do { sleep 1; }; if (animationState _man != _Anim) then { _man switchMove _Anim }; Sleep 1; if (animationState _man != _Anim) then { _man switchMove "AidlPercMstpSrasWrflDnon_i13"}; Sleep 1; Instead, it does an animation every second. I think it's because since the "call BIS_fnc_selectRandom;", the _Anim and the animationState pull 2 random animations, and until they find the same one, it'll keep spamming. To try to remedy this, I tried making another list "_Animm" with the same animations as "_Anim", and did if (animationState _man != _Animm) then { _man switchMove _Anim }; Got a long error, and just undid the _Animm changes. How can I get the behavior trick to work? I took a look at ArmA 2 Scripting Commands, but can't seem to find anything close to isAnimation/isBehavior, or related. -
Choose random anim from list not working
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ohhhh, nice find, my eyes, blah :P I see that the character wont switch/play the animation when I have: _man playMove _Anim; but if I have: _man playMove "AidlPercMstpSlowWrflDnon_i06"; it'll play the animation. Am I doing something wrong? Tried it with switchMove too. -
Got rid of their main weapons, and added only an RPG and 2 rockets to them. They never seem to take out the RPG, but they do have the "Main weapon" animation on them, like so http://gyazo.com/ffaf50a62c6eba04fa3568bd119a769d.png?1344453890 (1075 kB) Heres my code: _man = _this select 0; _man setCaptive true; removeallweapons _man; //_moveno = 1; _man addweapon "RPG7V"; _man addmagazine "PG7V"; _man addmagazine "PG7V"; //_man addmagazine "ACE_30Rnd_545x39_T_AK"; //_man addmagazine "ACE_30Rnd_545x39_T_AK"; //_man addmagazine "ACE_30Rnd_545x39_T_AK"; //_man addweapon "AK_74"; //_man setCombatMode "RED"; //_man setBehaviour "COMBAT"; //_man setunitpos "middle"; _man selectweapon "RPG7V"; //_man setCaptive false; Is there anything missing?
-
AI won't take out RPG
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Does the same as my script. -
If song is already playing, don't play.
ayser posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
So, I have a car, and I want it to play a sound. I got that part down, it plays the music it's supposed too, but I want to do it when the player chooses to play the music. When The player does "Toggle" (From the added action to the car), it will start the music. If the music is already playing, it'll hint "A song is already playing". This bit of code isn't working for me, and i'm not sure why. Any idea? Did I do something wrong? _object = _this select 0; _toggle = 0; while { alive _object } do { if ( _toggle == 1) then { hint "A song is already playing"; }; if ( _toggle == 0 && _toggle != 1) then { _object say3D "Qom_Nasheed"; _toggle = 1; //sleep 90; //_toggle = 0; }; }; -
If song is already playing, don't play.
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Doh! Shoulda tried that. It shows up and disappears now when I select it, but 5 seconds after it doesn't pop back up, just re-plays the song. Not sure what i'm doing wrong... So used to java scripting, and this is like a smack in the face _object = _this select 0; _toggle = 0; while { alive _object} do { _object say3D "Qom_Nasheed"; songPlaying = true; Sleep 5; songPlaying = false; hint "1"; }; Shouldn't it do the following: Song starts playing Sets songPlaying to true Waits 5 seconds Sets songPlaying to false (Making the "Play Song" option re-appear) What it does: Song starts playing Sets songPlaying to true Waits 5 seconds Song starts playing ----------------------------------------------------------- Edit: Got it working now :) _object = _this select 0; _toggle = 0; while { alive _object && _toggle == 0} do { _object say3D "Qom_Nasheed"; _toggle = 1; hint "Now playing Qom Nasheed"; songPlaying = true; Sleep 90; songPlaying = false; }; _toggle = 0; -
If song is already playing, don't play.
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Bump, still need help :( -
If song is already playing, don't play.
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://gyazo.com/3286cdb24a0f09eb050fea1e98dddcca.png?1344402599 (229 kB) _object = _this select 0; _toggle = 0; while { alive _object} do { _object say3D "Qom_Nasheed"; songPlaying = True; //_toggle = 1; //_object removeAction 0; Sleep 5; //_object addaction ["Song", "Scripts\Qom_Nasheed.sqf"]; hint "1"; }; The "Play Song" option doesn't appear at all, probably since I didn't do the "set songPlaying to true" correctly. Is it set songPlaying = true;, or what? Sorry, i'm still fairly noobie to scripting :P Edit: Tried these too, didn't work _object setVariable ["songPlaying", true]; _object setsongPlaying True; _object songPlaying True; Also tried putting this in my init, didn't work songPlaying = true; publicVariable "songPlaying"; -
If song is already playing, don't play.
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I tried this this addaction ["Song", "Scripts\Qom_Nasheed.sqf", (hideOnUse)]; Didn't work, even tried without ()'s. I've edited the .sqf and changed it to this _object = _this select 0; _toggle = 0; while { alive _object} do { _object say3D "Qom_Nasheed"; //_toggle = 1; _object removeAction 0; Sleep 5; _object addaction ["Song", "Scripts\Qom_Nasheed.sqf"]; hint "1"; }; Does the job fine, and removes the action, but i'm kinda stumped. I click song, it disappears for 5 seconds like I want it to, and comes back in 5 seconds. But when I click Song again, it wont dissapear and can be selected infinite times. -
Getting out of the Area of Operation = Kill / Other?
ayser posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I know this is possible, but I have no clue how they work, do they make a bunch of triggers around an area of operation and put in to repeat? Can someone guide me through this? Bare with me i'm still pretty new to Arma 2 scripting, thanks! -
Getting out of the Area of Operation = Kill / Other?
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Someone walks into the area, and it says a hint to everyone saying "Please move back into the area of operation PLAYER". So not a group, but the whole team (Or server, whichever is easier) -
Getting out of the Area of Operation = Kill / Other?
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Alright, on the kill trigger I changed list this to thisList, and it works now, but the hint still doesn't work, is there something wrong with the code? -
Getting out of the Area of Operation = Kill / Other?
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Tried it, it doesnt do anything, I get no scripting errors, but it just wont show the hint. Do I make a script and put that code in it, or just put it in a trigger? -
Getting out of the Area of Operation = Kill / Other?
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm going to use that, but I want to say "Move back in the area of operation" first, then if they go further i'll m ake another trigger with your script. I'm trying to make it say the players name, this is what I have, but it doesn't work. Any help? {hint format["Move back in the area of operation %1 !", name _x]} forEach list this -
Scripting Questions
ayser replied to Deuce82's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm 100% sure there is a way to get civilians to be hostile toward OpFor, I do believe it is the "rate" command, but i'm not sure how to do it, I completely forgot :( As for the stamina, I highly doubt it, but if there is, i'd really like to use the script :) Sorry for not being productive, just wanted to tell you there is a way to make civis go hostile! (Free bump!) -
Removing weapons, Adding another, And equipping.
ayser posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I know this is possible, I know this is easy, but I can't figure out what I have to add! This is what I have so far RPG_Only.sqf _man = _this select 0; while {alive _man} do { Removeallweapons _man; _man addmagazine "PG7V"; _man addweapon "RPG7V"; _man addmagazine "PG7V"; _man selectweapon "RPG7V"; }; It does what it says, adds mags, adds weapons, but it REPEATS it. I don't know what I should add to completely kill the script once it's done. I don't want to "Sleep 10000000;" it, I just want to completely kill it once its done. Any hints? :P -
Removing weapons, Adding another, And equipping.
ayser replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hmm... This works fine, but when I walk up to the person, He doesn't have the RPG out, once he see's an enemy, he then pulls it from his back. Any way to just have it equipped automatically? I thought the "SelectWeapon" command did it, but I guess not.