tharawdeal
Member-
Content Count
7 -
Joined
-
Last visited
-
Medals
Everything posted by tharawdeal
-
Help naming units created by a createUnit forEach loop.
tharawdeal posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The Scenario: I have a number of defensive sandbag positions that I want to be occupied by Taki Militiamen of random types. The Setup: Each sandbag position has a marker behind it where a defender will be placed. The names of the markers are stored in an array. I am spawning the defenders using a createUnit command within a forEach loop. This puts one defender of a random type at every marker in the array. So far, so good. The Problem: Not all the sandbags are facing the same way. Therefore, when the defenders spawn, I need a way to change the direction they are facing so that they don't have their backs turned to the places they are supposed to be watching. Also, I want to be able to give them other instructions after they are spawned. Now, in order to give these instructions to each defender, I need to give each man a name that I can reference. Using createUnit, I can give a created unit a name by putting, for example, Bob = this; in the createUnit init line. However, because I am creating each defender with a loop, I can't put Bob = this; in every init line, because the script would attempt to give each unit the same name. What I need is a way to give each created man a different name. I have tried a few different ways of doing this, none of which have worked so far. Here is what I have: //Array of sandbag defense marker names. _sbList = ["sb1", "sb2", "sb3", "sb4", "sb5", "sb6", "sb7", "sb8", "sb9", "sb10", "sb11", "sb12", "sb13", "sb14", "sb15", "sb16", "sb17", "sb18", "sb19", "sb20", "sb21", "sb22", "sb23", "sb24", "sb25", "sb26", "sb27", "sb28", "sb29"]; _i = 0; { //Names for the defenders. _defNameList = ["sb1Def", "sb2Def", "sb3Def", "sb4Def", "sb5Def", "sb6Def", "sb7Def", "sb8Def", "sb9Def", "sb10Def", "sb11Def", "sb12Def", "sb13Def", "sb14Def", "sb15Def", "sb16Def", "sb17Def", "sb18Def", "sb19Def", "sb20Def", "sb21Def", "sb22Def", "sb23Def", "sb24Def", "sb25Def", "sb26Def", "sb27Def", "sb28Def", "sb29Def"]; _defType = ["TK_INS_Soldier_AR_EP1", "TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1", "TK_INS_Soldier_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_3_EP1", "TK_INS_Soldier_AAT_EP1", "TK_INS_Soldier_AT_EP1"] call BIS_fnc_selectRandom; defName = _defNameList select _i; _defType createUnit [getMarkerPos _x, sbGroup, "this setPos (getMarkerPos _x); defName = this"]; _i = _i +1; } forEach _sbList; This doesn't throw any errors until I try to tell one of the units to do something, like sb1Def setDir 90;. Then I get an error saying that sb1Def was not defined. The arma2oa.rpt also contains 29 instances of warnings saying that various units don't have names. These both point to the names not being assigned to the created units. I'm not sure where I'm going wrong, or if perhaps the createUnit init line won't accept naming anything other than in the style of unitName = this;. How can I do this without having to resort to brute force copy/paste for all 29 defenders? Thanks. -
UPSMON - Urban Patrol Script Mon
tharawdeal replied to Monsada's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I am using UPSMON (with ACE) and the UPSMON artillery script on a Podnos2B14 mortar. The problem I have is that the gunner keeps killing himself with the mortar. He is positioned on a hill and is firing on units at a lower elevation. When he gets the order to fire, he lines up in the direction of the enemy, and *kaboom!* Gets one shell off and dies in the process. When I watch him fire, it looks like the blast from the tube is coming out at a very low angle, almost like he's trying to fire the weapon directly at the enemy rather than in a high arc. I tried moving the mortar to flatter ground, which solved the problem of the gunner dying while firing. This further leads me to believe that he's not using a very high-angle firing solution and that the blast of the tube is reflecting off the terrain and killing him. But I'd really like to be able to have the mortar up on the hill again. Is there a way to make the artillery script calculate a higher angle at which to fire? Or will I have to resort to using the default artillery module? Edit: I found a workaround for this if nobody comes up with a more elegant solution. In the scripts\UPSMON\common\MON_functions file, I commented out the following: _arti fire (weapons _arti select 0); It's not very nice, because the artillery piece doesn't "fire" anymore, but it solves the problem of the mortar gunner being killed by the blast from his own tube. -
Help naming units created by a createUnit forEach loop.
tharawdeal replied to tharawdeal's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yeah, I had tried formatting it before but I didn't do it correctly. Anyhow, it works! Thanks very much. -
Dedicated Server Mission Help
tharawdeal replied to bpurchase's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Have you made sure to include the ACE Wounds module in your mission? *Edit: Sorry, I see that you said it's working on everything BUT dedicated. :o -
I did the digital download thing from the Atari site and had no problems. The only minor issue was that I had to try a bunch of times to get the activation server to register my game after I had installed it. It could be that something was amiss because I was trying to activate the game so late at night (3-4 am). Other than that, it was easy.
-
I agree, more or less. Reloading a magazine-fed weapon on the run is dumb, and reloading a belt-fed weapon on the run is REALLY dumb (and really hard), but the game shouldn't be hard-coded to keep you from doing dumb things if you really want to.
-
I was US Army infantry for 3 years. We practiced reloading quickly a good bit, but never while on the move. With an M16/M4, I'd imagine that it could be done fairly easily while walking, but probably not while running, and definitely not with any of the belt-fed weapons. For one, it would be really difficult just because you are moving around so much, and also it wouldn't be advisable because there are a lot more things that could go wrong. It's one thing if you are behind cover and are reloading and your mag slips out of your fingers... No big deal, pick it up, make sure no dirt got in it and that the rounds are still lined up properly, load up and start putting lead down range. Running, on the other hand--your mag slips out of your hand, you accidentally kick it on its way down, it goes 2m to your left, hits the ground hard, two rounds come unseated off the spring, and you have to stop, turn around, look for your mag, bend down and pick it up, wipe a hunk of mud off of the part that goes into the magazine well, reseat the two rounds that moved forward... All the while somebody might be shooting at you, and/or you have little or no cover. Thus you are forced to either recover your dropped mag, which takes time, or leave it and waste 28-30 rounds for no good reason. Also, as was pointed out, you don't want to throw away your spent mags in combat unless you absolutely must. You can probably get more rounds later on, but you might not be able to get more magazines. All the ammo in the world will not help you if you have no magazines to fire it from. If you go cold and an enemy is 25m in front about to ventilate you, sure, get rid of the empty mag as fast as you can and reload a fresh one. Otherwise you will probably either put a spent mag back in a magazine pouch, put it in your cargo pocket, or throw it down the front of your shirt.