@chimeric You were told wrong. That variable is read by certain BG2 scripts to issue a "Scatter" shout, which causes creatures who are scripted to hear it to move toward their nearest enemy.
The creatures bodies darken due to Fire-damage overkill (STATE_FLAME_DEATH), just as creatures freeze/shatter due to Cold-damage overkill(STATE_FROZEN_DEATH).
I'm making an item with a special ability, similar to a talking item, but I don't want a dialogue to open when I click on the button. I would sooner just start a store - this is, in effect, a container, but I want a different message for the button, not "Open container." If that one is hard-coded, then instead of making the item a container I'll make it miscellaneous with a regular custom button, but one that would start the store. Any idea how to do that?
The button text is dependent on the action being performed, any change would affect the button for all containers. Editing UI.Menu would be the only way to get custom labels for the button.
You could make it a quick-item ability that summons an invisible creature to open the store. You won't be able to place items into it by dropping them on it in the inventory though.
It's not possible to create full-fledged party members that way, but you can get a virtually unlimited number of followers. It can be done with the sequence of script actions MakeGlobal(), ChangeEnemyAlly() and AddFamiliar() - example. Correct order of script actions is important.
Btw, too many creatures following your party will cause trouble sooner or later since all of them must be within a certain range if you don't want to see the dreaded "You must gather your party before venturing forth." whenever you leave an area.
That's okay. The container is a spellbook, and the contents are pages with spells. There is no adding, only ripping.
Now I'm trying to insert some transitions in a dialogue file for the first time... I get an error here right before the first IF. Do you see any problem with this?
Say, I've put together a Charged Bolt imitation from... graphics of some other game... and I'd like it to play more randomly. The animation in the projectile, that is. The options "Play random frame" and "Play random sequence" don't seem to do anything for "Source animation" - and for the animation inside "Projectile properties." By the way, what is the difference? Maybe I could get the projectile to play the cycle appropriate for the direction it goes, like the classic fireball. It has 5 cycles for S, SSW, SW, SWW and W, and those apparently get reflected around the compass. But I tried giving the charges BAM 5 cycles as well and turned on the same "Face target granularity," but they still show the same frames, just a little different on whether they take a bit longer or shorter to get somewhere. I'm thinking of making 3 projectiles with different BAMs, if I can't get a better solution. Any ideas?
I got it to work with the MakeGlobal() line added in, but I'm still left with the question of how to manage the critters. If I use it on cats, the cats won't follow; they'll just wander around because of their normal scripts. Is there a script I could give them, a permanent one, that would get the cats to either stay still or just approach Charname up to a certain distance?
The script action ChangeAIScript() can be used to remove or overwrite existing creature scripts. But you should be careful not to remove plot-relevant scripts that way.
Using cats as example, they have the script WDRUNSGT.BCS assigned to their default script slot in BG(2)EE, which causes them wander around. ChangeAIScript("", DEFAULT) should remove the script.
@argent77: I think I'm going to create a kit spell with this effect, allowing the user to collect a group of followers to follow them around. But I'm concerned about how 10 orcs and a human mage would behave. If I don't give them an attack script, the player will have to order the orcs to attack manually. But if I do give them an attack script, the mage will also attack, and we don't want that.
Could we tweak the script so that it gives spellcasters an empty script but gives non-spellcasters a basic attack script?
@argent77: It seems like it's impossible to go through party-required area transitions if any of the recruited critters die. Would it be possible to avoid this by giving them a custom script that removes their familiar status when they die?
@argent77: I think I'm going to create a kit spell with this effect, allowing the user to collect a group of followers to follow them around. But I'm concerned about how 10 orcs and a human mage would behave. If I don't give them an attack script, the player will have to order the orcs to attack manually. But if I do give them an attack script, the mage will also attack, and we don't want that.
Could we tweak the script so that it gives spellcasters an empty script but gives non-spellcasters a basic attack script?
You could check for creature class (e.g. with Class(O:Object*,I:Class*Class)) and assign your scripts appropriately. It may not always work though, as not all creatures provide meaningful class values.
@argent77: It seems like it's impossible to go through party-required area transitions if any of the recruited critters die. Would it be possible to avoid this by giving them a custom script that removes their familiar status when they die?
Sounds more like a glitch. I've encountered something like this when a follower was imprisoned or died in a special way (e.g. by petrification). Does a save and reload help? In any case, the Die() trigger could be used to execute final instructions when a creature dies.
Btw, can you move this discussion into a separate topic? It's going a bit too off-topic now.
@argent77: I've got it working some of the time, but not all of the time. I've managed to turn various humanoids as well as a skeleton and a dog into various familiars, but when I try to do it with a Huge Spider from Beregost, my spell turns it friendly, but it doesn't become a familiar. When I use it on a nearby commoner instead, though, the commoner does become a familiar.
This is the code I'm currently using. The spell applies it for 12 seconds, replacing the target's override script, racial script, and class script:
IF !InParty(Myself) Global("USSDJP02","LOCALS",0) THEN RESPONSE #100 SetGlobal("USSDJP02","LOCALS",1) MakeGlobal() ChangeEnemyAlly(Myself,FAMILIAR) AddFamiliar() END
That's most likely caused by script actions that are executed continuously, such as RandomWalk(). You could try try your luck with ClearActions(O:Object*).
@argent77: I get an error when I put ClearActions(O:Object*) in any of the script lines. I tried
IF !InParty(Myself) Global("USSDJP02","LOCALS",0) THEN RESPONSE #100 ClearActions(Myself) SetGlobal("USSDJP02","LOCALS",1) MakeGlobal() ChangeEnemyAlly(Myself,FAMILIAR) AddFamiliar() ClearActions(Myself) END
All right, it looks like the behavior was due to some strange bug where the Control Creature opcode, opcode 241, was preventing that script from working in the first place. The original script, without ClearActions, is functional as long as opcode 241 isn't active.
I've managed to turn various humanoids as well as a skeleton and a dog into various familiars, but when I try to do it with a Huge Spider from Beregost, my spell turns it friendly, but it doesn't become a familiar. When I use it on a nearby commoner instead, though, the commoner does become a familiar.
If you don't mind my asking, why do you want the followers to be familiars? If all you require is that they be friendly, you can simply change their EA status.
@chimeric: I want them to be able to follow the party from area to area. I have a couple spells for the Seducer kit that simply charm critters (bypassing immunities, notably) and a spell that uses a script to force a critter into the party, but now I'm trying to create a new spell that will let the Seducer gather an unlimited number of followers. The drawback is that the followers can't gain levels, you can't manage their inventory or spellbooks, and you can't raise them from the dead.
Oh, maybe there is a way to resurrect them... but that wouldn't leave a stone of balance standing, would it? The other two things can't be accomplished without including them in the party... from time to time. But is the Familiar option the only way to get them to travel around the map?
All right, it looks like the behavior was due to some strange bug where the Control Creature opcode, opcode 241, was preventing that script from working in the first place. The original script, without ClearActions, is functional as long as opcode 241 isn't active.
STATE_CHARM limits scripts to processing once per round, and disables the Specifics Script. Doesn't matter how the State is set - opcode 5, 241, or directly on the CRE file. It wouldn't have been instant, but it should have triggered eventually.
@chimeric: To my knowledge, there's only one other way to get a critter to follow you around. The Haiass mod has a custom wolf .cre file and adds a few lines to the script of every single area in the game ordering Haiass to spawn right next to Charname. But those scripts require a specific .cre reference, and I doubt it would possible, much less remotely feasible, to rig dozens of area scripts to automatically spawn potentially hundreds of different critter types. The familiar option will be best.
@kjeron: Right now my fix is to remove the charm effect using the same spell that applies the script. The critter will be red for about a second and then turns friendly.
@semiticgod , Not to mention that coming back to an area, there would be two such creatures. Does this change to Familiar affect the Find Familiar spell?
To everyone. For "Lighting" I put some SPLs in the archive edited to use the new visual effects. Didn't do anything else to the spells, vanilla files. But now someone playtesting them gets wrong strrefs for the spell names and descriptions. Why would that happen?
Trying to figure out how to add a visual indicator that the player can use to keep track of Psionic points used. My plan was to use two of the quiver slots, one which shows your maximum points useable per day and another which shows how many you've used so far. However, I can't seem to figure out how to make sure these "arrows" are placed in the proper equipment slots and stacked.
The ideal behaviour is this: -Party rests successfully -Character's psionic points are restored, all psyburn counters are removed from arrow slot 1. -A stack of counters is placed in arrow slot two, reflecting your max per day psy points useable (Icon reads "Psy Max:" and the quantity is the number of "psy max arrow counters" -When a psionic ability is used, it adds the appropriate number of counter arrows to arrow slot 1. That way player has a visual indication of how many points used so far today. "I've used 7 of my 25 psionic points" -Both of these counters to have code similar to whatever stops us from moving Boo from Minsc's inventory.
Unfortunately, I can't figure out a way to put these counters in the right spots. Perhaps someone knows a way to do this? If not, what about a different way to help the player track how many points he has left?
The arrow solution seemed ideal because the NPC is a monk and does not use launcher weapons.
Unfortunately, I can't figure out a way to put these counters in the right spots. Perhaps someone knows a way to do this? If not, what about a different way to help the player track how many points he has left?
You can specify slots with opcode 143 (slots 11&12), but it only allows replacing what's already there, it won't add to it.
Unfortunately, I can't figure out a way to put these counters in the right spots. Perhaps someone knows a way to do this? If not, what about a different way to help the player track how many points he has left?
You can specify slots with opcode 143 (slots 11&12), but it only allows replacing what's already there, it won't add to it.
That is interesting. I was in a scripting mindset and hadn't considered the idea that an opcode could be used. Unfortunately it seems like the opcode is limited to single items, otherwise I'd use it to add a stack. This will still be very useful for some other stuff I have planned, thanks for the tip.
Comments
The creatures bodies darken due to Fire-damage overkill (STATE_FLAME_DEATH), just as creatures freeze/shatter due to Cold-damage overkill(STATE_FROZEN_DEATH).
You could make it a quick-item ability that summons an invisible creature to open the store. You won't be able to place items into it by dropping them on it in the inventory though.
I ask because I was wondering if the mechanism could be used to simulate having 10 party members.
Btw, too many creatures following your party will cause trouble sooner or later since all of them must be within a certain range if you don't want to see the dreaded "You must gather your party before venturing forth." whenever you leave an area.
Now I'm trying to insert some transitions in a dialogue file for the first time... I get an error here right before the first IF. Do you see any problem with this?
- Never mind. *I* saw the problem with it.
Say, I've put together a Charged Bolt imitation from... graphics of some other game... and I'd like it to play more randomly. The animation in the projectile, that is. The options "Play random frame" and "Play random sequence" don't seem to do anything for "Source animation" - and for the animation inside "Projectile properties." By the way, what is the difference? Maybe I could get the projectile to play the cycle appropriate for the direction it goes, like the classic fireball. It has 5 cycles for S, SSW, SW, SWW and W, and those apparently get reflected around the compass. But I tried giving the charges BAM 5 cycles as well and turned on the same "Face target granularity," but they still show the same frames, just a little different on whether they take a bit longer or shorter to get somewhere. I'm thinking of making 3 projectiles with different BAMs, if I can't get a better solution. Any ideas?
ChangeEnemyAlly(Myself, FAMILIAR)
AddFamiliar()
Using cats as example, they have the script WDRUNSGT.BCS assigned to their default script slot in BG(2)EE, which causes them wander around. ChangeAIScript("", DEFAULT) should remove the script.
Could we tweak the script so that it gives spellcasters an empty script but gives non-spellcasters a basic attack script?
Sounds more like a glitch. I've encountered something like this when a follower was imprisoned or died in a special way (e.g. by petrification). Does a save and reload help? In any case, the Die() trigger could be used to execute final instructions when a creature dies.
Btw, can you move this discussion into a separate topic? It's going a bit too off-topic now.
This is the code I'm currently using. The spell applies it for 12 seconds, replacing the target's override script, racial script, and class script:
IF
!InParty(Myself)
Global("USSDJP02","LOCALS",0)
THEN
RESPONSE #100
SetGlobal("USSDJP02","LOCALS",1)
MakeGlobal()
ChangeEnemyAlly(Myself,FAMILIAR)
AddFamiliar()
END
IF
!InParty(Myself)
Global("USSDJP02","LOCALS",0)
THEN
RESPONSE #100
ClearActions(Myself)
SetGlobal("USSDJP02","LOCALS",1)
MakeGlobal()
ChangeEnemyAlly(Myself,FAMILIAR)
AddFamiliar()
ClearActions(Myself)
END
instead, but I see the same behavior.
@kjeron: Right now my fix is to remove the charm effect using the same spell that applies the script. The critter will be red for about a second and then turns friendly.
The ideal behaviour is this:
-Party rests successfully
-Character's psionic points are restored, all psyburn counters are removed from arrow slot 1.
-A stack of counters is placed in arrow slot two, reflecting your max per day psy points useable (Icon reads "Psy Max:" and the quantity is the number of "psy max arrow counters"
-When a psionic ability is used, it adds the appropriate number of counter arrows to arrow slot 1. That way player has a visual indication of how many points used so far today. "I've used 7 of my 25 psionic points"
-Both of these counters to have code similar to whatever stops us from moving Boo from Minsc's inventory.
Unfortunately, I can't figure out a way to put these counters in the right spots. Perhaps someone knows a way to do this? If not, what about a different way to help the player track how many points he has left?
The arrow solution seemed ideal because the NPC is a monk and does not use launcher weapons.