Jump to content

Sgt_Wilson

Member
  • Content Count

    107
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Sgt_Wilson

  • Rank
    Sergeant
  1. Sgt_Wilson

    Count dead groups

    Hi, Use IsNull, that will do it.
  2. Will AAE allow you to install example missions into the user folder, so they can be loaded up in the mission editor? This is the worst part for me, trying to explain about the directories in users, that has the same name as the player.
  3. Sgt_Wilson

    No ai respawn

    Try using deletevehicle on them once they have spawned a second time. If its AI, OFP will delete them, if there players nothing will happen. Well at least thats the theory.
  4. Hi, Do you want an action that is only available to certain vehicle classes, or will the same action be displayed for all vehicles? Do you want an action that just returns the actual class of any vehicle, like "M1A1" or "UAZ"? Do you want an action that tells you if its Land, Air , Tank, APC e.t.c This is what I assume you mean when you say Base Class? But I dont think you need to use nearest object, Actions should pass the Vehicle there attached to, to the script you call? Hard to say without knowing exactly what the action is for?
  5. Sgt_Wilson

    Canceling dowatch

    Its been a few weeks since I checked, but make sure the guy do watching ObjNull is not really just watching position [0,0,0]. I dont think thats what OFP's guys do normally, try doing: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Hint Format ["%1",GetPos ObjNull] You will see what I mean.
  6. Sgt_Wilson

    A list of all players

    I dont have a clue if this actually works or not, but I figure it should if the assumptions I've made are correct? And as nobody else has replied I'm sure there are more ways to do it, but apparently all AI in MP are classed as local to the server. So if you named all playable units in your mission PLAYER1....PLAYER14 e.t.c. in the editor, and add a game logic called server to your mission. Then call the following from the init.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> SPlayerCount=0 SPlayers=[] If !(Local Server):goto "SkipServer" ;Make sure you add all players, I cant be bothered typing all fourteen out here _StartArray=[PLAYER1,PLAYER2,....,PLAYER14] {If (!(Local _x) Or (_x==Player)) Then {SPlayers=SPlayers+[_x]}} ForEach _StartArray ;So SPlayers should now be a server array of all the players. SPlayerCount=Count SPlayers _Index=1 {Call {Format["MYPLAYER%1",_Index]=_x}; Public Variable Format["MYPLAYER%1",_Index]; _Index=_Index+1}} ForEach SPlayers Public Variable "SPlayerCount" Exit ;This bit will get the players for each client #SkipServer ;Wait until the server has finished @(SPlayerCount!=0) _Index=1 #Loop SPlayers=SPlayers+[Call {Format["MYPLAYER%1",_Index]}] _Index=_Index+1 If (_Index<=SPlayerCount) Then {goto "Loop"} This should give you a global array SPlayers on all the clients and the server? Curious to see if it would, perhaps someone in the know could confirm this?
  7. The easiest way to browse the content of an Addon is with OFP Manager: OFP Manager
  8. Sgt_Wilson

    Knowsabout scrolling

    This might be helpfull http://www.ofpec.com/editors/comref.php?letter=K#knowsAbout
  9. Sgt_Wilson

    Anims time

    Try <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">man playmove "FXDismay"
  10. Sgt_Wilson

    Naming a createdvehicle

    I tried it both ways, the way I originaly tested it. With this in the trigger: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Temp1=+(ThisList) Temp1 being a global variable, but it works the same passed to a script. This worked as expected with the dead units staying in the array indefinetly. I then tried using parameters passed to a script as you suggested. So in the trigger I had: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[ThisList] Exec "Script.sqs" And in Script.sqs I have this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Temp1=+_This Select 0 #Loop Hint Format["List %1",_Temp1] ~1 goto "Loop" After about 60 deconds the dead units start to disapear from the list, perhaps this delay is why your test appears to work? I tested this with AI men and vehicles, I can send you the test mission if you want to try it for yourself. Edit: Another thing about triggers is, even though you set it to activate once the condition is checked every ~0.5 seconds. Try adding this in the Condition field, to a trigger thats set to activate once: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Call {Hint Format ["%1",Time]; This} The probability of presence works the same for a units init field as it does with a trigger. If it does not showup in the game it will not be added to the array.
  11. Sgt_Wilson

    Naming a createdvehicle

    Hmmm <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_array=+_this select 0 Just creates a copy of the array _this which is not the cause of Gnat loosing the link to dead vehicles. Remeber _this is just a local array of parameters passed to the script. Any arrays contained within the _this (the actual info Gnat is interested in) do not get copied. In other words it still points to ThisList in the trigger. So it gets updated every time the trigger does, hence loosing the dead vehicles, because triggers will filter out dead units. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_array=+(_this select 0) Makes a copy of the content of ThisList so, when a vehicle gets destroyed he can just respawn the vehicle back into its original position in the array. I would say, dont use a trigger just to get a list of vehicles at the start of a mission, its overkill no matter how you look at it.
  12. Sgt_Wilson

    Naming a createdvehicle

    I think you need to change the script slightly, from: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_array=+_this select 0 To: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_array=+(_this select 0) Or change the trigger to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[+thislist] exec "namethem.sqs" But if you just want to add vehicles from the start you could add this to your init.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">VehiclesArray=[] And in the init field of each vehicle put this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">VehiclesArray=VehiclesArray+[This]
  13. Sgt_Wilson

    Opening a double gate?

    Dont know, unless for some reason OFP cant play two anims at the same time. If not sounds like something else is screwed.
  14. Sgt_Wilson

    Opening a double gate?

    You can use a semicolon to seperate the commands for your statement, and And for your condition: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class Opengates { displayName="Open Gates"; position="pos_gate"; radius=2.000000; condition="(this animationPhase ""ani_gate1"" < 0.5) And (this animationPhase ""ani_gate2"" < 0.5)"; statement="this animate [""ani_gate1"", 1] Â ; this animate [""ani_gate2"", 1]"; };
  15. Sgt_Wilson

    Delay between useraction?

    Yes it is a bit long winded, but once its done it can use for just about anything. I forgot to update this bit: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If !(Format["%1",AddonArray]=="scalar bool array string 0xfcffffef") Then Using Format on an array can be a bit dodgy, if it gets to big and you try and format it, it can cause a CTD. I did mean to change it so it checks a boolean instead. If you did not notice, you can get rid of this bit: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _REGISTER_ADDON={(Format["%1",_AddonArray]=="scalar bool array string 0xfcffffef")};But glad it does the job
×