To the scripting gods: Giving your character an ability via script at the start of the game...
Akuro
Member Posts: 93
in BGII:EE Mods
Hey folks,
so I want my child of bhaal to be really that powerful as all the people say. Until now, I've always given him a permanent innate ability via 2DA-file which allows him to cast spells without the 6-seconds-delay.
Now here's the problem: If my character is a mage-thief, that 2DA-file would give that ability every other character who is also a mage-thief, and I'd like to avoid that for obvious reasons.
Editing it in via the keeper is not an option because of rp-feelings
So I'd like to have a script which applies, let's say, ability "SPIN0101.spl" to my main char at the start of the game. Does anybody have an idea how to write such a script? Is it difficult? I could really use some help here, since I have no clue at all when it comes to scripting :-(
Thanks in advance!
Akuro
so I want my child of bhaal to be really that powerful as all the people say. Until now, I've always given him a permanent innate ability via 2DA-file which allows him to cast spells without the 6-seconds-delay.
Now here's the problem: If my character is a mage-thief, that 2DA-file would give that ability every other character who is also a mage-thief, and I'd like to avoid that for obvious reasons.
Editing it in via the keeper is not an option because of rp-feelings
So I'd like to have a script which applies, let's say, ability "SPIN0101.spl" to my main char at the start of the game. Does anybody have an idea how to write such a script? Is it difficult? I could really use some help here, since I have no clue at all when it comes to scripting :-(
Thanks in advance!
Akuro
0
Comments
IF
Global("FastCaster","GLOBAL",0)
THEN
RESPONSE #100
ActionOverride(Player1,ApplySpell(Myself,30101))
SetGlobal("FastCaster","GLOBAL",1)
END
The game will auto-translate 30101 as spin0101, unless you want to add an entry to spell.ids but you really shouldn't need to.
Do you think it's possible to edit ar0602.bcs with notepad++, add those lines and save the file?
I gotta try it out
---------
IF
Global("FASTCASTER","GLOBAL",0)
THEN
RESPONSE #100
ActionOverride([INANIMATE.21],ApplySpell([INANIMATE.HUMANOID],30101))
SetGlobal("FASTCASTER","GLOBAL",1)
END
---------
So far I haven't seen any difference, I'm sure I've forgotten a little detail... Hmm...
The spell is named SPIN0101 and I tried it with the parameters target:myself and target:creature - both versions show now effect.
I will have to check again...
Okay....I have the link now. Use the one that says "infinity".
Actually...on second thought....don't use that link--it doesn't go where I thought it goes. Well, it is NearInfinity, yes, but the link I posted is more for like getting the source code. You probably don't want that.
Heya, it's me again!
Thanks for the link (or the reference to) Near Infinity - so far NI managed to compile the script without the odd "INAMINATE" component.
Now my script ar0602.bcs has the exact lines you gave me at the end. Nevertheless nothing happens...
Did I forget something?
Do I have to declare the variable "Fastcaster" somewhere else? Humm....
Akuro
(And yeah, DLTCEP's internal script compiler has some issues. I believe it's generally recommended that you set DLTCEP up to use WeiDU as an external compiler.)
---
IF
Global("FastCaster","GLOBAL",0)
THEN
RESPONSE #100
ActionOverride(Player1,AddSpecialAbility("spin0101")) // No such index
SetGlobal("FastCaster","GLOBAL",1)
END
---
Now when I load up my game, the following occurs:
1. The "bling"-sound (level up sound) plays once
2. A message in the box appears "CHARNAME gained special ability:" (No name, because it isn't meant to be shown.
3. A new, blank icon appears under the innates-tab
4. It doesn't give me any effects, nor can I activate it
Okay, at least this is better than nothing - we're near the end, I know it
Does "ApplySpell" not work?