OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Deadfast on 24 Jun 2009, 17:22:27

Title: Creating a custom location
Post by: Deadfast on 24 Jun 2009, 17:22:27
Hello guys,
got a little problem with creating a custom location in ARMA 2.

Code: [Select]
loc1 = createLocation ["NameLocal", getPos player, 50, 50];
loc1 setName "Testing location";
loc1 setDirection 0;
loc1 setImportance 1;
The above doesn't work (no error, but no location appears).


Thanks in advance :)
Title: Re: Creating a custom location
Post by: nominesine on 24 Jun 2009, 18:55:00
The above doesn't work (no error, but no location appears).

Just out of curiosity: How do you check if there's a locatiopn or not? I thought they were like gamelogics - invisible.
Title: Re: Creating a custom location
Post by: Deadfast on 25 Jun 2009, 00:48:57
Well, the whole point is I want them to appear on the map, which is also one of their main purposes. ;)
They do not :(
Title: Re: Creating a custom location
Post by: Wolfrug on 25 Jun 2009, 06:14:10
Have you tried using setType (http://www.ofpec.com/COMREF/index.php?action=details&id=880) to give it a "graphic" as well? Since you don't seem to specify that anywhere else in the code...note I've never scripted with locations so I don't know - just an idea!

Wolfrug out.
Title: Re: Creating a custom location
Post by: nominesine on 25 Jun 2009, 12:03:58
I also suspect that you must give them a physical/graphical shape in order to see them. That's why I asked if you were absolutely certain that they are not there, even if you can't see them. Unfortunately I don't know what command to use either. I have only som vague references from the Biki and BI Forums concerning Locations. Please share what you find.
Title: Re: Creating a custom location
Post by: Deadfast on 25 Jun 2009, 15:21:13
Tried the setType Wolf recommended, but the location still did not show on the map.

The location object itself exists though (typeName returns LOCATION).
Title: Re: Creating a custom location
Post by: nominesine on 25 Jun 2009, 15:40:43
The location object itself exists though (typeName returns LOCATION).

Quick fix: Create a marker with the desired text and setMarkerPos it at the position you getPos from the gamelogic. The marker has a physical shape that can be seen on the map.

As a sidenote, I suspect that LOCATION logics have other uses. Namely when you define areas to be avoided or selected by the functions conmtained in the ALICE and Artillery Modules that can be found in the editor (F7). But this is mere speculation on my behalf.