Tand3rsson
-
Content Count
64 -
Joined
-
Last visited
-
Medals
Posts posted by Tand3rsson
-
-
Interesting you would say that, but it is not working for me :S
-
Hi!
Quick (I hope) question: How do I use knowsAbout for a unit spotting a member of a certain group?
like:
_unitOne knowsAbout _x > 2 forEach units _opforgroup
Ofcourse that one dosent work, but I was hoping it would help someone understand my question.
I am trying to use it as a if-statement, like:
{ if (_unitOne knowsAbout _x > 2) then { something happens }; } forEach units _opforgroup;Thanks! :)
-
Here mate.... Demo Mission here.Put all of this into the init of the object..... or look at the demo and see a different more manageable way.
nul = this addEventHandler ["HandleDamage",{nul = [_this select 0, _this select 4] spawn {private ["_obj","_ammo"];_obj = _this select 0;_ammo = _this select 1;hint "hit";if (_ammo == "B_127x99_Ball_noTracer" or _ammo == "PipeBomb") then {hint "fired";_boom = createVehicle ["Sh_85_HE",position _obj, [], 0, "CAN_COLLIDE"];_obj removeAllEventHandlers "HandleDamage";deleteVehicle _obj;};};}];So everything about the IED is done, accept adding both the 12.7 and the Pipebomb to that eventhandler :)
I think you are jumping in at the deep end though. There's a lot to understand before you start using Eventhandlers!
EDIT: Here's a link to a good thread... http://forums.bistudio.com/showthread.php?113418
Thank you for your time!
However, I might have been just a bit off with my description of what I wanted to do:P
The object shot or blown isn't the real "IED". However, when it is damaged a IED man, who previously planted a BAF IED, gets a touchoff action.
So, as in my exampel above, all I wanted to do was to add both pipebomb and the 12,7 round to that kind of eventhandler, not spawn any munitions to fake the IED going off.
However, you are right about me in the deep end :) But, thats what I got you guys here for ;)
Anywho, thanks alot for your response!
---------- Post added at 07:57 PM ---------- Previous post was at 07:16 PM ----------
OK!
I solved it myself! :) :)
this addEventHandler ["HandleDamage",{if (_this select 4 in ["B_127x99_Ball_noTracer","PipeBomb"])}];Was the thing I was looking for :)
THANKS for your time guys! Virtual beers to you all!
---------- Post added at 08:11 PM ---------- Previous post was at 07:57 PM ----------
If anyone wants to know:
I placed one man, namned IEDman1 on the map. I gave him a BAF_IED and told him to plant it right away in his init.
this addMagazine "BAF_ied_v2"; this Fire ["BAF_ied_v2_muzzle"];
Next I grouped him to a couple of markers (makes him spawn at one of them, randomly)
A trigger for the detonation (IED1T) is teleported to his posistion, also some garbage (which will be the "detonator")
IED1T setPos (getPos IEDman1); GARB1 setPos (getPos IEDman1);;
then I made his IED activation trigger (NAMNED IED1T):
Anybody present (8x8m)
Condition:
this && {_x iskindof "Landvehicle"} count thisList > 0Act:
IEDman1 setPos (getPos IED1T); IEDman1 action ["TOUCHOFF", IEDman1]; deleteVehicle garb1; deleteVehicle IEDman1;
As anyone will notice: What I wanted to achive was an IED with a preasure pad (the condition makes it activate on ANY vehicle)
The reason I teleport the IEDman1 to the bomb is because the range of the TOUCHOFF is 300m, which dosent work for me.
GARB1, is the whole remote detonation thing, if BLUFOR detects the charge, they will be able to shoot or blow it getting the postistion of the IEDman1, just like the trigger.
Havent found that many good garbage iteams (garbage is good though),
I have yet another trigger for this BLUFOR detonation, which basically says:
con:
damage garb1 > 0;
and then the same detonation procedure :P
This is problem solving for those who suck at scripting ;)
---------- Post added at 08:14 PM ---------- Previous post was at 08:11 PM ----------
Alot of editing, I know.
Just wanted to clarify that I did this for 30 different IEDmen, which all has a random chance of spawning. So this way, I got random IEDs (about 10 per play at a 33% chance) and each has like.. 6 different locations :P The result is epic, although the way might be hard. And some guy will probably be able to do this all from a script, at much less effort :D
-
Hi!
I have searched the forum some, but haven't found the answer for my question.
I want to be able to clear an IED I made with either a 50 cal sniper rifle or a satchel charge.
So I got this, added to the init of the object which needs to be damaged.
this addEventHandler ["HandleDamage",{(_this select 4) == "B_127x99_Ball_noTracer"}];This makes it so that only the 50 cal triggers damage for the object. If I add:
this addEventHandler ["HandleDamage",{(_this select 4) == "PipeBomb"}];Then only the pipebomb (satchel) damage the objective.
Question is: How do I add a eventHandler which works for both at the same time? I tried just adding the names like:
this addEventHandler ["HandleDamage",{(_this select 4) == "B_127x99_Ball_noTracer", "Pipebomb"}];But that is obviously not working XD
Help please?
-
Yepp :) Works lika a charm for me to! Thanks alot for taking time to help me!:) i appreciate it!
Do you have any tips for script learning:P? Obiously I have some knowledge of sqs. but nowadays its sqfs right, and most of it is greek to me :)
Once again, thanks!
-
Hi again!
For some reason, now it isn't working at all. Tried changing your
_caller doMove getmarkerpos _movetomarker; to many different variants:
_caller move getmarkerpos _movetomarker;
_caller doMove (getMarkerPos _movetomarker);
But nothing, now he is not moving at all :S
-
Tested now, no sucess. And also, if that would work, I would have to have a script for every unit that i want to do the patrol?
Well, ok, it sort of worked. He did select one destination, and moved there. However, after that he isnt chosing a new one :P And I do not wanna have to press radio alfa over and over again to make him move. I was thinking of putting the code in his init. Sorry if i was unclear, but the radio trigger was only for testing purpose
Still, thank you so much for taking time to answer!
-
Hi!
For some reason, my script isn't working (due to my limited skill). What I want it to do it: A vehicle moves to one of 7 random markers, when the vehicle is within say 50 m of this marker, it once again gets a random destination from these 7 random markers. And so on. For all eternity.
I have placed a vehicle in ediot, named it patrol1, and then 7 markers (mark1, mark2, mark3 and so on).
In a radio trigger (alpha) i have put: [mark1, mark2, mark3, mark4, mark5, mark6, mark7, patrol] exec "move.sqf" (and move.sqf is in my mission folder)
Move.sqf:
_markOne = _this select 0; _markTwo = _this select 1; _markThree = _this select 2; _markFour = _this select 3; _markFive = _this select 4; _markSix = _this select 5; _markSeven = _this select 6; _patrol = _this select 8; goto "Posis" #Posis _sel = floor random 7; _pos = switch (_sel) do { case 0: {_markOne}; case 1: {_markTwo}; case 2: {_markThree}; case 3: {_markFour}; case 4: {_markFive}; case 5: {_markSix}; case 6: {_markSeven}; }; _patrol doMove (getMarkerPos "_pos"); #Update ?(_patrol distance _pos < 50):goto "Posis" ~2 goto "Update"Anyone able to point out what I have done wrong, and how to correct this?
Thanks in advance!
-
I think this has been discussed already, if not on this topic, then on another one about armour. The problem is, Dragon skin isn't reliable. In high temperatures (think Iraq high), the adhesive between the individual armour plates started to let loose and the armour basically fell apart
F*ck! That would suck, if your body armor fell apart :-P
-
A bullet hitting you in the chest, must have a effect even if it dosent penetrated. Saw a video of a US soldier who got shot in the chest by an
Insurgent sniper. He fell to the ground, but then got up and ran to cover. The bullet was stoped by his armor, but still knocked him to the ground.
By the way, anyone seen that "dragon skin" they are making? Saw a video were it stopped a 7.62 AP round:-O. What kind of armor will the future hold?
-
Well, I agree.
It's kind of weird seeing a african rebel (Duala), moving around in exactly the same manor as a US SF. Also keeping in mind that aiming down the sights, or having the weapon set to anything else than full auto isn't the highest priority for an untrained rebel soldier... who is not only just a civilian with a gun, but most likely high...
-
Hi!
I have made a very simple script, for a body guard mission I am makeing. When a man1 fires a FN_FAL, body1 gets an addaction "Annie, Follow!", (which causes the VIP, Annie Baker to join his squad) and ability to call in a chopper and some other stuff.
1. However, how do I go about makeing the script fire only once? :-S Now, everytime man1 fires his weapon, body1 gets a new action.
Here is my script (dont laugh):
[["Transport"], body1] call BIS_SOM_addSupportRequestFunc; som1 setVariable ["TSS_vehicle_custom", heli1]; dig = body1 addAction ["Annie, Follow!","join.sqf"]; body1 groupChat "SHOTS FIRED! SHOTS FIRED!";
2. Also, the last part, where the bodyguard1, yells the text dosent work either... :S
My script knowledge is very limited, and most is some type of copy/paste solution...
---------- Post added at 02:06 PM ---------- Previous post was at 02:01 PM ----------
OK, I kind of got smart a minute after the last post, and did this
[["Transport"], body1] call BIS_SOM_addSupportRequestFunc; som1 setVariable ["TSS_vehicle_custom", heli1]; body1 removeAction dig; sleep 0.1; dig = body1 addAction ["Annie, Follow!","join.sqf"]; body1 groupChat "SHOTS FIRED! SHOTS FIRED!";
That works, almost as I want it to. However, the second problem, with groupChat remains :S
-
Wow! Thanks alot for all the answers! First of, not having them in groups would work, however, this will not work for my mission. I will try mr Gustavs idea when I get home! I will report back
-
Playing around with the undead mod, I decided to quarantine a city. Placed soldiers around the city in strategic pos, inorder to contain the infection. However... as soon as they see an enemy, they leave their posistion and run into the city to hunt them down. Can I stop this behaivor?
I tried using doStop this and force speed...
Also disable Ai "move", which however disable them from turning...
Is there a guard script out there which works? Any commands? Any help is useful!
-
Thank you! I am not home atm, but when I get there I'll try it out and then let you know how it went
-
_invisibleH = "HeliHEmpty" createVehicle (getPos heliname);
That would just give me a invis h at the helis pos, it wont follow it right?
-
Thanks, how would I go about if i want it to create a new invisible H, mid game, inorder to play a new music strip?
-
Okey, I have (honestly) searched around for this.
Basically, I have a chopper in the unsung mod. Whenever the player calls the chopper for transport, it will "say" a random music file when it's more than 400 meters from its home helipad, namned "base".
This gives me 2 problems:
1. IF the chopper is called on, gets a distance of 400 m from "base", then returns within 400m, and exits this circle again before the first music file is done, I suddenly have two files playing from the chopper at the same time. So the question is basically, how do I stop a sound, initiated with the say command?`
heli1 say "sound1".
2. When using: heli1 say "sound1", if I am inside the chopper, looking in a first person view the sound is extremly low. However, if I am looking in a 3d person view, or is outside the chopper, the music is much louder.
When using "playMusic", this problem does not happen, however, then the music is not coming from the chopper, which kills the whole idea. Any ideas as how to solve this?
-
Hi!
Can u define a place wich playmusic comes from? So that music is played from lets say a chopper and not just out in your "head"? Normally I use the "say" command, but then I get the problem that it is low inside, loud outside
-
Again, thanks for your help. Im going to play around with your script a bit, and hopefully learn something that way:-) and also ofc, read up on some turtorials.
Thank you so much for your patience! If I pull this campaign off, you are so getting an end credit;-)
Asfor the sounds I mentioned, I'll keep it down a bit, adding at most 5, same voice, no names,
-
Okey! Tested now:
This one works like a charm:
_killed = _this select 0; _name = name _killed; _peeps = []; {if (alive _x) then {_peeps = _peeps + [_x]}} forEach units _killed; _person = _peeps select (floor random (count _peeps)); _person groupChat format ["Oh no! %1 is down! MEDIC!",_name];however, the more advanced one I tried to pull of, I cant seem to get to work (so obiously I'm doing something wrong):
_killed = _this select 0; _name = name _killed; _peeps = []; {if (alive _x) then {_peeps = _peeps + [_x]}} forEach units _killed; _person = _peeps select (floor random (count _peeps)); _sel = floor random 4; _saythis = switch (_sel) do { case 0: {"(%1) Oh no! %2 is down! MEDIC!"}; case 1: {"(%1) SHIT! %2 is dead!"}; case 2: {"(%1) FUCK! %2 is hit!! He's fucked up!"}; case 3: {"(%1) FUCK! %2!! MEDIC!!"}; }; _talker sideChat format [_saythis,name _talker, name _killed];And, just to try and steal more of your time;):
1. Would it be possible to only get the unit to say first or lastname of the killed unit (while keeping full name of talker)
2. How would I go about adding sound to the second script? Ofcourse, in the best of worlds, the predecided voice of the talker says the name of the one killed in one soundclip, and then the phrase "is hit" or one of the others in a second soundclip. If this would be impossible (or very complicated), would you be able to set a playSound command only for the rest of the text (not the name of the one killed, only a "FUCK! HE IS DOWN" as a sound (or one of the 3 other possible) and the names will only be in the groupChat). like:
_talker sideChat format [_saythis,name _talker, name _killed];
_talker saySound "sound1"
am I way off wanting to add 4 or 5 different "is hit" sounds, and all possible name _killed said in the voice of the man calling it?
This would ofcourse mean 8 different sounds for each man, and then a additional 4 to 5 phrases for each man. I dont know, am I beeing inpractical?
-
Thank you! Im at work atm, but will try this out as soon as I can, and then I'll report back:-)
And, are there any scripting guides out there that you would recommend?
And finally, must say I am really impressed with the arma community, where so many people spends time helping others! Keep up the good work!
-
Thanks alot for the answer!
A couple of questions though;
The "_name" refers to the dead mans identity, the one defined by setIdentity?
Would it be possible to also add the name of the man going out on the groupchat?
Like: "(name_caller) Oh no! name_killed is down! MEDIC!"
I see the name variable after medic, does that one refer to %1?
And finally, since you use a random caller, would it be possible to add a random line of text? Maybe like 5 different possible variants?
Like:
Oh no %1 is down!
FUCK! %1 is hit!!
Thanks alot for the reply!
-
Okay, once again out of options, looking for help.
Have two major problems that I was hoping someone would be able to help me with:
1. ZERO campaign creating knowledge (yes, have looked around the forums, but just can't understand any of it).
I have an eight man squad that I want to use for my campaign. If say, sold1 dies in mission1 he cant really be alive in mission 2...
(I dont even know how to string missions together to a campaign, so maybe I'm in deep water now)
2. If a soldier in the squad gets killed, I want another one in the squad to yell (for example) "Fuck! John Doe is down! Medic!". Obiously the man saying this needs to be alive.
I have tried:
condition:
not alive sold1;
on act:
sold8 groupChat "Oh no! John Doe is down! MEDIC!";
But then sold8 might be dead aswell.
So, then tried :
condition:
not alive sold1 and alive sold8;
this would work, but then again, if sold8 has been blown to bits, noone will proclaim sold1's passing to the afterlife. And inorder to cover all possible combos of alive/dead I would have to make sooo many triggers. And it still wouldn't work since:
trigger1:
condition:
not alive sold1 and alive sold8;
trigger2:
condition:
not alive sold1 and not alive sold8;
on act:
sold2 groupChat "Oh no! John Doe is down! MEDIC!";
this would give me first sold8 proclaiming sold1 is down, and then again sold2 saying that sold1 is dead if sold8 would die.
So I'm thinking you would have to script this somehow, but my skills are way too limited.
Anyone got a clue? Cause I dont
How to use knowsabout for a group?
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
I am trying to get the code to execute from a script like this:
init:
Iseeu.sqf
_guard = _this select 0; _opforman = _this select 1; _opforgrp = group _opforman; { if (_guard knowsAbout _x > 2) then { hint "KNOWSABOUT"; _guard addMagazine "15Rnd_9x19_M9"; _guard addWeapon "M9"; _guard addMagazine "15Rnd_9x19_M9"; }; } forEach units _opforgroup;And I am getting zero response from unit1 :S