Location functions issues

ArmA 2 editing; configs, modeling, missions, textures, terrain etc.

Moderators: Lone Wolf, Snake Man

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Location functions issues

Post by T_Rex » 2009-07-21 13:33:35

When I first read on the Biki about the BIS location functions...

http://community.bistudio.com/wiki/BIS_fnc_locations

... I was excited and disappointed. Excited, because it meant that they had streamlined the ability to find locations, such as cities. But, disappointed in that it appeared my city functions were obsolete. :)

But, my attempts, so far, to get it to work have been unsuccessful.

Image

But, as I noted in that other thread, my city functions appear to work well, "out of the box."

Naturally, I'd prefer to understand the native functions, because they interact so well with the modules (such as ambient civilians).

One note about the ambient civilian stuff - one thing missing (from what I can tell) is an ambient civilian traffic module. I don't think it would be hard to create, once I understand the location logic stuff, though.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Location functions issues

Post by Snake Man » 2009-07-21 14:02:51

I have no idea about the module scripts and the BIS functions at the moment. But a quick thought was that aren't those locations just names, ie strings... hmm it says null-object in your array, so dunno how it tries to display them. I mean it clearly shows there are something, just "null" stuff hehe.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Location functions issues

Post by T_Rex » 2009-08-24 14:15:10

Heya SM-

Just wanted to let you know, I've done some more investigation on this and posted the info here:
http://www.ofpec.com/forum/index.php?topic=33978.0

Also, I can't find the thread, but I recall you talking about issues with spawning tanks and vehicles in a city. I found, and have played with, the findEmptyPosition command:
http://www.ofpec.com/COMREF/index.php?a ... 6&game=All

It is pretty nice. I've used it to place a helo and a small fortification structure. The syntax is pretty easy.

Code: Select all

_loc = _pos findEmptyPosition [20, 100, "Land_fortified_nest_small"];
Oh, and _pos was previously defined as a position array, so that's the spot where it starts looking, in case that wasn't clear. My idea for you is that you can get a city center, then define the radius of the city, then have it look for an "empty" spot for whatever vehicle you want to spawn. :) (That's kinda how I plan on using it.) ;)

One issue is that it just looks for an empty spot, so if it is used in a forest, the location may be on the side of a hill or something. But, used in a city, it'll usually find a decent place. Although, there are also now config type entries for "FlatArea", "FlatAreaCitySmall", and ""StrongpointArea" all of which have radius and position information.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Location functions issues

Post by Snake Man » 2009-08-24 15:50:37

Thanks that's good stuff. I'll look into that empty position command when have time for my campaign scripts again. Keep me updated on any developments. Thanks.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Location functions issues

Post by T_Rex » 2009-08-25 12:45:45

Ok, here's a small development. :)

This is a pic of the map with red markers on each city center that is linked to at least 3 (or more) other neighboring cities, according to the config. As you can see, there are plenty of combinations. :) Also, there are some cities that are rather close, but not considered "neighbors." I suspect this is because there are no direct roads linking them, or there is some other kind of terrain feature inhibiting movement.

http://i26.photobucket.com/albums/c114/ ... tion04.jpg

Using functions such as BIS_fnc_spawnGroup (spawns a group, including parameters for randomness), BIS_fnc_spawnVehicle (spawns a vehicle and entire crew), BIS_fnc_taskPatrol (basically a simplified UPS), and the more mundane stuff, I can pass a location and spawn groups wherever I want, and have them start moving. :)

I've done the spawnGroup/spawnVehicle combination in the cities on Utes to spawn a BMP-2, and it can be kinda tricky. I think it is a matter of playing with the settings of the findEmpty position to narrow down an appropriate spot. I'm going to transition to Chernorus to further explore it.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Location functions issues

Post by Snake Man » 2009-08-25 13:21:36

Interesting looking network on the image. Its strange to see that the elektrovwhatever city isn't connected to any others.

You said BMP placing is tricky, what do you mean... it gets often flipped by nearby houses or?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Location functions issues

Post by T_Rex » 2009-08-25 14:10:52

Well - I haven't seen it flipped, so that's good. :)

No, more like, I can click a spot that is in a crossroads (to test it, I used the onMapClick to get a position) that appears big enough for it. But, it will actually spawn around the corner behind a building. Now, this is using the BIS function to spawn the vehicle + crew, not the createVehicle spawning. Do you want me to post the addaction/script combo for you to test? (Perhaps in a different thread?)
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9354
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Re: Location functions issues

Post by Snake Man » 2009-08-25 19:02:41

Yeah dunno about the BIS functions, was thinking that maybe its some mechanized infantry create setup, where the squad leader is on the x,y spot you define, then all the rest of the units in wedge formation so to speak (like in mission editor groups). But dunno.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests