Jump to content

Magus

Members
  • Posts

    283
  • Joined

Everything posted by Magus

  1. I'm entertaining an idea to add some preprocessing and/or templating capabilities to MLS/IElib. Looking to gather some feedback before endeavouring. Gcc was my first thought, but it's not great with loops, so maybe jinja2 instead (or in addition). Some example snippets to get the ball rolling: baf IF See(NearestEnemyOf(Myself)) Global("abi_dalzim","LOCALS",0) LevelGT(LastSeenBy(Myself),15) // Level 16+ !GlobalTimerNotExpired("delay","LOCALS") THEN RESPONSE #100 SetGlobalTimer("delay","LOCALS",6) IncrementGlobal("doomed","LOCALS",1) IncrementGlobal("abi_dalzim","LOCALS",1) ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_ABI_DALZIMS_HORRID_WILTING) END IF See(NearestEnemyOf(Myself)) Global("efreeti","LOCALS",0) LevelGT(LastSeenBy(Myself),15) // Level 16+ !GlobalTimerNotExpired("delay","LOCALS") THEN RESPONSE #100 SetGlobalTimer("delay","LOCALS",6) IncrementGlobal("doomed","LOCALS",1) IncrementGlobal("efreeti","LOCALS",1) ReallyForceSpell(Myself,WIZARD_SUMMON_EFREET) END IF See(NearestEnemyOf(Myself) Global("sunfire","LOCALS",0) LevelGT(LastSeenBy(Myself),15) // Level 16+ !GlobalTimerNotExpired("delay","LOCALS") THEN RESPONSE #100 SetGlobalTimer("delay","LOCALS",6) IncrementGlobal("doomed","LOCALS",1) IncrementGlobal("sunfire","LOCALS",1) ReallyForceSpell(NearestEnemyOf(Myself),WIZARD_SUN_FIRE) END gcc equivalent #define HASH1 # // special character shenanigans #define HASH2(x) x #define cast_spell_level(SYMBOL, TARGET, SPELL_VAR, MIN_LEVEL) \ IF \ See(NearestEnemyOf(Myself)) \ Global(#SPELL_VAR,"LOCALS",0) \ LevelGT(LastSeenBy(Myself),MIN_LEVEL) \ !GlobalTimerNotExpired("delay","LOCALS") \ THEN \ RESPONSE HASH2(HASH1)100 \ SetGlobalTimer("delay","LOCALS",6) \ IncrementGlobal("doomed","LOCALS",1) \ IncrementGlobal(#SPELL_VAR,"LOCALS",1) \ ReallyForceSpell(SYMBOL, TARGET) \ END cast_spell_level(WIZARD_ABI_DALZIMS_HORRID_WILTING, NearestEnemyOf(Myself), abi_dalzim, 15) cast_spell_level(WIZARD_SUMMON_EFREET, Myself, efreeti, 15) cast_spell_level(WIZARD_SUN_FIRE, Myself, sunfire, 15) jinja2 {% for item in data.battle_spells %} // list defined elsewhere IF See(NearestEnemyOf(Myself)) Global("{{ item.var }}","LOCALS",0) LevelGT(LastSeenBy(Myself),{{ item.min_level }}) !GlobalTimerNotExpired("delay","LOCALS") THEN RESPONSE #100 SetGlobalTimer("delay","LOCALS",6) IncrementGlobal("doomed","LOCALS",1) IncrementGlobal("{{ item.var }}","LOCALS",1) ReallyForceSpell(NearestEnemyOf(Myself), {{ item.symbol }}) END {% endfor %} Of course, complex baf is already dominated by SSL, so this is mostly useful in less complex scripts. But on the other hand, the applications are not limited to baf. // never again confuse "GLOBAL" and "LOCALS" types #define LocalGT(x,y) GlobalGT(x, "LOCALS", y) IF LocalGT("my_var", value) ... // just because I'm tired of typing COPY_EXISING_REGEXP all the time #define copy_er COPY_EXISING_REGEXP copy_er GLOB ~*.itm~ ~override~ // or take it further #include header.h // header.h: #define POUND1 $ // more shenanigans #define POUND2(x,y) x ## y #define POUND3(x,y) POUND2(x,y) #define POUND_APPEND(x) POUND3(x,POUND1) #define copy_erg(FILE_EXT) COPY_EXISTING_REGEXP GLOB ~^.+\.POUND_APPEND(FILE_EXT)~ ~override~ // actual code copy_erg(dlg) DECOMPILE_AND_PATCH BEGIN x = 0 END BUT_ONLY // this is too long... IF ~~ study1 SAY @14 IF ~OR(2) Global("wm_book_spell","LOCALS",0) Global("wm_book_spell","LOCALS",1)~ REPLY @20 GOTO 00 // -> +6 = 6/7 IF ~OR(2) Global("wm_book_spell","LOCALS",0) Global("wm_book_spell","LOCALS",6)~ REPLY @22 GOTO 02 // -> +1 = 1/7 IF ~OR(2) Global("wm_book_spell","LOCALS",7) Global("wm_book_spell","LOCALS",8)~ REPLY @23 GOTO 03 // -> +2 = 9/10 IF ~OR(2) Global("wm_book_spell","LOCALS",7) Global("wm_book_spell","LOCALS",9)~ REPLY @24 GOTO 04 // -> +1 = 8/10 // how about this #define if_node(value1, value2, tra, goto) \ IF ~OR(2) Global("wm_book_spell","LOCALS",value1) Global("wm_book_spell","LOCALS",value2)~ REPLY tra GOTO goto IF ~~ study1 SAY @14 if_node(0,1,@20,00) if_node(0,6,@22,02) if_node(7,8,@23,03) if_node(7,9,@20,04) Technically, all this already can be done manually. But with some glue code in various places it could be automated similarly to how SSL works. Edit: no one, really? OK, I guess I'll just do my own thing, as always.
  2. I seen that, but what I mean to say that the fight is likely not supposed to go like that.
  3. I don't know of cases where it actually breaks things (as in broken game), but it can result in dupe items, multiple armor sets, etc. You should be alright without uninstalling. Or, if it really bugs you, just make a full backup of game directory and try uninstalling, see how it goes.
  4. This is from v30, but I guess it's the same in the latest. So in confrontation with Kaishas I made a foolish choice to focus the adds first. Turned out, reinforcements arrived faster than I could kill them. By the time I realized I really needed to kill Kaishas first, I was already pretty depleted, and stood no chance. Since I played Ironman, I resorted to Invisibility+retreat to previous area. The area was already crowded to the point it was hard to even walk to the exit. All party members died (except Imoen... in a cheap attempt to save her, I dismissed her from the party), but I managed to salvage some useful equipment. At this point, I've pretty much given up on this run, but show has to go on, right? In the previous area, I rested, prepared every area damage spell, and every scrupulously saved fire potion, wand, etc. And pre-buffed to the max. I knew I had only one shot, because supplies were limited and there was no way to take them all down with just spells. Upon entering the area, it was entirely covered in werewolves, I couldn't walk a single step. New ones continued spawning but they couldn't move too, stuck in the initial spot. I made a screenshot, but can't find it now. It looked extremely overwhelming. And I unleashed hell on them (well, to the extent a lvl 10 mage can). After a series of heavy, but carefully placed bombardments (Imoen was still there, and if I attacked her, she'd turn on me, and I'd have no chance to get her back into party) I was able to get to Kaishas and bring her down, then finish off the remaining enemies, while even still packing some firepower. While this was definitely interesting, and one of the moments that you play Ironman for, I'm reasonably sure that's not exactly intended behaviour. Gathered the rest of the items, invited Imoen back, ressed the rest of the party on the mainland. In the end, I got 2 levels from this fight alone.
  5. The corresponding component (overhauler or unborker, don't remember) is really described misleadingly and shouldn't be used in common installations. I thought it might be less autosaves, but you don't have it installed... so my money is on SCS. (I remember once seeing messages from Lamalha assassin group in Durlag's Tower. And another time actually meeting them in Copper Coronet).
  6. Pretty sure it's lolfixer, it does a lot of stuff like that. I think you can decompress biffs to the same effect. What's your current weidu.log?
  7. I think installation/uninstallation are fine in weidu. There's really no much leeway in how to do it, given how IE works and the need to support a plethora of mods. Translation is ok too. One way or another, it's going to be a bunch of files with numbered strings. We already have an API to edit any files programmatically, it's iesh. The problem is making it compatilbe with weidu mods. (And pretty sure there's no need to worry about GUI at the start.)
  8. For each Python snippet I will match and raise you a Weidu one. COPY_EXISTING_REGEXP GLOB ~*.itm~ ~override~ LPF GET_ITEM_TYPE RET type PATCH_IF type == ITM_TYPE_LONGSWORD LPF ALTER_ITEM_REQS INT_VAR min_str=10 You have to write the underlying code in both cases. So this argument is null and void. The real advantage of a general purpose language is that it's... general purpose. It has much larger community, better docs, more features, isn't dependent on 1-2 mantainers. And, it's actually a useful skill to have. While weidu is hardly applicable anywhere else. Not really. A C++ lib would only be developed by a chosen few. Learning curve is far too steep. Python, on the other hand, is widely regarded as one of the best choices for beginners, and since most modders are, and will be on that level, this makes it a very good choice if you want the ecosystem to grow naturally (modders developing their own functions and modules as needed). Oh, that one you can easily enough work around with a preprocessor. I entertained some thoughts on that, but nothing concrete yet. A "soundset installer" is useless. The only thing that can have a future is a weidu installation/uninstallation/rollback compatible generic installer. If I had to guess, I'd say a week or two should be enough to put together a PoC (assuming that you start with iesh). So, ball's in your court. I'll be watching this with interest.
  9. As @subtledoctor said, you'd need to make the tool backwards compatible with WeiDU. (Not necessarily re-implementing TP2, but at least installation/uninstallation routines). We briefly discussed this with @AL|EN a year or two ago. In general, I would say it's possible. However, if your only goal is to package soundsets, it's 100% not worth it. Just bite the bullet and learn WeiDU (and just look for ready functions, most any idea has already been implemented in one form or another). But if you're really serious about development, and have time to spare, the place to start with is iesh.
  10. How do you summon the bats? Maybe make it non-stackable, give each bat its own special and filter effects based on that?
  11. They are triggered by the engine, I believe. Just like BG1-style interactions. You can press the hotkey to advance game time (don't remember which one it is) and see them happen. I'm not sure how the system chooses between what to trigger, banter vs interaction. Maybe interactions start flowing after all banters are exhausted between the interacting characters. Maybe it's random.
  12. Imoen was originally intended to die in Spellhold. Interact.2da is not for banters, it's for BG1-style in-game interactions. Take a look here. They work in original BG1 and BGT too. Some mods extend them, though.
  13. It is mine, and it works on Classic (in fact, I only use Classic for testing). I didn't do anything about Otiluke + Fireball, because I didn't think of it. Not sure if something can be done, and doesn't worry me much, too. Although, if a way is found, and it's not too convoluted - everything is possible. Github issues are open for suggestions.
  14. In general, this is certainly a good idea. (Although I personally haven't encountered any issue with this just yet.)
  15. No stealing is in RR and TnT. Mislead and PI are also tackled in TnT. (Although not 100% bulletproof and not heavily tested.) No recharging is easy to do. Might be coming in UA. As for Protection for Undead, a better option would be to make it PnP.
  16. Point taken. However, learning is one thing, and production usage is another. The issue is that magic numbers are in some top 10 of bad programming practices, and generally should be avoided. The reasons why are explained numerous times by experienced programmers, easily googled with "why magic numbers are bad", or "code smell magic numbers". And yes, you can add comments to clarify the mumbo-jumbo. But they do not work as well as defined constants. For example, the code can be changed to OPCODE_hp_damage = 12 DAMAGETYPE_electricity = 262144 // (0 + (1 << 4)) (0 + (1 << 16)) LPF ALTER_EFFECT INT_VAR match_opcode = OPCODE_hp_damage parameter2 = DAMAGETYPE_electricity This is what "for the love of God" refers to. It is not hyperbolic at all. Unrelated to the main issue: Of course, with time you tire of defining and looking at the constants over and over again. The exact numbers are not useful for the context. So you tuck them away into an include. And then you want to use the same include in another mod. So a library is born. I do not mean at all that you should use IElib specifically. By all means, build your own or use another one. Just remember, every time when a programmer uses a magic number, God kills a kitten. (Although I do think that combining efforts is more efficient.) - I'm not sure why do you assume that. As far as I can tell, on the contrary, VSCode is the cross-platform code editor. - The extension and the library are two separate things. They are integrated, but can be used independently. Is it easier to remember 0x248 versus SCRIPT_OVERRIDE? Well, to each his own, of course. However, the goal is not having to remember, and focus on logic instead of offsets and bit fields:
  17. For the love of god LPF ALTER_EFFECT INT_VAR match_opcode = OPCODE_hp_damage parameter2 = DAMAGETYPE_electricity END https://ielib.bgforge.net
  18. I'm actually suprised it even installs on it. I didn't test on classic ToSC. Submit an issue on github, with steps to reproduce. In the best traditions of IE modding: with horrible hacks. Code is on github, so...
  19. You can do this with NearInfinity, DLTCEP or Weidu. If you want a quick, one-off in-game change, NI/DLTCEP will do fine (edit the file, drop into override dir). Weidu is the heavy machinery for creating mods that you actually want to distribute to other people. (But you still use NI/DLTCEP a lot while creating a mod, even it's weidu-packaged). Scripting languages themselves are simple and shouldn't pose a problem for an exprienced developer to get the hang of. Mostly the challenge lies in learning how Infinity Engine works, how the things are connected, and various tricks and quirks. And the most often given advice it to look at other mods to learn. Well, it's in your hands. Once you figured out a thing or two, feel free to create one.
  20. Cool, I did something similar with Otiluke, only handled it a bit differently. One tweak that I never find time to implement but still badly want is to be able to cut through Cromwell's chatter and just get straight to the point, selecting the item to be created directly or through some menu. His rummaging through inventory is mildly annoying in the original, but once you get some item upgrade mods, it's a never-ending click fest...
  21. So, this is since weidu 247, right? And the old way still works? And why does the function not handle the "temporary work directory" itself? Is there any reason why'd you want to not have it?
  22. Huh, I don't see what's even talk about then. The MVP is to just implement downloading the new iemod packages and that's it. It'll ensure that the update is atomic and all users receive the same files without any confusion. Then you could set up some topic with voting on desired features and see the users really do need the extra features, and which ones (deltas, pre-release, etc). Me personally, I don't care much about extra 200Mbs. And large mods aren't released that often, anyway.
  23. It would be delta if you only downloaded the diffs (not repo or tag or release source) and then apply the diff to the local. But I think it's too much to take on. What you describe is, I don't know, git update, or incremental update? Well, it doesn't matter much, just the question of terminolgy. The second part is quite simple - somewhere midgame I happily update some mods and suddenly hell breaks loose - some of them fail to install. Or install and cause crashes. Or screw up tkl refs. Or else. I want to be sure that at any point I can revert to the original state and continue playing the savegames I have. Preferably, with one button click. (Well, theoretically, since PI is windows-only and I don't have windows).
  24. "Delta" usually refers to bin files, I think the name is misleading. Anyway, I don't feel enthusiastic about this. I think that any bugs coming up in a existing installation are better handled by CLUAConsole. There's just too much that can go wrong with a mid-game update. But if you do actually implement this in one form or another, the first must have features are backup and rollback.
  25. Re: stuttering, I just use Pack Mule mod and don't take the holding bags anymore.
×
×
  • Create New...