Page 3 of 4

Posted: Wed May 23, 2001 12:10 pm
by Craig
Could you list the string head stuff cus i can't find it and how would i make the 15% hp only when enemy is around

Posted: Wed May 23, 2001 12:42 pm
by KensaiRyu
IF
Exists([EVILCUTOFF])
HPPercent(Myself,15)
THEN
RESPONSE# 100
RunAwayFrom(LastAttackerOf(Myself))
END

The quaffs a potion string is not vital however it lets you know that he just used a potion.

I am sending you a zip file that has all the display string # 's in it in alpha betical order.

Posted: Wed May 23, 2001 12:45 pm
by Craig
Heres my script will it work?
IF
HPPercentLT(Myself,50)//If my hit points
// are less than 50%
HasItem("Potn52",Myself)//And I have a Potion
// (of extra healing)
THEN
RESPONSE #100
UseItem("Potn52",Myself)//drink the potion
END

IF // if my hitpoints are less than
HPPercentLT(Myself,15)// 15%
THEN
RESPONSE #100 // Run away
RunAwayFrom(LastAttackerOf(Myself),150)
END

IF
See(Enemy)
THEN
RESPONSE #100
EquipMostDamagingMelee
THEN #20
OR(5)
Attack(NearestEnemyTo(Player 1))
Attack(NearestEnemyTo(Player 2))
Attack(NearestEnemyTo(Player 3))
Attack(NearestEnemyTo(Player 4))
Attack(NearestEnemyTo(Player 5))
Attack(NearestEnemyTo(Player 6))
END

And how do i post at bgscripts?
And, how do i nest?

[ 05-23-2001: Message edited by: craig ]

Posted: Wed May 23, 2001 2:24 pm
by KensaiRyu
Change it to this and it will work: (i compiled it and checked.)

IF
HPPercentLT(Myself,50)//If my hit points
// are less than 50%
HasItem("Potn52",Myself)//And I have a Potion
// (of extra healing)
THEN
RESPONSE #100
UseItem("Potn52",Myself)//drink the potion
END

IF // if my hitpoints are less than
HPPercentLT(Myself,15)// 15%
Exists([EVILCUTOFF])
THEN
RESPONSE #100 // Run away
RunAwayFrom(LastAttackerOf(Myself),150)
END

IF
See(NearestEnemyOf(Myself))
THEN
RESPONSE #50
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Myself))
RESPONSE #25
Attack(NearestEnemyOf(Player1))
RESPONSE #25
Attack(NearestEnemyOf(Player2))
RESPONSE #25
Attack(NearestEnemyOf(Player3))
RESPONSE #25
Attack(NearestEnemyOf(Player4))
RESPONSE #25
Attack(NearestEnemyOf(Player5))
RESPONSE #25
Attack(NearestEnemyOf(Player6))
END


And how do i post at bgscripts?

Join the group and go to Post.

And, how do i nest?

Complex nesting isnt really possible with scripting. Its not like programming. For a good example of the level of nesting you can do look at Sarkyns Scripts in the file section of BG scripts.

Also I tried to send you the file of String reference numbers but It was returned to me because your mailbox could not store a file of that size (its 900kb). It is listed in the system files area of bgscripts under DIALOGTXT.ZIP.

Posted: Wed May 23, 2001 3:07 pm
by velvetfreak
Thank you why say quafs a potion?
Craig that's an expression from wine-drinking culture :) a gulp not a sip, if you like.

Posted: Thu May 24, 2001 9:37 am
by Craig
I can't find the "Post" sign, could you make your own string?I think i know why you can't e-mail me i got !!!50!!! emails mostly from bgscripts(how do im stop this!!! :( :eek:
:( :eek: :( :eek:

E.P(Edit Post)
No No i want it to ALWAYS get most damaging melee then do the 16.66666667(or what ever)for which one he protects

[ 05-24-2001: Message edited by: craig ]

Posted: Thu May 24, 2001 9:45 am
by KensaiRyu
CRAIG ROFLMAO! Go to bgscripts then click on edit member preferences in the right corner and disable emails sent to you...*still laughing*...I like getting the emails you can learn alot from them... but thats me...*snickers* (they filled up your mailbox thats funny)

Posted: Thu May 24, 2001 9:54 am
by KensaiRyu
See([EVILCUTOFF])
THEN
RESPONSE #50
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Myself))
RESPONSE #25
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Player1))
RESPONSE #25
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Player2))
RESPONSE #25
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Player3))
RESPONSE #25
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Player4))
RESPONSE #25
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Player5))
RESPONSE #25
EquipMostDamagingMelee()
Attack(NearestEnemyOf(Player6))
END

Try that. Also I will send you the Dialog zip file if you delete some of those *snicker* posts...
(they spammed craigs mailbox)

Posted: Thu May 24, 2001 9:59 am
by Craig
thanks
A ha i have it sorted got yahoo email address now ive signed up and can see the files

[ 05-24-2001: Message edited by: craig ]

Posted: Thu May 24, 2001 10:00 am
by KensaiRyu
Anytime. :) If you have any more questions about ai post here.

Posted: Thu May 24, 2001 10:50 am
by Craig
have you e-mailed me yet?

Posted: Thu May 24, 2001 10:54 am
by Craig
It keeps on saing "invalid file name"

Posted: Thu May 24, 2001 7:29 pm
by velvetfreak
KR, how do the RESPONSE # numbers work? Is it random between the entries, with higher numbers given a better chance? I thought it must be a percentage given that the typical value is 100 but it seems that this is not so.

The stew thickens over at Yahoo groups. I'm not inclined to comment further until the dust settles, except to say that either backroom deals are being made or someone's making a lot of false claims.

Posted: Thu May 24, 2001 10:24 pm
by KensaiRyu
The response numbers are indeed a percentage however, they can be used different ways.

Response #100
Attack enemy 1

Response #100
Attack enemy 1

Response #100
Attack enemy 1

Response #100
Attack enemy 1

Response #100
Attack enemy 1

Response #100
Attack enemy 1

Response #100
Attack enemy 1

Response #100 (occurs 10 % of the time)
Attack enemy 2

Response #100 (occurs 10 % of the time)
Attack enemy 2

Response #100
Attack enemy 1

This is the same as :

Response #80 (occurs 80% of the time)
Attack enemy 1

Response #20 (occurs 20 % of the time)
Attack enemy 2

Posted: Thu May 24, 2001 10:53 pm
by KensaiRyu
It keeps on saing "invalid file name"

I tried to send it to you again and it got returned to me.

I will try again.

Posted: Thu May 24, 2001 10:56 pm
by velvetfreak
OK, just to make sure I've got this right:

IF
Blah Blah
THEN
RESPONSE #80
Attack(whatever)
END

This would still result in an attack action every time the IF returned true, right? IOW if there are no other RESPONSEs to evaluate it will use the one it's got every time.

Posted: Thu May 24, 2001 11:40 pm
by Manveru
@KensaiRyu : I have the following problem - I have made Shar-Teel as an NPC, however I wanted to make her more interesting - She wants the challenge with the strongest character in the group. Everything is ok to the some moment : She asks for the challenge. If we don't agree then she just waits for us and we can agree to challege her later. When we agree to fight her she attacks the strongest character as she is supposed to do, however she doesn't start the dialogue when she defeats my character or she is defeated. I have tried many things : SetInterrupt, ClearAllActions, StartDialogInterrupt and many more - nothing works. So my question what is wrong with this script (this is one of many versions) ? (this is her override script)

IF
Global("SharteelFight","GLOBAL",1)
HPPercentLT("Sharte1",50)
THEN
RESPONSE #100
DialogInterrupt(TRUE)
SetInterrupt(FALSE)
SetGlobal("SharteelFight","GLOBAL",2)
SetInterrupt(TRUE)
StartDialog("Sharte1",Player1)
END

IF
Global("SharteelFight","GLOBAL",1)
HPPercentLT(StrongestOf,50)
THEN
RESPONSE #100
SetGlobal("SharteelFight","GLOBAL",3)
Dialog(Player1)
END

IF
Global("SharteelFight","GLOBAL",1)
AttackedBy(StrongestOf,DEFAULT)
THEN
RESPONSE #100
AttackReevaluate(StrongestOf,30)
END

IF
AttackedBy([PC],DEFAULT)
THEN
RESPONSE #100
Enemy()
END

IF
Global("SharteelFight","GLOBAL",1)
HPPercentGT(Myself,74)
HPPercentGT(StrongestOf,49)
See(StrongestOf)
THEN
RESPONSE #100
ActionOverride(StrongestOf,Attack("Sharte1"))
AttackReevaluate(StrongestOf,30)
END

As the basis I used her original script from BG1, but it seems it doesn't work, then I used ppjon.bcs (Irenicus starts dialogue before he escapes from the spellhold after his HP is lower than 20), but it also doesn't work.

Thanks in advance.

Posted: Fri May 25, 2001 12:06 am
by KensaiRyu
Can you send me a copy of the Npc and scripts, I will take a look at it.I need them to be able to do some testing.

Posted: Fri May 25, 2001 12:43 am
by Manveru
I've sent it to you....

Posted: Fri May 25, 2001 1:08 am
by KensaiRyu
_____________________________________________
OK, just to make sure I've got this right:
IF
Blah Blah
THEN
RESPONSE #80
Attack(whatever)
END

This would still result in an attack action every time the IF returned true, right? IOW if there are no other RESPONSEs to evaluate it will use the one it's got every time.
_____________________________________________


Velvetfreak correct.

Manveru im taking a look now...how about I just send you a fixed script when im done.