Author Topic: applying race scripts globally  (Read 895 times)

Offline phordicus

  • Planewalker
  • *****
  • Posts: 8
applying race scripts globally
« on: November 05, 2004, 07:06:38 AM »
after checking out a subrace mod which attached a script to the player's race script slot, i began wondering:  could this be applied to every creature?  is there a way to, perhaps in baldur.bcs, to do a check for every creature?  i'm thinking no, because i can't find an OBJ that isn't directly based off of a PC/NPC actor.  my guess it would have to be attached to the PC, something like

Code: [Select]
IF
  Race(Nearest(Myself),RACE_ELF)
  Global("racecheck","LOCALS",Nearest(Myself),0)
THEN
  RESPONSE #100
    SetGlobal("racecheck","LOCALS",Nearest(Myself),1)
    ApplySpellRES("elfrace",Nearest(Myself))
END

naturally, you'd have to take Nearest all the way up to TenthNearest, and do each one of those for each race/subrace you wanted to tweak.  the completely unfortune thing with this is that Bioware seems to have used the race script slot as just an extra and some creatures already have vital scripts there, although they seem pretty minor so far in my perusal.

anyone else messed with this?

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: applying race scripts globally
« Reply #1 on: November 05, 2004, 10:49:45 AM »
One other solution would be to do a creature REGEXP and add scripts to empty slots of a creature if their race matched X. You'd need to build the REGEXP yourself, but the latest G3 Tweaks has a routine in the Improved Athkatlan Guards component that assigns a script to the highest empty script slot on a creature.
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: applying race scripts globally
« Reply #2 on: November 07, 2004, 04:25:26 AM »
In dplayer3.bcs add something like
Code: [Select]
IF
  Global("BeenHere","MYAREA",0)
THEN
  RESPONSE #100
    ReallyForceSpellRES("spell",Myself)
    SetGlobal("BeenHere","MYAREA",1)
END

And in spell.spl, have 1 extension header, with 1 feature block attached. In the feature block, set the target to Global, and use the "Set AI Script" opcode. Set the Race field to e.g. "pickrace".

In pickrace.bcs, have something like (I'm too busy to look up the syntax for these triggers/actions):
Code: [Select]
IF
  Race(Myself,Human)
THEN
  RESPONSE #100
    ChangeAI("human","race",myself)
END

IF
  Race(Myself,Elf)
THEN
  RESPONSE #100
    ChangeAI("elf","race",myself)
END

etc

HTH
/igi
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: applying race scripts globally
« Reply #3 on: November 10, 2004, 12:31:25 PM »
Even easier - use the 1st script fragment I posted, but instead of using "spell" to set the AI to a selection script, use IDS targetting, multiple .eff files, and use those to directly set the AI based on the race field.
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: