Jump to content

Photo

Some questions about scripts


25 replies to this topic

#16 jastey

jastey
  • Gibberlings
  • 7549 posts
  • Gender:Female

Posted 01 November 2018 - 11:00 AM

Maybe it's the "PartyRested()" trigger which gives only true right after the rest ends so if it's at the beginning of the baldur.bcs it gives true but if it's at the end of the script the time passed might be too long already - or something.

Keep in mind that other mods might add to the top after yours, so there might be a risk that the script block might not get executed in a mega mod install.



#17 Luke

Luke
  • Members
  • 203 posts
  • Gender:Male

Posted 01 November 2018 - 12:46 PM

Maybe it's the "PartyRested()" trigger which gives only true right after the rest ends so if it's at the beginning of the baldur.bcs it gives true but if it's at the end of the script the time passed might be too long already - or something.
Keep in mind that other mods might add to the top after yours, so there might be a risk that the script block might not get executed in a mega mod install.

What do you mean by the time passed might be too long already?

Edited by Luke, 01 November 2018 - 12:47 PM.


#18 jastey

jastey
  • Gibberlings
  • 7549 posts
  • Gender:Female

Posted 01 November 2018 - 12:50 PM

I meant the "PartyRested()" trigger only gives true if the script block is called the moment after the party rested, but not some instances later.



#19 Jarno Mikkola

Jarno Mikkola

    The Imp

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

Posted 02 November 2018 - 04:11 AM

... trigger only gives true if the script block is called the immediate moment after ...

Fixed tht for you.
So if the script has any true statement before this one and that one doesn't have a CONTINUE() in it, then the rest of the script is not "read", nor can it interact with the rest of the game. That's how the games scripts work.
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.

#20 subtledoctor

subtledoctor
  • Modders
  • 2856 posts
  • Gender:Male

Posted 02 November 2018 - 07:04 AM

What do you mean by the time passed might be too long already?


Scripts take a nonzero amount of time to process. BCS is not very efficient code, it's a bunch of IF->THEN scripting that has to run sequentially. Scripts can be triggered once per second (e.g. baldur.bcs) or triggered by external circumstances (e.g. creatures being created) etc. If a script is triggered before that last instance of it has finished processing, it can simply skip arguments at the end.

Example, code up a bunch of stat bonuses that operate by script with the CheckStat trigger. The bonuses can end up blinking in and out of existence as the game tries and fails to keep up with all the triggers. That's why nobody ever modded stat bonuses in the last 20 years.

This is why I'm constantly advising people to avoiding relying on scripts when it's possible to use spell effects instead.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#21 Jarno Mikkola

Jarno Mikkola

    The Imp

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

Posted 02 November 2018 - 08:03 AM

Scripts take a nonzero amount of time to process.

This is not true. One script can run 15 timer per second(half the frames per second infact). What's not nonzero taking is the THEN --- END process, that can very well take several rounds of effect time to complete, where the effected user of .bcs does nothing else, ever, as it's action list is occupied.

The IF part of a script does 1 thing, checks if variable x is true, from RAM... this is what your computer does all the time. That's why it's fast.

Edited by Jarno Mikkola, 02 November 2018 - 08:12 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.

#22 DavidW

DavidW
  • Gibberlings
  • 4710 posts
  • Gender:Male

Posted 02 November 2018 - 09:48 AM

No, sufficiently many IF blocks evaluated 15 times per second can slow the game to a crawl (at least on vanilla BG2) even if none of them actually fire. Avoiding that problem is a significant design constraint on SCS mage scripts, which are 10,000 to 20,000 lines long; I did fairly extensive testing on it back in the early days of SCS.

#23 subtledoctor

subtledoctor
  • Modders
  • 2856 posts
  • Gender:Male

Posted 02 November 2018 - 09:50 AM

EDIT - stated better than I could.

Edited by subtledoctor, 02 November 2018 - 09:51 AM.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#24 Jarno Mikkola

Jarno Mikkola

    The Imp

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

Posted 02 November 2018 - 01:05 PM

I did fairly extensive testing on it back in the early days of SCS.

Yeah, and how much of ram did you have by then ? In allowed usage. 16Gb's ? Cause the entire game didn't take 16 Gb's. Did you even make notes on your memory parameters etc when you tested the thing by then ? + OS, .exe etc related to memory utilization. Remember, the non-EE game ran on a Windows 95. Which is why the game files can only be 8 characters long(+3 characters in the extension). And the .bif's are copied to the cache folder if it has enought allowed space.
Now, there's no doubt that heavy script load put the non-EE game to it's knees, but that shouldn't be much of a problem today with EE, as the game can use the extended write space and all(Physical Address Extension).. this mean also that the game doesn't need biffing. If you have a 64 bit x86 processor.

@std: As your Leopard is one.


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.

#25 DavidW

DavidW
  • Gibberlings
  • 4710 posts
  • Gender:Male

Posted 02 November 2018 - 01:20 PM

Im not going to waste my time with this.

#26 Luke

Luke
  • Members
  • 203 posts
  • Gender:Male

Posted 10 November 2018 - 02:12 AM

No difference that I'm aware of.


So they both remove the active CRE from the GAM file, right?



Reply to this topic



  


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users