Jump to content


LeaveAreaLUA() and possible side effects?


5 replies to this topic

#1 argent77

  • Members
  • 232 posts
  • Gender:Male

Posted 02 February 2012 - 02:15 PM

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.

Edited by argent77, 02 February 2012 - 02:16 PM.


#2 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 02 February 2012 - 05:21 PM

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?
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#3 devSin

  • Fixpackers
  • 3017 posts
  • Gender:Male

Posted 02 February 2012 - 07:22 PM

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.

Edited by devSin, 02 February 2012 - 07:25 PM.


#4 argent77

  • Members
  • 232 posts
  • Gender:Male

Posted 03 February 2012 - 02:26 AM

View PostMiloch, on 02 February 2012 - 05:21 PM, said:

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.


View PostdevSin, on 02 February 2012 - 07:22 PM, said:

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.

Edited by argent77, 03 February 2012 - 02:33 AM.


#5 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 03 February 2012 - 02:32 AM

View Postargent77, on 03 February 2012 - 02:26 AM, said:

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).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#6 argent77

  • Members
  • 232 posts
  • Gender:Male

Posted 03 February 2012 - 02:44 AM

View PostMiloch, on 03 February 2012 - 02:32 AM, said:

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.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users