Jump to content

suy

Members
  • Posts

    229
  • Joined

  • Last visited

Posts posted by suy

  1. 4 minutes ago, DavidW said:

    If someone wants to give me idiot-proofed instructions on how to feed a text file with setup-stratagems --uninstall --force-install-list blah to WEIDU in OSX or Linux, I don't mind trying to implement it.

    That would be great! Pretty much what I said in the other comment. I can't provide proper WeiDU code to suggest a patch, but I think it would be a matter of choosing between this two templates:

    <<<<<<<<.../stratagems-inline/batch_template.bat
    setup-%MOD_FOLDER% --uninstall --force-install-list>>>>>>>>
    
    <<<<<<<<.../stratagems-inline/batch_template.sh
    weinstall %MOD_FOLDER% --uninstall --force-install-list>>>>>>>>

    Maybe there is some other quirk with white space that I can't predict, but I think it'll be easy. At worst, I can bother Angel, as he mods/plays on Linux as well. :)

  2. I did a quick try commenting out the line with

    REQUIRE_PREDICATE "%WEIDU_OS%" STR_EQ win32 @50011

    for the batch mode on Linux. On exit, it attempted to run the bat script and of course failed, but it left a bat file with this (it's a quick try, not a usual set of components):

    setup-STRATAGEMS --uninstall --force-install-list 1500 1510 3010

    On Linux (and I suppose it would be the same on Mac) it would just be "weinstall %MOD_FOLDER%" or "weidu %MOD_FOLDER%/setup-stratagems.tp2". If you don't want to provide support for other OSs, I think just allowing to run in batch mode and asking to edit the generated file, or printing the component list even, would be enough.

    Otherwise I can probably live editing the file tp2 and keep learning WeiDU. :)

    Oh, one last thing that I don't get yet, is how this interacts with the INI file. Is the INI file just for tweaking the options further? I've just peeked into it.

  3. 10 minutes ago, UMNiK said:

    I see no reason why a modding community comprising multiple active forums couldn't work towards the common goal of making things as easy as possible for newcomers.

    As I mentioned, people are doing their bests to improve the cross communication. The fact that such centralized list doesn't exist is because no one has put the time to do the effort. You seem to know what Github and awesome lists are. You surely will be able to create the repo yourself, and start adding mods. You can copy from Cahir's list and format it in Markdown if you please, then maintain the effort of accepting pull requests. There is no need to ask for permission to create one of those lists. Just don't expect people to submit pull requests to your project if you have not gained any traction. I personally have started to collect such a list for myself, and I want to publish it, eventually, on a certain website. It's more or less what you mention, but it's part of a larger Infinity Related website. In my case I don't expect to collect all mods, just all the mods that seem interesting to me. I don't want to spend that much time on doing that. But if you start the list and succeed, I'll gladly contribute some mod entries to it.

  4. Thank you very much for yet another shiny looking release! One tiny question on the 2.6-affected changes:

    Seems that the 2.5.17 engine introduced the fix for the spell interruption triggering when you receive 0 damage. Sadly BG2EE only had 2.5.16, so this bug triggered often on the most relevant part of the saga. Now with 2.6, both games are on par with this fix (I've not tried it yet myself). Have you deprecated the workaround that SCS added on spells for this? The "Grant complete immunity to elemental-damage spells if you are 100-percent resistant" from Universal Changes.

  5. 5 hours ago, UMNiK said:

    This guide is, as far as I can tell, missing one thing only to be considered the ideal first stop: how to actually find and choose which mods to install and play.

    I understand your frustration, but note that this is like asking where to find and choose which applications to install and use.

    Sure, some users are now able to use application stores as a centralized means, and Linux users have been using repositories and the like even before. But the stores exist because there is an incentive on both the store owner and the application maker to maintain the service/publish the app in the service. And public package repositories of open source projects can exist because the author of an open source project allows redistribution and modification (it would not be open source otherwise). Modders rarely even slap a license on ther mods, not even a Creative Commons one that disallows commercial use and modifications.

    Resources to publicize mods exist (e.g. the modding news forum here on G3 which is linkable to other news channels, e.g. on the Infinity Engine discord), and not all mod developers do so, because they don't have the time or the interest.

    The only way to have a list of mods for one to acknowledge their existence, is to follow every place where such a thing can be made public. Cahir's list is the closest thing I've seen so far, and of course it's not complete.

  6. Thank you both for the replies. I've been semi-offline for a while as well. I wasn't aware of this changes in the scaling (as I mentioned, I did not try the EE in the pre 2.0 times), and I'm terrible noticing any differences in images as my sight is pretty terrible it seems. 😅 I hope the UI mods satisfy you enough if you have to "go forward" to a new EE release. To me some of the additions in the new versions are worth it, both of the engine and of the mods themselves.

  7. I can't contribute much with solutions besides what has been said (OK, one little thing: if a mod is on Github, you could search in the history to see if it had commits before the 2.0 release, and see if those after affected compatibility, but it's a lot of manual work so probably not worth it for more than one mod, probably not even that, specially without some weidu knowledge).

    But if you don't mind a question: May I ask what's the issue with 2.x that 1.3 doesn't have? I think we've chatted on Mivsan_NT's discord, so you know about him and his playthrough. He mentioned that the 2.0 release changed things that he did not like without specifying much. The only thing that I've noticed better on his installation is the UI, which is moddable anyway to great extents (Lefreut's UI keeps a more 1.3 style, with the list of status effects having a lot of space to grow, as it should, and with tons of other improvements...). I wasn't around before 2.0, so I don't know what else was changed.

    Cheers.

  8. Thanks the clarification, David. In my case, I'm thankfully not too concerned with other mods (for now at least), as I think SCS is the only one that has complex spell/scripting that requires Detectable Spells (of the ones that I use and could actually support if I publish a mod, I mean). If eventually your copy of Detectable Spells gets changed to free more proficiencies, better yet.

    About my mod/use case: I did some experiment a while ago (without even WeiDU, just manual changes with NearInfinity), where I granted the Monk class some special bonuses/abilities based on proficiency points. E.g., given that they can't (normally) use 2 handed weapons, I enabled that proficiency for the class, and then made them gain bonuses with the fists when had a certain amount of points. I think those usual fighting style proficiencies are fine enough to make a decent mod (even more now that I recently learnt thanks to OlvynTweaks that one can expand fighting styles to 5 points instead of just 2/3). But I wanted to know if the limits could be pushed a bit more, and GrammarSalad paved the way for me. :)

    Thank you again, I've learnt a lot, and hopefully I've clarified this for less experienced people like me. This topic is very interesting.

  9. 4 hours ago, Grammarsalad said:

    Yes, the process exposes the extra proficiecies for player selection as per the other profs (excepting the first 8 or so). But, as SD has pointed out, they are already being used by detectable spells. Also, I don't even think that the most recent update changes spell detection using another method. It actually makes some sense as it would mess with those mods semi-unnecessarily.

    My plan was to create a mini mod (for ee only) that would be installed last and that would switch detectable spells to a different system. But, darn, that's just a lot of work and I don't even want to start it unless I finish my non- weapon proficiency mod. No idea if that'll happen.

    You would need you cycle through all scripts and change various prof related triggers as well as spells and items that set those proficiencies. In my brain, the code feels fairly simple, but it's probably going to be a messy affair in practice..

     

    Thanks, coincidentally, I was looking at this again to see if by reading this thread again for the 10th time I would get something. 🙂 I've also looked a bit at the ds.tph code, and I could not understand anything at all.

    But I looked at the game files after installing SCS and hence Detectable Spells, and I made some findings (brain dump mode ON, hopefully is helpful for someone, and please correct if I say something wrong):

    In the source code, there is a file named "ds/notes on current use.txt" that contains this:

    Quote

    133 CLERIC_DEFENSIVE_HARMONY                    bit-valued indicator; no current redundancy
    134 EXTRAPROFICIENCY20                        currently unused


    OK, so seems one of the proficiencies is free. But say that I need two, so let's look at the previous one (133). Looking at the spell I find that it has this two effects:

    Quote

    Type: Set spell state (328)
    Target: Preset target (2)
    Power: 4
    Unused: 1
    State: BUFF_ENHANCEMENT - 68

    And:

    Quote

    Type: Modify proficiencies (233)
    Target: Preset target (2)
    Power: 4
    # stars: Active class: 1, Original class: 0
    Proficiency: CLERIC_DEFENSIVE_HARMONY - 133
    Behavior: Set if higher (0)

    The one that modifies proficiencies was expected, of course, but I'm confused by the fact that two effects are needed, and using a different approach.

    I've searched into SCS's code, and I found very few occurrences on the AI scripts of CLERIC_DEFENSIVE_HARMONY, and all seem to be triggers of enemy scripts on enemies themselves of only two kinds: green dragon and priest. If I were to use this proficiency to allow some incompatible class like Sorcerer or Monk (which can't be dual/multi with Priests), initially this would not collide. Say that a CLAB file contains an "AP_" spell on every level that grants effects if a character has enough proficiency in this or that. I've tried this on regular proficiencies, and it worked. However If a character were buffed by this spell on level up then it would get unexpected bonuses.

    End the brain dump for now, but I have lots of questions:

    1. Could this last mentioned problem be worked around by removing effects by resource? I mean, the AP_ spell from the CLAB file could clear Defensive Harmony's effects, then check for proficiency, right? It would be weird that you level up and get that buff dispelled, but it's not a big deal as it's very short lived.
    2. Can Detectable Spells be changed to only use spell states? Should it? Or is it needed for compatibility with pre-EE games or older Detectable Spell versions?
    3. If splstate.ids is limited to 256 entries, I'm concerned that I see mine being almost 200 lines, and some of them of no apparent value for enemy AI scripts, like SHAMANIC_DANCE or ENHANCED_JESTER_SONG. After a search, I don't see them used (if I searched correctly). For party AI scripts, shouldn't this be done via checks on the modal state? Or am I missing some other use case of Detectable Spells?

    Thank you.

  10. Thank you. I've found that in SCS, the detectable spells directory has "notes on current use.txt" file with some notes, and indeed the 134 one mentions being unused, but all the other ones seem in use. I'll try to learn on that code to see if something can be squeezed out of it, or the whole data is unsuitable for user proficiencies.

  11. Noob(er) question. I don't fully understand all that was said, so I'm not totally sure if the unused proficiencies (EXTRA2, EXTRA3, etc.) in weapprof.2da would be fully usable for creating new proficiencies for the user, or might clash with mods using the data for storing their own stuff.

    I got that the Proficiency() trigger already checks only the 3 lowest bits that are editable by a player when setting proficiency points, and that opcodes(?) seem to be able to use the other bits safely. I also found that @Grammarsalad has asked about about exposing the hidden proficiencies, and that it seemed to be initially successful, but I don't know if that was just a first step in showing them, or compatibility was working well also.

    I don't use any mods that do fancy stuff like you mentioned on the first post. I'm mostly concerned about SCS, where I just don't understand the magic done by stuff like detectable spells.

    Thank you!

  12. I do most of my editing in Vim (now NeoVim). I wrote the syntax highlighting for BAF myself because I could not find one online for it. 5 years ago I had to also start using an IDE for C++ development because the tooling wasn't there, and there was no LSP (and in the IDE I still use vi-mode). Now I'm considering moving that part of development to NeoVim, but I need time to invest on it. MLS is another reason to start learning about using LSP on this editor. Though, to be honest, I probably will never write stuff in WeiDU. But I still want to read code from existing WeiDU mods.

  13. 10 minutes ago, Magus said:

    Well, it's probably a no-brainer for a c++ programmer, but as for me, I don't find the syntax too intuitive.

    Well, I don't find it intuitive either. The Mustache initial implementation was Ruby, and a lot of support and proposals for improvements came from Twitter folks doing JavaScript, I think. C++ is not even a language in which is common to use template systems because it's not popular for making web pages. All the other template systems that I've seen have the problem that are their own language. So they might be intuitive initially, but you have to learn them anyway to write code. The logic-less approach may not make complete sense for generating code, I give you that. But in that case, I'd rather go with a template system that is the very opposite of this, like the one in underscore/lodash, based on John Resig's approach. That allows you to use the real language.

    27 minutes ago, Magus said:

    But highlighting and intellisense become a bitch in that case.

    But do you have code completion, validation and so on on the language server for BAF or BAF+jinja2? I definitely have to check it out by myself, but I just don't use VS Code and I can't switch so easily.

    My examples, are just the very proof of concept, and the first use I've done with this, ever. I've written very little BAF code so far. But it would not be hardcoded, as all would be files that you supplement the main template with, and you can provide as many or as few as you want.

  14. Hi. Thank you for bringing this topic up. I wanted to make public my own party AI script soon (which is mostly inspired by the existing ones, and it's not too long, as I prefer to control almost everything, it just helps with the tedious part). Very early in the development process I noticed the problem of needing replacing (for the DisplayStringHead message), and also I did notice that there are too many repetitive tasks. I knew of SSL, but it's a bit like relying on a moving target without much documentation when I am a noob in scripting anyway.

    I ended up using cpp (the C/C++ preprocessor), as it's pretty ubiquitous and I'm familiar with it's syntax quite well. I also looked at other macro languages like M4, but it felt quite crazy. I went for cpp and accepted the repetition because I hate multiple line expansions and the ugly backslash at the end that it would be required for that.

    Since now you mentioned text templating systems, I went for Mustache in my case. It's a "logic less" template system with tons of implementations in different languages and a formal specification. It's well stablished. The default/initial Mustache implementation (Ruby based) is a bit dated, but has a command line tool, so you can just define the data in JSON/YAML and the template. You call the tool, and it produces the output, no code involved. However, I needed a more up to date implementation to use the inheritance feature, so I went with a C++ library called bustache. I can easily make a command line tool that just reads the files from input, like SSL does, and produces output. Let me know if anyone is interested. I could even make that into a GUI application, though I don't know if that's any benefit. For my use case, I wrote a program for myself, but again, can easily made abstract so you just need files and don't need to code a thing.

    Now, this is how the "code" looks.

    Templates that I need to reuse verbatim, just look like the output, so like BAF:

    // This is in one file that I've called "ClassesWithStealth"
    OR(3)
        Class(Myself,THIEF_ALL)
        Class(Myself,RANGER_ALL)
        Class(Myself,MONK)
    
    // This is another, named "ModalStatesDisabled"
    !ModalState(DETECTTRAPS)
    !ModalState(STEALTH)
    !ModalState(TURNUNDEAD)
    !ModalState(BATTLESONG)
    

    The following is a helper that I need to use twice, with a small differences, and which use the previous templates by including them. This is a bit more advanced because uses a feature called "inheritance". The next template I think it's called a "parent", because you can use it like this, or "inherit" it by overriding parts. It's simpler to see it than to explain it, so let's look:

    // This line is to change the delimiters. Just because in my keyboard is a pain to write
    // {{foo}} (the default in Mustache and which gives it its name), so I'd rather prefer
    // to write |foo|. Can be changed to almost anything you like. The next examples don't do it.
    {{=| |=}}
    IF
        // The notation with the dollar marks a chunk of text with a default value
        // but that can be overridden (in one case I use 0 and no extra BAF triggers, but
        // in another I add a check for enemies, and with a different variable value).
        // See the following file (in the next code block) to see how this is used.
        Global("suy#fight","LOCALS",|$fight|0|/fight|)
        Global("suy#mode","LOCALS",1)
        ActionListEmpty()
        !GlobalTimerNotExpired("suy#hide","LOCALS")
        // Likewise. The default definition on this template has no extra content,
        // but a user can override this, like if it were a function call. See below.
        |$check|
        |/check|
        // This reuses the snippets mentioned above. Just copy them verbatim.
        |>ClassesWithStealth|
        |>ModalStatesDisabled|
    THEN
        RESPONSE #100
            SetGlobalTimer("suy#hide","LOCALS",ONE_ROUND)
            Hide()
    END

    Now with this last template defined in AttemptToHide it can be used in the main template like this:

    // Just use the helper template, without overriding anything.
    {{<AttemptToHide}}
    {{/AttemptToHide}}
    
    // Same helper template, but this time override the defaults to check
    // for a different value of the variable, and add an extra line for an
    // additional trigger.
    {{<AttemptToHide}}
    {{$fight}}1{{/fight}}
    {{$check}}
        !See([EVILCUTOFF])
    {{/check}}
    {{/AttemptToHide}}
    

    The main template follows like the next snippet. It looks 100% like regular BAF in the first block, but with the second uses one template (that we've seen above) as "helper", to avoid repetition.

    IF
        Global("suy#fight","LOCALS",1)
        Global("suy#mode","LOCALS",1)
        ActionListEmpty()
        !See([EVILCUTOFF])
        Class(Myself,BARD_ALL)
        !ModalState(BATTLESONG)
    THEN
        RESPONSE #100
            BattleSong()
    END
    
    IF
        Global("suy#fight","LOCALS",1)
        Global("suy#mode","LOCALS",2)
        ActionListEmpty()
        !See([EVILCUTOFF])
        OR(2)
            Class(Myself,THIEF_ALL)
            Class(Myself,MONK)
        {{>ModalStatesDisabled}}
    THEN
        RESPONSE #100
            FindTraps()
    END

    So that's the idea. You write BAF inside a template, but when you see repetitive parts, you move them to files and include them N times. If those need to be reused but with changes, put the default values wrapped in {{$some_name}}default value{{/some_name}}. If you find the double braces too verbose, do as in the example above, and change the delimiters to whatever you like (I did change them to simple vertical bars, as you saw).

    I did not need to use loops here, but that's possible as well. Normally the data is defined elsewhere though. I could simulate SSL's target/trigger blocks by having those strings in an array. The template can loop over them, with different values in each iteration.

    Conclusions?

    I don't have them yet. I just ported my script which was 95% regular BAF, to this templated solution, so I'm still a noob on this approach. It looks a lot clearer in a sense (things have names, and there is no repetition, so I won't go back to writing all BAF by hand, as it's too error prone), but the syntax is too verbose. Having to open and close each use of a different file is too noisy. It should look like a function call, much terser. Given this limited scope (just a simple party AI script), I probably could do writing a program in any language and save snippets in variables and use the formatting capabilities to have default values or their replacement. This seems easy to do in a bunch of languages I have experience with.

    I think I can do everything in SSL with Mustache templates, but the number of pros (documented, well implemented) comes with the big, clear con of not being as concise, unless I figure a way how to do it. For example, copying this from SSL lesson six:

    IF TRIGGER
    TargetBlock(PCMages|PCsInOrderShort)
    TriggerBlock(Paralyse|MR)
    THEN DO
    Action(Spell,WIZARD_HOLD_PERSON)
    END

    This notation (if I'm not mistaken) would entail having to merge the list of entries of PCMages and PCsInOrderShort somehow (I don't think it can be done at the template level, so it would have to be in some other logic), and likewise for Paralyse and MR. Then, make a nested loop so each combination of target+trigger is looped over, and expand the action. SSL wins hands down in being somewhat simpler once you've learnt it.

    Note that I've not written anything with SSL yet, but I'll try to write my party AI script with it to compare side by side, though it will take time, and I'm not even sure it will be easier for this purpose.

    Cheers, and a cookie for you if you read the wall of text. 🙂

  15. Is it possible to detect if a party member is casting and/or going to cast a spell on `Myself`? Or alternatively if is casting anything, or doing anything.

    Basically, I want to avoid calling `Hide()` via the user AI script, by checking before if a party member is buffing/healing on `Myself`. If I'm unlucky, the combat might have stopped, and I'm proceeding to heal or buff a specific party member. If that party member has the script to hide constantly, it might turn invisible, and ruin the spell.

    If needed, I can check on something else, like a list of actions, for all the PlayerX, but I don't see such thing either.

    This is more or less the block that I use so far to hide:

    IF
        Global("suy#fight","LOCALS",0)
        Global("suy#mode","LOCALS",1)
        ActionListEmpty()
        !GlobalTimerNotExpired("suy#hide","LOCALS")   
        OR(3)
            Class(Myself,THIEF_ALL)
            Class(Myself,RANGER_ALL)
            Class(Myself,MONK)
        !ModalState(DETECTTRAPS)
        !ModalState(STEALTH)
        !ModalState(TURNUNDEAD)
        !ModalState(BATTLESONG)
    THEN
        RESPONSE #100
            SetGlobalTimer("suy#hide","LOCALS",ONE_ROUND)
            Hide()
    END
    

    Then I tried to add ObjectActionListEmpty(...) on all of Player1, Player2, etc., but still did not work, and it worked, but it's a bit too broad. Something more specific would be nice.

    Some other idea?

    Thank you.

  16. Thank you for this mod, @polytope! I'm trying in SoA on top of SCS, and I have to report that so far I'm having a really nice experience. I got into the planar sphere, and I wasn't too prepared, so when Tolgerias cast a trillion protections that I can't strip (Spell Trap with Spell Shield and some others; I'm playing on Insane), I gave Haer'Dalis a chance to cast Remove Magic, and it worked! He was only level 15, and Tolgerias is 21, so the chances are much more balanced with the mod. Sure, it's random, and there is always a 5% chance in vanilla anyway, but this is not the only case. In other circumstances I was over the level of the enemies (well, just Haer'Dalis and his higher caster level), and it did not work even in two attempts (no SI: Abjuration, it just didn't work).

    Surely just for now is little experience, but I wanted to give some positive feedback. I'll try to see if I can comment further when I have the time to play more.

    I also looked at the implementation, and the spell files are indeed big, with repetitive blocks that I hope are not done by hand. I suppose there is no other way to change the chances but go into engine-level modifications (which I will surely check, but it has close to no chance of happening if I have to do it).

  17. It's quite funny to see that someone else is also using the C/C++ preprocessor for "templating" a BAF file. I started last year a party AI script of my own, and I also went with it because I saw a ridiculous amount of repetition. Like, I want to show the "attacking enemies" message like some of the default AI scripts, and of course the number is different in BG1 Or BG2, so I need some basic search and replace.

    I've not gone too crazy, though, and I've conceded myself some uglyness, becuase I did not want to use a macro to expand to blocks that are very similar (then I have to type all the ugly backslashes...). I'm a C++ developer by trade, and in modern C++ we try to avoid the preprocessor a lot.

    Have you considered using another template language? I've started thinking that one of the more "typical" ones for outputting HTML and the like, could maybe be better suited. Or it's your constraint that you want to make it work with the completion of the language server, and this preprocessor works better?

    Thanks for the projects, BTW! I really, really want to dive into them when I find time.

  18. FWIW, it happens with a graphic file manager as well, which is using libarchive, which I assume implements the file format by itself and doesn't use an "unzip" process under the hood. Thanks for the reply.

  19. Hi. I don't know if this is an issue with the Infinity Auto Packager, Github Actions, or something else, but I want to report that the IEMOD package for this release has all regular files with no permissions (not even read permissions, which is very uncommon), so mod installation can't happen without fixing first the file permissions. The ZIP file is fine. This might be an issue on UNIX systems only, but it's still an issue. Let me know if I can help in some way.

  20. SCS addresses this, and says in the docs:

    Quote

    I think Item Randomizer is best installed before SCS, because SCS assigns weapon proficiencies to creatures according to which weapons they have, and Item Randomizer shuffles those weapons. One SCS component moves some over-powered items later in the game; if Item Randomizer has already moved them, they won't be moved again.

    I did this in my last playthrough, and went well... except that I would have preferred to let SCS move the OP items like Robe of Vecna, because those are moved to ToB instead of to a tough tier in SoA.

    Thankfully there is a recipe for changing this from Wisp.

×
×
  • Create New...