bigduke6
Member-
Content Count
31 -
Joined
-
Last visited
-
Medals
Everything posted by bigduke6
-
Checking variables inside scripts
bigduke6 replied to bigduke6's topic in ARMA - MISSION EDITING & SCRIPTING
Ah, that explains that. Thanks very much for the reply. I can stop banging my head now. Cheers, Mart -
Back again with another question for my replacement satchel charge scripts. I'm confused about a scripts ability to check a variable. When I create an explosive in the game I attach an action to it thus <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">pickupcharge1 = charge1 addAction ["Pick up explosive 1", "Pickupcharge1.sqs"] in case you change your mind and want to pick it up and set it somewhere else. No problem. Then in the script "Pickupcharge1.sqs" I check who activated the action and allocate it to a global variable thus <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">whopickedupcharge1 = _this select 1 I know the right variable is placed in there because if I show it in a hint <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["whopickedupcharge1 = %1",whopickedupcharge1] it correctly displays 'p1' (without the quotes). All good so far. But then in the script when I check on who picked it up so I know who to reallocate the charge to I use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? whopickedupcharge1 = p1 : p1placecharge1 = p1 addAction ["Place explosive 1", "Placecharge1.sqs"]; goto "End" ? whopickedupcharge1 = p2 : p2placecharge1 = p2 addAction ["Place explosive 1", "Placecharge1.sqs"]; goto "End" hint "Error in whopickedupcharge1" #End exit it doesn't seem able to match up with the soldiers and always falls through in to my error message, and doesn't reallocate the action. It feels like a really basic question, and probably is, but why can't the 'if' statements match up the check when the correct variable is in there? I have tried it with checking against p1 'p1' (p1) "p1" but just can't get it to work. I've tried making the variable local and global but neither way works. Any help greatfully recieved, to alleviate my flattened forehead from banging my head on the desk. Thanks, Mart
-
Addaction only for unit added to
bigduke6 replied to bigduke6's topic in ARMA - MISSION EDITING & SCRIPTING
Ah, apologies. I thought that code would add the action to the local p1 soldier, still leaving me the same problem when other soldiers came close. I was thinking of how to restrict it from other soldiers, when simply by restricting it from other computers you get the same effect. Hey presto. Thanks. Cheers, Mart -
Guys, I'm writing a few scripts for co-op MP to get round the fact that you can't detonate or use each others satchel charges if one player dies, and also the fact that you have to detonate them all at the same time rather than being able to blow one at a time. So, to cut a long story short as part of the process I have a script which does this <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">p1placecharge1 = p1 addAction ["Place explosive 1", "Placecharge1.sqs"] where p1 is player1, etc, which works fine. The problem is when another player walks close and looks at the player with this action, the action also appears in their action menu, like if I'd added the acton to an object which could be used by anybody. Then can then place the charge which is on the other player, essentially nicking it off them. So, the question. How do I make the action only show up and therefore useable to the player I've actually added it to, rather than anyone who happens to be close enough and looking at them. Thanks in advance. Mart
-
Addaction only for unit added to
bigduke6 replied to bigduke6's topic in ARMA - MISSION EDITING & SCRIPTING
Guys, thanks for the replies but maybe I didn't explain it enough as I think you've got the wrong idea. I can successfully add the action ONLY to the required player ( there is a series of action menu commands which the team leader uses to keep an explosive or issue it to one of his team, and the person so issued with each explosive gets a corresponding 'Place explosive 1', etc in their menu). The problem is if, say the team leader gives all the charges to soldier p1, and gives none to another soldier, say p2, when I teamswitch to soldier p2 while testing the mission, while he is away from soldier p1 everything is fine, there are no actions in his menu. The problem is when I move p2 close to p1 and look at him, the 'Place explosive 1', 'Place explosive 2' and 'Place explosive 3' actions appear in p2's action menu, even though he has no explosves. As soon as p2 looks away or moves away from p1 the action gets removed from the action menu. It's like if you add an action to an object, say a house, when you get close enough, I think 3m or 5m and look at it, the action appears in your action menu, and then gets removed if you look away or move too far away again. I can nullify the action by checking in the script who activated the action and if it's not the person carrying the appropriate explosive I can make it exit, but I'd rather keep it tidy and not have the action appear at all. Although, thinking about it now, if you can only do it while close enough to the other player and while looking at him, I suppose you could reason that you're getting the charge out of his backpack and setting it for him, while he's firing or something. Hmm, that's going to play havoc with my scripts though, having a different person setting a charge from the person carrying it.... But I'd still like to know if it's possible to stop added actions for one soldier appearing in another soldiers menu when he gets close. Regards, Mart -
Guys, Done a search in ArmA and found nothing, searched OFP and found a couple of threads saying how good this would be but no actual mods or addons to do it. Has anyone done or is planning an animation/model for ArmA for allowing a soldier to pick up a wounded comrade, or even a dead one at that I guess - Don't leave anyone behind. I play coop missions with a buddy and it would be great if one had the chance to go back in and pick up the other if he's wounded and can't walk. I'm not interested in all these public competitive servers, just small scale Co-op missions, where as far as I'm concered this is a must-have feature. Thanks, Martin
-
Carrying a wounded soldier
bigduke6 replied to bigduke6's topic in ARMA - MISSION EDITING & SCRIPTING
Cheers guys, I'll have a look. In the meantime, I'm trying to do something simple myself just for a game this week. I'm trying to mess around with the different health/damage settings to find the threshold for walking/crawling, but having written a simple script to increase a test soldiers health by 0.05 using setdamage in steps to see the effect, at 0.35 blood appears on right leg at 0.9 he dies but at all settings he is able to walk and run/sprint with no problems. Am I missing something? Martin -
Carrying a wounded soldier
bigduke6 replied to bigduke6's topic in ARMA - MISSION EDITING & SCRIPTING
Just had an idea, without animating it as such. Check if someones hit if their health is too low to walk, then repeatedly check the distance to the other players, so that if another player is standing next to them to 'help' them, temporarily put their health back up enough so they can walk, as long as the other player stays next to them, so imagine helping them walk rather than carrying them. When the other player moves too far away, put their health back down. Could even add an acton to the 'healthy' player of 'Help comrade', and while it's active have the wounded player not use movement controls, and use a script to setpos the wounded player to the side or back of the helper, then have an action for put comrade down to stop the setpos'ing and the other player can move as normal. Just an idea. Martin -
Units in squad stops while moving in safe
bigduke6 replied to Proud Gamer's topic in ARMA - MISSION EDITING & SCRIPTING
Yep, I get the problem as well. I have a 4 man squad patrolling around a town on WP's with a CYCLE WP and nearly always, but not always, the 3rd and/or 4th guy will stop. Thiking about it, it's always next to the cycle WP. Hmm, wonder if that's coincedence. Martin -
changing positions in vehicles......
bigduke6 replied to bugkill's topic in OFP : MISSION EDITING & SCRIPTING
Figured out how to change positions instantly in an airborne helicopter. I eject the soldier, and then 0.1 seconds later move the soldier to the new position. Given the soldiers doorgunnerhook1 player1 travelling in helicopter hook1 So then the code is <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">doorgunnerhook1 action ["eject", vehicle hook1] ~0.1 doorgunnerhook1 MoveInCargo hook1 player action ["eject", vehicle hook1] ~0.1 player1 MoveInGunner hook1 You need the time delay - without it the moves don't get actioned - I guess the computer is still ejecting you when the move is issued. It looks instant from a players point of view. I'll add this to the 'How to....' list Martin -
arma artellery fire on map
bigduke6 replied to landychev's topic in OFP : MISSION EDITING & SCRIPTING
I'm trying to learn all this clever stuff myself. I've been searching and just found this. Check out this tutorial here http://www.ofpec.com/OFPReso....ick.htm from the ofpec tutorial page. Doesn't specifically deal with artillery fire, but tells you how to use the command to send where you clicked to be able to use it. Theres lots of useful tutorials there. http://www.ofpec.com/ed_depot/tutes.php Martin -
arma artellery fire on map
bigduke6 replied to landychev's topic in ARMA - MISSION EDITING & SCRIPTING
I'm trying to learn all this clever stuff myself. I've been searching and just found this. Check out this tutorial here http://www.ofpec.com/OFPReso....ick.htm from the ofpec tutorial page. Doesn't specifically deal with artillery fire, but tells you how to use the command to send where you clicked to be able to use it. Theres lots of useful tutorials there. http://www.ofpec.com/ed_depot/tutes.php Martin -
Hi all, getting back into all this editing malarky after a break. I'm back to doing 'Nam MP missions, and am stuck on something. I can't get AI enemy small arms armed guys to fire on an airborne helo, even though they could damage it. An RPG guy will try a lucky shot. If I land in the middle of an enemy squad, they all mill around - some wll throw grenades and the RPG guy will take a shot, but no small arms. I've tried landing and shooting at the helos myself, and you can cause damage will small arms, so why won't they fire? I've tried dotarget and dofire, but they just won't fire. Any tips would be appreciated. I'm flying the cayuse from sebnam pack, but the principle will be the same for all. Thanks in advnace, Martin
-
Small arms enemy to fire at helos
bigduke6 replied to bigduke6's topic in OFP : MISSION EDITING & SCRIPTING
MH, Ooh yeah, they're shooting up my Loach good and proper now. The invisible targets solved all the AI firing/health problems as well. Nice. Thanks for your help. Martin -
Small arms enemy to fire at helos
bigduke6 replied to bigduke6's topic in OFP : MISSION EDITING & SCRIPTING
MH, Thanks again. Got the pbo from your link and added it to the addons folder. However, still cant see an invisible unit type to select. Which category does it come under - men, objects, etc. Tried searching for the original les invisible target post to see if there was a readme but couldn't find anything, well actually found loads of posts with the word 'invisible' in but couldn't find a readme for that addon. No doubt it's right in front of my eyes.... Martin -
changing positions in vehicles......
bigduke6 replied to bugkill's topic in OFP : MISSION EDITING & SCRIPTING
Just to prove that I do search for the answers before I post a question.... I want to have an intro mission where the player is transported to his new base on a helo (Chinook in this case from sebnam). There is a pilot, gunner, and several other cargo passengers. I create an empty helicopter, a seperate pilot and gunner and move them in (moveindriver, moveingunner). Player is moveincargo sitting in the back. To make the flight a bit more interesting, I want the helo to take some fire and then to (artificially) wound the gunner, and then have the pilot shout to the player 'Well you'd better get on that damn gun' or similar. So at the required point I add the action <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> hook1 AddAction ["Man the doorgun", "Man_doorgun.sqs"] Problem is, I can't get the position moves to work while the helicopter is airborne. In fact, when I execute this script to do the switch, the (AI) pilot lands the helo, the gunner gets out, the gunner then runs around and climbs back in as cargo, but the player doesn't move. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> doorgunnerhook1 assignAsCargo hook1 ~1 Player1 assignAsGunner hook1 That's an improvement on this script, which did nothing <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> doorgunnerhook1 MoveInCargo hook1 ~1 Player1 MoveInGunner hook1 So, is there a way to change positions instantly in an airborne helicopter? Thanks in advance for any help. Martin -
Small arms enemy to fire at helos
bigduke6 replied to bigduke6's topic in OFP : MISSION EDITING & SCRIPTING
MH, Thanks for the quick reply. Not sure how to complete it though. Invisible infantry unit? I've got a helicopter called loach1. I created a unit of a soldier called helotarget1, and scripted it as you said, but he seems to hang out the bottom of the helo, so I changed it to add 2 to the vertical getpos, so now he's just above the helo (so he does't detonate grenades dropped out the helo). The idea worked, in that they open fire, although he also dies fairly quickly. I guess I need to regenerate him with a health check back up to full. If I have multiple helos, I just need a similar script for each. Scripted as <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #loop helotarget1 setPos [getPos loach1 select 0, getPos loach1 select 1, (getPos loach1 select 2) +2] helotarget1 setvelocity velocity loach1 ? ((damage helotarget1) > 0.1) : setdammage helotarget1 0 ~0.1 ?alive loach1: goto "loop" deletevehicle helotarget1 Checked through all the soldiers, and couldn't see (pardon the pun) an invisible one. Is it in an add-on? The soldier also fires, so I set him to ammo of zero, but then if there's an invisible unarmed soldier I can use for the target that solves all my problems. Martin -
THE MATRIX (A series of single missions)
bigduke6 replied to AgentJonathan's topic in OFP : MISSION EDITING & SCRIPTING
Couldn't you have a script running which checks the health of the player, and on taking damage it puts it back up, but only does this a limited number of times depending on a counter. For example, ten times the script would put the players health back up to full. Then maybe the next 10 times put the players health back up to three quarters or half, etc, then you've had it. I'm just getting back into the editor and scripting so can't supply you with anycode, but the idea should be okay. Martin -
Found this old answer to a question I had today. I'm trying to do an enemy VIP travelling by bike to be ambushed (VC tax collector or suchlike). Problem is, the guy doesn' seem to get on the bike. Let me explain. If I (as in a player character) is within visibilty distance of the guy to get on the bike, he does it every time. But if I'm out of sight at the start, and then go and find him, the idiots on foot, having ignored the movein. This happens 100% every time - if I'm there he gets on, if I'm not, he doesn't. Also tried a GET IN waypoint, but has the same effect. Ugh! The bike is bike1, the guy is a sebnam (civilian) villager, init line is: this moveindriver bike1 It's like if you can't see it, OFP doesn't bother working it out. Any suggestions would be gratefully received. Mart
-
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> Because there's a track definition in description.ext. So the "not found" error only occurs when OFP attempts to actually play the file. But the definition, per se, is legitimate. That's what I was getting at. If Campbell was asking <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> And will the file show up in Music in trigger with rest of music? then I assumed that he hadn't actually allocated his new files to any trigger or waypoint because he couldn't see them in the list.....So if he can't see them in his list of available music, then he can't have set a track to play, which means OFP won't have looked for it. So, what does he do to get OFP to say 'file not found'? Is it when the mission plays (must be, but how can it be looking for a track if he hasn't selected it from the music list?) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> This is interesting. Where is your "music" folder? Within your mission's folder or in OFP's main folder? I have my music folder(s) within my mission folder(s) ....\OperationFlashpoint\Users\(username)\missions\(mission name) This I guess gets all pbo'd up when you save it to SP or MP. I play MP, and have had a couple of weird cases in the past where not all MP players (there's 2 of us) can hear the music. Sometimes, only the computer which created the server can hear the music, but then other 'music' in the same playing of the same mission does get heard by all players. Maybe it depends if it gets 'played' by a waypoint, trigger, etc. Are you still getting the same 'file not found' message Campbell, or have you cracked it? Mart
-
Campbell, I am confused. If you can't see the music file name in the music portion of the trigger, how are you getting the file not found message. If you haven't put it in the trigger, what is trying to find it to play it? What do you do, or what does the game do, that causes the file not found error to display? Also, I do have the first backslash in my des file, and mine seems to work okay. Mart
-
I would guess you have missed out an '=' somewhere. Check the lines <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">tracks[]={file1}; and for each file <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">sound[] = {\music\file1.ogg, db+10, 1.0}; for missing a '='. You say it says file not found? That's different to the screen print you supllied. Have you got an example of this message? Mart
-
Bobcat, Thanks for posting these scripts. I'm progressing in mission writing, and am on the verge of script writing, so these are very interesting. I would like to use something similar to your loadchopper.sqs, but have some questions if you don't mind. I'm probably just going to show how little I know about scripting, but here goes anyway.... The script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> loadchopper.sqs - helicopter lands,people get in, takes off [heli,groupLeader] exec loadChopper.sqs Code Sample  ; "Land and Load Chopper" Script by Bobcat ; RAAAAAAAAAAAAAAAAAAAAAARRRRR _group = _this select 0 _chopper = _this select 1 ~0.5 _chopper flyInHeight 2 _chopper lockWp true _loadgrp = units group _group _chopper setSpeedMode "limited" ~random 1 _i = 0 goto "START" #START _dir = getDir _chopper _trpAmount = count _loadGrp _chopper flyInHeight 0 ? getpos _chopper select 2 < 7 :  _chopper setvelocity [(velocity _chopper select 0)-(velocity _chopper select 0)/20,(velocity _chopper select 1)-(velocity _chopper select 1)/20,(velocity _chopper select 2)] ? _i >= _trpAmount : goto "STOP" ? (_loadGrp select _i) in _chopper : _i = _i + 1 ~0.01 goto "START" #STOP _chopper lockWp false _chopper flyInHeight 50 _chopper setSpeedMode "full" Exit Given the order of your parameters in the exec line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [heli,groupLeader] exec loadChopper.sqs is the variable assignment the right way round? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _group = _this select 0 _chopper = _this select 1 Then, working through the script, I can figure out what everything does....but I can't see which bit actually orders the troops to get in the helicopter. In the Unloadchopper.sqs, you have code which unassigns squad member (n) from the chopper, and then issues him a GET OUT order. Does it need an assign statement and then a GET IN order to get the troops to get in in this script? Also, what function does the <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _dir = getDir _chopper line do in the script (I know what it does, but how does this script use the returned value?) Then, is there a reason why the line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _trpAmount = count _loadGrp is inside the loop, rather than being worked out once at the start. Does the value change as the soldiers get out of the helicopter? Lastly, is there a reason behind using a delay of ~random 1 rather than ~0.5 ? As I said, I am a fairly newbie at mission editing, and a complete newbie at scripting, so apologies if I've asked dumb questions but the above would help me to get a grasp of the basics. I want to use a loadchopper type script in my latest Vietnam helicopter pilot mission I'm doing. The players (2) have to return to an LZ to make an emergency extraction of a platoon (4 seperate squads/groups) they've just dropped off who have been ambushed by the enemy. I'm trying to use the 'distance' command to find the nearest squad to any helicopter which lands, and then orders that squad to get in. I think I've cracked the logic....just about. I'm a programmer/analyst by trade, so its basically just about learning another programming language really. I thought Assembler was bad enough! Thanks in advance for any help/pointers you can give. Mart
-
Campbell, I'm assuming you have actually created the sound files you want to use, and saved them in .ogg format? If so.... I only add music to my missions, and to do it you need the following in the folder where your mission is saved when you save it from the mission editor (codemasters/operation flashpoint/users/yourusername/missions/yourmissionname) 1) A folder named music where you put all your ogg format music files 2) A file called description.ext. To do this open up notepad and type the following: class CfgMusic { Â Â tracks[]={file1}; Â Â class file1 Â Â { Â Â name = "file1"; Â Â sound[] = {\music\file1.ogg, db+10, 1.0}; Â Â }; Â Â }; Then click 'save as', type 'description.ext' and save it in the mission folder as above. Simple. Each file has to be defined in the Tracks[]=(file1,file2,file3,etc) section, separated by a comma, and each sound/track needs to have the its own section of code as in class file1 Â Â { Â Â name = "file1"; Â Â sound[] = {\music\file1.ogg, db+10, 1.0}; Â Â }; I tend to use the same names throughout, so just use the name of the sound file you created everywhere it says 'file1' above, and MAKE SURE the 'file1.ogg' file is actually in the music folder in the CORRECT mission folder. If you save a mission with a different name, the mission editor will create a new folder, and it will NOT have your music folders/files, etc in it. The db+10 sets the volume of the sound, and the 1.0 the pitch. Don't mess with the pitch, but be aware that if everything else is working fine but you still can't hear a sound/music, try upping the sound value (eg, db+40), or if in a noisy environment in game (I tend to write helicopter pilot missions so its quite noisy) I had to go into the actual game options (not in mission editor), and actually increase the music volume setting, and slightly decrease the other two. Note that I'm a fairly noobie to this myself, so there may be other/better ways of doing this, but it certainly works for me. If you still have problems, reply with the names of the music files you have created and want to use, and I'll write the definitions for you, so you can see how to do it. The same principles apply for radio and voices, so once you've cracked music, go back to the tutorial in my previous post and read it again, and it should all make sense. Mart 'Charlie don't surf!'
-
How to ignore waypoints after a trigger
bigduke6 posted a topic in OFP : MISSION EDITING & SCRIPTING
Hi all. Need a little help with this. Searched on 'delete AND waypoint' and thereabouts but couldn't find anything. I'm writing another MP Nam helicopter pilot mission (for 2 players, hey if I had 4 players there would be no problem as all the Huey's would have 'human' pilots and not need AI control), this time a troop of 4 Hueys inserting a Platoon near an LZ. I've got game logic randomly making various VC units move to the area and attack, so its a bit random. The Huey's land one at a time, as it's a small LZ. Anyway, problem is, if we lose a helo before the landings have started, it messes up the mission as the forces are out of balance and it knackers up my 'landing one after the other' logic. So, I have a trigger set up to check that (the landings haven't started) AND (any of the helos are destroyed) and if true, to abort the landings and return to base. The detection logic of this trigger works fine, but then I need the helos to ignore all previous waypoints, and force them to return to base. I have this in the trigger 'on activation' helo1 move (getPos pad1) also tried helo1 domove [getpos pad1 select 0, getpos pad1 select 1,getpos pad1 select 2] When the trigger activates, you can see the helo 'start' to change direction, but then they just head off to the bottom left corner of the map. ? Nowhere near either the base or any of the previous waypoints. Confused, I am. Yes, the helicopter is called helo1, and there is an 'invisible H' called pad1 at the base. Any help would be much appreciated. Thanks, Mart