How to use the OnEnterRegion function (FAQ)

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
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: How to use the OnEnterRegion function

Post by Maveritchell »

Code: Select all

ActivateRegion("regionname")
testfunction = OnEnterRegion(
	function(region, player)
		if [whatever callbacks you want] then
			whatvever you want to happen
		end
	end,
"regionname"
)
User avatar
Eagle Eye
First Lance Corporal
First Lance Corporal
Posts: 129
Joined: Thu Nov 01, 2007 12:44 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Belgium
Contact:

Re: How to use the OnEnterRegion function

Post by Eagle Eye »

thanks!
correctmushroom2013
Second Lance Corporal
Second Lance Corporal
Posts: 102
Joined: Fri Jul 19, 2013 11:10 am
Projects :: Droid Factory Conquest
Games I'm Playing :: SWBF2 BDO
xbox live or psn: No gamertag set
Location: Russian Federation

Re: How to use the OnEnterRegion function (FAQ)

Post by correctmushroom2013 »

Updated!
More correctly and working of code version))

Code: Select all

ActivateRegion("NameReg")
NameReg = OnEnterRegion( 
    function(region, player) 
      if IsCharacterHuman(player) then 
        PlayAnimation("AnimName") 
		DeactivateRegion("NameReg")	
      end 
   end, 
 "NameReg" 
)
NameReg - name of your region
AnimName - name of your animation group
:wink:
Post Reply