Jump to content

LeaveAreaLUA() and possible side effects?


argent77

Recommended Posts

Posted

I have scripted a short cutscene where my party is teleported to another map. This works very well under normal conditions, but I've noticed a strange effect when there is some battle action going on in the map where I teleport from.

 

It looks like the scripts in the previous map are still being processed while my party is already in the new area. I can follow the action in the message windows and it goes on and on until the battle is won (one way or another).

 

I'd like to stop this behaviour somehow, but I haven't found a way yet.

 

This is my teleport script, which is triggered via StartCutScene() in the baldur.bcs:

IF
True()
THEN RESPONSE #100
CutSceneId(Player1)
MoveViewObject(Player1, VERY_FAST)
SmallWait(10)
StorePartyLocations()			// save current party location
CreateVisualEffectObject("ICRMPAR2", Player1)
CreateVisualEffectObject("ICRMPAR2", Player2)
CreateVisualEffectObject("ICRMPAR2", Player3)
CreateVisualEffectObject("ICRMPAR2", Player4)
CreateVisualEffectObject("ICRMPAR2", Player5)
CreateVisualEffectObject("ICRMPAR2", Player6)
SmallWait(5)
FadeToColor([30.0], 0)
SmallWait(30)
LeaveAreaLUAPanic("ARA704", "", [2166.324], 2)
LeaveAreaLUA("ARA704", "", [2166.324], 2)
ActionOverride(Player2, LeaveAreaLUA("ARA704", "", [2183.291], 2))
ActionOverride(Player3, LeaveAreaLUA("ARA704", "", [2201.257], 2))
ActionOverride(Player4, LeaveAreaLUA("ARA704", "", [2222.214], 2))
ActionOverride(Player5, LeaveAreaLUA("ARA704", "", [2175.195], 2))
ActionOverride(Player6, LeaveAreaLUA("ARA704", "", [2276.235], 2))
MultiPlayerSync()
Wait(1)
FadeFromColor([30.0],0)
SmallWait(30)
EraseJournalEntry(@400)
AddJournalEntry(@401, QUEST)
EndCutSceneMode()
END

The new map is a wilderness map which has the area type flags ["Outdoors", "Day/Night", "Weather", "Forest" and "Can Rest"] set.

 

I have looked up the official Bioware scripts but found no clue so far. Any help is very much appreciated.

Posted

I dunno, I think I've seen this with combat too. You might want to either check there's no combat or kill it all via script. Do you need it in baldur.bcs or can't you put it in an area script or somewhere else?

Posted

The game will decide on its own what it runs.

 

Like Miloch says, try not calling it from Baldur.bcs, and make sure you run a ClearAllActions() before StartCutscene().

 

My only other suggestion would be to try making your new area a master area.

Posted

I dunno, I think I've seen this with combat too. You might want to either check there's no combat or kill it all via script.

That'll be a good work-around. I noticed the weird scripting behaviour when the Athkatlan City Guards started to help me fending some creatures off.

 

 

Like Miloch says, try not calling it from Baldur.bcs, and make sure you run a ClearAllActions() before StartCutscene().

I always call ClearAllActions() before starting a cutscene, although sometimes it doesn't clear all actions.

The teleportation is activated via a quickslot item. I'm using opcode 265 "Set Global Variable" to trigger the sequence in baldur.bcs, because the item can be used anywhere in the game. I'd prefer an option which doesn't involve the baldur.bcs, but I haven't found one yet.

Posted
I'd prefer an option which doesn't involve the baldur.bcs, but I haven't found one yet.
Have your item summon an invisible creature that runs the script then destroys itself. There are a number of items like this in the Aurora mod (gogondy, ancient timepiece, boots of the bar, etc.). That last item also does teleportation (but only if no combat is occurring).
Posted
Have your item summon an invisible creature that runs the script then destroys itself.

That's a very good idea, and it would even solve another problem I have to sort out yet.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...