Author Topic: A nook of questions  (Read 2478 times)

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
A nook of questions
« on: June 26, 2008, 10:10:30 AM »
I don't know if anyone has ever made something like that and will it be accepted or not, but it's no waste trying. I want this topic to be a place where you can ask short questions about modding.

Gah, let me start then ^^



In my mod, after we defeat two thieves, they run into dimension door and a new creature is created in AR1002 (guy named Maztec)

IF
   Global("CreateMaztec","GLOBAL",1)
THEN
   RESPONSE #100
      SetGlobal("CreateMaztec","GLOBAL",2)
      SetGlobal("MageComes","GLOBAL",1)
      CreateCreature("MAZTEC",[895.670],0) // Maztec
      SetGlobalTimer("MageAttacks","GLOBAL",200)
END

This script from above works perfectly.

Where shall I place that one from below if I want it to work to wherever outdoor BG II area we go ?

IF
   GlobalTimerExpired("MageAttacks","GLOBAL")
   Global("MageComes","GLOBAL",1)
THEN
   RESPONSE #100
      SetGlobal("MageComes","GLOBAL",2)
      CreateCreatureObject("Zalanr",Myself,0,0,0) // Zalan Rot
      ActionOverride("Zalanr",MoveToObject([PC]))
END

This script is supposed to create a mage named Zalan Rot after 8 hours (game time) from killing two thieves. I want him to appear just in front of PC. I'm pretty sure I did something wrong, but can't get what.

Hm, well it's not that short question as I thought it would be ... :P

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: A nook of questions
« Reply #1 on: June 26, 2008, 10:30:12 AM »
baldur.bcs is the game's master script which always runs regardless of where you are, who's in the party, etc. etc. Although its use is generally discouraged unless necessary because overlong scripts really can lead to game lag, in practice I have yet to see it happen with proper, judicious use of baldur.bcs. (You'd also want an AreaType check in there...)

Alternately, you could identify all outdoor areas you care about and simply EXTEND your code into all of their area scripts (which are typically just ARxxxx.bcs). This wouldn't be robust to people adding more outdoor areas through mods, however.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Re: A nook of questions
« Reply #2 on: June 27, 2008, 12:05:50 PM »
Which action must be used if I want that mage to appear instantly in front of PC ? (it works but the mage is created in the corner of map and looks like staying there is the only thing he is planning to do this evening :s)

I tried ActionOverride("Zalanr",MoveToObjectNoInterrupt([PC])) but it seems the "NoInterrupt" is used for something else (I did not see any difference between MoveToObject and that action from above)

Offline plainab

  • Sasha al'Therin
  • Planewalker
  • *****
  • Posts: 491
    • Infinity Engine Modding
Re: A nook of questions
« Reply #3 on: July 01, 2008, 09:10:07 PM »
Which action must be used if I want that mage to appear instantly in front of PC ? (it works but the mage is created in the corner of map and looks like staying there is the only thing he is planning to do this evening :s)

I tried ActionOverride("Zalanr",MoveToObjectNoInterrupt([PC])) but it seems the "NoInterrupt" is used for something else (I did not see any difference between MoveToObject and that action from above)
I think you mean SetInterrupt rather than NoInterrupt.  Here is an example usage from the IESDP:
Code: [Select]
86 SetInterrupt(I:State*Boolean)
This action sets whether a creature can be interrupted while carrying out script actions.

  IF
    See(Player2)
    !Range(Player2,4)
  THEN
    RESPONSE #100
      SetInterrupt(FALSE)
      MoveToObject("Player2")
      SetInterrupt (TRUE)
  END
 
You could try in your response section:
Code: [Select]
ActionOverride("Zalanr",SetInterrupt(FALSE))
ActionOverride("Zalanr",MoveToObject([PC]))
ActionOverride("Zalanr",SetInterrupt(TRUE))

But, i don't think that there is anything that will create the creature directly in-front of the pc.  However, you could create an invisible creature that once they have moved to the pc will become visible via some effect...
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altherin.webs.com

 

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