Author Topic: DO STUFF HERE ANDY! Feral Halflings problems  (Read 4714 times)

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
DO STUFF HERE ANDY! Feral Halflings problems
« on: February 26, 2005, 06:59:12 PM »
As reported by SixofSpades, there are some scripting/AI problems with the Feral Halflings. 

CREATURENAMEKITALIGNMENTDVOVERRIDECLASSRACEGENERALDEFAULTDIALOG
OBSHAL01ENTUFIGHTERLAWFUL NEUTRALOBSHAL01SHOUTDLGGPSHOUT1OBSHAL01OBSHAL01
OBSHAL02TOGANFIGHTERNEUTRAL EVILOBSHAL02OBSHAL02WTASIGHTOBSHAL02
OBSHAL03NECRENECROMANCERLAWFUL NEUTRALOBSHAL03SHOUTDLGGPSHOUT3OBSHAL03LOWBYEOBSHAL03
OBSHAL04HALFLING WARRIORFIGHTERNEUTRAL EVILOBSHAL04GPSHOUTOBSHAL01WTASIGHTOBSHAL04
OBSHAL05KAYARDICONJURERLAWFUL EVILOBSHAL05GPSHOUTMAGE16CWTASIGHT
OBSHAL06TAIBELAMAGENEUTRALOBSHAL06GPSHOUTMAGE12DLOWBYEWTASIGHT
OBSHAL07MOGADISHCLERICLAWFUL EVILPRIES18AGPSHOUTPRIES18AWTASIGHT
   

(This is just me trying to work things out, btw).

The above table are how the creatures were coded by Bioware.  The fields in red denote assigned scripts/dialogs that don't exist.  The green field denotes a death variable shared by pries18a.cre (though I cannot find that pries18a.cre is used in BG2).

Here is the current UB .tp2 code that alters the halflings:

Code: [Select]
COMPILE ~ub/dialogs/u!minor.d~
        ~ub/dialogs/obshal03.d~
USING   ~ub/tra/%s/ubdialog.tra~

COPY_EXISTING ~OBSHAL01.CRE~ ~override/OBSHAL01.CRE~  /* Planar Sphere Feral Halflings */
WRITE_ASCII   ~0x248~        ~shoutdlg~               /* Assign script to initiate dialog */
WRITE_ASCII   ~0x250~        ~gpshout~
WRITE_ASCII   ~0x258~        ~obshal01~

COPY_EXISTING ~OBSHAL03.CRE~ ~override/OBSHAL03.CRE~  /* Planar Sphere Feral Halflings */
WRITE_ASCII   ~0x248~        ~shoutdlg~               /* Assign script to initiate dialog */
WRITE_ASCII   ~0x250~        ~gpshout~
WRITE_ASCII   ~0x258~        ~obshal03~
WRITE_ASCII   ~0x260~        ~lowbye~

(u!minor.d does not alter the halflings, btw)

The contents of obshal03.d are as follows:
Quote
BEGIN ~OBSHAL03~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
  SAY #33118 /* ~Perfect.  I have longed for a fresh meal and I am delivered.  You have walked into my arms.  Necre sees that you are ready to fill his stomach.~ */
  IF ~~ THEN REPLY #33119 /* ~I ain't ready for nothing other than bashing your ugly head in.~ */ GOTO 2
  IF ~~ THEN REPLY #33120 /* ~Didn't your mother ever tell you not to talk to strangers.~ */ GOTO 1
  IF ~~ THEN REPLY #33122 /* ~I really must be going.  I have no desire to kill you, but I will if I must.~ */ GOTO 3
  IF ~InParty("minsc")~ THEN REPLY #33133 /* ~We have a hamster for you to snack on, would that do?~ */ EXTERN ~MINSCJ~ 63
END

IF ~~ THEN BEGIN 1 // from: 0.1
  SAY #33121 /* ~My mother taught me how to eat strangers.  Want to see what I learned?~ */
  IF ~~ THEN DO ~Enemy()
ChangeEnemyAlly("obshal01",[ENEMY])~ EXIT
END

IF ~~ THEN BEGIN 2 // from: 0.0
  SAY #33123 /* ~Necre thinks you will be the one with the bashed in head, for how else will I suck the sweet brains from your skull?~ */
  IF ~~ THEN DO ~Enemy()
ChangeEnemyAlly("obshal01",[ENEMY])~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 0.2
  SAY #33124 /* ~I have no desire to kill you either.  However, I must eat and I'm sure you'd rather be dead before I make a meal of you.~ */
  IF ~~ THEN DO ~Enemy()
ChangeEnemyAlly("obshal01",[ENEMY])~ EXIT
END

IF ~~ THEN BEGIN 4 // from:
  SAY #33135 /* ~The hamster will be dessert.  After we eat you of course.~ */
  IF ~~ THEN DO ~Enemy()
ChangeEnemyAlly("obshal01",[ENEMY])~ EXIT
END

(Looking at it now, this probably could have been done via replacing a state trigger of the first state instead of compiling the .dlg all over again).

Could the problem be related to the two neutral* alignments and the use of GPSHOUT.bcs?

Here's GPSHOUT.bcs:
Quote
IF
   AttackedBy([GOODCUTOFF],DEFAULT)
   OR(3)
      Allegiance(Myself,GOODBUTBLUE)
      Allegiance(Myself,NEUTRAL)
      Allegiance(Myself,0)
THEN
   RESPONSE #100
      Shout(151)
      Enemy()
END

IF
   HitBy([GOODCUTOFF],CRUSHING)
THEN
   RESPONSE #100
      Shout(151)
      Continue()
END

IF
   See([GOODCUTOFF])
   Allegiance(Myself,ENEMY)
   ActionListEmpty()
THEN
   RESPONSE #100
      Shout(151)
      Continue()
END

IF
   Heard([ANYONE],151)
   InMyGroup(LastHeardBy(Myself))
   !Class(Myself,INNOCENT)
   OR(2)
      Allegiance(Myself,GOODBUTBLUE)
      Allegiance(Myself,NEUTRAL)
THEN
   RESPONSE #100
      Enemy()
      MoveToObject(LastHeardBy(Myself))
END

IF
   Heard([ANYONE],151)
   InMyGroup(LastHeardBy(Myself))
   OR(2)
      Allegiance(Myself,GOODBUTBLUE)
      Allegiance(Myself,NEUTRAL)
THEN
   RESPONSE #100
      Enemy()
END

IF
   Heard([ANYONE],151)
   InMyGroup(LastHeardBy(Myself))
   !Class(Myself,INNOCENT)
   !See(NearestEnemyOf(Myself))
THEN
   RESPONSE #100
      MoveToObject(LastHeardBy(Myself))
      Continue()
END

IF
   General(Myself,HUMANOID)
   HPPercentLT(Myself,20)
   HPGT(Myself,1)
   !Dead("yself)")
   Global("whined","LOCALS",0)
   See(NearestMyGroupOfType)
   Allegiance(Myself,ENEMY)
   !Dead("astSeenBy(Myself))")
THEN
   RESPONSE #50
      SetGlobal("whined","LOCALS",1)
      DisplayStringHead(Myself,46151) // help!
      Shout(153)
   RESPONSE #50
      SetGlobal("whined","LOCALS",1)
      DisplayStringHead(Myself,49763) // I require assistance
      Shout(153)
   RESPONSE #50
      SetGlobal("whined","LOCALS",1)
      DisplayStringHead(Myself,49764) // Defend me!
      Shout(153)
   RESPONSE #50
      SetGlobal("whined","LOCALS",1)
      DisplayStringHead(Myself,49765) // Slay my attacker!
      Shout(153)
END

IF
   Heard([ANYONE],153)
   InMyGroup(LastHeardBy(Myself))
   !HaveAnySpells()
THEN
   RESPONSE #100
      EquipRanged()
      AttackReevaluate(LastAttackerOf(LastHeardBy(Myself)),30)
END

IF
   BreakingPoint()
   Global("Panic","LOCALS",0)
THEN
   RESPONSE #50
      SetGlobal("Panic","LOCALS",1)
      DisplayStringHead(Myself,49766) // I can't take this
   RESPONSE #50
      SetGlobal("Panic","LOCALS",1)
      DisplayStringHead(Myself,49767) // No more
   RESPONSE #50
      SetGlobal("Panic","LOCALS",1)
      DisplayStringHead(Myself,49768) // Mercy!
END

IF
   HitBy(Myself,CRUSHING)
THEN
   RESPONSE #100
      RunAwayFrom(NearestEnemyOf(Myself),15)
END

IF
   Global("attackSpellcaster","GLOBAL",1)
   !Allegiance(Myself,ENEMY)
THEN
   RESPONSE #100
      SetGlobal("attackSpellcaster","GLOBAL",0)
      Enemy()
END

« Last Edit: April 12, 2005, 06:13:36 PM by Andyr »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: Feral Halflings problems
« Reply #1 on: April 12, 2005, 05:46:30 PM »
What was the problem? They weren't going hostile?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: Feral Halflings problems
« Reply #2 on: April 12, 2005, 06:06:04 PM »
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: Feral Halflings problems
« Reply #3 on: April 12, 2005, 06:12:59 PM »
Oh. Hmm. Perhaps then we should just delete the scripts?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: DO STUFF HERE ANDY! Feral Halflings problems
« Reply #4 on: April 12, 2005, 06:40:04 PM »
Dunno.  Scripting and AI I ain't being so good at.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: DO STUFF HERE ANDY! Feral Halflings problems
« Reply #5 on: April 12, 2005, 06:43:47 PM »
The same... has been a while since I did much.  :-[ I'm thinking, though, if it worked fine in the original game but the script restoration seems to be stopping it, and the script restoration's not really adding anything, so we may as well get rid of it. :) The new stuff's in the dialogue.

Though, hmm, we'd probably need to extend the actions in the dialogue to make the other halflings hostile, in that case?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline icelus

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3173
  • Gender: Male
Re: DO STUFF HERE ANDY! Feral Halflings problems
« Reply #6 on: April 12, 2005, 07:57:30 PM »
IIRC, the scripts had to be shuffled on the .cre files to make the halflings shout their dialog.  They didn't before.  But by assigning scripts, I think I screwed something up somewhere that caused some of the halflings to attack each other instead.
<Moongaze> Luckily BWL has a very understanding and friendly admin.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: DO STUFF HERE ANDY! Feral Halflings problems
« Reply #7 on: April 16, 2005, 08:19:30 PM »
Any ideas, Sim or anyone else? Ice and I discussed this over MSN; neither of us is really sure why it's happening... It's the last thing we need to do for v14 so thoughts are appreciated.

I should stick to kits.
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: DO STUFF HERE ANDY! Feral Halflings problems
« Reply #8 on: April 16, 2005, 09:28:08 PM »
Code: [Select]
IF
  See([2])
  Global("TALKED","LOCALS",0) // Could also be NumTimesTalkedTo(0) w/ no SetGlobal
THEN
  RESPONSE #100
    SetGlobal("TALKED","LOCALS",1)
    StartDialogueNoSet(LastSeenBy(Myself))
END
EXTEND_TOP OBSHAL01 and OBSHAL03.

Code: [Select]
COPY_EXISTING ~OBSHAL04.CRE~ ~OVERRIDE~
  WRITE_ASCII 0x0250 ~~ #8 // Shouldn't have OBSHAL01 script
BUT_ONLY_IF_IT_CHANGES
Don't try to talk because I have nothing to say...

Code: [Select]
REPLACE ~OBSHAL01~
IF ~~ 1
  SAY #33115
  IF ~~ EXIT
END

IF ~~ 2
  SAY #33116
  IF ~~ EXIT
END

IF ~~ 3
  SAY #33117
  IF ~~ EXIT
END
END

REPLACE ~OBSHAL03~
IF ~NumTimesTalkedTo(0)~ 0
  SAY #33118
  + ~~ + #33119 + 2
  + ~~ + #33120 + 1
  + ~~ + #33122 + 3
  + ~InParty("MINSC")~ + #33133 EXTERN ~MINSCJ~ 63
END

IF ~~ 1
  SAY #33121
  IF ~~ EXIT
END

IF ~~ 2
  SAY #33123
  IF ~~ EXIT
END

IF ~~ 3
  SAY #33124
  IF ~~ EXIT
END

IF ~~ 4
  SAY #33135
  IF ~~ EXIT
END
END
Just replace the dialogues.

This all seems to work perfectly for me. There's no need to shuffle their script assignments, and no need to make any of them neutral. The only issue is OBSHAL04, which has the OBHSAL01 script assigned (for no apparent reason; it does nothing). While you're here, you might want to restore OBSDEM01 (or whatever, the named demon in the outer world), so you can tell him you're gonna rip his heart out.

Offline Andyr

  • Dance Commander
  • PPG
  • Planewalker
  • *****
  • Posts: 3178
  • Gender: Male
    • The Gibberlings Three IE mod community
Re: DO STUFF HERE ANDY! Feral Halflings problems
« Reply #9 on: April 17, 2005, 08:25:03 AM »
Will give this a go, thanks. :) As for the named demon, I believe that's on the list of false'd dialogues or something.

EDIT: Halflings fixed.
« Last Edit: April 17, 2005, 10:11:45 AM by Andyr »
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

I am unfortunately not often about these days so the best way to get hold of me is via email.

 

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)?: