Jump to content


Photo

Making a BS File


  • Please log in to reply
10 replies to this topic

#1 Darkmist

Darkmist
  • Member
  • 52 posts

Posted 07 September 2002 - 01:10 PM

I want to use this script that makes the theif hide then detect traps.
I Edited Valens Script and took out the ValenNoAttack...ect. This was here I don't know what it is "CheckStatLT(Myself,100,RESISTSLASHING)"

IF
OR(7)
See(SeventhNearestEnemyOf(Myself))
See(SixthNearestEnemyOf(Myself))
See(FifthNearestEnemyOf(Myself))
See(NearestEnemyOf(Myself))
See(SecondNearestEnemyOf(Myself))
See(ThirdNearestEnemyOf(Myself))
See(FourthNearestEnemyOf(Myself))
False()

THEN
RESPONSE #100

END


IF
CheckStatLT(Myself,100,RESISTSLASHING)

OR(4)
See(NearestEnemyOfType([0.0.0.LONG_BOW]))
See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
See(NearestEnemyOfType([0.0.0.BARD_ALL]))
OR(2)
ActionListEmpty()
ModalState(DETECTTRAPS)
THEN
RESPONSE #100
AttackReevaluate(LastSeenBy(Myself),30)
END

IF
CheckStatLT(Myself,100,RESISTSLASHING)

See(NearestEnemyOf(Myself))
OR(2)
ActionListEmpty()
ModalState(DETECTTRAPS)
THEN
RESPONSE #100
Attack(NearestEnemyOf(Myself))
END


IF
CheckStatLT(Myself,100,RESISTSLASHING)
InParty(Myself)
ActionListEmpty()
!Detect([EVILCUTOFF])
!StateCheck(Myself,STATE_INVISIBLE)

THEN
RESPONSE #100
Hide()
END

IF
CheckStatLT(Myself,100,RESISTSLASHING)
ActionListEmpty()
InParty(Myself)
OR(2)
!See(NearestEnemyOf(Myself))

!ModalState(DETECTTRAPS)
THEN
RESPONSE #100
FindTraps()
END

Anyways, I want to make a New BS file and add it to my Scripts Folder in the BGII Folder. Named Theif 5 that conatins that script. I used Near infinity and cant find Something that Complies it to a BS file. All i get is BAF and BCS.
1.)Can you help me out?
2.)Is there a BS Editor?
3.)How Do they add Discriptons to the Scripts when you select them in game(Don't really care about this one) Thanks

#2 -Me :)-

-Me :)-
  • Guest

Posted 07 September 2002 - 01:24 PM

CheckStatLT(Myself,100,RESISTSLASHING) checks to see whether the creature running the script has less than 100% slashing resistance.

I don't know about NI, but Infinity Script Editor, available from TeamBG, can compile BS scripts.

SCRPDESC.2DA controls the names and descriptions you see for player script ingame.

#3 Extremist

Extremist
  • Member
  • 8 posts

Posted 07 September 2002 - 11:13 PM

BS and BCS files are treated as the same files. I mean, the contents inside these files is always the same, no matter the file extension.
You just compile what you want into, let's say, MYSCRIPT.BCS and then just rename it into MYSCRIPT.BS.
Why would you go for TeamBG compilers if you are already compiling expert in another util, right?  ;)

#4 -Me :)-

-Me :)-
  • Guest

Posted 08 September 2002 - 12:47 AM

hehe... I like the TeamBG compiler :)

#5 Darkmist

Darkmist
  • Member
  • 52 posts

Posted 08 September 2002 - 07:02 AM

:)+Sep 7 2002, 11:24 PM-->
QUOTE(Me :) @ Sep 7 2002, 11:24 PM)
CheckStatLT(Myself,100,RESISTSLASHING) checks to see whether the creature running the script has less than 100% slashing resistance.

I don't know about NI, but Infinity Script Editor, available from TeamBG, can compile BS scripts.

SCRPDESC.2DA controls the names and descriptions you see for player script ingame.[/quote]
All SCRPDESC.2DA has in it is a bunch of numbers and letters:

2DA V1.0

-1

TITLE DESCRIPTION

CUSTOM 17167 -1

None -1 -1

Fighter1 17582 17583

Fighter2 17584 17585

Fighter3 17586 17587

Fighter4 17588 17589

Thief1 17590 17591

Thief2 17592 17593

Thief3 17594 17595

Thief4 17596 17597

Mage1 17598 17599

Mage2 17600 17601

Mage3 17602 17603

Mage4 17604 17605

Cleric1 17606 17607

Cleric2 17608 17609

Cleric3 17610 17611

Cleric4 17612 17613

aGen 653 680

Cautious 681 682

aPass 684 683

aRang 685 686

Control 841 842

What do I add to it if my file is Theif5.BS so it will appear in game? Also Where can I type the description for the script so that will appear in game?

#6 Darkmist

Darkmist
  • Member
  • 52 posts

Posted 08 September 2002 - 07:51 AM

I looked at Teamsbg scipt faq and i know how to do it, however when it gets to this part:


Type in the String box your first script title, eg. FIGHTER - AGGRESSIVE:
>>>>>>>Mines Theif5, do I add colons like this Theif5: ?

An important change is needed to the "Unknown" line in Attributes (1st line). Click on the line and an editing box will appear, change the value of 00 00 to 03 00.
>>>>> Ok where is this? All i see is:

Attributes: Value:
Entry Type No message data (0)
Associated Sound None
Volume Varriance 0
Pitch Varriance 0

If I Click the Entry type I get this:
Ambient message(2)
message with tags(7)
No message Data(0)
Standard message (3)
Unknown(1)
Unknown(4)
Unknow(5)
Unknown(6)

I cant edit them either so I dont know what the hell to do. Help wpuld be appreciated asap

#7 Darkmist

Darkmist
  • Member
  • 52 posts

Posted 08 September 2002 - 08:22 AM

Forget all that crap. I see Theif5 Under Custom in the game. Now Im having a problem with my script. My charecter :
Hides in shadows
(It does this each second)
Detects Traps
Stops Detecting Traps
Detects Traps
Stops Detecting Traps
Detects Traps
Stops Detecting Traps
Detects Traps
Hides in shadows
Repeats.

Now somethings gone wronge in my script, can u point it out please?

IF
See(NearestEnemyOfType([0.0.0.LONG_BOW]))
See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
See(NearestEnemyOfType([0.0.0.BARD_ALL]))
OR(2)
ActionListEmpty()
ModalState(DETECTTRAPS)
THEN
RESPONSE #100
AttackReevaluate(LastSeenBy(Myself),30)
END

IF
See(NearestEnemyOf(Myself))
OR(2)
ActionListEmpty()
ModalState(DETECTTRAPS)
THEN
RESPONSE #100
Attack(NearestEnemyOf(Myself))
END

IF
InParty(Myself)
ActionListEmpty()
!Detect([EVILCUTOFF])
!StateCheck(Myself,STATE_INVISIBLE)
THEN
RESPONSE #100
Hide()
END

IF
ActionListEmpty()
InParty(Myself)
OR(2)
!See(NearestEnemyOf(Myself))
!ModalState(DETECTTRAPS)
THEN
RESPONSE #100
FindTraps()
END

#8 cirerrek

cirerrek
  • Member
  • 193 posts

Posted 09 September 2002 - 07:31 AM

I don't see anything inherently wrong with your script. I usually keep the ActionListEmpty() just below the IF for PC control reasons. Also for ordering, I would change the order you have the scripts. My thoughts are you would want your thief to start hiding and detecting, and then if they encounter an enemy to break stealth mode and attack or stay in stealth mode and run back to the party StrongestOf() or something like that. Another thing is that AttackReevaluate() has been found to be flawed or not implemented correctly so that you end up losing Attacks per round. Attack() works better if set up correctly or under certain circumstances.

Here is one different way to do it based on a script segment from Sarkyn's gThief. IRC, it uses a timer to take advantage of the 20 seconds you remain hidden while in stealth mode before another check is made.

Ugh, wordwrap is not comment friendly.

STATE_NOT_VISIBLE is a custom state, you can translate it by just saying
!StateCheck(Myself, STATE_NOT_INVISIBLE)
!StateCheck(Myself, STATE_NOT_IMPROVEDINVISIBLE)

// ***************************************
// Segment Name: gs_HideAndDetect.baf
// ***************************************

// * HIDE AND DETECT TRICK
// * [Allows a Thief character to be BOTH hidden and detecting Traps 90% of the time]
// * [Only done when >75%HP to avoid not getting healed by gs_HealOther]

// * If not already detecting traps, and hidden, detect traps and start the timer
IF
ActionListEmpty()
CombatCounter(0) // and combat is over
OR(2)
Class(Myself,THIEF_ALL)
Class(Myself,MONK)
!ModalState(DETECTTRAPS)
ModalState(STEALTH)
THEN
RESPONSE #100
SetGlobalTimer("gh_Thief","LOCALS",18)
FindTraps()
END

// * If timer expired, and I'm not damaged -> hide!
IF
ActionListEmpty()
CombatCounter(0) // and combat is over
GlobalTimerExpired("gh_Thief","LOCALS")
HPPercentGT(Myself,75)
CheckStatGT(Myself,50,HIDEINSHADOWS) // and I have a decent chance of success
THEN
RESPONSE #100
Hide()
END

// * If not already hidden, and I'm not damaged -> hide!
IF
ActionListEmpty()
CombatCounter(0) // and combat is over
OR(2)
Class(Myself,THIEF_ALL)
Class(Myself,MONK)
!StateCheck(Myself,STATE_NOT_VISIBLE) // and not invisible/impinvis/hiding
HPPercentGT(Myself,75)
CheckStatGT(Myself,50,HIDEINSHADOWS) // and I have a decent chance of success
THEN
RESPONSE #100
Hide()
END

#9 Darkmist

Darkmist
  • Member
  • 52 posts

Posted 09 September 2002 - 04:53 PM

Thanks cirerrek, I want my theif To
A.Hide
B.Detect Traps
C.Attack Nearest enemy
D.If no enemys, Repeat A & B
Just like Valens Script. Can you write it this way? Thanks

#10 cirerrek

cirerrek
  • Member
  • 193 posts

Posted 09 September 2002 - 08:15 PM

"CheckStatLT(Myself,100,RESISTSLASHING)"

I would hedge that that particular trigger is in the scripts to detect whether or not Valen is in mist form or not.

I don't know what Valen's entire script looks like. Her script may use advanced targeting techniques and if that is the case, you will probably have to tie into the targeting routine by using LastSeenBy(Myself).

Here is a simple example of an attack routine, just add this below the other script segment I posted.

IF
OR(2)
ActionListEmpty() // or I am not doing anything
ModalState(DETECTTRAPS) // or I am detecting traps
OR(10)
See(TenthNearestEnemyOf(Myself)) // or I see the tenth of ten bad guys
See(NinthNearestEnemyOf(Myself)) // or I see the the ninth of ten bad guys
See(EighthNearestEnemyOf(Myself)) // or I see the eighth of ten bad guys
See(SeventhNearestEnemyOf(Myself)) // or I see the seventh of ten bad guys
See(SixthNearestEnemyOf(Myself)) // etc.,
See(FifthNearestEnemyOf(Myself)) // etc.,
See(FourthNearestEnemyOf(Myself)) // etc.,
See(ThirdNearestEnemyOf(Myself)) // etc.,
See(SecondNearestEnemyOf(Myself)) // etc.,
See(NearestEnemyOf(Myself) // etc.,
Range(NearestEnemyOf(Myself),8) // and they are within eight search squares so in melee range or only a minor jog over is necessary
THEN
RESPONSE #100
Attack(NearestEnemyOf(Myself) // attack the nearest bad guy until they are dead
END

After everyone is dead, if this and the previous script segements were the only two in the script, then it would loop back up to the Detecting and Hiding Portion of the script.

Very simple example, of course. If you want something more complicated, check out GB's-PC scripts, or Sarkyn's gScripts, or Rich Martel's uScript. I think they can all be found in the files section of the yahoo group IEEAIS. I've even got an TOB version of Sarkyn's gSeries, called eSeries uploaded there, but I just noticed I have a nasty bug in the scripts that is preventing the heal others section from occurring and I haven't been able to pin down just where I dropped the monkey wrench.

Cirerrek

#11 -Gullard-

-Gullard-
  • Guest

Posted 02 July 2004 - 05:25 PM

The best place to get AI scripting help is InfinityScripters

http://groups.yahoo....inityScripters/