Jump to content

Sgt_Wilson

Member
  • Content Count

    107
  • Joined

  • Last visited

  • Medals

Everything posted by Sgt_Wilson

  1. Sgt_Wilson

    Custom binoculars

    You can change the animations slightly to allow you to use your own binoculars with scripts. One of the problem is you cant use the keyboard to switch between binocs and weapons, you would have to define user actions to activate and deactivate the binocs. Place this addon in the editor and call playmove "FOBinoc" using a radio trigger. http://www.ofpec.com/yabbse....d=13099 And select Iron sights to actually look through them, which highlights another problem. At the moment when you do, it will switch to the ironsights of the weapon you placed on the floor as part of the FOBinoc anim, and the view looks like you are spinning around. Which is a major obstical AFAIK? There is a video camera addon kicking around somewhere, with different anims and model, you might have the basics for your own optics?
  2. Sgt_Wilson

    M113-based mortar carriers?

    Not much point if you cant change the mortars elevation, it would be to much trouble trying to get it into a position where it could hit anything
  3. Sgt_Wilson

    M113-based mortar carriers?

    You could use OFP scripting and some trigonometry to fix that. But, is it me? I cant adjust it's elevation?
  4. Knowing some of the hidden calculations would be handy when it comes to the knowsabout value and other things in OFP. While I'm sure these are some of the things that go to make OFP an outstanding game, any insight would help. All of the above can probably be determined using knowsabout alone, if you know how OFP does some if its calculations. But at the end of the day, any enhancements to scripting in OFP2 will be enough for me
  5. Sgt_Wilson

    Ammo and refuel vehicles

    You could use the "addaction" command to add, Refuel and Rearm options to a motorbike. And use "SetFuel" and "AddMagazine" in scripts called buy your two new actions, to refuel and rearm vehicles in the vicinity of your supply bike.
  6. Sgt_Wilson

    Setdir so unit faces an object

    What about the DoWatch command? Or this function over at OFPEC DirToObj Function
  7. Sgt_Wilson

    Trigger setpossin'?

    If you use the format command on an unitialised vairable it retuns the string "scalar bool array string 0xfcffffef" ?((Format ["%1",_westscore]) == "scalar bool array string 0xfcffffef") : Format ["%1",hint "meow"] If you use the format command on a variable thats has been used, then set to nil. Cant remember exactly, but it returns something like "<Null>" You can do the same with null objects: ?(Format["%1",_Target]!="<NULL-object>") Or dead people: ?(Format["%1",Name _Target])=="Error: No unit" Most of the time you dont need to do this with null or dead objects, but there are times when it has come in handy. Edit: To tie it in with your init event question, you can use the test on initialised variables to avoid calling the code in your config.cpp init event a second time. When a unit exits a vehicle.
  8. Could it be done by giving the AI commands, via a dialog? Something like an on-screen Joypad. But clumsy, would not even begin to describe it  Edit: Just in case. What I mean is, it is a solution. But just a clumsy solution.
  9. This will switch the view to the AI pilot of Heli1, not exactly what you wanted. But close <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Heli1 SwitchCamera "Internal"
  10. Sgt_Wilson

    Busy pavements (side walks) and roads?

    Of course, just thought they were similar problems. Even in a city there must be somethings going on, you may never get to see? Its something I've been toying with as I learn more about OFP scripts. Your cutscene idea may be the best, I dont think you can create that many objects on the fly, without lag? Are you handling all the logic that checks to see when each destination is reached using the move command? How complex are the paths your setting up? Cheers
  11. Sgt_Wilson

    Busy pavements (side walks) and roads?

    Hi, I've been thinking about a similar idea, but more of how to keep a living Island supplied. I thought waypoints would be the best way to get someone to move from A to B? The problem lies with creating the AI population only when they can be seen by the player. My idea is to maintain a Diary for every character: Jim the bus drivers, get up at 7:00 hours, Leaves his house at 7:30, and arrives at the bus depot at 8:00. This way if you the player, are half way between Jim's house and the bus depot at 7:45, you should see him going to work. If you attack his car, he will be late. If you are nowhere near, it's assumed he got there ok and Jim is never created. The rest is trying to figure out what happens, if or when he does make it to work, and how to check and update all of the relevant inhabitants who use Jim’s bus service,  along with everyone in the players (players AI if he has any) proximity, without slowing down the entire game.
  12. Hi, Funny thing is, I have just come from a website describing how to program BSplines. I need them to help with a prediction problem. But it would make a handy camera script for cutscenes e.t.c I thought perhaps, a script that takes an array of points (Keyframes) and number of steps and plots the camera position along the resulting curve? And perhaps a second array that plots a seperate curve for the camera target, if required? Is this what you were thinking of? Hmm I just tried it out in Excel, easy enough to implement. Trouble is it does not require the spline to pass through the keyframes (just close to) Back to google
  13. Sgt_Wilson

    Need help understanding

    To make your OFP scripts more robust Pascal is an ideal language to teach the principles of sound programming. Yeah, but as the loop progresses the camera will shift along the X axis in increasing amounts. This just lets you move the camera from one position to another, in predefined steps. Like the keyframes used in animation. If you used the same principle of interpolation with some trigganometry, you could setup up some dramatic, sweeping camera scripts. For example you could define three positions for the camera for say three characters, then get your script to move smoothly between each of the three camera positions (Keyframes). This could be done using either 200 steps or 2000, either way you would just have to worry about the three keyframes, and the script would work the rest out. I found excel's scatter graph to be an absolute god send when it comes to 2D visualisation of this kind of thing in OFP.
  14. Sgt_Wilson

    The physics of ofp

    Hi, I'm curious to find out what, and how, aspects of the physical world are modeled in OFP. For example: Are projectiles subject to lift and drag e.t.c ? Do weather conditions, effect a projectiles flight path ? Cheers P.S This is not an attempt to re-open the, Is OFP a flight sim or what! Debate
  15. Hi, I noticed on some MP, Battlefield 1985 maps. A marker is displayed on the map when a player plants a mine. You could DePbo to find out how, as I dont know how to detect when a mine is layed? So if you maintained an array of all the the mines planted, you could use the "obj1 distance obj2" command? Or you could hold an array of all the [X,Y] positions and use: _Distance=Sqrt(((_MineXPos-_PlayerXPos)^2)+((_MineYPos-_PlayerYPos)^2)) Although I'm not sure how quick this would be compared to nearest object, if you had lots of mines and scanned ever 0.5 seconds.
  16. Hi, I dont know anything when it comes to scripts within addons (But I will need to, after I have worked out the umpteen other things I need. Before getting to that point). So I hope you dont mind if I ask you some questions along the way? If you added _P1 to either a global or local Array in your initial init event: _PidArray Set [(count _PidArray)+1,_P1] or defined as a global var: PidArray Set [(count PidArray)+1,_P1] Would _PidArray still contain the same info, when the init event is called a second time, by the (unwanted) exit vehicle event? Cheers
  17. Hi, Is there any particular reason for getting the info from mission.sqm file? If you create your groups at runtime, you can store all the info you need in an array.
  18. Sgt_Wilson

    Bridge laying problems

    I did read somewhere that bridges have to be placed on level terrain? i.e The two locations on Nogova. Are apparently, the only two possible places on the entire map.
  19. Sgt_Wilson

    Problem with setpos

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_x=(getPos _unit) select 0 +_xs The above code will give me an error everytime in OFP with a Division by zero, error message? If _xs = 10 then the code would translate to: _x=(getpos _unit) select (0 + 10) As GetPos only returns 3 elements, it will fall over trying to find element 10. Because the line where you initialise _x fails, your code goes on to call: So you get the "Type all: Number expected" error message because _x un-initialised is of type any. And SetPos expects  numbers. If you added: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #drehung _x=0 _y=0 _x=(getPos _unit) select 0 +_xs _y=(getPos _unit) select 1 +_ys And then run your code, you will get the "Division by zero" error message as mentioned above. You have to be careful, OFP only displays the last error message.
  20. Sgt_Wilson

    The physics of ofp

    Hi, Yeah gravity is definetly implemented, although I'm not sure by how much. Looks like air drag is to. But what standard might they use to calulate it's effect on a given round? You would also think that recoil would effect a round to? At least you can see it effect tanks in OFP. Wind would make it interesting for sniping, but anything else would be a hard work. I read somewhere that a round fired from a rifled barrel tends to shift to the right? And temperature can drasticly effect a bullets performance. Thanks all.
  21. Sgt_Wilson

    Problem with setpos

    Try changing: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_x=(getPos _unit) select 0 +_xs _y=(getPos _unit) select 1 +_ys To: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _x=(getPos _unit select 0) +_xs _y=(getPos _unit select 1) +_ys You may be telling it to select an element that does not exist?
  22. Sgt_Wilson

    How is it possible to make...

    Use dowatch with a [X,Y,Z] position, that points to where you want the gun to fire.
  23. Sgt_Wilson

    Projectile velocity

    Thanks for the quick reply RED, I'll give them both a try.
  24. This is related to a script I want to write, so I'll ask here. How can I find out the projectile velocity of say, a M1Abrams's sabot round. Or any of the other big guns? Cheers
  25. Hi, Hmm....This is probably a stupid question but Would CoC allow you to call different cutscenes on different clients depending on side and location of each player e.t.c Errr.....assuming it's possible, and you cant do it all ready?
×