Jump to content

Prospero

Member
  • Content Count

    478
  • Joined

  • Last visited

  • Medals

Everything posted by Prospero

  1. Prospero

    200k?.....

    I posted the 200K file size figure, and it is purely based on my experimental observations of importing .3ds meshes into O2. It has nothing to do with the size of the .p3d file which you then produce within O2. Prospero
  2. The topic says it all:) Animation phase - is it based on mils or radians? It's just quite difficult to be certain... Anyone know for definite? Prospero
  3. The topic says it all:) Animation phase - is it based on mils or radians? It's just quite difficult to be certain... Anyone know for definite? Prospero
  4. Prospero

    Vtol script available

    Hehehe, well I could spend my time fixing it or I could spend my time finishing ProSphere;) ProSphere will be released on Wednesday (evening), available from ofp.info Prospero
  5. OK some dumb questions: The Object command returns the object whose unique ID number is passed to it. What's the opposite of this? I.e. what command would return the unique ID number when passed the object? The reason I ask is I'm trying to sort out a script to make an action added to a player unit via the addAction command follow the unit around regardless of the vehicles he enters/exits. Of course if some kind person has a script snippet handy... I'm a lazy bast at heart. Prospero
  6. Prospero

    Object and addaction commands

    Thanks again Uiox. Here's my latest version (speediest), but I think it still suffers from the "double action problem" occasionally. _t = "Action" _f = "action.sqs" _p = player _a = _p addaction [_t, _f] _o = _p #lp _v = vehicle player ?(_v != _o): goto "sb" #rn _o = _v ~0.01 goto "lp" #sb ?(_v != _p): _a = _v addaction [_t, _f] ?(_v == _p): _o removeaction _a goto "rn" Prospero
  7. Prospero

    Transparent textures

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (denoir @ Oct. 20 2002,01:16)</td></tr><tr><td id="QUOTE">I'm not sure that I'm a kind soul, but here you go: http://www.flashpoint1985.com/cgi-bin....2;st=14 It's about squad logos, but the principle should apply <span id='postcolor'> Ta very much Denoir. Prospero
  8. Prospero

    Transparent textures

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (denoir @ Oct. 20 2002,01:16)</td></tr><tr><td id="QUOTE">I'm not sure that I'm a kind soul, but here you go: http://www.flashpoint1985.com/cgi-bin....2;st=14 It's about squad logos, but the principle should apply <span id='postcolor'> Ta very much Denoir. Prospero
  9. Prospero

    Vtol script available

    <a href="http://uk.photos.yahoo.com/bc/prosphere2002/vwp?.dir=/My+Documents&.dnm=ps1.jpg&.src=ph&.view=t&.hires=t" target="_blank"> ProSphere Picture</a> Hmmm I need to get the link working. Prospero
  10. Prospero

    Addons with no shadow

    I agree, and would add that although it's slightly off-topic, people should make an effort to "style" their textures to fit in with the appearance of BIS-made objects. It's no good suddenly having a photorealistic helicopter - yes it's nice - but it doesn't fit in. Now, if only for shadows on the sea, and shadows cast by objects onto other objects... Prospero
  11. Prospero

    Object and addaction commands

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Prospero @ Oct. 20 2002,11<!--emo&)</td></tr><tr><td id="QUOTE">---------- _v = player _def = _v addaction ["Action", "action.sqs"] _ov = _v #lp _v = vehicle player ?(_v != _ov) && (_v != player): _a = _v addaction ["Action", "action.sqs"] ?(_v != _ov) && (_v == player): _ov removeaction _a _ov = _v ~0.05 goto "lp" ----------<span id='postcolor'> Hmmmmmmmmmm. There seems to be a bug in this code. Can anyone spot it? It seems to work perfectly, but just very occasionally one will get in a vehicle and there will be two copies of the action on one's Action Menu. Get out of the vehicle and it's back to normal again. Bum. Here's my latest version, which still suffers from the same bug: ---------- _t = "Action" _p = player _a = _p addaction [_t, "action.sqs"] _o = _p #lp _v = vehicle player ?(_v != _o) && (_v != _p): _a = _v addaction [_t, "action.sqs"] ?(_v != _o) && (_v == _p): _o removeaction _a _o = _v ~0.001 goto "lp" ---------- Prospero
  12. Prospero

    Object and addaction commands

    OK, I basically wanted what Sui did there, but in script form and without using a trigger. The following seems to work nicely: ---------- _v = player _def = _v addaction ["Action", "action.sqs"] _ov = _v #lp _v = vehicle player ?(_v != _ov) && (_v != player): _a = _v addaction ["Action", "action.sqs"] ?(_v != _ov) && (_v == player): _ov removeaction _a _ov = _v ~0.05 goto "lp" ---------- Prospero
  13. Prospero

    Object and addaction commands

    And thanks to Sui too;) Prospero
  14. Prospero

    Animation phase - mils or radians?

    I'm bumping this topic as I added many edits to my last-but-one message here (see above). I suspect that people may find the information useful. Prospero.
  15. Prospero

    Animation phase - mils or radians?

    I'm bumping this topic as I added many edits to my last-but-one message here (see above). I suspect that people may find the information useful. Prospero.
  16. Prospero

    Transparent textures

    Could some kind soul point me to a tutorial on creating textures with an alpha channel in Adobe Photoshop? (Please not an OFPEC link - I was banned there, thank god.) Prospero
  17. Prospero

    Transparent textures

    Could some kind soul point me to a tutorial on creating textures with an alpha channel in Adobe Photoshop? (Please not an OFPEC link - I was banned there, thank god.) Prospero
  18. Prospero

    Object and addaction commands

    Thanks again Uiox;) That should sort me out. Prospero
  19. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Suma @ Oct. 16 2002,12:15)</td></tr><tr><td id="QUOTE">If you really want something to be fast, [edit] preload content of the file to some global variable instead (once, in init.sqs). </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> GridPosFunction = preprocessFile "pos2grid.sqf" .... _gridpos = (getpos player) call GridPosFunction <span id='postcolor'> This way you will avoid reloading and releasing file at each use of the function (at some memory cost).<span id='postcolor'> Could I somehow preload a Drop command into a global variable this way? Prospero
  20. Prospero

    Object and addaction commands

    Just asking, but does addAction still not return a valid value? (i.e. the bug mentioned in even the latest ComRef?) This would make things far simpler if fixed. Prospero
  21. Prospero

    Object and addaction commands

    That's very helpful Uiox. Many thanks. Prospero PS: It's a shame those event handlers only work for the vehicles into which your getting in/out of, rather than on the person.
  22. Prospero

    Animation phase - mils or radians?

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Colonel_Klink @ Oct. 19 2002,14:27)</td></tr><tr><td id="QUOTE">Question: I presume the code  to start the animation is in script form to be called within OFP. Is there any way to have that in the cpp?<span id='postcolor'> Good question. I believe this may be possible with v1.85, but I haven't got round to trying it. Perhaps someone else who has could contribute? Prospero
  23. Prospero

    Animation phase - mils or radians?

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Colonel_Klink @ Oct. 19 2002,14:27)</td></tr><tr><td id="QUOTE">Question: I presume the code  to start the animation is in script form to be called within OFP. Is there any way to have that in the cpp?<span id='postcolor'> Good question. I believe this may be possible with v1.85, but I haven't got round to trying it. Perhaps someone else who has could contribute? Prospero
  24. Prospero

    Animation phase - mils or radians?

    Script-controllable Rotations - via angle and rate. --------------------------------------------------------- OK, this assumes that animations are based on radians. If it's mils, it's obvious how to change it. OK, let's go... 1) Have this in your config.cpp - anywhere in the CfgVehicles section: ---------- animated=1; class Animations { class Yaw { type="rotation"; animPeriod=0.0000001; selection="myselection"; axis="osa_yaw"; angle0=0; angle1=6.2831853; //angle1=6.4<-------- If it's mils. I've yet to find out. }; }; ---------- 2) Notice that I've created a rotation axis called "osa_yaw" and I've named the selection I want to rotate about this axis as "myselection". We'll say that "myselection" is a component part of an object called "myobject". You can call the axis, the selection and, of course, the object whatever you like. You don't have to learn Czech for custom rotations;) 3) Now, here's the script snippet to control the rotation: ---------- ; Specify desired rotation angle _dir in DEGREES (_dir can be > 360 degrees or < 0 degrees if you like). Then... _yaw = abs((_dir % 360) / 360) ?(_dir < 0): _yaw = 1 - _yaw myobject animate ["Yaw", _yaw] ---------- 4) And you're done;) 5) You can set the angle _dir to any specific angle you like - it can be negative - you can incremement or decrement it in a fast loop to get a continuous rotation. Whatever. Up to you. Prospero Edit: I wonder if the two lines... _yaw = abs((_dir % 360) / 360) ?(_dir < 0): _yaw = 1 - _yaw ... could be contracted to one, and without a condition? Further edit: If you just increment / decrement _dir for infinitely long rotations, ensure _dir doesn't overflow. To avoid this, reset it to 0 when it's any multiple of 360, for example. Further edit: OK, now some of you may be wondering how to get an *accurately timed* rotation *rate* using the above method. Here: ---------- ; Note that _directionrate is in DEGREES PER SECOND. _dir = 0 _directionrate = 45 _ot = Time #lp ~0.0001 _nt = Time _dt = (_nt - _ot) ?(_dt == 0): goto "lp" _yaw = abs((_dir % 360) / 360) ?(_dir < 0): _yaw = 1 - _yaw myobject animate ["Yaw", _yaw] _dir = _dir + _directionrate * _dt _ot = _nt goto "lp" ---------- Further edit: If you define a whole object as the selection to be rotated, you can of course then yaw the object with setDir, and pitch it using a custom animation around a named pitch axis. This gives you the ability to "kinda" set an object's yaw *and* pitch. Here's a 2-Axis rate controller script: ---------- _yaw = 0 _yawrate = 45 _pitch = 0 _pitchrate = 90 _ot = Time #lp ~0.0001 _nt = Time _dt = (_nt - _ot) ?(_dt == 0): goto "lp" _ph = abs((_pitch % 360) / 360) ?(_pitch < 0): _ph = 1 - _ph myobject setdir _yaw myobject animate ["Pitch", _ph] _yaw = _yaw + _yawrate * _dt _pitch = _pitch + _pitchrate * _dt _ot = _nt goto "lp" ---------- And you would have the following in your config.cpp - again, anywhere in the CfgVehicles section, and this time I've called the selection "All". Remember, you have to make and name this selection manually - click & drag a box over the whole thing;) ---------- animated=1; class Animations { class Pitch { type="rotation"; animPeriod=0.0000001; selection="All"; axis="osa_pitch"; angle0=0; angle1=6.2831853; }; }; ---------- Further edit: Many separate custom rotation axes can be defined on one .p3d model, but sadly, you cannot assign two rotation axes to rotate one selection, although obviously, you can assign several components to one selection. Therefore, you can't setDir an object's yaw, then pitch and roll the selection (the selection being the entire object) with two custom axes. Damn shame... However, to define two *separate* rotation animations in your config.cpp, you would add this: ---------- animated=1; class Animations { class Rotation1 { type="rotation"; animPeriod=0.0000001; selection="selection1"; axis="osa_rot1"; angle0=0; angle1=6.2831853; }; class Rotation2 { type="rotation"; animPeriod=0.0000001; selection="selection2"; axis="osa_rot2"; angle0=0; angle1=6.2831853; }; }; ---------- As you can see, I've defined the two rotatable selections as "selection1" and "selection2". Remember, you can call these anything you like. Further edit: It should also be pointed out that you can control ANY selection by manual animation script (as above) - For example, add an entry in the config.cpp for a rotation animation for one of the "reserved" (Czech-named) selections. Just ensure that your script addresses the correct axis & selection. To find out the correct axis and selection names, examine the object's original MLOD single-player demo .p3d file. Now, if you were to call that object "myobject", then... myobject animate ["osa_<something>", <angle>] So, say you wanted a cutscene where a technician is testing out an AH-64's pan/tilt cannon as the helicopter sits on the ground in a hangar. This way you can make that cannon pan and tilt as you want. Well, pan OR tilt. I'm not sure if you can do both at the same time...
  25. Prospero

    Animation phase - mils or radians?

    Script-controllable Rotations - via angle and rate. --------------------------------------------------------- OK, this assumes that animations are based on radians. If it's mils, it's obvious how to change it. OK, let's go... 1) Have this in your config.cpp - anywhere in the CfgVehicles section: ---------- animated=1; class Animations { class Yaw { type="rotation"; animPeriod=0.0000001; selection="myselection"; axis="osa_yaw"; angle0=0; angle1=6.2831853; //angle1=6.4<-------- If it's mils. I've yet to find out. }; }; ---------- 2) Notice that I've created a rotation axis called "osa_yaw" and I've named the selection I want to rotate about this axis as "myselection". We'll say that "myselection" is a component part of an object called "myobject". You can call the axis, the selection and, of course, the object whatever you like. You don't have to learn Czech for custom rotations;) 3) Now, here's the script snippet to control the rotation: ---------- ; Specify desired rotation angle _dir in DEGREES (_dir can be > 360 degrees or < 0 degrees if you like). Then... _yaw = abs((_dir % 360) / 360) ?(_dir < 0): _yaw = 1 - _yaw myobject animate ["Yaw", _yaw] ---------- 4) And you're done;) 5) You can set the angle _dir to any specific angle you like - it can be negative - you can incremement or decrement it in a fast loop to get a continuous rotation. Whatever. Up to you. Prospero Edit: I wonder if the two lines... _yaw = abs((_dir % 360) / 360) ?(_dir < 0): _yaw = 1 - _yaw ... could be contracted to one, and without a condition? Further edit: If you just increment / decrement _dir for infinitely long rotations, ensure _dir doesn't overflow. To avoid this, reset it to 0 when it's any multiple of 360, for example. Further edit: OK, now some of you may be wondering how to get an *accurately timed* rotation *rate* using the above method. Here: ---------- ; Note that _directionrate is in DEGREES PER SECOND. _dir = 0 _directionrate = 45 _ot = Time #lp ~0.0001 _nt = Time _dt = (_nt - _ot) ?(_dt == 0): goto "lp" _yaw = abs((_dir % 360) / 360) ?(_dir < 0): _yaw = 1 - _yaw myobject animate ["Yaw", _yaw] _dir = _dir + _directionrate * _dt _ot = _nt goto "lp" ---------- Further edit: If you define a whole object as the selection to be rotated, you can of course then yaw the object with setDir, and pitch it using a custom animation around a named pitch axis. This gives you the ability to "kinda" set an object's yaw *and* pitch. Here's a 2-Axis rate controller script: ---------- _yaw = 0 _yawrate = 45 _pitch = 0 _pitchrate = 90 _ot = Time #lp ~0.0001 _nt = Time _dt = (_nt - _ot) ?(_dt == 0): goto "lp" _ph = abs((_pitch % 360) / 360) ?(_pitch < 0): _ph = 1 - _ph myobject setdir _yaw myobject animate ["Pitch", _ph] _yaw = _yaw + _yawrate * _dt _pitch = _pitch + _pitchrate * _dt _ot = _nt goto "lp" ---------- And you would have the following in your config.cpp - again, anywhere in the CfgVehicles section, and this time I've called the selection "All". Remember, you have to make and name this selection manually - click & drag a box over the whole thing;) ---------- animated=1; class Animations { class Pitch { type="rotation"; animPeriod=0.0000001; selection="All"; axis="osa_pitch"; angle0=0; angle1=6.2831853; }; }; ---------- Further edit: Many separate custom rotation axes can be defined on one .p3d model, but sadly, you cannot assign two rotation axes to rotate one selection, although obviously, you can assign several components to one selection. Therefore, you can't setDir an object's yaw, then pitch and roll the selection (the selection being the entire object) with two custom axes. Damn shame... However, to define two *separate* rotation animations in your config.cpp, you would add this: ---------- animated=1; class Animations { class Rotation1 { type="rotation"; animPeriod=0.0000001; selection="selection1"; axis="osa_rot1"; angle0=0; angle1=6.2831853; }; class Rotation2 { type="rotation"; animPeriod=0.0000001; selection="selection2"; axis="osa_rot2"; angle0=0; angle1=6.2831853; }; }; ---------- As you can see, I've defined the two rotatable selections as "selection1" and "selection2". Remember, you can call these anything you like. Further edit: It should also be pointed out that you can control ANY selection by manual animation script (as above) - For example, add an entry in the config.cpp for a rotation animation for one of the "reserved" (Czech-named) selections. Just ensure that your script addresses the correct axis & selection. To find out the correct axis and selection names, examine the object's original MLOD single-player demo .p3d file. Now, if you were to call that object "myobject", then... myobject animate ["osa_<something>", <angle>] So, say you wanted a cutscene where a technician is testing out an AH-64's pan/tilt cannon as the helicopter sits on the ground in a hangar. This way you can make that cannon pan and tilt as you want. Well, pan OR tilt. I'm not sure if you can do both at the same time...
×