-
Content Count
334 -
Joined
-
Last visited
-
Medals
Everything posted by mr.peanut
-
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.
-
Synced weather change script
mr.peanut replied to celery's topic in ARMA - MISSION EDITING & SCRIPTING
<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! -
idea for getting AI to be bad shots. thoughts?
mr.peanut replied to revenicus's topic in ARMA - MISSION EDITING & SCRIPTING
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. -
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.
-
Use the unpbo tool on the addon, then you can look at the scripts to see what commands were used.
-
Synced weather change script
mr.peanut replied to celery's topic in ARMA - MISSION EDITING & SCRIPTING
You better put a pause before those publicVariable commands... -
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.
-
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.
-
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.
-
Select all units of a group?
mr.peanut replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
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!"}; -
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?
-
Not very useful since you would have to specifiy in advance the map object.
-
You can't add event handlers to the default map objetcs.
-
Detect whether mapclick is on a building?
mr.peanut replied to charliereddog's topic in ARMA - MISSION EDITING & SCRIPTING
MandoAir at www.ofpec.com -
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.
-
Are you certain enem1 is the name of your trigger? Perhaps using that command on a non-trigger causes the crash?
-
Select all units of a group?
mr.peanut replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
code snippet deleted due to error -
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.
-
making units ignore other enemy units?
mr.peanut replied to revenicus's topic in ARMA - MISSION EDITING & SCRIPTING
Group the trigger with the unit. -
Detect whether mapclick is on a building?
mr.peanut replied to charliereddog's topic in ARMA - MISSION EDITING & SCRIPTING
<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 -
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?
-
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.
-
Create a condition with "nearObjects" ?
mr.peanut replied to snkman's topic in ARMA - MISSION EDITING & SCRIPTING
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. -
Making your solder start with item upon respawn?
mr.peanut replied to JoeDeath's topic in ARMA - MISSION EDITING & SCRIPTING
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. -
I found dutchboy's scud script here.