ConanOfOz
Member-
Content Count
57 -
Joined
-
Last visited
Never -
Medals
Community Reputation
0 NeutralAbout ConanOfOz
-
Rank
Lance Corporal
-
</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.
-
Multiple unit detection for triggers
ConanOfOz replied to Toumaxx's topic in OFP : MISSION EDITING & SCRIPTING
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... -
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.
-
a suggestion to implement a new command
ConanOfOz replied to shadow's topic in OFP : MISSION EDITING & SCRIPTING
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! -
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.
-
Is there a limit to Script Size
ConanOfOz replied to ConanOfOz's topic in OFP : MISSION EDITING & SCRIPTING
</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 -
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
-
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...
-
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.
-
*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...
-
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.
-
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.
-
</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?
-
</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.
-
My first script...I need a hand
ConanOfOz replied to Owuor's topic in OFP : MISSION EDITING & SCRIPTING
</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........