Skip to content

General mod Questions thread

13468970

Comments

  • chimericchimeric Member Posts: 1,163
    Because, subtledoctor, it has to be a universal and open-ended system, not a patch. Even supposing I can figure out just who to fix, which characters or creatures on someone's setup, what will happen if the player installs a new NPC or several, or maybe reinstalls them? Can I require people to run my mod every time they change something? And it's fine to put things in baldur.bcs in moderation. It bogs down nothing and there is no other script for anytime, anyplace.
  • [Deleted User][Deleted User] Posts: 0
    edited August 2017
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • tbone1tbone1 Member Posts: 1,985

    I mean, players should know not to mess around with mod setups in the middle of their games. That's on them. It will never go well, regardless of whether this particular mod has s installed. And every BG mod has to pay attention to install order, so easy enough to simply say in your readme, "install this after any/all NPC mods."

    In other words, for all that software has advanced in 30 years, users haven't.
  • [Deleted User][Deleted User] Posts: 0
    edited August 2017
    The user and all related content has been deleted.
  • chimericchimeric Member Posts: 1,163



    Or heck, just patch it onto every .cre file in the game. It won't matter - AI scripts won't ever use it - and you guarantee every playable NPC will have it, even the ones added to the party by ctrl-q.

    All right, you've convinced me.

  • chimericchimeric Member Posts: 1,163
    The G3 guide says about this action:

    "This action changes the assigned script file for the active creature. The new script name is specified in the scriptfile parameter. The level parameter dictates the script level to change - values are from scrlev.ids. Scripts can be set for any scriptable object (container, creature, door etc.), but are not persisted."

    Not persisted, really? So if I save the game and reload, the old scripts will return?
  • chimericchimeric Member Posts: 1,163
    I'm putting some people to sleep, at an inn, and it looks awfully uncomfortable when they stretch out in full plate, a winged helmet and clutching two long swords. An adventurer's instinct, maybe, or just spasmed hand flexors, but it's dangerous to room service. Can I script NPC to take off their basic equipment and then, once they wake up, put it on again? How about FillSlot() for this? Doesn't guarantee the chosen items will be the same as the optimal exploring setup, but how many weapons and suits of armor do we carry around at once, really. The only hassle may be with double-wielders. If I use FillSlot() to search for something for the offhand slot, the game is going to stick the first thing suitable in there, even a shield or a dagger. And those who use two-handed weapons will have their big swords and bows taken off. It may be better to somehow just unselect weapons so they don't show but stay held. How do I do that?
  • chimericchimeric Member Posts: 1,163
    Specifically at what point does the mug icon appear? Same question for fatigue. What values do I need for CheckStat() with these to single out people visibly drunk and tired?
  • kjeronkjeron Member Posts: 2,368
    Non-zero entries in INTOXMOD.2da and FATIGMOD.2da.
  • ArdanisArdanis Member Posts: 1,736
    They persist, IESDP is wrong.
  • ArdanisArdanis Member Posts: 1,736
    Try polymorphing them into sleeping sprites.
  • chimericchimeric Member Posts: 1,163
    Hmm. I haven't thought of that. But there is just a handful of those. No dwarven women or elven women or gnomes of either sex. No half-orcs.
  • chimericchimeric Member Posts: 1,163
    How do I check for them? Fatigue and intoxication are stats no. 30 and 31. So what do I need, CheckStatGT(Myself,0,30) and CheckStatGT(Myself,0,31)?
  • chimericchimeric Member Posts: 1,163
    They at most turn to attack an unconscious PC for a moment, then break off and turn on others who are standing. This may be tactically to keep the sleepers out of the combat, instead of waking them up with damage, but it's strange. Any way to bypass that?
  • chimericchimeric Member Posts: 1,163
    edited August 2017
    Okay, the downside of patching turned out to be that it changed nothing about existing creatures - NPC in or out of the party. And it's YOUR fault!
  • [Deleted User][Deleted User] Posts: 0
    edited August 2017
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • chimericchimeric Member Posts: 1,163
    Yes, I figured! That's why it's a bad solution!

    I guess I should say thanks for the suggestion...
  • chimericchimeric Member Posts: 1,163
    Any way to tell if it's raining? Yeah, yeah, besides the little drops.
  • chimericchimeric Member Posts: 1,163
    I've asked a lot of questions, well, here is a contribution from my end: if you want a character to take off some of his items without having to know a specific RESREF of an item, you can order him to take his own equipment. From an invisible summoned minion:

    ActionOverride(LastSummonerOf(Myself),TakeCreatureItems(Myself,3))

    In TAKEITEM.IDS "3" is for weapons, so this command causes the character to put his weapon and shield in his inventory, in the first empty slots. Later you can use FillSlot(SLOT_WEAPON) and FillSlot(SLOT_SHIELD) to rather reliably put them back in his hands, unless he is carrying an assortment of weapons and shields in the backpack. The FillSlot() commands can be a standard list - if the character has nothing for a slot, he will just move on to the next order. The IDS file gives you a few more options:

    IDS V1.0
    0 ALL
    1 BACKPACK
    2 EQUIPPED
    3 WEAPONS
    4 QUICKITEMS

    I haven't tested, but you should be able to strip people completely with these. Also, in the case of weapons, a command like the above in a fight would effectively disarm an enemy, though he might just put on the stuff again if scripted with EquipMostDamagingMelee() and such. Still, it should cause an one-round loss of attacks, at least, or potions for "0" or "4." If armor also gets taken off with "0" and "2," then it may not, possibly, be reequipped in the same fight.
  • ArdanisArdanis Member Posts: 1,736
    Only by checking and targeting the exact objects, i.e. PlayerX or script name. Nearest() and [] are out of luck.
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    There's no weather trigger, AFAIK. You can make it rain (or snow, etc..) with a Weather() action. Then, you know the weather. I do that in the Neera Banters mod. The mod starts up a particular weather type before firing a weather-related banter.
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    What happens if the inventory is full? Is the item is dropped on the ground?
  • tbone1tbone1 Member Posts: 1,985
    chimeric said:

    I haven't tested, but you should be able to strip people completely with these.

    Okay, has anybody else had an idea for a mod of, say, Safana and Coran going to a disreputable bar in Baldur's Gate?
  • chimericchimeric Member Posts: 1,163
    edited August 2017
    To AstroBryGuy - Yes, items drop then. So that works, but I'm having trouble with using FillSlot(SLOT_WEAPON0) to get weapons back in people's hands. For some reason it's a destructive replacement that consumes all items of a type. If the character had, say, a spear and a sling equipped and a staff in the backpack, then was told to take his own stuff, the spear and sling end up in the inventory and the quick item slots empty out. But after FillSlot() the last one of the weapons in the backpack, whichever it is, ends up in the leftmost slot, which I assume is WEAPON0. It's not selected, however, and not showing out on the avatar, only on the paperdoll. What is selected instead is always the next slot with a fist. And all other weapons in the backpack are just consumed.

    Also TakeCreatureItems() requires the creature doing the taking to have an avatar. No NULL_ANIMATION, though we can use Translucency at 255 + a flying shadowless avatar for complete invisibility, which is almost as well. And I'm having trouble getting staff from a minion, though I robbed an ogre just fine. Maybe there is something wrong with the minion. I invite people to experiment with this - we could use minions as moveable containers if we figure out how the transfer works.
    Post edited by chimeric on
  • chimericchimeric Member Posts: 1,163
    It's really too bad. Missing features like these show the limitations of the engine more than even technical shortcomings. Imagine what we could do if we could make characters react to weather or if a spell could only be cast in the rain. That pillared temple ruins with Red Wizards in it in BG has a wide, water-filled bowl in the middle, and the water ripples under rain drops. It would be so fine to make that bowl into a trigger so it becomes a scrying mirror in the rain, part of a quest... Beamdog, how about a weather check trigger?
  • chimericchimeric Member Posts: 1,163
    Too bad. Unfair, too. Nothing is stopping PCs from kicking enemies on the ground.
  • jasteyjastey Member Posts: 2,781
    What action would I use to let my NPC be unconscious during a fight so the enemies stop attacking him, does PlayDead() work here the same way?
  • kjeronkjeron Member Posts: 2,368
    PlayDead() is just an animation, they need STATE_SLEEPING.

    It only works in certain conditions. If all of their visible enemies are sleeping, they will still target you if they target using Nearest(), but not if they target using [] or are berserk. They will only switch targets if they are using the AttackReevaluateI() action, not when using the Attack() action.

    Unconscious creatures have had other special exceptions as well. The engine doesn't allow creatures with non-lethal weapons(fists) to attack unconscious creatures at all, even when manually ordered. Wall spells (Wall of Moonlight) originally could not affect them either.
  • jasteyjastey Member Posts: 2,781
    Thank you. (This means it doesn't solve a problem I have, but that's good to know, too.)
  • ArdanisArdanis Member Posts: 1,736
    Try opcode 100, param1=0 & param2=2. It will make your NPC untargetable by anyone, though you'll have to remove it later (e.g. with 321).

    Also, while I personally have conceptual objections to utilizing custom AI instead of game's default, but if you have control over enemies and their scripts, those can be modified to prioritize targets or only pick specific ones. Normally I'd suggest to look at some of the existing AI scripts for how it's done, but... it might be more overwhelming than it sounds, especially if you aren't already somewhat familiar with the subject, so feel free to ask for help with that.
Sign In or Register to comment.