OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: NightJay0044 on 22 Jan 2009, 05:42:50

Title: attachObject
Post by: NightJay0044 on 22 Jan 2009, 05:42:50
Hi all, with the use of the attachobject command, it says attatches a location to a specified object.

What does this mean. When I think of location I'm thinking of a place on the island or something, but are they talking about a variable or something?

If that's the case, how is this command used in the game and such? thanks all.
Title: Re: attachObject
Post by: h- on 22 Jan 2009, 09:45:41
There seems to be a slip-up in the ComRef, attachObject is ArmA-only function..
Title: Re: attachObject
Post by: Worldeater on 22 Jan 2009, 12:52:11
Nonetheless, the question is quite interesting (and so would be possible answers). Would you mind moving this thread to the corresponding ArmA section? TIA!


And while we're at it:

- What are locations (http://community.bistudio.com/wiki/Location) good for? Which problem are they meant to solve? Or are they simply another form of local markers with metadata?
- Why do they have an importance (http://community.bistudio.com/wiki/importance) and what might it be used for?
- Is anyone aware of a mission that makes use of locations so far?
- Wouldn't it be possible to create map-independent missions by using locations to find villages, towns, cities and other interesting places (e.g. to position camps and depots in Warfare dynamically)?





Title: Re: attachObject
Post by: Planck on 22 Jan 2009, 15:38:33
Locations are the things you see on the game map, like, town names, viewpoints, village names, place names, etc etc.

See command createLocation (http://ofpec.com/COMREF/index.php?action=details&id=853) for more detail.


Planck
Title: Re: attachObject
Post by: NightJay0044 on 22 Jan 2009, 16:11:28
Thank you guys, that helped for me to undersand what a location is regarding the attachobject command. yes can someone please move this to the ArmA place. I didn't realize it was only for ArmA, which I don't have and can't use it   :(....ah that's alright. Better that I learned what it was though.. :)...

Hey quick question though, when you use the;

[classname, position, sizeX, SizeY] array

In the position part, is that the exact position on the map they are talking about, because it has a bunch of numbers? Or can it be a MAP ID or something else, i'm not clear on the numbers? Thank you. And then would you use this code in some kind of script or would you use it in a command line in the mission editor?  Looks like an external code..
Title: Re: attachObject
Post by: Worldeater on 22 Jan 2009, 16:29:05
Yes, the array indicates the position on the map (using three coordinates: longitude, latitude and height). And no, you can't use an ID here.

The code on the createLocation site can be used in both, script and editor (except for the local variable which the editor will complain about).

Uhm, what do you mean by "external code"?
Title: Re: attachObject
Post by: NightJay0044 on 22 Jan 2009, 16:39:24
 :),w hat I mean by "external code" or "external scripting" is the use of commands and codes outside the game and editor..An .sqs file basically   
Title: Re: attachObject
Post by: Worldeater on 22 Jan 2009, 16:58:40
Doh! Got it! :D
Title: Re: attachObject
Post by: Spooner on 22 Jan 2009, 18:37:22
SPON HoloMap (http://www.ofpec.com/forum/index.php?topic=32658.msg224782#msg224782) uses the location and sizes of villages, cities and capitals in order to show grey circles on the rendered 3D map where those urban areas are. You can see it clearly on the big screenshot of Sahrani (quadrants.jpg).

Also findClosestTown (http://www.ofpec.com/forum/index.php?topic=29743.0) and, I think, GNV Civilans (http://www.ofpec.com/forum/index.php?topic=32383.0) use locations.
Title: Re: attachObject
Post by: Worldeater on 22 Jan 2009, 19:57:50
Nice, thanks Spooner! I'll have a look at them. Meanwhile I found out about the...

Quote from: http://community.bistudio.com/wiki/Map_Symbols
importance - decides, which icon is drawn when there are several overlapping icons in one place