Jump to content


Photo

Disable saving


9 replies to this topic

#1 Salk

Salk
  • Modders
  • 2893 posts
  • Gender:Male
  • Location:Sweden

Posted 17 October 2017 - 01:19 AM

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?



#2 Roxanne

Roxanne

    Modder

  • Modders
  • 1618 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 17 October 2017 - 01:43 AM

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.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6249 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 17 October 2017 - 01:47 AM

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.


Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#4 Salk

Salk
  • Modders
  • 2893 posts
  • Gender:Male
  • Location:Sweden

Posted 17 October 2017 - 01:56 AM

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, 17 October 2017 - 01:56 AM.


#5 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6249 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 17 October 2017 - 02:52 AM

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


Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#6 argent77

argent77
  • Modders
  • 722 posts
  • Gender:Male

Posted 17 October 2017 - 02:55 AM

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



#7 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6249 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 17 October 2017 - 03:24 AM

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, 17 October 2017 - 03:37 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#8 Salk

Salk
  • Modders
  • 2893 posts
  • Gender:Male
  • Location:Sweden

Posted 17 October 2017 - 04:45 AM

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, 17 October 2017 - 04:46 AM.


#9 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2556 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 19 October 2017 - 06:48 AM

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, 19 October 2017 - 06:50 AM.

"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#10 Salk

Salk
  • Modders
  • 2893 posts
  • Gender:Male
  • Location:Sweden

Posted 20 October 2017 - 01:45 PM

Hello Ardanis!

 

Nice to see you around and thanks for the suggestion.

 

The blocks are already all wrapped between SetInterrupt so perhaps that is enough.





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users