Jump to content

RunEnemy


Recommended Posts

This is going to be really tough to fix; I'm not sure if it can be done in time for the next release or if it should go to pending. Preliminary code:

COPY_EXISTING RunEnemy.bcs override
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY "(LastSeenBy(Myself)," "([255],"
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

Obviously, there's still a lot more that needs to be done to get this working correctly.

Link to comment

Fixed for v4.

 

// trigger misordering causing folks to flee from party, not enemies
COPY_EXISTING ~runenemy.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY ~\(See(\[ENEMY\])\)[%tab% %lnl%%mnl%%wnl%]+\(!?Detect(\[PC\])\)~ ~\2 \1~
 COMPILE_BAF_TO_BCS
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Do we really want to do this?

 

runenemy.bcs is used mostly by the sort of random commoners who go hostile and call the police when <CHARNAME> throws a murder party or steals their washcloths. They ought to run away from the party, not from each other and their protectors while ignoring the villain at hand (the player!)

Link to comment

Yes, we do. RUNENEMY only controls their behavior while they're neutral and see enemies onscreen. WTRUNSGT and WDRUNSGT will be used if they themselves become enemies (and haul ass away from the party, they will).

 

But when they're neutral and they see the PC (it's essentially an "am I onscreen" test), they should be running away from the enemy they spotted, not the PC who just came into visual range.

Link to comment
WTRUNSGT and WDRUNSGT will be used if they themselves become enemies (and haul ass away from the party, they will).

 

I was thinking specifically of the lot which lacks the shout/runenemy/wtrunsgt scripting triad - in particular,

COPY_EXISTING ~aewimer1.cre~ ~override~
		  ~aewimer2.cre~ ~override~
		  ~aewimer3.cre~ ~override~
		  ~bdgoph01.cre~ ~override~
		  ~bdgoph02.cre~ ~override~
		  ~brat1.cre~	~override~
		  ~brat2.cre~	~override~
		  ~brat3.cre~	~override~
		  ~ftown1.cre~   ~override~
		  ~ftown2.cre~   ~override~
		  ~ftown3.cre~   ~override~
		  ~ftown4.cre~   ~override~
		  ~haquat.cre~   ~override~
		  ~maria.cre~	~override~
		  ~mourner5.cre~ ~override~
		  ~mourner6.cre~ ~override~
		  ~mtown1.cre~   ~override~
		  ~mtown2.cre~   ~override~
		  ~mtown3.cre~   ~override~
		  ~mtown4.cre~   ~override~
		  ~murtlen.cre~  ~override~
		  ~noblem1.cre~  ~override~
		  ~noblem2.cre~  ~override~
		  ~noblew1.cre~  ~override~
		  ~noblew2.cre~  ~override~
		  ~peony.cre~	~override~
		  ~postul1.cre~  ~override~
		  ~postul3.cre~  ~override~
		  ~postul5.cre~  ~override~
		  ~postul6.cre~  ~override~
		  ~pwauk2.cre~   ~override~
		  ~radeel.cre~   ~override~
		  ~scbutler.cre~ ~override~
		  ~scqar.cre~	~override~
		  ~scsarles.cre~ ~override~
		  ~sethle.cre~   ~override~
		  ~trskin02.cre~ ~override~
		  ~trtavp05.cre~ ~override~
		  ~uhmer02.cre~  ~override~
		  ~wellyn.cre~   ~override~

have neither of the those additional scripts. If you've already checked them, let me know please, so that I may squander my time in lazier pursuits :)

Link to comment

RunEnemy shouldn't help them otherwise (they still wouldn't do anything if they turn hostile). NearestEnemyOf() probably doesn't work for neutrals -- the whole point is to get neutral NPCs to react to the presence of EA 255 creatures, like SeeEnemy has neutral guards attack hostiles.

 

As for missing scripts, I don't think it's a big enough issue to really warrant fixing (if only to avoid the inevitable discussion of the pros and cons that drags for 50 pages).

Link to comment
As for missing scripts, I don't think it's a big enough issue to really warrant fixing (if only to avoid the inevitable discussion of the pros and cons that drags for 50 pages).

I think it'd be a good fit for the existing OBC Additional Script Fixes, especially as Nythrun has already put together a good starter list. Definitely low-pri, though.

Link to comment

For OBC Addt'l Script Fixes:

 

// commoners missing scripts to turn hostile and run away if attacked
COPY_EXISTING ~aewimer1.cre~ ~override~
             ~aewimer2.cre~ ~override~
             ~aewimer3.cre~ ~override~
             ~bdgoph01.cre~ ~override~
             ~bdgoph02.cre~ ~override~
             ~brat1.cre~    ~override~
             ~brat2.cre~    ~override~
             ~brat3.cre~    ~override~
             ~ftown1.cre~   ~override~
             ~ftown2.cre~   ~override~
             ~ftown3.cre~   ~override~
             ~ftown4.cre~   ~override~
             ~haquat.cre~   ~override~
             ~maria.cre~    ~override~
             ~mourner5.cre~ ~override~
             ~mourner6.cre~ ~override~
             ~mtown1.cre~   ~override~
             ~mtown2.cre~   ~override~
             ~mtown3.cre~   ~override~
             ~mtown4.cre~   ~override~
             ~murtlen.cre~  ~override~
             ~noblem1.cre~  ~override~
             ~noblem2.cre~  ~override~
             ~noblew1.cre~  ~override~
             ~noblew2.cre~  ~override~
             ~peony.cre~    ~override~
             ~postul1.cre~  ~override~
             ~postul3.cre~  ~override~
             ~postul5.cre~  ~override~
             ~postul6.cre~  ~override~
             ~pwauk2.cre~   ~override~
             ~radeel.cre~   ~override~
             ~scbutler.cre~ ~override~
             ~scqar.cre~    ~override~
             ~scsarles.cre~ ~override~
             ~sethle.cre~   ~override~
             ~trskin02.cre~ ~override~
             ~trtavp05.cre~ ~override~
             ~uhmer02.cre~  ~override~
             ~wellyn.cre~   ~override~
 SET "script_runenemy" = 0
 SET "script_wtrunsgt" = 0
 FOR (index = 0 ; index < 5 ; index = index + 1) BEGIN
   READ_ASCII (0x248 + ("%index%" * 0x08)) "script"
   PATCH_IF ("%script%" STRING_COMPARE_CASE "runenemy" = 0) BEGIN
     SET "script_runenemy" = 1
   END ELSE
   PATCH_IF (("%script%" STRING_COMPARE_CASE "wtrunsgt" = 0) OR
             ("%script%" STRING_COMPARE_CASE "wdrunsgt" = 0)) BEGIN
     SET "script_wtrunsgt" = 1
   END
 END
 PATCH_IF ("%script_runenemy%" + "%script_wtrunsgt%" != 2) BEGIN
   FOR (index = 0 ; index < 5 ; index = index + 1) BEGIN
     READ_ASCII (0x248 + ("%index%" * 0x08)) "script"
     PATCH_IF (("%script%" STRING_COMPARE_CASE "none" = 0) OR ("%script%" STRING_COMPARE_CASE "" = 0)) BEGIN
       PATCH_IF ("%script_runenemy%" = 0) BEGIN
         WRITE_ASCII (0x248 + ("%index%" * 0x08)) "runenemy"
         SET "script_runenemy" = 1
       END ELSE
       PATCH_IF ("%script_wtrunsgt%" = 0) BEGIN
         WRITE_ASCII (0x248 + ("%index%" * 0x08)) "wtrunsgt"
         SET "script_wtrunsgt" = 1
       END
     END
   END
 END
 BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...