Assigning a EnterRegion event to multiple regions [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Assigning a EnterRegion event to multiple regions [Solved]

Post by GAB »

I'd like to know if it is possible to assign a EnterRegion event to more than one region?

I have already tried the below:

Code: Select all

OnEnterRegion(
    function(region, character)
        <callbacks n' stuff>
    end,
"region1","region2","region3","region4
)
With the code above, the event only happens when I enter on region1, and I'd like it to happen whenever the player enters in one of the specified regions (region1 through region4).

Also, before anyone suggests creating multiple events applying each one to each region, I spent quite some time working on a script that, depending on which region is entered, cause some events to happen on a location. Since these events are all very similar, I'd like to keep them all in one place.
Last edited by GAB on Wed Jan 02, 2013 7:42 pm, edited 2 times in total.
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: Assingning a EnterRegion event to multiple regions

Post by CressAlbane »

You could create your own LUA function, then call it from different events.
User avatar
GAB
1st Lieutenant
1st Lieutenant
Posts: 431
Joined: Sun Jul 03, 2011 8:56 pm
Location: Somewhere around the world
Contact:

Re: Assingning a EnterRegion event to multiple regions

Post by GAB »

Humm... good idea. And that would allow me to keep the important stuff in one place. I'll test it out.

EDIT:

All right. It worked nicely and neatly. Thanks Cress.
Post Reply