-
Content Count
2708 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by johnnyboy
-
I need a script to calculate the position of one object relative to another. I am near certain that this function was posted on OFPEC, but that site has been down for days now. Can someone please post the function here? Thanks!
-
Need relative position script
johnnyboy replied to johnnyboy's topic in ARMA - MISSION EDITING & SCRIPTING
Awesome! That's exactly what I need. Thanks a million you guys. -
Need relative position script
johnnyboy replied to johnnyboy's topic in ARMA - MISSION EDITING & SCRIPTING
Thanks T_D, that is a related command, as you input two objects, and it will tell you the relative x,y,z values that gets you from one object's position to another. What I'm looking for is you input one object, and the relative x,y,z values, and it returns the position relative to that object (so I can then setpos an object to that relative position. Specifically what I need is a function that takes this input: - An object - x value relative to the object - y value relative to the object The function calculates and returns a position relative to the object. For example, if I pass these values: Player, 2, -3 The function gets the position of the player, gets the direction of the player, and adds 2 the y position (adjusting it for player object direction, as if the player object direction was zero), and subtracts 3 from the y value (adjusting for object direction again. Its trigonometry, using sign and cosign...but I suck at math and hate to reinvent the wheel. Example usage: You want to place an object 3 feet behind, and two feet to the left of the player. This function was on the OFPEC website for download. -
Using scripts to open doors in buildings
johnnyboy replied to johnnyboy's topic in ARMA - MISSION EDITING & SCRIPTING
I found my answer, but it took a little digging: 1. UnPBOed the Buildings PBO file found in the ARMA ADDONS directory. 2. Found the building .p3d file for my building of interest kbud.p3d. 3. Opened the p3d file in a hex editor and looked for intelligible words in there. 4. Saw the word "devere1" and guessed this was czech for door. 5. Confirmed devere is czech for door on a translator website. So, for the LAND_KBUD type building, the following commands will open and close doors: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> myBuilding animate ["Dvere1", 1]; myBuilding animate ["Dvere1", 0]; 1 is for open, 0 is for close. If we are lucky, they will have consistently used the prefix "Dvere" followed by a number, and this command will work on doors for any building. For those buildings with more than one door, start with 1, and increment til your script opens the door you desire. -
What do you mean that you can't use "fixed objects as mission objects"? What are you trying to do?
-
Do all the .ogg files in your profile sound directory get fed to other players in multiplayer, or only the ones that you actually execute? I'm wondering if having alot of files in the directory is bad, or only bad if you use them all.
-
Berghoff, How did you create your mission still picture? I have been unable to create a PAA file that works for ARMA missions, and have seen posts by others having the same problem. Edit: Never mind, I have it working now. I had the wrong image file name in my Overview html. Texview works fine for converting JPGs to PAAs.
-
Excellent mission sir! Best I've played yet. Better than any campaign missions I've played (I'm about halfway through now, but losing interest in the campaign). Highlights: 1. Excellent mission intro using the dynamic map to brief the player visually. 2. Good location where ARMA ai seems to excel (i.e., the AI doesn't do as well in the big cities). 3. During the counterattack the BRDM moves in and out, making him very unpredictable. 4. Just the right amount of challenge. Took me about 4 hours plus a few saves to beat it. Multiple times I had to retreat into courtyards, solo, low on ammo, with the AI constantly moving into flank me. Intense! Small problems, in case you want feedback: 1. The M113 that comes into support defending against counterattack kept getting stuck on building walls. About 9 out of 10 times. Probably nothing you can do about that since its the same old lame AI driving like ofp... 2. I beat the mission, but the last objective for the counterattack was not checked off. But this may have been my fault, because I held back in the area where the original BMP objectives were, rather moving up to where the defend waypoint was. Excellent work.
-
switchmove animations
johnnyboy replied to {USI}_Zombie's topic in ARMA - MISSION EDITING & SCRIPTING
These are both handy techniques, thanks for sharing them. I'm trying to find the animation for left lean and right lean, and neither of these techniques are showing a different animation for leaning. I also can't find them in the Biki. Any idea how to find the lean animations? -
The "typeof" command will get you the object type name you need to create your instances of that object using CreateVehicle command. So to find the name of an object you like, find the object on the map, then turn Show IDs on and get the ID. The first line of code below gets the object for the ID (change the ID to your desired object's ID). The second line will display the type name using the "typeof" command. The third line creates a new instance of that object at the players position. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _obj = (position player nearestobject 256237); player sidechat format ["object direction is: %1, type=%2", getdir _obj, typeof _obj]; _newObj = typeof _obj createVehicle (position player);
-
Another workaround I use, is to have a looping script that removes the hidden targets for a few seconds, then puts them back for a few seconds, over and over. This prevents supporters from only shooting at hidden targets.
-
Agreed. Great for cutscenes, and it can add a little spice to scripted missions. A good example is if the player's team hides out in a house. You sprinkle a few targets around the house, then you get lots of incoming fire.
-
Here is a handy script written by General Barron for OFP. It works for ARMA too (I've tried it). The comments explain how it works and how to call it. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;----------------------------------------------------------------------------------------- ----------------------------------------- ;manMG1.sqs ;By General Barron ;aw_barron@hotmail.com ;3/29/03 ;This script is used to make units man a machine gun when its gunner gets killed. ;A unit from a group you specify will go to man the machine gun after its gunner gets killed. ;This unit will always be the lowest-ranking unit in the group, so that it doesn't interfere ;with waypoints of the group (unless there is only one unit left in the group). ; It is called as follows: ;[mg,group] exec "manMG1.sqs" ;"mg" is the name of the machine gun you want manned. ;"group" is the name of the group that will be manning the machine gun. ;You can end all manMG scripts that are running by setting the variable manMG_end to TRUE ;----------------------------------------------------------------------------------------- ----------------------------------------- manMG_end = FALSE _gun = _this select 0 _group = _this select 1 #Loop @NOT alive gunner _gun OR NOT alive _gun OR manMG_end ?NOT alive _gun OR manMG_end : exit ;wait until the gunner dies ;?"alive _x" count units _group <= 0 : exit ?{alive _x} count units _group <= 0 : exit ;if the group manning the machine gun has no units left, exit the script _gunner = units _group select (count units _group - 1) ;select the last unit in the group _gunner assignAsGunner _gun [_gunner] orderGetIn TRUE ;make him get in the gun goto "Loop"
-
Invisible objects by Lester worked great for OFP, and he is planning on releasing one for ARMA soon (in weeks or days I think) as part of a MAPFACT addon. I know they work in ARMA because I converted his OFP target addon to ARMA and tried it. Its his addon though, so I'm now waiting for the official MAPFACT one. Invisible targets only take damage from nearby explosions (bullets and projectiles pass through with no damage). This happens, but not that frequently. Plus you can run a script to replace targets if they are destroyed. I use the hidden targets in various ways: 1. Run a script that continually repositions the target near the player (randomly). This gives the enemy ai something besides the player to continually shoot at. The player is then taking alot more rounds in his general direction. 2. Add an armored target near infantry player. This causes enemy armor, enemy AT soldiers, and helicopters to fire cannonts, rockets, etc., near the player. 3. Put triggers around static cover objects such as vehicles, barrels, small walls, windows, etc. When player or AI enters the trigger area an invisible target is created on the opposite side of the object. Enemy AI then pours fire down on that target. If you are player and hide behind a car, the enemies are now hosing down that car, giving you that thrilling sound of bullets hitting metal. The scripts will alternately hide and show the target, so the enemy fire is more sporadic (otherwise enemy will fire at the target nonstop). This is no substitute for real suppressing fire though, but until BIS codes suppressing fire, it helps, but it takes alot of work. My scripts for number 3 above were all hardcoded in various missions. I hope to develop a generic one that will automatically calculate the opposite side of a cover object where to place the target, and adjust it as player moves. So if you hide behind a car on the West side, the target will appear on the East, and vice versa.
-
Great idea. I've been using flagpoles and lampposts for years in ofp, but they aren't tall enough when in/on buildings, so I would have to hassle with adjusting their height to see them. These tall markers solve that problem.
-
Try the NAME command: http://community.bistudio.com/wiki/name
-
Almost right. The following works: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["Your time is %1 seconds", (endTime - startTime)];
-
I turned off Vsynch, and the problem went away. Wow. Thanks a million ofpforum. I urge you all to try to this. I'm glad the problem is gone, but find it strange that this is the first game that ever required setting tweaks at the video card driver level to get the game to function correctly.
-
You probably know this, but you can "respawn to group" in multiplayer. You may not be able to switch teams, but at least you can spawn into another soldier within your group when you are killed.
-
I could not agree more. I love OFP and ARMA. I mail ordered the Czech release, but couldn't wait, so bought the German release online too! But the ironsights aiming is VERY FRUSTRATING. More often than not--as I am painfully waiting for my bead to float over my target-- the AI acquires me first and kills me. This happens when I start aiming BEFORE the AI starts aiming. I believe this will hurt ARMA's broader appeal and sales, as only die hard OFP fans (like me) will stick with the game as is. I really hope they patch this before the broader 505 release.
-
Difficulty in aiming with ironsights is #1 PROBLEM with this game. I don't play arcade games, nor do I wish this to be an arcade game. OFP is my all time favorite game, and now ARMA is my new favorite. But ironsight aiming is extremely frustrating. I should have no problem shooting crouched at targets 50M or less, but the aimpoint sways all over the place. The AI shoot much better than the player at these distances. I have better luck using the reticule crosshairs instead, which is sad for an ironsights game. I wish BI great success for this game. But I think they will lose appeal (i.e., less sales) with the more casual fan base if they don't fix this. Awesome game otherwise though!
-
Make Civilians enemies
johnnyboy replied to Somerville's topic in ARMA - MISSION EDITING & SCRIPTING
Thanks to this thread, I just tried this too, and it worked great. But setfriend .1 for civilian side had one unintended consequence: The soldiers started shooting and rocketing empty civilian vehicles in the town. Kind of funny, like they decided to trash everything owned by the civilians. EDIT: Sorry guys, I think I was wrong on this. I tried to create a simpler mission for Kronzky to demonstrate this, and I couldn't get the SetFriend to do anything, and I also couldn't recreate the situation where the soldier AI started shooting empty vehicles (which occured one time in a complex mission I'm working on). I have no idea what made the AI start shooting civvie vehicles in that one case. However, I can definitely make soldiers shoot civilians (and vice versa), using this old tried and true method: 1. Create an OPFOR unit with a Probability of Presence of zero. 2. Create civilian units. 3. Group civilian units to the OPFOR unit who has the Probability of Presence of zero. BLUFOR units now shoot these civilians on sight. To control when BLUFOR shoots these civilians, do this also: 4. Set civilians units to SETCAPTIVE TRUE (now BLUFOR won't shoot them). 5. When you want civilians shot, reset the civilian units to SETCAPTIVE FALSE (via a trigger, waypoint or script). Now BLUFOR will shoot the civilians. -
The following is an OFP script authored by Toadlife. It may need some tweaks before it works in ARMA (I haven't tried it yet): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> requiredversion "1.85" ; This script will cause unit or group of units to follow another unit or group of units without joining ; any group ; Initialize this script with the string below: ; [[leaders],[followers],distance,degree,leeway,checkinterval,behaviour,position] exec "follow_toadlife.sqs" ; ; ** [leaders] = an array of units which will be followed, can be only one unit. Must be in array format! ; ** Example: [soldier1,soldier2,soldier3] ; ** [followers] = an array of units that will follow the leaders, can be only one unit. Must be in array format! ; ** Example: [man1,man2,man3] ; ** distance = Distance followers must stay from leaders ; ** degree = position relative to leaders followers will stay relative to the direction the leader is facing ; ** Example: 0 = directly in front of leader / 90 to the right of leader ; ** leeway = distance followers can be from their currently assigned position before they must move again ; ** checkinterval = how often the followers check their position releative to the leaders position ; ** behaviour = the behaviour of the followers ("careless", "safe", "aware", "combat", "stealth") ; ** position = position the followers will assume ("auto", "up", "down") ; _leaders = _this select 0 _followers = _this select 1 _dis = _this select 2 _degree = _this select 3 _leeway = _this select 4 _checkinterval = _this select 5 _behaviour = _this select 6 _position = _this select 7 "_x setbehaviour ""_behaviour""" foreach _followers "_x setunitpos ""_position""" foreach _followers goto "move" ~1 #check {if (!alive _x) then {_followers = _followers - [_x]}} foreach _followers {if (!alive _x) then {_leaders = _leaders - [_x]}} foreach _leaders ?count _followers == 0:exit ?count _leaders == 0:exit ?((_leaders select 0) distance (_followers select 0) > (_dis + _leeway)): goto "move" ?((_leaders select 0) distance (_followers select 0) < ((_dis + _leeway) * 0.5)): goto "move" ~_checkinterval goto "check" #move _lpos = getpos (_leaders select 0) _ldir = getdir (_leaders select 0) _lposx = _lpos select 0 _lposy = _lpos select 1 _moveto = [_lposx + ((sin (_ldir + (_this select 3))) * _dis), _lposy + ((cos (_ldir + (_this select 3))) * _dis), 0] "_x Move _moveto" foreach _followers ~4 goto "check" Good luck. If you have to tweak it to get it work, please post your solution for the rest of us!
-
To have it start out flying, click on the chopper unit to see its properties. Change the "Special" property to "Flying", and the chopper will be airborne when mission starts.
-
When vehicles drive over bridges with lights on, areas beneath bridges are lit (i.e., light penetrates bridge). This may be related to a bug where tread tracks appear underneath the bridges when a tank drives over the bridge.