ZNorQ 0 Posted August 16, 2007 I've used the 'object' function in more than one occasions in Flashpoint, but according to the BIS'es wiki, 'object' doesn't work in ArmA. Anyway, do anyone know what to use instead of 'object'? ZNorQ PS! Is this a bug, or is it left out intentionally? Share this post Link to post Share on other sites
suma 8 Posted August 17, 2007 This is described on the very same Wiki: http://community.bistudio.com/wiki/object Quote[/b] ]DOES NOT WORK IN ARMED ASSAULT, use nearestObject id instead. Share this post Link to post Share on other sites
ZNorQ 0 Posted August 17, 2007 This is described on the very same Wiki:http://community.bistudio.com/wiki/object Quote[/b] ]DOES NOT WORK IN ARMED ASSAULT, use nearestObject id instead. I know about that, just that I found it abit strange to use this function to refer to an object. Wasn't really sure how to use it. It seems to me though, that I can put [0,0,0] as a standard parameter, like this; _myhouse = [0,0,0] nearestObject 124264 Would it be wise to use a position close to the object, or doesn't it matter? ZNorQ Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted August 17, 2007 Use a position close to the object. The game checks against every object in order of distance until it finds what it's looking for. If you're just wanting to do something with one of a few tightly grouped objects, place a marker right on top of it. If you're needing to do several things around a town with it, you can get away with placing a marker in the center of the town to handle it. Share this post Link to post Share on other sites
ZNorQ 0 Posted August 17, 2007 Use a position close to the object. The game checks against every object in order of distance until it finds what it's looking for. If you're just wanting to do something with one of a few tightly grouped objects, place a marker right on top of it. If you're needing to do several things around a town with it, you can get away with placing a marker in the center of the town to handle it. Ok. But, I'm propably going to access the object(s) several times, so I'm going to give reference to them via variables;<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">myhouse1 = getMarkerPos "mrk_myhouse1" nearestObject 124264; Or something like that. Now, I'm trying to keep my map as clean as possible, and extra markers in an already cluttered map is something I try to avoid. To make it easy, would there be any big performance impact doing it this in the 'init.sqf'; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">myhouse1 = [0,0,0] nearestObject 124264; When I'm using myhouse1, would there still be "search operations" to find the object, or is it now stored in that variable? ZNorQ PS! I know I could find the actual position and hard-code it into the script, but that could end up in tideous work.. Dang, I miss 'object'. Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted August 17, 2007 I would think that would make the load time dramatically increase. However, if the map is cluttered as you say, surely there are objects scattered around already that you could just name and use? In all likely hood, you've already got the stuff named? Share this post Link to post Share on other sites
ZNorQ 0 Posted August 18, 2007 I would think that would make the load time dramatically increase. Ok. However, if the map is cluttered as you say, surely there are objects scattered around already that you could just name and use? Well, one way is to put in the actual coordinations by hardcoding it into the script; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[12297, 6956, 0] nearestObject 535500 ... I'll just do that, if it's quicker. It's going to be used in a 27 MP COOP game, so I'd want to try to keep the CPU load as low as possible, I guess.. Thanks for your feedback, Colonel. ZNorQ Share this post Link to post Share on other sites