Jump to content

ConanOfOz

Member
  • Content Count

    57
  • Joined

  • Last visited

    Never
  • Medals

Everything posted by ConanOfOz

  1. Here's the scenario. From within the Initialization of one member of a group (usually the leader) I have... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">units group this exec "AddMeAndMine.sqs" <span id='postcolor'> The AddMeAndMine script is expecting a parameter of type Group (I hope!), and has (so far) only only line... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">"?!(_x in AllUnits): AllUnits = AllUnits + [_x]" ForEach (_this) <span id='postcolor'> When I Preview this mission, I get the error... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">'|#|?!(_x in AllUnits): AllUnits = AllUnits + [_x]':Error Invalid number in expression <span id='postcolor'> I don't understand what I've done wrong. BTW, is there a way to get the error message to persist on screen, or is there an error log written somewhere? It's a real pain in the arse to get a long-ish error message like this one recorded...
  2. ConanOfOz

    Law ammo problems

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (BiG_D @ Feb. 25 2002,18:36)</td></tr><tr><td id="QUOTE">In my soldiers init field I use the removemagazine command to get rid of all handgrenades and clips he has, add the LAW and ammo with addweapon and addmagazine, but it refuses to give me ammo. I have a LAW launcher with no ammo and cannot fix it. Am I stupid? Is the answer obvious?<span id='postcolor'> A small possibility...AddMagazine BEFORE you AddWeapon. That's all I can think of.
  3. I'll apologise in advance to my esteemed colleagues, but I think they are WAY over complicating what you have too do here. I am certain you can do this with one trigger and one simple script. I have just moved from Australia to the USA, and I've only today gotten back online. Within about 24 hours I will get back to you with a Trigger description and script. I'm really sure about this, so be patient with me...
  4. ConanOfOz

    Lights off

    I've had this problem also, and the only mehtod I found that worked was to set the driver's mode to "Safe". Furthermore, you cannot seem to do this from his initialisation field. I had to put the command in my init.sqs file AND add a delay of about 2 seconds. This last I run into all the time...If the init.sqs fires off too quickly it often fails to do what it's supposed to do. Hope this helps.
  5. ConanOfOz

    SimpleScan

    An example has arisen that illustrates what (I believe) is an error in the logic of the Detection criteria of Triggers. Â Essentially, a soldier who has just been shot in the head is capable of Activating a Detection condition. If you think some other soldier is tripping the alarm, create a mission, you West as Sniper, 1 East soldier, 1 Trigger West Detected by East. Â Set the East Soldier looking away from you. Â Start the mission, and he doesn't know about you. Â Shoot him in the head (instant death) and the Trigger still activates. For those who agree that this is wrong, try my script. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;SimpleScan.sqs ;This script makes up for the fact that the OFP Mission Trigger will return a TRUE ;condition for detection even though the 'detecting' unit has just died. ;Requirements... ;init.sqs must set - ; Â NeedToScan = False ; Â ICU = False ; Â KAThreshold = a number between 0 and 4 (recommend 1.0) ; ;Trigger ; Â Name - EastPresent ; Â Activation - East Present, Repeatedly ; Â Condition - This ; ;Trigger ; Â Name - Busted ; Â Activation - None ; Â Condition - ICU (Boolean set by this script) ; Â Note - This is the actual 'alarm' per se. Â Set your Effect (e.g. sound alarm) ; Â Â Â Â Â or whatever action you wish to take here, or as On Activation, or both ; ;Trigger ; Â Name - Detected ; Â Activation - West Detected by East, Repeatedly ; Â Condition - This ; Â On Activation - NeedToScan = True; [] Exec "SimpleScan.sqs" ; Â On Deactivation - NeedToScan = False ; Â Note - We are using this mainly because we can avoid running our SimpleScan script ; Â Â Â Â Â all the time. Â NeedToScan = False will tell this script to exit. Â ICU = False ; Â Â Â Â Â will deactivate Trigger "Busted", our true 'alarm' Trigger. #StartHere ;Get list of potential enemy 'detectors' ;'EastPresent' is a trigger activated by 'East - Present'. _Enemies = List EastPresent ;Initialise our index pointer _Index = 0 ;Discover size of _Enemies array _MaxEnemies = Count _Enemies ?_MaxEnemies == 0 :Exit ;Start by assuming there is no true detection _ThisICU = False #LivingDetect ;Enemy must have a KnowsAbout (KA) value greater than KAThreshold ;KAThreshold is defined in init.sqs. Â Values are 0 - 4 (decimals permitted) ;This enemy must be alive! ;If in ANY case an Enemy has KA > KAThreshold AND is alive, trigger the Busted _ThisGuy = _Enemies Select _Index _ThisICU = _ThisICU or (((_ThisGuy KnowsAbout Player) >= KAThreshold) and (Alive _ThisGuy)) ;Move to next unit. _Index = _Index + 1 ;If there is a 'next unit', go get him. ?(_Index < _MaxEnemies): Goto "LivingDetect" ;_ThisICU will now be true if ANY of the above iterations was true ICU = _ThisICU ;If ICU is true, we can wait a few seconds before repeating this script ?!ICU: Goto "DontWait" ~2 #DontWait ;Whether ICU is true or not, we don't need to scan every microsecond. ;4 times per second is ample, so... ~0.25 ?NeedToScan : Goto "StartHere" ;If Trigger "Detect" has deactivated and set NeedToScan to false, then we can assume ;that ICU can also be false, and thereby deactivate Trigger "Busted" ICU = False <span id='postcolor'> Important Notes about Trigger Placement Trigger EastPresent For an enemy to qualify as a potential "detector", he must be within the area covered by this trigger. Â If you don't care where the enemy is, then ensure this trigger encompasses the entire map. Trigger Detected For Player to be "detected", Player must be within the area covered by trigger. Â If you don't care where the player is, then ensure this trigger encompasses the entire map. Trigger Busted The only significance about where you place this trigger is where you want the "source" of the alarm to appear to be. Â Therefore, you will probably place this trigger in the middle of an enemy objective/camp/base. This trigger need not be unique either. Â You can have several triggers whose condition is ICU that can all be set off by the Player getting busted. Â It's up to you. Assumptions Made by this Script It will be obvious to most that this script is designed for a Player on the West side, on his own, who must not be detected by the East. Â The result of Trigger Busted activating is entirely up to you and your imagination. Deactivation ICU will be set false, and thereby deactivating Trigger Busted, immediately there is no living enemy who is able to detect you. Â If you would prefer the "Busted" status to persist for a while, even if the detecting soldier has since died, then change the following two lines... Find:- </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_ThisICU = _ThisICU or (((_ThisGuy KnowsAbout Player) > KAThreshold) and (Alive _ThisGuy)) <span id='postcolor'> and change it to... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">ICU = ICU or (((_ThisGuy KnowsAbout Player) > KAThreshold) and (Alive _ThisGuy)) <span id='postcolor'> Now find the line... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">ICU = _ThisICU <span id='postcolor'> ...and remove it. Â You can also remove the preceding comment, and also the line which sets "_ThisICU = False" since both have become redundant. The code as is will deactivate the Trigger Busted immediately that there is no living soldier detecting you. Â With these modifications, once ICU has been set true, it will remain true until the Trigger detected deactivates, which can take quite some time even after no one is around to "detect" you. Â I think what actually happens is the trigger retains the highest KA (KnowsAbout) value of all the "detecting" soldiers, and a dead soldier does not remove his effect on this situation. Â KA drops at very approximately 1 per 20 seconds. Â Further, I think a Trigger's detection threshold is a KA of 1 (or greater). Â When you shoot a guy in the head, he's gonna throw a KA of 4. Â Even though he's now dead, and no other sodlier is detecting you, it will be something like 60 seconds before the Trigger's "remembered" KA drops below threshold (1?) and deactivates. *phew* In short, making those two changes will cause a considerable delay between "No one detects you anymore" and deactivation of the alarm. Closing Comments This script was tested against v1.42, and seems to follow intended behaviour as far as I can tell. Â If you find it doesn't work, I'm happy to try to help and/or fix the problem if I can. Oh yeah, This script is provided AS IS
  6. Of course, we don't kow how easy or difficult this would be (I can also hear Suma groaning ), but it sounds like a simple exercise, and I'll add my vote for it. These suggestions would indeed open a lot of possibilities. As you'll see by my recent flurry of topics, detection has been a prime concern for me lately, and the ability to change clothes...Well, doesn't that just get the imagination running off into the night!
  7. ConanOfOz

    SimpleScan

    Ok, already I've got a change to make. Â Find the line </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?_MaxEnemies == 0: Exit <span id='postcolor'> and replace it with... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?_MaxEnemies == 0: Goto "NoEnemies" Goto "CarryOn" #NoEnemies ~1 Goto "StartHere" #CarryOn <span id='postcolor'> It occured to me that if a designer has a trigger Detected with at least part of it's area outside of the area defined by trigger EastPresent, then we might start this script with no one in the _Enemies array. Â I believe trying to Select out of an empty array will throw an error, so having _Enemies array empty would have caused an error at the line _ThisGuy = _Enemies Select _Index. However, having the script exit if _MaxEnemies -- 0 was not the correct response, because then this script would not execute again until trigger Detected deactivated, then Reactivated... and no checking would be done during this time. About Trigger Placement This issue reminded of a comment I meant to make about the relative positions of Triggers Detected and EastPresent. Â My recommendation is that they are both centred at the same location, and that the radii of EastPresent exceed those of Detected by about 500 metres.
  8. ConanOfOz

    Is there a limit to Script Size

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Suma @ Feb. 18 2002,19:57)</td></tr><tr><td id="QUOTE">Please check this topic.<span id='postcolor'> Yes, that's my problem. Relating to my question about Comments appended to a script line, I had to go through my script and move my comments. the easiest way to do this was go to the semicolon and hit <Enter>... ...and of course I got left with "#Start " Thanks for the help on this one
  9. I have a fairly large script, about 13.5Kb. Â It is mostly comments (about 75%) since I'm tackling a "new" issue, and I need to explain my logic approach as well as the functionality of the code. The script does a few simple variable intializations, then gets into the nitty gritty beginning with #Start. Â I've added debugging tags, such as Player SideChat "Now running IterateICU" so I know if the code is entering certain portions or not. At the end of the code there is a Goto "Start". Â Immediately after #Start, I have a debug telltale, and immediately before Goto "Start" I have another debug telltale. From the messages on screen, I know that the script passes #Start, and gets to the line immediately prior to Goto "Start", yet it does not then (again) print the debug telltale which follows #Start, as surely it must!? So, I'm wondering if there is a limit to the size of the script file, or does anyone have a suggestion? I'm happy to post the script, but it really is big, what with all the comments it contains.
  10. ConanOfOz

    A Trigger Question

    Alright, for the moment, the behemoth know as ScanForDetection.sqs has been adbondoned. A far simpler script has taken it's place and, blow me down, seems to work quite as well as it's big brother. I've placed it in a new topic called SimpleScan, since this is the name of the new script. BTW, it works for me...
  11. I found the following in a FAQ about arrays... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"> ... Other way to use this: remove the third element in an array: MyArray = MyArray - [MyArray select 2] ... <span id='postcolor'> 99% of the time, the intended action may in fact be what happens, but the statement is in error, and the result may not be what you expect. Â What actually occurs is this... 1. Retreve the value in ordinal position 3 (3rd value) from array MyArray. 2. Place that value within the square brackets (we must subtract a type Array from an Array, this way ensures that happens). 3. DELETE ALL OCCURENCES OF THIS VALUE FROM ARRAY MyArray. If all the contents of MyArray are unique, then you don't have a problem. Â However, if this array can contain duplicate values (there could be all sorts of cases where you want to hold values that may occur more than once in your array) then you come completely unstuck with this command. Bottom line is, the example command DOES NOT remove the 3rd element of this array. It DOES remove ALL values which are the same as the value held in the 3rd element of this array.
  12. Is the following supposed to work? <some legal script> Â Â ;A comment about this line My experience suggests you cannot add a comment to a line of code or the parser will see the comment as part of the code and, naturally, throw an error.
  13. ConanOfOz

    A Trigger Question

    *bump* "Ouch"! I just ran into something unexpected You wouldn't expect it... My script will not Loop. That's right, a simple Goto "somelabel" is not functioning. You'll see a couple of posts from me asking some questions -- these explain the problem(s) so I won't repeat it here. The good news is I beleive I have the logic of what we need correctly developed but, of course, I can't test that arrogance until I can make the script work I'll keep you posted. Once I have a functioning "ScanForDetection.sqs" I'll probably start a new topic to announce it, and invite improvements from others...
  14. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Owuor @ Feb. 17 2002,08:50)</td></tr><tr><td id="QUOTE">Awesome! Â Thanks for the code Conan. Now, if only I could put Maveriks on my Trabant...ala something from Q-Branch. Â Is this possible?<span id='postcolor'> *ROFLMAO* Hello, Mr. Bond. Well, I would think it would work, but I reckon you're going to have a problem firing them. You see, these things really need to be fired with at least some altitude. If you fire them from ground level, you are probably going to blow yourself up when the missile plows into the gound right in front of you BTW, I don't know why my code works. What I originally posted was a cut-and-paste straight from a script. I was looking at it later and realised I had one "AddMagazine" command, and the rest were all "AddWeapon" commands. I did in fact have 8 rockets to fire... Go figure?
  15. ConanOfOz

    Mission Poll

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Intruder @ Feb. 17 2002,23:01)</td></tr><tr><td id="QUOTE">I personally think that the Red Hammer missions lacked realism, but focused on gameplay (with a squad of 5, take on the entire US army )<span id='postcolor'> Yes, with "cheap" stuff like, "Here you go, you've got 5 guys, and two tanks". Gee, thanks! Give me 6, or give me 3, but if you're offering tanks, knock it off with the odd numbers.
  16. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Owuor @ Feb. 14 2002,20:34)</td></tr><tr><td id="QUOTE">... bcam camsetpos [setPos prototype] ...<span id='postcolor'> I see you have a typo here. Should this not be GetPos prototype? If you have that error in your actual script........
  17. Setup A group of East Soldiers. Â Each has... [this] join BadGuys ...in his init field. Â The leader of the group is LeaderE1 Problem If I refer to this group in a Units command like this... _ArrayUnits = Units BadGuys ...the array I get is strange, i.e. if I print the "Count" of this array... Player GlobalChat Format["%1", Count _ArrayUnits] ...it prints "Scalar". Â If I change my units command like this... _ArrayUnits = Units Group LeaderE1 ...then it works, and the above "GlobalChat" prints "9". The Manuals Both the BIS manual, and one I found on this site show the form... Units grp ...where "grp" is type "Group", but in both cases, they don't use that syntax in their examples. Â Instead, they use a form like the second version of my own "Units" command. The Issue The thing is, the following two lines, I would have thought, should be identical... NewGroup = BadGuys NewGroup = Group LeaderE1 ...where Badguys is my group as defined above, and LeaderE1 is the leader of that group. What's going on here?
  18. ConanOfOz

    When making a mission

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Warning possible stupid/newbie question Is it possble to change the loadout of Choppers/Planes in this manner? (i.e. give them the rockets from the AA launcher?)<span id='postcolor'> *LOL* Yeah, it is. In response to a related question, I wrote a script to create a cessna and add some stingers to it. Â It worked! You won't actually see any weapon pods on a cessna, all the craft will still look the same as before, but my pissy little cessna was loaded for bear and did fire the missiles.
  19. ConanOfOz

    Paradropping Infantry

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">...all im wondering is in the sqs file, on the line: _aunits = units l1 do i have the line as: _aunits = units l1; l2; l3 so that it will drop all three groups of infantry, ...<span id='postcolor'> If I have understood you correctly, L1, L2 and L3 represent the leaders of each group, not the groups themselves... If that's the case then... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _aunits = units group l1 + units group l2 + units group l3 <span id='postcolor'> ...will fill your array _aunits with all of your infantry from all three groups. If they do represent actual groups, then remove the three instances of "group" from my suggestion.
  20. ConanOfOz

    Laser Bomb Aimer...how to?

    If this is always the condition the mission beings with, then you need not bother with a trigger. Just put the commands in your init field...
  21. ConanOfOz

    Array of all vehicles?

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Royal_Blackwatch @ Feb. 16 2002,05:20)</td></tr><tr><td id="QUOTE">I´m currently working on a mission and need an array were all the Refuel Trucks of my side are listed, not just those of my squad (not the amount of them). Is there a way to handle this?<span id='postcolor'> assuming you don't have *too* many of these to deal with, name them something like "Repair1, Repair2" and so on, add the following to your init.sqs... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> RepairArray = [Repair1, Repair2, ...Repairn] <span id='postcolor'> Don't forget the array is 0-based
  22. ConanOfOz

    A Trigger Question

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (julyTenth @ Feb. 16 2002,01:28)</td></tr><tr><td id="QUOTE">thanks for your input, ConanOfOz the basic design of my mission was (in theory) pretty much what you described in your solution and variation, but i'm stuck for ideas on how to implement a script that would cycle through every unit from the eastern side to perform the relevant functions (checking for signs of life, and their knowsAbout value) any ideas you can provide in this regard would be greatly appreciated<span id='postcolor'> I think I'm pretty close to a solution. So long as I don't run into something unexpected, I think I'll have an answer for you (us, really, this is a generic solution) tomorrow.
  23. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">I'm wondering if it is possible to add weapons to the little civilian plane.  I just thought it would be interesting to have  rockets on on. Whether by trigger or script...is this possible? (I am a newbie to scripting so keep this in mind if you answer).  Thanks.<span id='postcolor'> Yes, *LOL*, it works... Cessna = "Cessna" CreateVehicle GetPos Player Cessna AddMagazine "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" Cessna AddWeapon "MaverickLauncher" [\code]
  24. ConanOfOz

    Cheats for Multiplayer

    Leaning back in chair, and in best Arnold voice, saying, "Yeah, count me in" So here's my anti up.... 1. A few folk have stated or implied that we shouldn't be talking about Trainers in this forum because it's spreading awareness of their existence. Â You can't be serious! 2. A few folk reckon they heard about trainers for the first time in this forum. Â *Ahem* Â Please refer to 1. above. 3. Some have defended the "right" of people to use any cheats they want in single player. Â Regardless of your personal opinion of the matter, what a person does in the privacy of their own computer room is their own business. 4. Some have attacked the use of cheats in a Multiplayer scenario. Â I used to be an avid Tribes player, for almost a year I haven't played at all because of cheats (and yeah, Team Killers). Â I think most of us will agree (at least in public) that MP cheating completely destroys the enjoyment of playing a game, BUT everyone needs to think about what you can actually do about it, including... 5. Game developers coding to prevent cheating. Â I was amused as TheAvonLady broached the subject, did a neat little pirouette, and really said nothing (very politic of you). Â The fact is, skilled hackers can, and will, break anything they can get their hands on. Â If it runs on your machine, a cheat is possible. Â The only place developers have a chance is on server-side protection, because that defeats the previous definition; i.e., the hackers can't get their hands on it. Â That only means cracking is not guaranteed, but it is still very likely over time. Conclusion Let's see, if we can trace the MP hackers, go to their house and beat the crap out of them, well, that might stop cheating, but also lands us in jail. Legal action? *ROFLMAO* What's left? Â I suppose the ball's squarely in the developer's court.
  25. ConanOfOz

    Help with Captives

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">...Now here's my problem. Â If I assign them as a US squad, the Spetz Natz shoot them on sight. Â If I assign them with the Spetz Natz then the US troops shoot them when I try to liberate them. Â Does anyone know how to stop this from happening? Â Thanks for any help you can give me. Pomp Tactical Co-op Clan<span id='postcolor'> Are they in a group? Â Such as "Hostage"... Â If so, then... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">;This will prevent them being shot by enemies "_x SetCaptive True" ForEach Hostage ;Also, they should be weaponless, so... "RemoveAllWeapons _x" ForEach Hostage ;Finally, just for a little polish... _i = 0 _Last = Count Hostage #DoAnother Hostage[_i] SwitchMove "FXStandSurUniv" _i = _i + 1 ?(_i < _Last): Goto "DoAnother" <span id='postcolor'> That last one has to be iterated long hand because the SwitchMove command takes a parameter in quotation marks, as does the Statement preceding a ForEach command. Â I beleive this would confuse the script parser and fall on it's arse, so.... If they are not in a group, then you'll just have to repeat the first two commands for each one.
×