Jump to content


Photo

LeaveAreaLUA() and possible side effects?


5 replies to this topic

#1 argent77

argent77
  • Members
  • 257 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.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

 

My contributions:


#2 Miloch

Miloch

    Barbarian

  • Modders
  • 4749 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?
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#3 devSin

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

argent77
  • Members
  • 257 posts
  • Gender:Male

Posted 03 February 2012 - 02:26 AM

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.

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

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

 

My contributions:


#5 Miloch

Miloch

    Barbarian

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

Posted 03 February 2012 - 02:32 AM

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).
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett

#6 argent77

argent77
  • Members
  • 257 posts
  • Gender:Male

Posted 03 February 2012 - 02:44 AM

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.

Imagination is more important than knowledge. Knowledge is limited; imagination encircles the world. - Albert Einstein

 

My contributions:




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users