Jump to content

Limitations of CopyGroundPilesTo() action


Recommended Posts

Posted

Does action CopyGroundPilesTo() has any limitations regarding on what areas it can work? I try it in Ulcaster Dungeon and it doesn't work when I try to copy ground piles to Nashkel Temple e.g.

C:Eval('CopyGroundPilesTo("AR4802",[353.334])')

However it does work when try to copy it within same area:

C:Eval('CopyGroundPilesTo("AR3901",[455.272])')

Also, coping ground piles into this are doesn't work.

 

Do you know about any issues regarding reliability of this action?

Posted

Perhaps it doesn't want to do it if you target non-walkable terrain — did you check that?

Posted

Yes, target was walkable and I was able to copy to this exact point piles form different location.

I tried once again few test cases and this problem seems to be not 100% predictable. I need to run few more tests on clean installation.

 

It could be that it is not problem with "CopyGroundPilesTo()" itself, but with the way how I test (beginner here).

E.g. when is set "Player1 can die" flag on area AR3901, then start new game, travel to AR3901 with:

C:Eval('ActionOverride(Player1, LeaveAreaLUA("AR3901","",[455.272], N))')

and kill my character with CTRL+Y, then camera goes back to Candlekeep and I still get game over screen.

Can it be that "LeaveAreaLUA" leaves something behind? Maybe new area is not properly loaded in such case?

Posted

Yes, yes. I mentioned this other case because I don't trust this LeaveLocationLUA, it produces strange results. Anyway, sorry for confusion.

I'm testing it using console Eval function, like in example in first post. I'm traveling between locations using LeaveLocationLUA as I showed in previous post. Let me test some more and get back to you with proper steps to reproduce.

Posted
1 hour ago, marchitek said:

E.g. when is set "Player1 can die" flag on area AR3901, then start new game, travel to AR3901 with:

C:Eval('ActionOverride(Player1, LeaveAreaLUA("AR3901","",[455.272], N))')

and kill my character with CTRL+Y, then camera goes back to Candlekeep and I still get game over screen.

Try jumping to the "master/parent" area (e.g. AR3900) first, and then to the "interior/child" area (e.g. AR3901).  A beer says the camera will work as expected.

Posted
On 3/8/2022 at 10:14 PM, lynx said:

I suggest you test with actual scripts, since that's what a mod would use.

True. I noticed this issue testing on actual script. Then I turn into testing with console to isolate problem. After tests on clean installation with console problem seems to not exist. So this is something wrong with how I use it. I'm running this action from `baldur.bcs`. Here is the code:

IF
	StateCheck(Player1,STATE_REALLY_DEAD)
THEN
	RESPONSE #100
		ClearAllActions()
		StartCutSceneMode()
		SmallWait(15)
		ApplySpell(Player1,CLERIC_RAISE_DEAD)  // SPPR504.SPL (Raise Dead)
		SmallWait(5)
		CopyGroundPilesTo("AR4802",[353.334])  // Temple of Helm (Nalin)
		DestroyGroundPiles()
		SmallWait(5)
		ActionOverride(Player1,LeaveAreaLUA("AR4802","",[473.395],NE))  // Temple of Helm (Nalin)
		SmallWait(5)
		ApplySpell(Player1,CLERIC_HEAL)  // SPPR607.SPL (Heal)
		SmallWait(15)
		EndCutSceneMode()
END

I have "Player1 can die" flag set on all locations.

Test case:

  • start new game
  • drop quarterstaff
  • C:Eval('ActionOverride(Player1, LeaveAreaLUA("AR3901","",[455.272], N))')
  • kill protagonist with Ctrl+Y

Expected:

  • protagonist will be at AR4802 [473.395] with full health
  • all ground piles from AR3901 are copied to AR4802 [353.334] (AR3901 is Ulcaster dungeon, there are some ground piles there by default)

Result:

  • protagonist is at AR4802 [473.395] with full health but at [353.334] there is quarterstaff
  • sometimes: camera shows Candlekeep and then game crash occurs

 

On 3/8/2022 at 10:34 PM, Sam. said:

Try jumping to the "master/parent" area (e.g. AR3900) first, and then to the "interior/child" area (e.g. AR3901).  A beer says the camera will work as expected.

Wow, this in fact change something. Now camera goes back to AR3900, not Candlekeep. What is this mechanic? How engine detects those "master" areas?

I think this could be root cause of my problem. I tested a bit and it seems that when character is dead on "interior" area, ground piles are copied from last visited "master" area. My guess on character dead game somehow switch context to last visited "master" area. I guess this is also the reason for this sporadic game crash  (when context is switched before resurrection occurs, games crashes because there is no character on "master" area to resurrect).

Posted

Master areas are those in mastarea.2da.

I would only be testing with real piles, the ones in Ulcaster dungeon may be normal containers.

Posted
7 hours ago, lynx said:

Master areas are those in mastarea.2da.

Thanks! I found here some more info from CamDawg:

Quote

Generally any large area is a master area, and all of the homes/caves/etc. inside of it are not.

Say you're in the Docks in BG2, ar0300, which is a master area. Wherever you visit in the Docks--Sea's Bounty, Thieves Guild, Harper HQ, etc.--the Docks area script is always running, and will keep running until you visit a new master area. There are some other factors--IIRC master areas also force auto-saves when leaving and determine current weather--but the area script is the big one for modders. You may also need it to be a master area to work on the Worldmap, but on that I'm not so sure.

So it seems protagonist death cause change of active area to master area and if this happens, CopyGroundPilesTo() acts only on piles there. This seems to be asynchronous from normal script processing. I've done one more test, I moved script block, that I pasted above, into "AR3901.bcs". Then sometimes it works as expected (piles are copied form interior area), but sometimes camera just jump to master area and resurrection don't happen. If I try to resurrect then from console: game crash occurs. I will try to redo this as cutscene, maybe it will somehow help.

I guess bottom line could be that after all CopyGroundPilesTo() works as expected.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...