Skip to content

General mod Questions thread

145791070

Comments

  • chimericchimeric Member Posts: 1,163
    And if you replace a script with something, you should replace THAT with a blank afterwards. Except the default-level script for NPC, which is going to get set to a specific file as they leave the party without fail, so you can do whatever with that slot. And AREA. :D

    And about sleep - is there anyone who targets an attack on a plain Nearest()? I doubt it.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited August 2017
    Death variables are normal variables. So yeah, if multiple creatures die with the same script name, their generated death variable will be the same. So they will increase the same DV. Note, you can override a scripting name (therefore the DV) in the .are format OR via scripting at any point before death.

    MakeGlobal doesn't care about a proper scripting name (the protagonist has none either).

    Global characters don't make an area active. Only party members do. All of the joinable npcs of the old game are global chars (they are in the .gam file, not in the .are). Makeglobal "transfers" them from the .are to the .gam - more like, global creatures get saved into the .gam instead of the .are.
    Global characters also run their scripts 24/7, so having a lot of them with buggy scripts (those that got some blocks repeatedly triggering) can break the game.
  • kjeronkjeron Member Posts: 2,368
    chimeric said:

    And about sleep - is there anyone who targets an attack on a plain Nearest()? I doubt it.

    We are talking about Nearest() as a type of object specifier, as opposed to [] and direct references(Player1), so all/most of these:
    2 LeaderOf
    3 GroupOf
    4 WeakestOf
    5 StrongestOf
    6 MostDamagedOf
    7 LeastDamagedOf
    8 ProtectedBy
    9 ProtectorOf
    10 LastAttackerOf
    11 LastTargetedBy
    12 NearestEnemyOf
    13 LastCommandedBy
    14 Nearest
    15 LastHitter
    16 LastHelp
    17 LastTrigger
    18 LastSeenBy
    19 LastTalkedToBy
    20 LastHeardBy
    28 StrongestOfMale
    29 SecondNearestEnemyOf
    30 ThirdNearestEnemyOf
    31 FourthNearestEnemyOf
    32 FifthNearestEnemyOf
    33 SixthNearestEnemyOf
    34 SeventhNearestEnemyOf
    35 EighthNearestEnemyOf
    36 NinthNearestEnemyOf
    37 TenthNearestEnemyOf
    38 SecondNearest
    39 ThirdNearest
    40 FourthNearest
    41 FifthNearest
    42 SixthNearest
    43 SeventhNearest
    44 EighthNearest
    45 NinthNearest
    46 TenthNearest
    47 WorstAC
    48 BestAC
    49 LastSummonerOf
    50 NearestEnemyOfType
    51 SecondNearestEnemyOfType
    52 ThirdNearestEnemyOfType
    53 FourthNearestEnemyOfType
    54 FifthNearestEnemyOfType
    55 SixthNearestEnemyOfType
    56 SeventhNearestEnemyOfType
    57 EigthNearestEnemyOfType
    57 EighthNearestEnemyOfType
    58 NinthNearestEnemyOfType
    59 TenthNearestEnemyOfType
    60 NearestMyGroupOfType
    61 SecondNearestMyGroupOfType
    62 ThirdNearestMyGroupOfType
    63 FourthNearestMyGroupOfType
    64 FifthNearestMyGroupOfType
    65 SixthNearestMyGroupOfType
    66 SeventhNearestMyGroupOfType
    67 EigthNearestMyGroupOfType
    67 EighthNearestMyGroupOfType
    68 NinthNearestMyGroupOfType
    69 TenthNearestMyGroupOfType
    76 NearestDoor // Can doors sleep?
    77 SecondNearestDoor
    78 ThirdNearestDoor
    79 FourthNearestDoor
    80 FifthNearestDoor
    81 SixthNearestDoor
    82 SeventhNearestDoor
    83 EighthNearestDoor
    84 NinthNearestDoor
    85 TenthNearestDoor
    94 LastKilled
    95 NearestAllyOf
    96 SecondNearestAllyOf
    97 ThirdNearestAllyOf
    98 FourthNearestAllyOf
    99 FifthNearestAllyOf
    100 SixthNearestAllyOf
    101 SeventhNearestAllyOf
    102 EighthNearestAllyOf
    103 NinthNearestAllyOf
    104 TenthNearestAllyOf
    105 FarthestEnemyOf
    106 SecondFarthestEnemyOf
    107 ThirdFarthestEnemyOf
    108 FourthFarthestEnemyOf
    109 FifthFarthestEnemyOf
    110 SixthFarthestEnemyOf
    111 SeventhFarthestEnemyOf
    112 EighthFarthestEnemyOf
    113 NinthFarthestEnemyOf
    114 TenthFarthestEnemyOf
  • chimericchimeric Member Posts: 1,163
    Those are rare, though. Except NearestEnemyOf(Myself) and LastSeenBy(Myself). Those are common. Anyway, I won't pretend that I know a lot about this. But I can improve a little on Ardanis' suggestion for opcode 100 - instead of protection from ANYONE, jastey should use EVILCUTOFF. That way friendlies could still help these party members, heal them and so on. Or she could use Sanctuary. Also the convenient way to get rid of the protection is probably with Cast spell on movement.
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,760
    The moderation team have decided to merge several threads by @chimeric with this topic, as this is exactly what this thread is about - getting answers on questions about modding.
  • chimericchimeric Member Posts: 1,163
    edited August 2017
    Right, fine. But are people going to look here, or is this a dumpster?

    Here is what I want to know next: does Dispel Magic in the computer games roll random checks, 5% difference per caster level difference, like in the pen-and-paper game, or it is just a yes or not check? The case at hand: a creature to be freed from an enchantment, scripted to respond when no longer in a certain spell state. The party gets to dispel it, if they can manage it, but the spell needs to be very strong and almost beyond the power of the party for the levels of BG1-early BG2. I'm thinking of setting the caster level for the spell at 15, but will be the chances of, say, a 7th level mage casting Dispel Magic then?
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,760
    This is not a dumpster, but a thread with 7 pages already. As for people, they will decide themselves - can they provide an answer (or answers), or not.
  • chimericchimeric Member Posts: 1,163
    Most of those 7 pages are questions, not answers. Sure, people will decide, but visibility suffers. If visitors don't know what the question is about, they have no desire to offer an answer. Why would they want to answer "general questions"? Your decision doesn't bother me much, you've done this before, I just don't see a point of tucking away everything. The forum isn't being flooded, exactly.

    Anyway, to those who want to look here and continue talking about the targeting issue. So sleeping creatures are off-limits unless it's a specific target - script name or PlayerX. Well, we can't know the script name in advance, but how about this snippet to go on top of scripts?
    IF
    
    InPartySlot(LastTargetedBy(Myself),0)
    
    THEN
    
    RESPONSE #1
    
    AttackReevaluate(Player1,6)
    
    END
    
    IF
    
    InPartySlot(LastTargetedBy(Myself),1)
    
    THEN
    
    RESPONSE #1
    
    AttackReevaluate(Player2,6)
    
    END
    
    ...
    Anybody care to test if this makes sleepers fair game?

    P.S. @Avenger_teambg , I didn't see your answer. What was that about changing script names within the game? That's impossible, isn't it? And about making an ogre, whose script name is OGRE, Global. What would be the code to send this ogre hunting after a player in another area, then?
  • BrutaleBentBrutaleBent Member Posts: 36
    So, since I downloaded NearInfinity very recently, and for the sake of learning, I figured out to make a super OP caster robe and import it to the game, using WeiDU - so I could add description and name to the dialog file without hassle.

    Now, the issue is, I want to change the functions of the robe, where it now provides Improved Alacrity while equipped, I would like to make it cast X per day from the item cast menu - and I for the love of god cannot figure out why the hell it won't work - So, this beginner humbly asks anyone with some know-how to help a brother out. ;)

    The base for the robe was Edwins Robe of Red Flames. Don't know if that's important. :P Anyways, I uploaded the item files I made so you can look at it - MKROBE01.itm is the one with permanent Improved Alacrity, and MKROBE02.itm is the one where I try to get it to cast the spell on the wearer, I've tried a bunch of different things - and what you see is my latest failure.

    TL;DR HALP.
  •  TheArtisan TheArtisan Member Posts: 3,277
    @BrutaleBent

    The spell file for Improved Alacrity, SPWI921, does not exist in BG:EE and SoD which is probably the reason why the charge ability isn't doing anything. You can make a copy of the spell with a custom file name and use that instead, or just use the Aura Cleansing opcode 188 instead of the Cast Spell opcode 148 for the item ability.
  • BrutaleBentBrutaleBent Member Posts: 36
    @Artemius_I Don't know if relevant - but I was testing it in BG2:EE, so shouldn't it work? :sweat:

    And do you mean like this? (Sorry, I'm really new at this... Like, one day of experience new.)


  •  TheArtisan TheArtisan Member Posts: 3,277
    Ah okay. I thought perhaps you were testing it in BGEE which is why I suggested that first thing. Strangely, I tested your item and had no problems with the active. Try changing opcode 148, Cast Spell (at Point) to 146 Cast Spell (at Target) and see if that solves anything.
  • kjeronkjeron Member Posts: 2,368
    @BrutaleBent
    The item is not flagged to recharge when resting, this flag is in the "Flags" field below "When Drained", labeled "Recharge after Resting". The "When Drained" field just prevents it from disappearing when it reaches 0 charges.

    The effect index for the ability is incorrect. Offset 0x92 should be 21 (the "cast spell at point" effect is the 21st effect, starting from 0), currently its 2 (one of the Set Color effects). Near Infinity doesn't display non-standard effect orders correctly, so it may appear correct, but its not.
  • BrutaleBentBrutaleBent Member Posts: 36
    edited August 2017
    Annd it works, thanks to the both of you!

    Set it to cast spell (146) and changed the effect nr. to 21, while adding said effect to global effects too - don't know if it's redundant to have the spell under item ability AND global effect.

    Added file in case you guys wanna comment on the redundancy question. :P

    Now, is it possible to get the game to register it as a spell cast, so it can auto-pause after cast? ;)
  • chimericchimeric Member Posts: 1,163
    To @BrutaleBent: probably not, but you can include an invisible minion trip to PauseGame().

    A new question here - spawn points. They are referred to with O:Object, but what kind of names do their actions take? I can't seem to get SpawnPtSpawn("Spawn Point 1") to do anything.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    chimeric said:



    P.S. @Avenger_teambg , I didn't see your answer. What was that about changing script names within the game? That's impossible, isn't it? And about making an ogre, whose script name is OGRE, Global. What would be the code to send this ogre hunting after a player in another area, then?

    Yeah, you are right. This one exists only in IWD2

    284 SetScriptName(O:Object*,S:NewScriptName*)
  • chimericchimeric Member Posts: 1,163
    Oh, fuck! That's my Holy Grail! Beamdog, pleeeese introduce that action to the rest of the games!! It would work MIRACLES.
  • chimericchimeric Member Posts: 1,163
    @Ardanis , Are you here? Sorry to bother you, but you remember how you once told me Weidu cope for LPF creature ability, the syntax for it? Probability1 and all that sort of thing? Well, what's the code for saving throw and saving throw adjustment? I want the ability I'm adding to have a save vs. Rod, Staff, Wand at -2.
  • ArdanisArdanis Member Posts: 1,736
    edited August 2017
    http://www.weidu.org/~thebigg/README-WeiDU.html#sec51
    SET savingthrow to type of savingthrow to be allowed against the effect
    SET savebonus to saving throw bonus
    savingthrow = 8
    savebonus = 0 - 2
    Post edited by Ardanis on
  • chimericchimeric Member Posts: 1,163
    Thanks, mate.
  • chimericchimeric Member Posts: 1,163
    @Ardanis, By the way. That global-setting you told me about, with MYAREA, is it permanent? And it is different for every area that we enter, right? Just to be clear.
  • ArdanisArdanis Member Posts: 1,736
    Very much permanent. MYAREA gets the current area's resref (e.g. AR1100) and substitutes it.
  • chimericchimeric Member Posts: 1,163
    edited August 2017
    God, I'm so freaking smart. Just now I had a problem with AddXPWorth() - it had to be granted from outside, as a reward, but only the active creature can do it. So it had to be ActionOverride(Player1,AddXPWorth(LastSummonerOf(Myself))) from a minion, giving its summoner's XP worth to Player1. But ActionOverride breaks any other actions at the time and ruins stealth, if that's what the character is doing. I had to keep him stealthy while bestowing this reward. My solution? Give XP to Player2 instead. I mean, the points will still be shared among the party no matter who does the ActionOverride!

    o:)

    And yet, not smart enough. With an override the connection to LastSummoner is lost. The characters don't know whose XP to reap. But this would work with specific objects.

    Could this be made to work for non-specifics with global shouts? Something like this, to give Player1 the XP worth of any creature (cast a spell to get it to summon a minion with this script):

    GlobalShout(1457) /// or whatever
    ActionOverride(Player2,AddXPWorth(LastSummonerOf(LastHeardBy(Myself))))

    Pretty deep nesting here, but if it holds, then it's reliable. So, Player1 earns the experience and Player2 reaps and distributes it. Repeat for Player2-Player6. Ideas? Anybody wanna test it along with me?
    Post edited by chimeric on
  • chimericchimeric Member Posts: 1,163
    Can anybody tell me if Charisma helps with SELLING prices?
  • chimericchimeric Member Posts: 1,163
    And another thing: Weidu. I need to make it so all stores purchase items of the Notes type (50). But I don't want to overwrite existing "Store purchases" categories. Rather I'd like to extend the list (the file) with another "Store purchases." But that means extending the file somehow, or the offset won't yet exist. Any ideas?
  • kjeronkjeron Member Posts: 2,368
    edited September 2017
    Charisma Store Modifier = CHRMODST.2da. It works. Sorry, misread.
    //	Update all stores to accept new itemtypes
    COPY_EXISTING_REGEXP	~.*\.sto~	override
    	READ_SHORT	0x8	type
    	READ_LONG	0x2c	buy_off
    	READ_LONG	0x30	buy_num
    	SET	buy_add = 0	//	Number of categories to add, to update offsets
    	SET	add_category = 0	//	Initialize check variable
    	SET	add_notes = 0	//	Initialize check variable
    	FOR	(i = 0; i < buy_num; ++i)	BEGIN
    		READ_BYTE	(buy_off + i * 0x4)	category
    		PATCH_MATCH	category WITH
    			50	BEGIN	//	Match Notes Category / No Unnecessary Duplication
    				SET add_notes = 0
    			END
    			11 37 WHEN add_category = 0	BEGIN	// Match to restrict it to stores that already sell scrolls or books
    				++add_category
    			END
    			DEFAULT
    				++add_category  // only if you want to blindly add it to every store
    		END
    	END
    	//	Add categories
    	PATCH_IF	add_category	BEGIN
    		PATCH_IF	add_notes BEGIN
    			INSERT_BYTES	(buy_off + buy_num * 0x4)	0x4
    			WRITE_BYTE	(buy_off + buy_num * 0x4)	50
    			++buy_add
    		END
    		//	Update offsets
    		WRITE_LONG	0x30	(THIS + buy_add)
    		READ_LONG	0x34	items_off
    		PATCH_IF	items_off >= buy_off	BEGIN	
    			WRITE_LONG	0x34	(THIS + buy_add)
    		END
    		READ_LONG	0x4c	drink_off
    		PATCH_IF	drink_off >= buy_off	BEGIN
    			WRITE_LONG	0x4c	(THIS + buy_add)
    		END
    		READ_LONG	0x70	cures_off
    		PATCH_IF	cures_off >= buy_off	BEGIN
    			WRITE_LONG	0x70	(THIS + buy_add)
    		END
    	END
    BUT_ONLY
    Post edited by kjeron on
  • ArdanisArdanis Member Posts: 1,736
    IIRC charisma and reputation only affect the buying price, not selling.
  • chimericchimeric Member Posts: 1,163
    @kjeron : will try, but thanks already. @Ardanis : yes. Asking questions in a dumpster isn't very quick, so I just went and tested. It's always at 50% of the item price for selling, or whatever the store's markup is. :(

    Beamdog, how about looking into this? I mean, it's one of those features just lying on the surface that could spice up the games.
  • chimericchimeric Member Posts: 1,163
    On a completely unrelated topic, how does one get items' ground icons to glow? You know, they respond to Tab with an aquamarine outline for easy loot finding, but I can't seem to get my custom icons to do the same. The standard files are completely ordinary, just 1 frame each, and that one already has the highlight. But in the game, of course, the icons only light up with Tab or mouseover. I've tried imitating the icons, but mine either always have the highlight, if I paint it on, or never if I don't.
  • PheosicsPheosics Member Posts: 16
    Would it be possible to create a class tree like structure where you can start off as only a handful of classes, but as you level up the classes you unlock others you can switch to? Something similar to the Final Fantasy Tactics classes for reference.
Sign In or Register to comment.