Crash without a trace [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
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 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: Crifton
Contact:

Crash without a trace [Solved]

Post by Tourny »

I'm trying to make a controlled teleport (whether or not somebody already is doesn't matter much to me). The system is basically you enter the region of a panel and it will activate the appropriate teleport region. Before I could get it to turn on, but not off, and there were too many errors so I started over. Now whenever I enter the region, it crashes. When I look in the error log, it makes no reference to the crash and doesn't really acknowledge that anything happened out of the ordinary. The PC_Mungelog also does not report any errors.

Here is my function:

Code: Select all

OnEnterRegion(
   function(region,character)
      if GetEntityName(region) == ("tombcastle_panel") then
         ActivateRegion("tombcastle")
      end
   end,
"tombcastle_panel"
)
The "ActivateRegion" command for the region is up higher in the PostLoad section.

I also have a question that would help eliminate the panel region entirely:

If I use OnObjectKill for the panel, and that activates the teleport region,

then I have a region at the other end that turns off the region and puts the panel back,

If I use OnLeaveRegion> RespawnObject, will that make the panel come back to life?

EDIT: I put the function in code format so it represented the tabs correctly.


EDIT2
(Sorry about double post)

Ok, so I got it to not crash, but the teleport region doesn't turn on.

Code: Select all

Message Severity: 3
.\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #2 to `OnEnterRegion' (string expected, got no value)
stack traceback:
	[C]: in function `OnEnterRegion'
	(none): in function `ScriptPostLoad'
IS the error.

Code: Select all

ActivateRegion("tombcastle_panel")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"tombcastle_node")
end,
"tombcastle"
)

OnEnterRegion(
   function(region,character)
      if GetEntityName(region) == ("tombcastle_panel") then
         ActivateRegion("tombcastle")
      end
   end
)

end
Is my script.
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Crash without a trace

Post by Fiodis »

Try going the OnObjectDamage way you described above. I can't think of anything wrong with your script offhand, except that maybe

Code: Select all

      if GetEntityName(region) == ("tombcastle_panel")
should be

Code: Select all

      if GetEntityName(region) == "tombcastle_panel"
(No parentheses around "tombcastle_panel")

Just a hunch, though.
User avatar
Tourny
Command Sergeant Major
Command Sergeant Major
Posts: 289
Joined: Sat Sep 27, 2008 5:58 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: Crifton
Contact:

Re: Crash without a trace

Post by Tourny »

Hmm....

EDIT: I got it to work. Thanks guys.
Post Reply