Jump to content


Photo

How to let creatures move between areas?


  • Please log in to reply
2 replies to this topic

#1 Huxaltec

Huxaltec
  • Member
  • 10 posts

Posted 27 March 2010 - 11:10 AM

Hi everybody!

(Sorry for my bad English)
These days, I try to make a cre that is able to travel between areas(with the party), like the haiass.cre in the "haiass el lobo" mod. I made a MyCre.baf with the MakeGlobal() action command.
But I don't know what to do next...

Thanks fo reply :D !!!!!!!!!!!!!

Edited by Huxaltec, 27 March 2010 - 11:20 AM.


#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 28 March 2010 - 10:55 PM

You need a script block that moves the creature to the party's location, then you need to extend every single area script in the game with that block, or patch it into areas without a script. Sure, you could be lazy and extend baldur.bcs but that's lame :P.

From Haiass, the script block for haiare.baf:
IF
  Global("HaiassJumpOn","GLOBAL",1)
  Global("HaiassSeUne","GLOBAL",1)
  !InActiveArea("haiass")
  !See("haiass")
  !Dead("haiass")
THEN
  RESPONSE #100
    MoveGlobalObject("haiass",Protagonist)
END
And then the mod .tp2 code to extend that to all the area scripts:
COMPILE ~haiass/append/haiare.baf~

COPY_EXISTING_REGEXP GLOB ~^\([^xX].*\|[xX][^rR].*\|[xX][rR][^2].*\|[xX][rR]2[^46].*\)\.are$~ ~override~
  PATCH_IF SOURCE_SIZE > 0x11b BEGIN
    READ_ASCII 0x94 ~rsc~ //Area script
    TO_LOWER rsc
    PATCH_IF (~%rsc%~ STRING_EQUAL ~none~ = 0) AND (~%rsc%~ STRING_EQUAL ~~ = 0) BEGIN //If not a null script
      PATCH_IF NOT VARIABLE_IS_SET $df(EVALUATE_BUFFER ~%rsc%~) BEGIN //And hasn't been buffered already
        SPRINT $df(EVALUATE_BUFFER ~%rsc%~) ~%rsc%~ //Add to buffer
      END
    END ELSE BEGIN
      SPRINT ~rsc~ ~%SOURCE_RES%~ //Area script
      PATCH_IF FILE_EXISTS_IN_GAME ~%rsc%.bcs~ BEGIN
        WRITE_ASCIIE 0x94 ~%rsc%~ #8 //Write it to the area file
        SPRINT $df(EVALUATE_BUFFER ~%rsc%~) ~%rsc%~ //Add to buffer
      END ELSE BEGIN
        INNER_ACTION BEGIN
          COPY_EXISTING ~haiare.bcs~ ~override/%rsc%.bcs~
        END
        WRITE_ASCIIE 0x94 ~%rsc%~ #8 //Write it to the area file
      END
    END
  END
BUT_ONLY_IF_IT_CHANGES

ACTION_PHP_EACH df AS i => xs BEGIN //Extend all scripts in buffer
  EXTEND_BOTTOM ~%xs%.bcs~ ~override/haiare.bcs~
END
Change the variable and creature names as relevant. It's worth noting that "haiass" in this case is the creature's scripting name (also called death variable) not the filename (it's that too but it needs to be the scripting name).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#3 Huxaltec

Huxaltec
  • Member
  • 10 posts

Posted 29 March 2010 - 09:53 AM

Thx Miloch !!!! All works perfectly...