Skip to content

General mod Questions thread

1246770

Comments

  • kjeronkjeron Member Posts: 2,367

    @kjeron: How would I remove those usability flags in WeiDu?

    COPY_EXISTING	~.*\.itm~	override
    	READ_BYTE	0x18	flag
    	PATCH_IF	(flag BAND 4) = 0	BEGIN	// Undroppable
    		WRITE_LONG	0x1e 0	// Class/Race/Alignment
    		WRITE_BYTE	0x29 0	// Kits
    		WRITE_BYTE	0x2b 0	// More Kits
    		WRITE_BYTE	0x2d 0	// More Kits
    		WRITE_BYTE	0x2f 0	// More Kits
    	END
    BUT_ONLY
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    edited May 2017
    @kjeron: I pasted the code into my TP2, but installation failed. It said,

    ERROR: Failure("resource [.*\\.itm] not found for 'Copy'")

    I fixed it by replacing

    COPY_EXISTING ~.*\.itm~ override

    with

    COPY_EXISTING_REGEXP ~.*\.itm~ override
  • kjeronkjeron Member Posts: 2,367

    I fixed it by replacing
    COPY_EXISTING ~.*\.itm~ override
    with
    COPY_EXISTING_REGEXP ~.*\.itm~ override

    Yes, sorry.
  • chimericchimeric Member Posts: 1,163
    It's true, the problem with leveling up non-standard classes is that there are no experience tables for them - and other things too, probably. But I've experimented with editing (manually) creatures who have non-standard classes to begin with, like an Ogre Mage. Ogre Mages have quite a lot of spells given directly in the CRE they always memorize and can cast, if you have one in the party, but they don't get a spellbook as proper mages do. It's always the same selection therefore. If you change an Ogre Mage to the mage class (or any other normal class, I assume), the creature immediately becomes ready to level up, because it has now accumulated the 0 XP necessary to reach Level 1 in the experience tables that exist. You can start to level up normally even with unusable items, but not exit the level-up screen. Otherwise, i.e. with the items off, the creature becomes a regular mage with respect to spells per level, Lore, THAC0 and so on, gets a spellbook but loses its freebie spells. This is what happens when something goes from a critter to a character.

    When it comes to characters swapping classes, I've used opcode 72 to change class - to a mage again, specifically MAGE, i.e. wizard. You can do this and even turn a sorcerer into a wizard if you like or the other way around. You can also switch a multi-class or dual-class character to single class, in this case I turned a mage/thief into a straight mage. The main limitation is that these transformations don't give a creature the ability to cast spells if it couldn't before. The spellbook or scroll don't get enabled, but you do get an interface change with a useless Cast button. With a switch to thief you get working ability icons and would probably be able to turn undead as a priest. If the creature was a specialist mage, it won't lose the bonus spell for turning generalist. I don't know about special abilities of kits and such.

    The creature keeps its former items on, armor, weapons and everything, you get their benefits and can swing them, but on the inventory screen they are shown in red and if you take them off you won't be able to put them on again. What really changes is the character sheet, though hit points stay the same. The creature can level up in the new class. When (if) the class change wears off, the levels become those of the old class, but the level number remains. Whether this is a leg-up depends on what you switch between. I first switched from fighter to wizard at a rather high level, so the experience table got a lot worse for leveling up, but if you switch to thief early on... It's also possible to dual to the class you are already in from opcode 72 - I've made Imoen a mage with this effect, but she was still able to switch to a mage "for real."

    I don't know if changing class with a script works differently, but I hope some of this will be useful to you.
  • The user and all related content has been deleted.
  • ArdanisArdanis Member Posts: 1,736
    I used to play it all the time. Dual vs multi is determined by creature flags, the race limitations themselves iirc are set in 2DAs.
  • The user and all related content has been deleted.
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    I did just that now with a switch to fighter/mage. Imoen's 4 levels of thief got split up into 3 levels of fighter and 1 level of mage, and she lost the ability to dual-class.



    Still no spellbook, though. Is it possible the book is enabled somewhere else?

    Also the numbers of XP are wrong for the levels she gets. It seems the game first splits current XP between new classes, then sets their levels so that all but 1 level go to the first class. If the second class ends up with a lot of XP but only at 1st level, you naturally get to level up in it all the way up.



    But the leveling-up is abnormal - if I make Shar-Teel level up here, I get the abilities, proficiencies and hit points, but the character sheet doesn't update, she still shows as a level 1 mage. So I could level up forever. What's even stranger is that after I'd gone back to Imoen, turned her into a fighter/mage this way and threw some XP on her was able to keep leveling up in her original class - as thief. She kept getting skill hit points, though the interface gave no place to spend them, and her backstab multiplier kept increasing, apparently. She was a thief underneath.

    You know what's entirely possible? That opcode 72 only signals to the engine that "this is fighter/mage" without actually changing any statistics. The character sheet changes to look at, the interface is swapped out, items are red-colored as unusable and NPC acknowledge the character as a member of the new class (the reason I originally fiddled with this), but what if the character actually performs as the old class? This would explain why there is no spellbook.

    Someone else has dualed, changed the class to a new single and received "Regained abilities of former class" on leveling up high - though it still never shows up. The question is, is the change completely fake or do characters really have new statistics after all? Never mind multi-classing, but this could be useful if changing someone to a fighter really let it get on the progression ladder...

    After testing: no. You can change their class, you can throw XP at them, but they level up with the hit points, limitations and stars of the old class. The whole thing is appearance-only. For thieving abilities and turning undead this probably means they never get the points to spend...

    After more testing: yep. They level up with the power of the old class and the limitations of the new class. Kagain turned thief got many stars from leveling up but couldn't put any in martial weapons, and he got a negative increment to thieving points!!

    Then again, IF thieving works on account of just having the interface to click, even when you're a fighter underneath, then Stealth could be boosted with other opcodes. This might be useful for turning creatures into thieves - opcode 72, then a Stealth bonus.

    YeS! Tested. Kagain fake-changed into a thief with two opcodes on top for his arthritis is smooth like a David Lynch ballerina. Also tested for the backstab multiplier - applies. What is that useful for? Well, imagine that you want to orchestrate a monster encounter where they keep dodging in and out of sight and striking from the shadows. Even better - imagine that you want some of the monsters on the map to be invisible after spawning, imitating the surprise mechanic, so they party has to tumble onto them. Instead of changing the class of monster in NI you could extend the top of creatures' scripts (ones that are monster-specific, like XVART.BCS, TROLL.BCS etc. and write a few more of your own) with something like this:

    IF
    OnCreation()

    THEN
    RESPONSE #5

    ApplySpellRES("makethif",Myself)
    Wait(5)
    Continue()

    RESPONSE #30

    Wait(5)
    Continue()
    END

    IF
    OnCreation()
    Class(Myself,THIEF)

    THEN
    RESPONSE #100

    Hide()
    Continue()

    END

    The custom spell some of the monsters would cast would apply in a modest radius opcode 72 with a stealth boost, turning the entire spawned band into one-time sneaks. They would jump on the party out of thin air once it comes near, maybe even stabbing in their backses! I just wonder what the real THAC0 and number of attacks become with a 72 change?

    I'm ending this page-turner with a great mystery: whether turning undead works for de jure priest levels. If it does, the opcode becomes quite nice for an improptu ordination - a custom spell to give the target this power. Another high-level party member leveraging his levels to assist the cleric in the turning of undead would be a handy thing in places.
    Post edited by chimeric on
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    About Turn Undead and Detect Illusions: do these things work using a spell, like bard songs and the Shaman's dance do? I thought I saw a Detect Illusions spell when poking around in Near Infinity once, and I know that Detect Illusions in Improved Anvil is modded to not bypass SI: Divination, so presumably it's possible to modify these things.
  • The user and all related content has been deleted.
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    Still no spellbook, though. Is it possible the book is enabled somewhere else?

    THAC0, Saving Throws, Spell slots, and Known Spells only update when you actually level up. Most other aspects update immediately (item restrictions, spec/apr bonuses, action-bar, lore, turn-undead level).
    chimeric said:


    After testing: no. You can change their class, you can throw XP at them, but they level up with the hit points, limitations and stars of the old class. The whole thing is appearance-only. For thieving abilities and turning undead this probably means they never get the points to spend...
    After more testing: yep. They level up with the power of the old class and the limitations of the new class. Kagain turned thief got many stars from leveling up but couldn't put any in martial weapons, and he got a negative increment to thieving points!!

    This happens because you are using an attached effect, not a permanent change. Leveling up uses your base class, while the "button" to level up only looks at current class/xp to decide when it is enabled. If you used opcode 72 with timing mode 1 it would fully become the new class.

    Experience is not stored separately for each class, each character has only one listing of experience.
    A multiclass divides it among all classes. A Dual-class subtracts the necessary experience for their original class from their maximum experience, but it otherwise doesn't exist - your total exp is reset to 0 when you dual-class.

    Your Second and Third class levels are already set, just hidden. Most NPC's have their second and third class levels set to '1', while others have arbitrary numbers (15, 30, etc...). The Chargen process sets Charnames second and third level to '0' if they are not being used.
    chimeric said:


    Then again, IF thieving works on account of just having the interface to click, even when you're a fighter underneath, then Stealth could be boosted with other opcodes. This might be useful for turning creatures into thieves - opcode 72, then a Stealth bonus.

    ANYONE can use Hide in Shadows through scripts, your class/kit is irrelevant, you just need points in the
    skill. Same for all Modal's except Turn Undead. Pickpocket and Open Lock are a little trickier since you have to specify a target if your activating them through scripts. Disarm Trap is possible through scripts but not worth IMO it due to how traps are currently identified in area files.
    chimeric said:


    I'm ending this page-turner with a great mystery: whether turning undead works for de jure priest levels. If it does, the opcode becomes quite nice for an improptu ordination - a custom spell to give the target this power. Another high-level party member leveraging his levels to assist the cleric in the turning of undead would be a handy thing in places.

    Turn Undead level is hardcoded to Cleric's and Paladin's(-2), and the opcode to modify it doesn't work on other classes either - similar to how the Casting Level Bonus opcode only works if the class can already cast spells of that type(priest/wizard). I've put this to use before using the Turn Undead opcode, by using a 0-duration opcode 72 right before it. You could fully convert the Bard Song/Shaman Dance into Turn Undead if you wanted to.
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    kjeron said:


    THAC0, Saving Throws, Spell slots, and Known Spells only update when you actually level up. Most other aspects update immediately (item restrictions, spec/apr bonuses, action-bar, lore, turn-undead level).

    It doesn't matter when they should update. The spellbook never appears with a 72 change, before or after leveling up in what seems to be the new class - but is actually the old class forced to accept the old one's experience table and limitations. I wrote about this. Characters get some special abilities of the fake class, like the backstabbing multiplier and starting thieving skills, on account of being level 1 thieves, but not magic if turned into spellcasters. In short, some abilities accrue, some don't. I'd like to know whether regular stuff - THAC0, saves, number of attacks etc. really do conform to what's on the character sheet or if that part is for show too.
    kjeron said:

    This happens because you are using an attached effect, not a permanent change. Leveling up uses your base class, while the "button" to level up only looks at current class/xp to decide when it is enabled. If you used opcode 72 with timing mode 1 it would fully become the new class.

    My duration was 9.
    kjeron said:

    ANYONE can use Hide in Shadows through scripts, your class/kit is irrelevant, you just need points in the
    skill. Same for all Modal's except Turn Undead. Pickpocket and Open Lock are a little trickier since you have to specify a target if your activating them through scripts. Disarm Trap is possible through scripts but not worth IMO it due to how traps are currently identified in area files.

    It's true, I forgot that anyone can hide. Well, so much the easier to implement surprise. Making the creature a pseudo-thief with 72 first may be useful, at least, if it's to be a new party member or familiar, or rather if you want a way to give all joiners some stealth. That's not a bad idea, actually, for something that involves hiring mercenaries or such. They'd all get the thief interface. Or perhaps manipulation - a spell to take over the mind of a street NPC and make him/her sneak and steal.

    And if you had a bunch of "bards" following the party around, you could have a lot of songs played at once in your ears, I suppose. Baldur's Gate: A Musical Odyssey! With Mickey Mouse directing.

    Or: some actual musicians at inns and taverns, standing and playing. Bard songs can be modified to have different effects, yes? Can they be changed on the fly? I see the outline of a... JUKEBOX!
    kjeron said:

    Turn Undead level is hardcoded to Cleric's and Paladin's(-2), and the opcode to modify it doesn't work on other classes either - similar to how the Casting Level Bonus opcode only works if the class can already cast spells of that type(priest/wizard).

    Well, I wasn't going to modify the ability but make a random high-level guy a priest, walk among skeletons, click on the icon and see. Heck, now I'm going to have to do it.

    An unexpected result! I tested a change to CLERIC on Edwin, who was maxed-out for BG1. Well, he controlled those skeletons alright, so we know Turn Undead uses the fictional class level, but also the Cast button remained enabled for him. He didn't get priest spells, but he had his own arsenal of mage stuff with specialist bonuses. In effect, this made him into a mage that can turn undead. Kit idea?

    I took the opportunity to see if he could still use items now red for him - a Wand of Fire he had equipped. He could, though if he took off the stuff, he wouldn't have been able to equip it again.

  • chimericchimeric Member Posts: 1,163
    edited May 2017

    About Turn Undead and Detect Illusions: do these things work using a spell, like bard songs and the Shaman's dance do? I thought I saw a Detect Illusions spell when poking around in Near Infinity once, and I know that Detect Illusions in Improved Anvil is modded to not bypass SI: Divination, so presumably it's possible to modify these things.

    Not spells. Those are called modal actions, because a character is always only in one of those modes. Look for them in MODAL.IDS in Near Infinity - NORMAL or NONE, I don't remember, is there too. I don't know about Improved Anvil, but the tweak must be on the side of SI: Divination or somewhere in between. For example, one of the things this ability does is make vanish creatures of ILLUSIONARY Gender, if they are hostile - because it only does away with hostile illusions, thankfully. As it happens, there aren't any illusionary creatures in the games except a couple of werewolves in the mad gnome's tent in BG2, so when making new illusion spells and challenges a while ago, including hostile illusionary "creatures," I wanted to introduce some new rules to set them apart from basic summons. Though the mod remains unfinished, I did make a few spells.

    Among other things, illusions were to be unkillable, but they could be disbelieved, dispelled, eliminated with True Seeing and Detect Illusions. But it's too easy to bring this ability to 50% or so for a character. In a couple of rounds any hostile illusion, no matter how powerful, would have been wiped off by a 2nd level gnome, and there is no way to make Detect Illusion less powerful. What to do? I decided that the stronger hostile illusions will be scripted to change Gender every other round for a round and maybe not begin with that vulnerable Gender at all. That way a thief trying to see through them would have to be luckier and take a longer time even with this skill at 100%. So there are ways around, but not an actual rebuff to modal actions. If I'm not mistaken, even deaf creatures get the benefit of a bard song.
  • kjeronkjeron Member Posts: 2,367
    edited May 2017
    chimeric said:

    kjeron said:


    THAC0, Saving Throws, Spell slots, and Known Spells only update when you actually level up. Most other aspects update immediately (item restrictions, spec/apr bonuses, action-bar, lore, turn-undead level).

    It doesn't matter when they should update. The spellbook never appears with a 72 change, before or after leveling up in what seems to be the new class - but is actually the old class forced to accept the old one's experience table and limitations. I wrote about this. Characters get some special abilities of the fake class, like the backstabbing multiplier and starting thieving skills, on account of being level 1 thieves, but not magic if turned into spellcasters. In short, some abilities accrue, some don't. I'd like to know whether regular stuff - THAC0, saves, number of attacks etc. really do conform to what's on the character sheet or if that part is for show too.
    kjeron said:

    This happens because you are using an attached effect, not a permanent change. Leveling up uses your base class, while the "button" to level up only looks at current class/xp to decide when it is enabled. If you used opcode 72 with timing mode 1 it would fully become the new class.

    My duration was 9.
    Timing mode 9 is an attached effect in this regard, this only affects aspects of the creature that change dynamically.
    Timing mode 1 is the only one that can change the "base" class, and the "base" class determines which "level-up" statistics are used.
    With timing mode 9 you will still level up as a thief, with timing mode 1 you will level up as a fighter/mage.

    If you want a general idea - if changing the associated .2da file does not immediately update the creatures statistic, neither will changing their class.

    Backstab multiplier changes dynamically, change your kit/class or the .2da, and it updates immediately.
    All the thieving skill .2da's update dynamically, and such so does changing class/kit:
    (THIEFSCL.2DA, SKILLBRD.2DA, SKILLDEX.2DA, SKILLRAN.2DA, SKILLSHM.2DA, TRAPLIMT.2DA).
    chimeric said:

    An unexpected result! I tested a change to CLERIC on Edwin, who was maxed-out for BG1. Well, he controlled those skeletons alright, so we know Turn Undead uses the fictional class level, but also the Cast button remained enabled for him. He didn't get priest spells, but he had his own arsenal of mage stuff with specialist bonuses. In effect, this made him into a mage that can turn undead. Kit idea?

    How was that unexpected? The biggest problem you will run into doing this is XP Table. If you were to alter all classes to use the same experience tiers, it would actually be quite stable, so long as you didn't mix single/mutli classes. You do lose your mage casting level though.
    If you try it, know that for the Kit's CLAB to be used, the kit's class in "KITLIST.2da" must match the "base"(mage) class.
    For it to be displayed on the record/inventory screen, the kit's listing in "CLASTEXT.2da" must be for the "current"(cleric) class.
    For the kit description to be displayed on the record screen, the kit's listing in "CLASTEXT.2da" must be for the "base"(mage) class.
    chimeric said:


    I took the opportunity to see if he could still use items now red for him - a Wand of Fire he had equipped. He could, though if he took off the stuff, he wouldn't have been able to equip it again.

    Class/kit Usability = Equipability.
    Only opcodes can disable item "use": 144(button), 180(itemres), and 181(itemtype).
    Post edited by kjeron on
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    I didn't know that about the 1 duration. Hear! Hear! It did the trick completely - spell books and scrolls appeared and statistics were gained at level-up. Great job! You've cleared the way to a proper class change.

    ...Now what happens if the effect is dispelled? :dizzy:
  • kjeronkjeron Member Posts: 2,367
    edited May 2017
    chimeric said:

    I didn't know that about the 1 duration. Hear! Hear! It did the trick completely - spell books and scrolls appeared and statistics were gained at level-up. Great job! You've cleared the way to a proper class change.

    ...Now what happens if the effect is dispelled? :dizzy:

    Timing Mode 1 does not leave an effect behind to be dispelled (or removed by opcode 321 or death or export etc...), in the case of opcode 72.
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    kjeron said:

    How was that unexpected? The biggest problem you will run into doing this is XP Table. If you were to alter all classes to use the same experience tiers, it would actually be quite stable, so long as you didn't mix single/mutli classes. You do lose your mage casting level though.

    With timing mode 1 you suggested, the class change seems real and complete. And normal. It seems to me that Edwin in this case should really trade his wizard spells for the priest scroll. With a semi-change using timing mode 9 he had his wizard's selection AND the Turn Undead ability. I'll leave the kit idea to people who do this sort of thing.

    I did a little more testing just now to see what timing mode 1 to CLERIC does to mages, Edwin again. His spellbook became grayed out, with the old spells still visible, and he received the priest scroll, but no spell selection or memorization slots. They appeared only when he leveled up, just as you've said. Whoever wants to play around with 72 is going to have to navigate around this. Maybe for multi-classing humans at start-up the change could be applied immediately in Candlekeep after character creation or experience set to 0? It takes 0 XP to reach level 1 in a class. If opcode 104 can reset the total or set it to 1 for a multi combination, the player would just have to level up manually once there, next to Winthrop's. Okay, a few bonus hit points from the defunct class. Could be taken away by a script, all except 3 to account for Constitution.

    By the way, avatars stay the same with 72. This effect could let people play a hulking fighter type but actually a mage or thief or vice versa.
  • chimericchimeric Member Posts: 1,163
    kjeron said:

    Class/kit Usability = Equipability.
    Only opcodes can disable item "use": 144(button), 180(itemres), and 181(itemtype).

    That's not true. Try 72 with timing mode 9 and you'll see that officially unequippable items can stay equipped and be used from item slots.

    Anyway, I made a prototype for letting humans and anyone to multi-class in all of the combinations from CLASS. It's an item to keep it to one file - a ring - and it turns the target into a starting cleric/thief with a combination of opcode 72, an experience reset and changes to the number of attacks, Lore and hit points to keep them to the minimum. We know what the minimum is, it's what everyone starts out with, which is why this should be a solution for starting characters. If really implemented, this would probably take the form of an addition to the starting area script to give a custom ability to the main character for, say, 60 seconds. The ability would then let him choose a class combination from a menu.

    The reason hopping about on opcode 72 is no good for developed characters is because it's not enough to reduce XP and change class - their level would also have to be changed, and I noticed that opcode 96 doesn't delevel people properly. It also can't reduce level count in all classes to 0.

    For starting characters, though, this would do the trick nicely for the most part. The classes show up as 1/0, but kjeron has already explained that, and at leveling up statistics like attacks and lore fall in line. A few I couldn't set straight, though. One number that doesn't change at all with 72 is THAC0. In any combinations it's still what it was before and after a refresher level-up. It should be possible to set THAC0 with opcodes, but I have doubts about that method. Another place is proficiencies. 72 doesn't take away stars, so I had to modify them - confiscate them all. Leveling up brings new stars, but since both classes can't go to level 0, players would only get beginning stars from the one that does.

    Here is the ring. Try it! It does make one a cleric/thief, and that's cool! If THAC0 can be handled, proficiencies could be assigned with some script checks, though, of course, we have no way of knowing where players would want to put them. Maybe a better solution would be to roll all levels back to 1 instead of 0, so there would be no freebie stars for any class, and ask people to generate a fighter. That ought to satisfy them completely with regard to stars at the get-go.
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    kjeron said:

    Class/kit Usability = Equipability.
    Only opcodes can disable item "use": 144(button), 180(itemres), and 181(itemtype).

    That's not true. Try 72 with timing mode 9 and you'll see that officially unequippable items can stay equipped and be used from item slots.
    I think you misunderstood me, because your saying same thing in a different way.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    Is there a way to bring SoD's new animations (neothelids, IWD-style wights and shadows, and smaller-circled green dragons and bugbears) into BG2?
  • chimericchimeric Member Posts: 1,163
    I have another question for anyone willing to answer. Can spawn points be edited with Weidu? I'd like to configure them in an area so they produce a different kind of creature. There seems no way to control spawn points with scripts and controls within a basic, so I'm thinking of making them produce generic invisibles scripted to replace themselves in response to globals.

    Oh, and can Weidu... scratch that, can the engine change the description of an "info trigger" or whatever they are called? I'm talking about the exit cave from the Nashkel mine. Outside the cursor over it is the gate, Enter, but clicking produces only the line that the passage has collapsed... By the way, was this so in the original BG? I think it used to be possible to walk back in there. Anyway, I'm satisfied with that door giving a message instead of entry, but I'd like to be able to switch it flexibly. For example, if the party travels directly to that desert area before going to the mine, the line about a collapsed tunnel leading "back" won't make much sense.
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    Never mind. Had another question that resolved itself. Still would like to know the above, though.
  • ArdanisArdanis Member Posts: 1,736
    Spawns can't react to variable checks, so you'd need a script for that, yes. Btw a lot of BG2 dungeon spawns points in dungeons are scripted, so you can use them as reference.

    Duplicate the region and activate/deactivate the two to switch between them. If it's just a different string to display, you can simply script the info trigger (if it uses embedded strref instead of script, then remove the former and script it instead). I don't think you can make a travel region prevent area transitioning, scripts or not, so duplication is the only choice here.
  • chimericchimeric Member Posts: 1,163
    I don't have BG2 installed. But if you say scripts can do it, I'll look into it. Can I use Weidu to substitute scripts for a spawn point or several in an ARE? Do you know the code for that?
  • ArdanisArdanis Member Posts: 1,736
    There's fj_are_structure function for area editing, usage examples can be found here http://www.weidu.org/~thebigg/README-WeiDU.html#sec52
  • badungubadungu Member Posts: 53
    @chimeric,

    I coded some examples how to handle spawn points inside an area file...
    COPY_EXISTING ~AR5100.are~ ~override~ SET spawn_delete = 0 //set spawn_delete to 0 GET_OFFSET_ARRAY spawns ARE_V10_SPAWN_POINTS //get spawns array (0x60 4 0x64 4 0 0 0xc8) PHP_EACH spawns AS spawns_num => spawns_offset BEGIN //loop through spawns array READ_ASCII spawns_offset spawns_name (32) NULL //read the name of the spawn points //set creature 1 in spawn point 10 to somecre PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 10~ BEGIN //if spawn point name = Spawn Point 10 WRITE_ASCII spawns_offset+0x24 ~somecre~ #8 //creature 1 END //set creature 1-10 in spawn point 11 to somecre PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 11~ BEGIN //if spawn point name = Spawn Point 11 PATCH_FOR_EACH offset IN 0x24 0x2c 0x34 0x3c 0x44 0x4c 0x54 0x5c 0x64 0x6c BEGIN //patch for these offsets (creature 1-10) WRITE_ASCII spawns_offset+offset ~somecre~ #8 //creature 1 END END //get id of spawn point 12 for deletion PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 12~ BEGIN //if spawn point name = Spawn Point 12 SET spawn_id = spawns_num //set spawn_id to current id SET spawn_delete = 1 //set spawn_delete to 1 (only if a spawn point exists with this name) END END //delete spawn point 12 PATCH_IF spawn_delete = 1 BEGIN //only if spawn_delete = 1 LPF fj_are_structure INT_VAR fj_delete_mode = EVAL ~%spawn_id%~ //delete evaluated spawn_id STR_VAR fj_structure_type = spawn //type END END //add new spawn point LPF fj_are_structure INT_VAR fj_loc_x = 3555 //location x fj_loc_y = 367 //location y fj_spawn_num = 2 //#creatures fj_difficulty = 200 //encounter difficulty fj_max_num = 4 //max spawned creatures STR_VAR fj_structure_type = spawn //type fj_name = ~new spawnpoint~ //name fj_cre_resref0 = ~somecre~ //creature 1 fj_cre_resref1 = ~somecre~ //creature 2 END BUT_ONLY

    If you want to add a trapped spawn, you could use something like this:

    //add new proximity region(trigger) LPF fj_are_structure INT_VAR fj_type = 0 //proximity (trap) fj_box_left = 1157 //bounding box: left fj_box_top = 1049 //bounding box: top fj_box_right = 1264 //bounding box: right fj_box_bottom = 1137 //bounding box: bottom fj_trap_detect = 100 //trap detection difficulty fj_trap_remove = 100 //trap removal difficulty fj_trap_active = 1 //trap active (1 = yes) fj_loc_x = 1200 //launch x coordinate fj_loc_y = 1090 //launch y coordinate fj_vertex_0 = 1169 + (1137 << 16) //vertex 0 fj_vertex_1 = 1157 + (1050 << 16) //vertex 1 fj_vertex_2 = 1241 + (1049 << 16) //vertex 2 fj_vertex_3 = 1264 + (1121 << 16) //vertex 3 STR_VAR fj_structure_type = region //type fj_name = ~prox_trigger_1~ //name fj_reg_script = ~script~ //script END

    The script.bcs could look like this:

    IF Entered([ANYONE]) THEN RESPONSE #100 CreateCreatureEffect("somecre","",[-1.-1],S) END
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Ardanis: Is it possible to bring SoD animations into BG2? Could I give Morentherene's green dragon sprite to a BG2 critter?
  • ArdanisArdanis Member Posts: 1,736
    edited May 2017
    I'm not really a specialist in graphic resources, but should be doable. Morenthing's animation slot is 7f62, and in the respective .ini there's usually the animation .bam's prefix referenced to track down and copy. In this case, it's two files only. Don't ask me how to mess with it if you want alterations made, though, as I said it's not something I'm well familiar with :)
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    @badungu , Thanks a lot. I believe this is the bit I need to alter the creature list:

    PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 11~ BEGIN //if spawn point name = Spawn Point 11
    PATCH_FOR_EACH offset IN 0x24 0x2c 0x34 0x3c 0x44 0x4c 0x54 0x5c 0x64 0x6c BEGIN //patch for these offsets (creature 1-10)
    WRITE_ASCII spawns_offset+offset ~somecre~ #8 //creature 1
    END
    END

    Another good idea which isn't often used, I think, is to script with CreateCreatureOffscreen. This is a very natural-seeming way to make creatures emerge on the scene, if they are commanded to come towards the party by their script name, one after the other.
  • chimericchimeric Member Posts: 1,163
    edited May 2017
    I'm probably not putting some syntax right, because I'm getting a missing-token complaint for this:

    PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 1~ BEGIN //if spawn point name = Spawn Point 1 PATCH_FOR_EACH offset IN 0x24 0x2c 0x34 0x3c 0x44 0x4c 0x54 0x5c 0x64 0x6c BEGIN //patch for these offsets (creature 1-10) WRITE_ASCII spawns_offset+offset ~nxvart_#~ #8 //creature 1 END END BUT_ONLY - error here - PATCH_IF ~%spawns_name%~ STRING_EQUAL_CASE ~Spawn Point 2~ BEGIN //if spawn point name = Spawn Point 2 PATCH_FOR_EACH offset IN 0x24 0x2c 0x34 0x3c 0x44 0x4c 0x54 0x5c 0x64 0x6c BEGIN //patch for these offsets (creature 1-10) WRITE_ASCII spawns_offset+offset ~nxvart_#~ #8 //creature 1 END END BUT_ONLY
Sign In or Register to comment.