Jump to content

mr.peanut

Member
  • Content Count

    334
  • Joined

  • Last visited

  • Medals

Everything posted by mr.peanut

  1. Is there any way to hook the map objects that have no exposed class(trees for example), without using their ID? I need to be able to hook all objects near a unit without knowing their ID. It seems that this is not possible, which I find mind boggling.
  2. <s>In OFP publicVariable was notorious for failing when used without a small pause, perhaps because there is so much data transfer right at mission start(not an issue when used after mission has started). A small pause would guarantee that the PV command not run until mission starts. I had this exact problem with my own OFP MP weather script. Maybe this is not the case for ArmA, but better safe than sorry?</s> Edit: idiot me did not notice all was in a loop!
  3. Best way to do this is to write a bullet deviation script. You use a "FIRED" eventhandler to catch the bullet and then slightly modify its velocity. Â Download the High Dispersion for RPG/LAW/AT script in the ofpec Ed Depot scripts sectionhere and try modifying it. The old JAM addon for OFP also had high dispersion (HD) ammo. You could always unpbo the addon to see how they did it.
  4. mr.peanut

    Map objects unclassed

    I am talking about getting all objects(classed and unclassed) within a radius at any location. A new command is needed, one that grabs all streamed unclassed map objects within a radius of a position. Surely this must be possible.
  5. mr.peanut

    Built in effects

    Use the unpbo tool on the addon, then you can look at the scripts to see what commands were used.
  6. You better put a pause before those publicVariable commands...
  7. mr.peanut

    Hiring Soldiers

    That should not happen if the code is in a radio trigger, because AFAIK the trigger should only fire on the machine of the player who activated it.
  8. Has anyone used worldToModel successfully? It keeps giving me [0,0,0] for everything. Edit: actually it keeps giving me back the horizontal coords as [0,0] the vertical seems okay.
  9. mr.peanut

    worldToModel

    What I am getting is a position well outside the bounding box is still returning [0,0] as the horizontal coord. If you have a working example please post it. Edit: never mind just did simple test in editor. I must have screwed something else up. Thanks.
  10. I think what kyle really meant to put was: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_Y = _X;{_X distance _Y < 100} count (units GroupB) > 0} count (units GroupA) > 0 which was similar to the snippet I wrote and then scratched out because mine was wrong. You would use this line as your condition in an if statement or trigger etc.: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if ({_Y = _X;{_X distance _Y < 100} count (units GroupB) > 0} count (units GroupA) > 0) then {hint "We are screwed!"};
  11. The nearestObjects command and its variants do not return all "STATIC" objects on the map. In particular they do not return trees nor do they return walls. They return some pieces of fence but not others. Why is this and is there a work-around?
  12. mr.peanut

    Map objects

    Not very useful since you would have to specifiy in advance the map object.
  13. You can't add event handlers to the default map objetcs.
  14. MandoAir at www.ofpec.com
  15. mr.peanut

    Parameters

    People who need more than two params sometimes use a param to list combinations of options. Clunky but it works. e.g.Skill level/Day_Night Low/Day Low/Night High/Day High/Night etc.
  16. mr.peanut

    Game Crashing

    Are you certain enem1 is the name of your trigger? Perhaps using that command on a non-trigger causes the crash?
  17. code snippet deleted due to error
  18. Try reading up on event handlers. The "HIT" event handler fires whenever a unit is hit, although for vehicles the hit must cause a minimum amount of damage to register.
  19. Group the trigger with the unit.
  20. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_max = _box select 1 _max = _building modelToWorld _max _bdheight = _max select 2
  21. mr.peanut

    Spawn Height

    Yep, I am scuttled on this one. What I wanted was given an X,Y position to state whether or not a building occupied that position. I was hoping that there was some way to spawn a GL such that it would automatically end up on top of a building, similar to how units in the editor do. Now I know I have to use nearObjects, boundingBox, modelToWorld and a point inside polygon function. This is not hard, but the other way would have been simpler and more efficient. Nothing sucks resources more than rescripting what the engine already does, but is not exposed. Implementing this second method, has shown me that many native objects on a map, namely stone walls, trees, certain fences, and car wrecks, are not returned by nearObjects or its variants. O why o why?
  22. When a unit is placed in the editor on a building, it ends up on top. Is the same true for a game logic? If it is, is there anyway to get the same behaviour when using createVehicle? I want to spawn a game logic at any location but for it to end up on top of a building.
  23. Hmmm... Have to recant somewhat on my previous post. If trigger is to be stationary then: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">({damage _x < 1} count (position player nearObjects ["Tank",100])) > 0 should work.
  24. With AI units, the only way I can think of is the old fashioned method of passing the units names into a script via strings. Unit's name is p1 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nul = ["p1"] execVM "rearm.sqf" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = compile _this select 0; if (local call _unit) then { while {TRUE} do { waitUntil (not alive (call _unit)); sleep 1; waitUntil (alive (call _unit)); (call _unit) addWeapons. your weapons here; }; }; At least, this is how the problem was overcome in OFP. Not sure if it will work in ArmA.
  25. mr.peanut

    All about SCUD

    I found dutchboy's scud script here.
×