Skip to content

General mod Questions thread

1565759616270

Comments

  • OlvynChuruOlvynChuru Member Posts: 3,076
    Luke93 wrote: »
    Why do 'DestroyItem()' and Opcode #112 (Remove item) fail to remove opcode #66 (Translucency - timing = 2) from an ITM? Is there a particular reason?

    While I don't know exactly what the problem is, I do know Translucency is one of the stats in a CRE file. Perhaps the effect you used is permanently changing it.
  • BubbBubb Member Posts: 1,001
    Opcode #66 is one of the opcodes that uses a secondary Persistent Effect mechanism to achieve the fade in / fade out modes. I could see how if you are using one of those modes it might be impossible to remove by conventional means.

    And, confirming OlvynChuru's suspicion, Timing mode = Instant/Permanent until death (1) will alter the base stat of the creature, so watch out for that.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Bubb wrote: »
    And, confirming OlvynChuru's suspicion, Timing mode = Instant/Permanent until death (1) will alter the base stat of the creature, so watch out for that.

    @OlvynChuru

    Yes, sure, but in my case 'timing' is set to 2 (Instant/While equipped) not 1.... As a result, op#112 managed to remove it at last (the issue was caused by something else....)

    Separately, speaking of opcode #331: how is 'caster level' (special = 2) related to the entries in the 2DA file? Suppose I'm a level 17 sorcerer and my 2DA file has 9 entries: will I summon 17 creatures randomly chosen from the 9 listed in my 2DA?
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    Bubb wrote: »
    And, confirming OlvynChuru's suspicion, Timing mode = Instant/Permanent until death (1) will alter the base stat of the creature, so watch out for that.

    @OlvynChuru

    Yes, sure, but in my case 'timing' is set to 2 (Instant/While equipped) not 1.... As a result, op#112 managed to remove it at last (the issue was caused by something else....)

    Separately, speaking of opcode #331: how is 'caster level' (special = 2) related to the entries in the 2DA file? Suppose I'm a level 17 sorcerer and my 2DA file has 9 entries: will I summon 17 creatures randomly chosen from the 9 listed in my 2DA (provided the summoning cap allows me to summon 17 creatures of course...)?
    Post edited by _Luke_ on
  • kjeronkjeron Member Posts: 2,367
    Luke93 wrote: »
    Separately, speaking of opcode #331: how is 'caster level' (special = 2) related to the entries in the 2DA file? Suppose I'm a level 17 sorcerer and my 2DA file has 9 entries: will I summon 17 creatures randomly chosen from the 9 listed in my 2DA (provided the summoning cap allows me to summon 17 creatures of course...)?
    It will summon creatures until their combined power level exceeds caster level.
    For op331 (in Spell/Item):
    Special=0: Summon amount equal to (Param1 + DiceNum(d)DiceSize))
    Special=1: Summon amount equal to (Param1 + DiceNum(d)DiceSize))
    Special=2: Summon until power level equals/exceeds "Caster Level"

    For op331(in EFF):
    Special=0: Summon until power level equals/exceeds Param1
    Special=1: Summon amount equal to (Param1 + DiceNum(d)DiceSize))
    Special=2: Summon until power level equals/exceeds "Caster Level" field of EFF

    For op127 (in Spell/Item):
    Special=0: Summon until power level equals/exceeds Param1
    Special=1: Summon amount equal to Param1
    Special=2: Summon until power level equals/exceeds "Caster Level"

    For op127 (in EFF):
    Special=0: Summon until power level equals/exceeds Param1
    Special=1: Summon amount equal to (Param1 + DiceNum(d)DiceSize))
    Special=2: Summon until power level equals/exceeds "Caster Level" field of EFF
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    @kjeron

    I see. So, when 'special' is 2, this effect is more powerful when used by enemies, isn't it? I mean, they're not subjected to the summoning cap....

    Also, the creatures are chosen at random regardless the value of 'special', right?
  • kjeronkjeron Member Posts: 2,367
    Luke93 wrote: »
    I see. So, when 'special' is 2, this effect is more powerful when used by enemies, isn't it? I mean, they're not subjected to the summoning cap....

    Also, the creatures are chosen at random regardless the value of 'special', right?
    Both correct.
    For NPC-classes, it's even more powerful, since they use their innate level for wizard/priest spells, not level 1, as a UAI thief would.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    OK, WeiDU question:
    If I want to delete unused resources from the override folder (because I replaced them with my own, so they are no longer needed), is DELETE enough? Or should I also add DISABLE_FROM_KEY?

    EDIT: unless I'm missing something, DISABLE_FROM_KEY is necessary only if the resource under consideration is part of the base game (i.e., it's not added by mods). Is that correct?
    Post edited by _Luke_ on
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    Luke93 wrote: »
    OK, WeiDU question:
    If I want to delete unused resources from the override folder (because I replaced them with my own, so they are no longer needed), is DELETE enough? Or should I also add DISABLE_FROM_KEY?

    Why would you need to do this?
    - If you've overwritten a resource, it's already gone
    - If you've redirected something to a new resource, the old one is harmless.

    Imagine that I'd like to replace creatures in monster summoning tables introduced by some other mod (e.g., Iwdification). So, I CREATE my own resources and edit the 2DA entries of those tables.... So yes, the old CREs are harmless but also unused, so I was thinking of removing them....

    In any case, yes, DELETE will make a copy of its target if you don't say anything (i.e., if you don't specify 'OptNoBackup'....)
  • [Deleted User][Deleted User] Posts: 0
    edited June 2019
    The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    EDIT - of course, if deleting things, I would make very sure that there aren't other resources that reference the files you want to delete... That can be tricky. What if snother mod comes along, sees that IWDification is installed, and then operates on the assumption that its resources are present?

    Yes, you're right, it can be tricky (even though this should not be the case).... But at the same time I don't like having unused resources in my override... Will think about it....
  • southfla79southfla79 Member Posts: 214
    simple question (I hope). How do you add crit immunity to an item? Tried looking at different helms in near infinity and can't find anything.
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @southfla79, @subtledoctor

    Keep in mind that if the ITM under consideration is already flagged as 'Headgear' (offset 0x1c), then don't set that flag to 1 or you'll remove crit immunity...
  • southfla79southfla79 Member Posts: 214
    edited June 2019
    Thanks. I didn't think it was that since it's not checked off in the base game.

    Didn't see Luke93's post. I guess that's why it's not checked off for helms in the base game.
  • The user and all related content has been deleted.
  • southfla79southfla79 Member Posts: 214
    edited June 2019
    nevermind. misread.
  • RatatoskrRatatoskr Member Posts: 716
    Does anyone know if there is a code action that deselects a character?

    I'm running into a problem because my NPC joins the party while dead and is automatically selected then. But if you try to move while she's selected, the game crashes.

    Hitting the 'select all' button unselects her since she's dead, but I'd like to do it automatically if possible.
  • kjeronkjeron Member Posts: 2,367
    Ratatoskr wrote: »
    Does anyone know if there is a code action that deselects a character?

    I'm running into a problem because my NPC joins the party while dead and is automatically selected then. But if you try to move while she's selected, the game crashes.

    Hitting the 'select all' button unselects her since she's dead, but I'd like to do it automatically if possible.
    None of them I tested worked with a selected Dead character.
    However, you can try APPEND:
    22 MoveToObject(O:Target*)
    23 MoveToPoint(P:Point*)
    
    to "ACTSLEEP.IDS" to prevent the crashing, but I don't know if it will have any adverse effects.
  • RatatoskrRatatoskr Member Posts: 716
    kjeron wrote: »
    Ratatoskr wrote: »
    Does anyone know if there is a code action that deselects a character?

    I'm running into a problem because my NPC joins the party while dead and is automatically selected then. But if you try to move while she's selected, the game crashes.

    Hitting the 'select all' button unselects her since she's dead, but I'd like to do it automatically if possible.
    None of them I tested worked with a selected Dead character.
    However, you can try APPEND:
    22 MoveToObject(O:Target*)
    23 MoveToPoint(P:Point*)
    
    to "ACTSLEEP.IDS" to prevent the crashing, but I don't know if it will have any adverse effects.

    Thanks for trying. I'm wary of appending without knowing what might happen so I may just have to make a known bugs section.

    At least it's a fairly easy fix on the player's end of things. All they have to do is hit one button.
  • BubbBubb Member Posts: 1,001
    @Ratatoskr: I've found that MoveGlobalObject() and MoveGlobalObjectOffscreen() will force the engine to unselect the dead party member if it targets an active creature.

    The following should work, replacing "Korgan" with your NPC's script name:
    MoveGlobalObject("Korgan",Player1)
    
  • RatatoskrRatatoskr Member Posts: 716
    edited June 2019
    @Bubb Thank you. I will try that.

    Edit: Any suggestions on where I put this code? I've tried all the script files that make sense to me and it doesn't seem to be working.

    As soon as she joins, she's both dead and selected and that doesn't seem to be going away.
    Post edited by Ratatoskr on
  • BubbBubb Member Posts: 1,001
    @Ratatoskr: It should go right after the JoinParty() that's bringing her into the party.
  • RatatoskrRatatoskr Member Posts: 716
    And while I'm asking questions, does anyone know what causes the "unterminated comment" installation error on weidu? I can't seem to track the issue down.
  • RaduzielRaduziel Member Posts: 4,714
    Ratatoskr wrote: »
    And while I'm asking questions, does anyone know what causes the "unterminated comment" installation error on weidu? I can't seem to track the issue down.

    Probably a / from a // or either a /* or */ is missing.
  • RatatoskrRatatoskr Member Posts: 716
    @Bubb This still doesn't seem to be working for me. But I'll keep fiddling with it. It might be a problem with my save. Or maybe I need another actionoverride..

    @Raduziel Thanks. That helped. I hadn't realized my weidu highlighting was misleading me when I'd dummied out se code, but adding //to every line fixed the issue
  • StormfinStormfin Member Posts: 28
    Hello!

    Question from a complete amateur - If I want to make a spell mod using pre-existing files in the game, do I need to do anything specific to make them compatible with mods like SCS, TnB and SR?

    If I install these mods first and then make my own files, is that the easiest way of ensuring compatibility?

    Cheers
  • AllbrotherAllbrother Member Posts: 261
    edited June 2019
    Can anyone look over the scripts below and help me figure out how to make them work as they don't do anything right now?

    This is appended to dplayer2.bcs:
    IF
    	ActuallyInCombat()
    	Global("fight2","GLOBAL",0)
    THEN
    	RESPONSE #100
    		SetGlobal("fight2","GLOBAL",1)
    END
    
    IF
    	!ActuallyInCombat()
    	Global("fight2","GLOBAL",1)
    THEN
    	RESPONSE #100
    		SetGlobal("fight2","GLOBAL",0)
    END
    

    This is appended to dplayer3.bcs:
    IF
    	ActuallyInCombat()
    	Global("fight1","GLOBAL",0)
    THEN
    	RESPONSE #100
    		SetGlobal("fight1","GLOBAL",1)
    END
    
    IF
    	!ActuallyInCombat()
    	Global("fight1","GLOBAL",1)
    THEN
    	RESPONSE #100
    		SetGlobal("fight1","GLOBAL",0)
    END
    

    This is appended to baldur.bcs and baldur25.bcs
    IF
    	OR(2)
    		Global("fight1","GLOBAL",1)
    		Global("fight2","GLOBAL",1)
    THEN
    	RESPONSE #100
    		SetGlobal("fight","GLOBAL",1)
    END
    
    IF
    	Global("fight","GLOBAL",1)
    	!GlobalTimerNotExpired("TBC","GLOBAL")
    THEN
    	RESPONSE #100
    		PauseGame()
    		SetGlobalTimer("TBC","GLOBAL",3)
    END
    
    IF
    	Global("fight1","GLOBAL",0)
    	Global("fight2","GLOBAL",0)
    THEN
    	RESPONSE #100
    		SetGlobal("fight","GLOBAL",0)
    END
    

    Basically, I'm trying to make the game pause in combat every half round. First I tried just the timer/pause block appended to dplayer2 and dplayer3 and that worked, but it would cancel the queued action of whichever character triggered the pause, which is extremely annoying.

    So I figured I'd get around that by just using the character scripts to set globals once at start and end of combat and trigger the pause globally via baldur/baldur25, but this way it doesn't pause at all. I've been fiddling with this for a while and as much as I stare at it, I don't see a reason why it shouldn't work. Any ideas?

    And if it's a dead end, any tips on how to achieve the desired effect without the annoying side effect of queued actions being cancelled?
  • BubbBubb Member Posts: 1,001
    @Allbrother: I've just had a look inside the PauseGame() assembly. In order to pause the game it invokes the auto-pause mechanism, and since the auto-pause mechanism was only designed to work with creatures in the game world, it ignores any attempts to pause the game from a non-sprite script.

    Running PauseGame() from a game script / area script simply won't work, sadly.

    Perhaps summoning an invisible sprite to perform the action for the player would work, though the delay involved might ruin what you are trying to do.
Sign In or Register to comment.