DavidW
-
Posts
8,009 -
Joined
-
Last visited
Content Type
Forums
Events
Downloads
Gallery
Mods
News
Store
Posts posted by DavidW
-
-
A fairly simple way is to create a "cancel" spell available on the selection screen, that uses 171 to restore a use of the parent ability. Of course, you still lose your round's actions, and you're still SOL if you just click away rather than properly cancelling.
-
As for ADD_SPELL, it us actually not a solution for SR. SR avoids ADD_SPELL on purpose a lot of the time, because scripts in SCS expect Expeditious Retreat to be WIZARD_PROTECTION_FROM_PETRIFICATION - not a newly added WIZARD_EXPEDITIOUS_RETREAT.
This is not a good idea. For obvious reasons SCS doesn't actually make a lot of use of Protection from Petrification, but if I did script for it, you'd end up with a wizard who casts Expeditious Retreat on SR installs in exactly the situation when they'd have cast Protection from Petrification on non-SR installs, whereas the use case for those spells is completely different.
There is some (debatable) case for overwriting a spell if you want to replace it with a *thematically similar* spell: it's a quick-and-dirty way to get the AI to use it and to introduce scrolls of it. But there's no good case for doing it with thematically distinct spells. If you want to remove Protection from Petrification, use hidespl.2da to make sure the player can't see it, and edit the scroll out of the game (or overwrite it with another scroll if you're feeling lazy). Add Expeditious Retreat separately, with ADD_SPELL.
As a historical note, I think the reason SR does overwrites is less about playing nice with SCS, more about (a) solving the problem of scroll introduction without having to write complicated WEIDU code, since originally Demivrgvs was mostly writing the mod using editors and just used WEIDU as a file-install tool; (b) coping with the various ways in which (non-EE, pre-ToBeX) BG2 hardcodes a maximum number of spells.
Yeah, but the spell.ids can have both:
2108 WIZARD_PROTECTION_FROM_PETRIFICATION 2108 WIZARD_EXPEDITIOUS_RETREAT
It's not a great idea to double up in spell.ids if you can help it: various bits of the game and the mod environment assume ids files are one-to-one. (INT_OF_SYMBOL and LOOKUP_IDS_SYMBOL_OF_INT stop being reliable inverses, for instance.) But it's a particularly bad idea here, because spell.ids shouldn't lie: if I script for WIZARD_PROTECTION_FROM_PETRIFICATION, I expect to get an anti-basilisk spell, not a speed boost.
-
Installing another copy of the original game is the simplest and most reliable way, unless you’re really short of hard-drive space.
You can try that trick with the override; it won’t work on vanilla BG2 because there are baseline-game files in the override, but it might well work with BG2EE. SCS biffs some files, but only animations, so it shouldn’t matter too much.
-
The appeal is more to the general case: formalize a method to 1) create a 2da file if it doesn't already exist, with a list of some files with some characteristics; or 2) if the 2da file already exists, append the desired information to it unless the information is already there.
On a technical level: this is the SCS method for doing things like that (minus a little bit of bespoke stuff)
<<<<<<<< …/stratagems-inline/blank >>>>>>>> DEFINE_ACTION_FUNCTION log_this STR_VAR file="" input="" repeat="yes" BEGIN ACTION_IF !FILE_EXISTS ~%file%~ BEGIN COPY ~.../stratagems-inline/blank~ ~%file%~ END ACTION_IF (~%repeat%~ STRING_COMPARE_CASE ~no~) || !FILE_CONTAINS_EVALUATED ("%file%" "%input%\($\|%WNL%\|%MNL%\|%LNL\)")BEGIN APPEND_OUTER ~%file%~ ~%input%~ END END
Then do
LAF log_this STR_VAR file="override/outerplanar.mrk" input="DEMGLAB 50 77 12" repeat=no END
to store "DEMGLAB 50 77 12" in override/outerplanar.mrk if it's not there already.
But on a conceptual level: I don't really trust the mod environment I'm installing into enough to assume that I can get my data from some 2da rather than collecting it myself...
-
I didn't want to have a full cre/itm/eff/spl regexp every time the function got invoked as it would just crush install time. We (modders collectively) would be better served just creating/updating a 2da with all of the clones, that other modders could read and adjust as appropriate and run the occasional regexp copy against.
Inccidentally this is an excellent idea. I've been doing this with a few things lately - e.g. creating a table of arcane spells and the scrolls from which to learn them. It could also be useful for armor file -> armor type -> enchantment, since armor category and enchantment are not coded into .ITM files. Sky's the limit, really, and .2da files are easy to parse and involve basically zero overhead. It might be worth formalizing some drop-in code or function that modders can use to generate, or append to if pre-existing, arbitrary tables matching X files with Y characteristics...
SCS does a lot of this automatically - for any spell I set a variable WIZARD_[sPELL] equal to the .spl file, and (if it exists) a variable WIZARD_[sPELL]_SCROLL equal to the scroll file.
The code is in stratagems/sfo/general/lib_macro.tpa, and you're welcome to borrow it, but I'm not sure how cleanly it lifts out from the rest of SCS's function environment (that's the usual reason I don't proactively donate functions and macros to this thread).
-
The next "full" version of SCS completely does away with the "instantaneous spell" trick, so don't waste time systematically rewriting it. (They exist for the purposes of sequencers and triggers; I'm moving to automated building of those triggers as standalone spells using 146/148. As with most bits of my local copy, though, the changes are quite substantial and might well introduce new bugs, so I'm loath to try ripping them out and putting them into v31.)
-
Whitelisting is more efficient, I think. (At least for AP_ effects; the overhead for installing those is vastly higher than for GA_).
-
So: I absolutely agree with you, this is a problem in the SCS enforce_class function that needs fixing. I'm grateful for you catching it; I might well not have noticed it myself.
BUT I don't think your solution is optimal, and my own version does it a bit differently.
Also:
So, notwithstanding that you profess not to care about players use other mods in conjunction with SCS
I don't think I've professed any such thing. If SCS didn't care about other mods, I'd just distribute its end-product and save 95% of install time (and loads of my own time). SCS works really hard to work with whatever's already installed. What I'm less bothered by is supporting megamods where people have hundreds of not-that-carefully-chosen things installed.
-
That's fine... but bear in mind that I'm really unlikely to take anyone else's code directly into a release of SCS that I do myself. I'm much more interested in suggestions and identified problems than I am with actual code. And I wouldn't want you or anyone to feel you've done lots of work and then be disappointed that it doesn't get used.
(Of course, the current RC release of SCS isn't one I'm doing myself, so taking something into that pro tem is another matter. But my next version is likely to start from the v30 code, and incorporate my versions of the various bugfixes and patches people have done, rather than just start from those patches.)
-
Just to flag that while I'm delighted when people fix bugs during periods where I'm short of time myself, I'm really reluctant to have people mess with the code otherwise, unless I've been able to check it personally. SCS is extremely complicated and coded very differently from other WEIDU mods.
(Which isn't to say I'm not interested in optimization suggestions, as long as they don't cut against other design goals - although those particular functions get implemented in a completely different way on my current beta.)
-
A while ago I made my own converter to auto-convert the IWD spell resources over to BG2, using bits of IWDEE code. It's mostly not useful for IWDification because it doesn't work for vanilla BG2, but there's a fragment that might be some use: my solution to where to put scrolls. What I did was to assign each IWD arcane spell a BG partner. Then any time the partner scroll appeared in a store, area container or creature inventory, a copy of the IWD scroll goes there too. That scatters the spells a bit more realistically through the game, and makes them feel a bit more integrated.
Happy to donate the code if it's of use; I've rewritten it slightly to remove dependency on SCS's function library. Just put it in a library file and INCLUDE it. I know I should be doing this through git but I can't work out how the fork functionality works; seems I can't remember how to attach a document to a post either (I suck at collaboration tools). Here it is as text, or I can email a copy.
/////////////////////////////////////////////// //// Data /////////////////////////////////////////////// ACTION_DEFINE_ASSOCIATIVE_ARRAY iwd_scrolls BEGIN EXPEDITIOUS_RETREAT=>CDIA126 SNILLOCS_SNOWBALL_SWARM => CDIA204 DECASTAVE => CDIA216 CATS_GRACE => CDIA225 ICELANCE => CDIA327 LANCE_OF_DISRUPTION => CDIA328 BELTYNS_BURNING_BLOOD => CDIA422 SHADOW_MONSTERS => CDIA426 EMOTION_COURAGE => CDIA427 EMOTION_FEAR => CDIA428 EMOTION_HOPE => CDIA429 MORDENKAINENS_FORCE_MISSILES => CDIA430 SHOUT => CDIA431 VITRIOLIC_SPHERE => CDIA432 SHROUD_OF_FLAME => CDIA524 DEMI_SHADOW_MONSTERS => CDIA525 SUMMON_SHADOW => CDIA526 CONTACT_OTHER_PLANE => CDIA528 CONJURE_WATER_ELEMENTAL => CDIA533 ANTIMAGIC_SHELL => CDIA610 LICH_TOUCH => CDIA626 MONSTER_SUMMONING_4 => CDIA627 OTILUKES_FREEZING_SPHERE => CDIA628 SHADES => CDIA629 DARTS_OF_BONE => CDIA630 SOUL_EATER => CDIA631 TROLLISH_FORTITUDE => CDIA632 MONSTER_SUMMONING_5 => CDIA706 MALAVONS_RAGE => CDIA709 ACID_STORM => CDIA724 SEVEN_EYES => CDIA725 SUFFOCATE => CDIA726 MONSTER_SUMMONING_6 => CDIA801 MIND_BLANK => CDIA802 GREAT_SHOUT => CDIA806 IRON_BODY => CDIA814 MONSTER_SUMMONING_7 => CDIA901 END ACTION_DEFINE_ASSOCIATIVE_ARRAY bg_scrolls BEGIN STINKING_CLOUD => SCRL97 KNOCK => SCRL91 STRENGTH => SCRL98 FLAME_ARROW => SCRL1F LIGHTNING_BOLT => SCRL1K CONTAGION => SCRLA8 EMOTION_HOPELESSNESS => SCRL5H OTILUKES_RESILIENT_SPHERE => SCRL5J CONE_OF_COLD => SCRL2F ICE_STORM => SCRL1X SUN_FIRE => SCRLAR CHAIN_LIGHTNING => SCRL7S DISINTEGRATE => SCRL7T DEATH_FOG => SCRL7R TENSERS_TRANSFORMATION => SCRL7G DELAYED_BLAST_FIREBALL => SCRL8N SPHERE_OF_CHAOS => SCRL8M PROTECTION_FROM_ENERGY => SCRL8Y BIGBYS_CLENCHED_FIST => SCRLB1 IMPROVED_MANTLE => SCRL9C CARRION => SCRL8A WYVERN_CALL => SCRL7W SUMMON_EFREET => SCRL8S SLEEP => SCRL81 SPIDER_SPAWN => SCRL6R MONSTER_SUMMONING_3 => SCRL2G ANIMATE_DEAD => SCRL2D ORACLE => SCRL6W CONJURE_FIRE_ELEMENTAL => SCRL7X DELAYED_BLAST_FIREBALL => SCRL8N PRISMATIC_SPRAY => SCRL8P END ACTION_DEFINE_ASSOCIATIVE_ARRAY shadow_data BEGIN SNILLOCS_SNOWBALL_SWARM => STINKING_CLOUD DECASTAVE => KNOCK CATS_GRACE => STRENGTH ICELANCE => FLAME_ARROW LANCE_OF_DISRUPTION => LIGHTNING_BOLT BELTYNS_BURNING_BLOOD => CONTAGION SHADOW_MONSTERS => SPIDER_SPAWN EMOTION_COURAGE => EMOTION_HOPELESSNESS EMOTION_FEAR => EMOTION_HOPELESSNESS EMOTION_HOPE => EMOTION_HOPELESSNESS MORDENKAINENS_FORCE_MISSILES => OTILUKES_RESILIENT_SPHERE SHOUT => CONE_OF_COLD VITRIOLIC_SPHERE => ICE_STORM SHROUD_OF_FLAME => SUN_FIRE DEMI_SHADOW_MONSTERS => MONSTER_SUMMONING_3 SUMMON_SHADOW => ANIMATE_DEAD CONTACT_OTHER_PLANE => ORACLE CONJURE_WATER_ELEMENTAL => CONJURE_FIRE_ELEMENTAL ANTIMAGIC_SHELL => SPELL_DEFLECTION LICH_TOUCH => DEATH_SPELL SHADES => WYVERN_CALL OTILUKES_FREEZING_SPHERE => CHAIN_LIGHTNING DARTS_OF_BONE => DISINTEGRATE SOUL_EATER => DEATH_FOG TROLLISH_FORTITUDE => TENSERS_TRANSFORMATION ACID_STORM => DELAYED_BLAST_FIREBALL SUFFOCATE => SPHERE_OF_CHAOS MIND_BLANK => PROTECTION_FROM_ENERGY GREAT_SHOUT => BIGBYS_CLENCHED_FIST IRON_BODY => IMPROVED_MANTLE SUMMON_SHADOW => CARRION MONSTER_SUMMONING_4 => WYVERN_CALL MONSTER_SUMMONING_7 => SUMMON_EFREET MONSTER_SUMMONING_6 => SUMMON_EFREET MONSTER_SUMMONING_5 => SUMMON_EFREET MALAVONS_RAGE => DELAYED_BLAST_FIREBALL SEVEN_EYES => PRISMATIC_SPRAY EXPEDITIOUS_RETREAT => SLEEP END //////////////////////////// /// actual code begins //////////////////////////// ACTION_IF GAME_IS "tutu" BEGIN OUTER_SPRINT tutu_var "_" END ELSE BEGIN OUTER_SPRINT tutu_var "" END ACTION_PHP_EACH shadow_data AS iwd_spell=>bg_spell BEGIN OUTER_SPRINT iwd_scroll $iwd_scrolls("%iwd_spell%") OUTER_SPRINT bg_scroll $bg_scrolls("%bg_spell%") OUTER_SPRINT bg_scroll "%tutu_var%%bg_scroll%" OUTER_SPRINT $shadow_map("%iwd_scroll%") "%bg_scroll%" END COPY_EXISTING_REGEXP GLOB ".*\.sto" override GET_OFFSET_ARRAY offset_array STO_V10_ITEMS_SOLD PHP_EACH offset_array AS key=>offset_base BEGIN READ_ASCII offset_base item_resref TO_UPPER item_resref READ_LONG (offset_base+0x14) number SET $stock("%item_resref%")=number END PHP_EACH shadow_map AS iwd_scroll=>bg_scroll BEGIN PATCH_IF INDEX_BUFFER ("%bg_scroll%")>=0 BEGIN TO_UPPER bg_scroll SET number_in_stock=$stock("%bg_scroll%") ADD_STORE_ITEM "%iwd_scroll%" AFTER "%bg_scroll%" #1 #0 #0 "IDENTIFIED" ("%number_in_stock%") END END BUT_ONLY COPY_EXISTING_REGEXP GLOB ".*\.cre" override PHP_EACH shadow_map AS iwd_scroll=>bg_scroll BEGIN PATCH_IF INDEX_BUFFER ("%bg_scroll%")>=0 BEGIN ADD_CRE_ITEM "%iwd_scroll%" #0 #0 #0 ~IDENTIFIED~ ~INV~ END END BUT_ONLY COPY_EXISTING_REGEXP GLOB ".*\.are" override PHP_EACH shadow_map AS iwd_scroll=>bg_scroll BEGIN PATCH_IF INDEX_BUFFER ("%bg_scroll%")>=0 BEGIN SET container_to_add_to=0 GET_OFFSET_ARRAY cnt_array ARE_V10_CONTAINERS PHP_EACH cnt_array AS cnt_number=>offset_base BEGIN GET_OFFSET_ARRAY2 item_array offset_base ARE_V10_ITEMS PHP_EACH item_array AS ind=>offset BEGIN READ_ASCII offset item_resref PATCH_IF "%item_resref%" STRING_EQUAL_CASE "%bg_scroll%" BEGIN SET container_to_add_to=cnt_number+1 END END END PATCH_IF container_to_add_to>0 BEGIN LPF ADD_AREA_ITEM STR_VAR item_to_add="%iwd_scroll%" container_to_add_to END END END END BUT_ONLY
-
At some point I'm going to need someone to explain to me how I release my own updated version in this Github framework ... as always I'm very grateful to people who release updates when I'm away, but when (if?) I get out from under work and toddler I'd prefer to use my own previous build as the starting point rather than build on others' code. (Among other issues, I would *strongly* prefer to handle SR compatibility through RequireBlock(Demivrgvs) in the SSL rather than through a separate fork.)
Not, to put it mildly, an urgent issue! And many thanks to CamDawg and others for doing a v31 in my absence.
-
They do (or at least: they should).
-
Also, SCS scripts are adaptive (they install differently according to which magic items are in the game, whether some other mods are installed, which options the player selects at install time, etc) - that requires me to compile at install time.
-
These last couple are fixed in v31 (no ETA though)
-
What's the technique, as a point of interest? I was looking at this the other day for random reasons.
-
At least a sort of bug. I'll update DS.
-
Hello DawidW
I m seconding alien wish : with EET and some mod the install time of Stratagems is important ( some hours ), and give sometimes "out of memory" error
See my reply to Alien. I don't use megamod installations myself and supporting quick installs on them is not a priority, absent detailed and specific advice as to how.
K4tos seems to have find a way of reducing memory usage using LUA
I don't know if it is applicable to Stratagems but it (quoting K4thos) "call lua.exe from within weidu to handle all regexp stuff for BAF and D files during installation"
But I don't know any lua and I'm not likely to learn any time soon.
-
Hello DavidW,
during my infinite amount of Mega Installations, I notice that SCS install time was greatly increased between 28-30, it could be also results of new weidu fixes/changes etc. I've using the same PC for last 3 years, (i5, 2xSSD, 16GB) and SCS part of installation take huge amount of time when the AI code is trying to modify all creatures from other mods. Could you take some time to improve installation times, atleast for EE engine? Could you use lua language to replace some weidu macros to gain speed? K4thos already did it for EET to reduce amount of memory which weidu use so maybe it could serve also for speed?
The short answer is probably not.
The long answer is that I test SCS on clean or lightly-modded versions of vanilla BG2 and BGEE/BG2EE, and if the install time stays below 20 minutes or so on a reasonably fast PC, I'm contentthat it's not a serious issue and I'd rather prioritise other things. Active support for a short install on megamodded installations is a bit beyond what I really support - I don't have megamodded installs as my main target. That said, if someone looks at the code and identifies specific ways to speed any given bit up, I'm happy to listen. (Though I don't recommend anyone puts the time in until v31 comes out as there are some significant under-the-hood changes - some of which will probably speed things up, others not!)
-
It's intended to be removed by cleric/mage spells and by the temple Remove Curse. It's clearly not working on some installs but I haven't yet got around to working out whether that's a mod incompatibility issue, a vanilla/EE issue, just a straight SCS bug, or some combination.
-
Yes, that's unintended and suboptimal.Not a bug perhaps but PCs using the SCS AI script will completely avoid attacking disabled targets, even if there are no active enemies left.
-
It's Kreso's set of SR-based tweaks to SCS v30. I didn't have anything to do with it.
(Normally this would irritate me a bit, as I wasn't asked - but I was pretty much uncontactable at the time, even by email, so I assume Kreso/Demi tried and failed to get in touch.)
-
fixed in v31
-
The ones that are bugfixes for SCS: probably.
The ones that are vanilla bugfixes: possibly.
The ones that are new content and tweaks: probably not.
SCS v31 Release Candidate (Now No. 3) Now Available for Testing
in Sword Coast Stratagems
Posted · Edited by DavidW
I suspect I know SR better than anyone else knows the innards of SCS!