Jump to content

Disable saving


Salk

Recommended Posts

Hello!

New question: I would like to temporarily disable saving during the execution of a script and restore it at the end of it, if the area allows for saving the game in the first place of course.

I think AddAreaFlags(I:Type*AREAFLAG) and RemoveAreaFlags(I:Type*AREAFLAG) can do the job but the problem is: how do I check that the area itself allows for saving the game to begin with? AreaType() uses values from areatype.ids but I need values from areaflag.ids.

Any ideas?

Link to comment

Hello!

 

New question: I would like to temporarily disable saving during the execution of a script and restore it at the end of it, if the area allows for saving the game in the first place of course.

 

I think AddAreaFlags(I:Type*AREAFLAG) and RemoveAreaFlags(I:Type*AREAFLAG) can do the job but the problem is: how do I check that the area itself allows for saving the game to begin with? AreaType() uses values from areatype.ids but I need values from areaflag.ids.

 

Any ideas?

Sorry, not really an idea, just a confirmation of what you found. I have attempted similar things like changing resting flag or dead magic zone. While I managed the first, I found no solution for the second.

You may get some ideas from the BG2 thieves stronghold areas and some dead magic zones in the new areas added by EE/SoD. The second example may not work on the classic game anyway.

A workaround - given that your AreaFlag code works - may be that you create a list of those non-saving areas and put that into the trigger. There are not many in the game, the random encounter areas and another handful. This is the way that many mods e.g. check for resting at an inn, just by having a list of OR(Y) AreaCheck("xxxxxx")...not elegant but effective.

Link to comment

But why would you want to ? A script only takes a 1/15th of a second to actually complete, unless you have actions that delay that. Characters actions like, move to a point etc. that the player is not assumed to mess with by saving in the middle of.

Link to comment

Roxanne,

 

I get the workaround... I was hoping for a more direct solution but thanks for your input.

 

Imp,

 

I need it for one of my modifications. I don't want the Player to save during the level up process of summoned familiars. Depending on the player level it can take quite some time.

Edited by Salk
Link to comment
I need it for one of my modifications. I don't want the Player to save during the level up process of summoned familiars. Depending on the player level it can take quite some time.

Understood, kinda... but that might become somewhat interruptive(sp?), maybe that could be done in a dialog the player starts !?! Or not. Just throwing the idea here. To see if it sticks on the wall.

Aka when the player mage that has a familiar, levels up... nothing happens to the familiar, until the player shouts out to the little demon we all know he has, and offers his soul to it, the imp says he doesn't want it, but takes the two bits of sugar the player has in his pouch and the troll fingers and gains the ability to cast a first level fireballs, like he didn't have it in the first place(the dialog sets a global, which the .cre's script then "levels up" the .cre, gains abilities, and sets global further etc. In case I didn't make it clear, the dialog becomes available via a check of the player chars level, and the absence of the global).

Link to comment

Afaik, you can't save the game while an AoE projectile is active (e.g. a cloud spell). You could cast a dummy spell with an invisible AoE projectile to avoid saving, and remove it with opcode 273 (Zone of Sweet Air) after the scripted scene finished (or use a fixed duration for the AoE projectile). I think it's possible to use a custom 2DA for opcode 273 where you can add the dummy spell resref (so that other potentially active AoE spells are not affected).

Link to comment

Afaik, you can't save the game while an AoE projectile is active (e.g. a cloud spell). You could cast a dummy spell with an invisible AoE projectile to avoid saving, and remove it with opcode 273 (Zone of Sweet Air) after the scripted scene finished (or use a fixed duration for the AoE projectile). I think it's possible to use a custom 2DA for opcode 273 where you can add the dummy spell resref (so that other potentially active AoE spells are not affected).

But you break the game if the .cre that's controlling the spell get's killed or similar thing.

Imagine the Sarevok fight, in which there's several hard enemies, the player kills a few of them, the player levels up, Sarevok being the last to stand, he then scares the familiar with fear spell, the familiars spell gets casted, it leaves the area via the exit that the player can't use and the player is stuck.

PS, similar to this happened to several players with SCSI with the exit(I trust you to be familiar with the case).

 

Now, I am not saying that you have to do what ever you want the way I would... but to take these things into consideration when making them.

Edited by Jarno Mikkola
Link to comment

Well, there is already a check that does not allow for the level up process to take place if there are enemies around.

 

I have been using NI's function to check for what areas do not allow for saving and in BGT it seems it's just 19 so I followed Roxanne's advice and did that.

Edited by Salk
Link to comment

Try wrapping it into ~SetInterrupt(FALSE) /* ... */ SetInterrupt(TRUE)~. I don't remember if it works on actors only or from area/global scripts as well, but uninterruptible actions prevent saving until they're complete.

Edited by Ardanis
Link to comment

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...