Axo
Member-
Content Count
12 -
Joined
-
Last visited
Never -
Medals
Community Reputation
0 NeutralAbout Axo
-
Rank
Private First Class
-
The camera way does consider attitude, but unfortunately you can´t get rid of the object with camdestroy... In one of my early posts I tryed the vector method unsuccessfully, but today I made it work (it was a brackets thing):</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _vm = velocity _Obj _vx= _vm select 0 _vy= _vm select 1 _vz= _vm select 2 _vmod = sqrt( _vx^2+ _vx^2+ _vx^2) _pm = position _Obj _px= (_pm select 0) + ((_vx*20)/_vmod) _py= (_pm select 1) + ((_vy*20)/_vmod) _pz= (_pm select 2) + ((_vz*20)/_vmod) #_px, _py, _pz : point 20 mts ahead of _Obj <span id='postcolor'> Thanks for the tips!!
-
I´m trying to add an eventhandler "fired" to a weapon in the cpp. Just doing so doesn´t work. I know how to add it to the vehicle class of the soldier, but that doesn´t work if the weapon is picked-up from the field... Can be done? workarounds?
-
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (InqWiper @ Jan. 31 2003,15:57)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Any idea of how to get a point ahead (20 mts) of a flying object (it must be in 3D) <span id='postcolor'> Kam="camera" camcreate getpos [0,0,0] Kam camsettarget Chopper Kam camsettrelpos [0,20,0] Kam camcommit 0 Pos=getpos Kam I think that should work.<span id='postcolor'> But then I´ll have an object in that position, and I won´t be able to use nearestobject there, right? the camera object dissapears if I do a camdestroy?
-
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (InqWiper @ Jan. 31 2003,15:54)</td></tr><tr><td id="QUOTE">To me it doesnt seem like nearestobject would be a good way to catch all vehicles in a list or something because then you would have to check nearestobject from every centimeter of the map, atleast it seems like it to me. I dont have any good idea how to do this, it would be nice if you could just camcreate a trigger  <span id='postcolor'> I´d be very nice to dynamically add triggers.... Suma...
-
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Spitfire @ Jan. 31 2003,15:32)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (InqWiper @ Jan. 31 2003,18:58)</td></tr><tr><td id="QUOTE">I would like to know this also, it would make it much easier to track bullets with a camera if you dont have to check for the bulletnames.<span id='postcolor'> NearestObject will catch the nearest object of ANY type when you leave out the "". That is, </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = nearestObject [getpos player];<span id='postcolor'> works OK. The problem is, that the nearest ANY object from the player is always the player itself. To catch any object in front of the player, you must not specify the point of reference to be the player itself, but some point a bit ahead of the player. Something like this: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_obj = nearestObject [((getpos player select 0) + 3*(sin getDir player)), ((getpos player select 1) + 3*(cos getdir player)), getpos player select 2];<span id='postcolor'> The previous will check the nearest object from a point which is 3m ahead of the player, regardless the heading of the player. If the player is the closest object to that spot, the _obj will point to the player. Therefore you have to check if the _obj is of class "Man" or something else. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">?("Man" countType [_obj] == 0) : hint "_obj is not the player";<span id='postcolor'> Unfortunately, a bullet doesn't seem to belong in any "type" that you can define in countType. If it did, it would be easy to catch a fired bullet. So far the only solution would be to use all the appropriate bullet names in nearestObject itself.<span id='postcolor'> Any idea of how to get a point ahead (20 mts) of a flying object (it must be in 3D) I´ve tryed this... </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _vm = velocity _Obj _vx= _vm select 0 _vy= _vm select 1 _vz= _vm select 2 _vmod = sqrt( _vx^2+ _vx^2+ _vx^2) _pm = position _Obj _px= _pm select 0 + (_vx*20/_vmod) _py= _pm select 1 + (_vy*20/_vmod) _pz= _pm select 2 + (_vz*20/_vmod) <span id='postcolor'> for some reason this doesn´t works...It gives me an error of "divide by zero" even when i´m sure the object is moving!
-
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (InqWiper @ Jan. 31 2003,15:22)</td></tr><tr><td id="QUOTE"></span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Is there a way to know all the vehicles object currently in a map (w/o triggers cause is for an addon script)???<span id='postcolor'> Er....I really did not understand the question 100%  <span id='postcolor'> Any way of building an array of all the vehicles in a mission dynamicaly from a script (not by hand) This script it´s going to be inside an addon, so it´s no way to know what vehicles will be using the mission. I´ll need the vehicles list to ask for nearestobject[_Obj,"vehicle"] for each one.
-
Is there a way to know all the vehicles object currently in a map (w/o triggers cause is for an addon script)???
-
You can add an eventhandler "Fired" to exec a script (the event passes the name of the weapon fired as a parameter) Search the forum for details.
-
What is the name of that camcreat
Axo replied to nam_viet's topic in OFP : MISSION EDITING & SCRIPTING
Pipebombs works, and explode instantly w/o contact with the ground -
</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (RED @ Jan. 31 2003,07:11)</td></tr><tr><td id="QUOTE">That should work if you have initialised the variable _Obj with an object name. Bear in mind that the nearestobject command will only work for a certain distance. RED<span id='postcolor'> Of course _Obj must be initialised. It doesn´t, the first sample returns object _Obj and the second never returns anything...:(
-
I´m trying to get the closest object (of any kind) to an object but I can´t figure how... I´ve tryed: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Near = nearestobject [_Obj,""]<span id='postcolor'> And </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Near = nearestobject [_Obj,"All"]<span id='postcolor'> etc... If can be done with vehicles, works for me Another option is to repeat the line for every vehicle... PD: Is there a way to know all the vehicles object currently in a map (w/o triggers)
-
Question : Does this server take real advantage of SMP boxes ??