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.
And about sleep - is there anyone who targets an attack on a plain Nearest()? I doubt it.
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.
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.
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.
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?
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.
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?
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.
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.
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.
@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.
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?
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.
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?
@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.
@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.
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!
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?
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?
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
@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.
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.
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.
Comments
And about sleep - is there anyone who targets an attack on a plain Nearest()? I doubt it.
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.
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
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?
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? 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?
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.
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.
And do you mean like this? (Sorry, I'm really new at this... Like, one day of experience new.)
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.
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?
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.
284 SetScriptName(O:Object*,S:NewScriptName*)
SET savebonus to saving throw bonus
savebonus = 0 - 2
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?
Charisma Store Modifier = CHRMODST.2da. It works.Sorry, misread.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.