Author Topic: Adding New Information Triggers?  (Read 5698 times)

Offline Rabain

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
  • Luck o' the Irish!
Adding New Information Triggers?
« on: August 18, 2004, 10:32:08 AM »

This is probably the most obvious thing in the world but how do i add the dialogue string to dialog.tlk for a new information trigger i want to add in an area?

For example when i click on picture its says "this is a nice picture of your mother" or somesuch in floating text.  How do i get the knew text into the .tlk file seeing as the trigger itself does not have a .dlg file to update etc

thanks

peace out
Touchstone: Wild Elf Fighter
BG2CPM: Dialog Portraits for Everyone!
WTPFamiliars: A new version of the Find Familiar Spell
All at: Border Kingdoms

Offline japheth

  • PPG
  • Planewalker
  • *****
  • Posts: 143
Re: Adding New Information Triggers?
« Reply #1 on: August 18, 2004, 11:20:55 AM »
First just take note of the offsets that your string reference will be located at. You can do this with NI. (Open up your area with NI, go to your Info point, click View/Edit and find the offset for Info point text.)

Then you just copy your area over normally and use SAY to patch the text:

COPY ~mymod/myarea.are~ ~override/myarea.are~
SAY 0x4584 ~When you touch the fountain stuff happens.~

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Adding New Information Triggers?
« Reply #2 on: August 18, 2004, 11:35:35 AM »
Did you mean that you wish to add a trigger to an existing area at the same time?
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline japheth

  • PPG
  • Planewalker
  • *****
  • Posts: 143
Re: Adding New Information Triggers?
« Reply #3 on: August 18, 2004, 12:17:37 PM »
Did you mean that you wish to add a trigger to an existing area at the same time?


Ah, well if that's what you mean that's something else entirely. In my opinion, it's *way* too much trouble to add an info/travel/proximity trigger on the fly with WeiDU.

I've never tried it because it's too much work. You have to update vertices, make sure the vertices are in the "right spot", etc.

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Adding New Information Triggers?
« Reply #4 on: August 18, 2004, 02:17:40 PM »
Crybaby... ::)

That's all us mac-users have available (there's no area-editing tools except for NI and Weidu). Kids these days just don't appreciate the hard work us old guys had to do when we were kids. Why, when I was a wee little lad, I had to use shell scripting uphill both ways to school through three feet piles of goblin dung! ;D

EDIT:
I guess I should make this post relevant to the topic.  Japheth, weren't you the one that posted all those templates for adding triggers/etc to a tp2?  I would think you'd be the first to champion the idea.  Anyways, it's not that hard to add info points, etc that way and it makes for greater compatibility if you're simply changing an in-game area.  I've really worked over Waukeen's Promenade with that techninque.
« Last Edit: August 18, 2004, 02:26:32 PM by Loriel »

Offline japheth

  • PPG
  • Planewalker
  • *****
  • Posts: 143
Re: Adding New Information Triggers?
« Reply #5 on: August 18, 2004, 03:00:36 PM »
Yeah... that was me, heheh.

I guess I just don't have the zeal for explaining that I used to have. Feel free to show him the way young padawan. ;)

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Adding New Information Triggers?
« Reply #6 on: August 18, 2004, 03:38:50 PM »
Ack...I went in search of that thread that had templates of all the different elements of an ARE file. There are at least three threads, but the most important one - the one with the finished product - was on the late TeamBG server.

@Japheth
I don't think that my attempts at explaining it would help - I'm less gifted in the words department than some, but thanks to your tutorials and other peoples' work, I can give working examples and let him sort it out!

@Rabain
If it's an area that you created, just use the method that Japheth mentioned at the top of the thread. If this is an in-game area, it's going to take a little bit more work, but be more rewarding to implement. Start with Japheth's tutorial on READ_BYTE to get the basics, then try applying them to this example for your area trigger. This example is unfinished and needs some help to make it work (watch out for the vertices section), but once you have figured it out, you can add info points all over the area saying you did it, if you want.
« Last Edit: August 18, 2004, 03:45:11 PM by Loriel »

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Adding New Information Triggers?
« Reply #7 on: August 18, 2004, 04:28:44 PM »
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Rabain

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
  • Luck o' the Irish!
Re: Adding New Information Triggers?
« Reply #8 on: August 19, 2004, 09:19:55 AM »

Okay thanks guys.  What i was looking for was adding an info point to a new area.  So it should be easier to amend using Japheths instructions in the first reply post...thank the gods!

My forays into offsets have never went well.  I will try this an hope for the best!

Thanks again

Rabain

Touchstone: Wild Elf Fighter
BG2CPM: Dialog Portraits for Everyone!
WTPFamiliars: A new version of the Find Familiar Spell
All at: Border Kingdoms

Offline Baronius

  • Planewalker
  • *****
  • Posts: 112
  • Gender: Male
    • The Black Wyrm modding & gaming community
Re: Adding New Information Triggers?
« Reply #9 on: August 19, 2004, 11:47:35 AM »
If you have changed anything on the area file, make sure to check target offsets and if necessary, update them to correct value in the TP2. (this is generally true when writing bytes with WeiDU)
This is necessary because if you change the area file (which is obviously an untyped file), the specific fields' positions might change if new data is written (for example when a new creature is added)
« Last Edit: August 19, 2004, 11:51:17 AM by Baronius »
The Black Wyrm modding & gaming community: www.blackwyrmlair.net

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: Adding New Information Triggers?
« Reply #10 on: August 19, 2004, 01:44:49 PM »
Here's a copy of the .tp2 code created by CBisson for adding triggers to an area. He made up a working package of example code a while back after working out the details on the various forums with various feedback. (Yes, I tend to archive everything of modding note. heh)

Code: [Select]
//******************************************************************
//*Notes:
//* You may use this code for your own mods. Simply change
//* whatever RESREFs you need.
//* Do not change any of the variables that have already been
//* made up, particulary those that alter offsets as it
//* will mess up the area file.
//* If you plan on adding more than one type of header (such as
//* two actors, you'll need to duplicate this code exactly.
//* Of course, you can alter any of the X,Y points to your own decimals.
//* I've only included the most popular changes to headers, so
//* if you need to change the number of times an actor has been
//* spoken to, for example, you'll have to figure out the offset.
//* When adding this code to your own .TP2, do not include these notes or
//* the BEGIN 'How to....' line
//*
//******************************************************************

BEGIN ~How To Add Triggers To ARE files With Weidu.~
//Which File are we going to edit:
COPY_EXISTING ~AR0020.ARE~ ~override/AR0020.ARE~

//Prepare for the area modification.
//---------------------------------DO NOT ALTER FROM HERE TO THE FOLLOWING BREAK.
 READ_SHORT ~0x058~ ~#ofActor~
 READ_SHORT ~0x054~ ~actorOff~
 READ_SHORT ~0x05a~ ~#ofTrigg~
 READ_SHORT ~0x05c~ ~triggOff~
 READ_SHORT ~0x064~ ~#ofSpawn~
 READ_SHORT ~0x060~ ~spawnOff~
 READ_SHORT ~0x06c~ ~#ofEntra~
 READ_SHORT ~0x068~ ~entraOff~
 READ_SHORT ~0x074~ ~#ofConta~
 READ_SHORT ~0x070~ ~contaOff~
 READ_SHORT ~0x076~ ~#ofItems~
 READ_SHORT ~0x078~ ~itemsOff~
 READ_SHORT ~0x080~ ~#ofVerti~
 READ_SHORT ~0x07c~ ~vertiOff~
 READ_SHORT ~0x082~ ~#ofAmbia~
 READ_SHORT ~0x084~ ~ambiaOff~
 READ_SHORT ~0x08c~ ~#ofVaria~
 READ_SHORT ~0x088~ ~variaOff~
 READ_SHORT ~0x09c~ ~#ofExplo~
 READ_SHORT ~0x0A0~ ~exploOff~
 READ_SHORT ~0x0A4~ ~#ofDoors~
 READ_SHORT ~0x0A8~ ~doorsOff~
 READ_SHORT ~0x0AC~ ~#ofAnima~
 READ_SHORT ~0x0B0~ ~animaOff~
 READ_SHORT ~0x0B4~ ~#ofTiled~
 READ_SHORT ~0x0B8~ ~tiledOff~
 READ_SHORT ~0x0BC~ ~songsOff~
 READ_SHORT ~0x0C0~ ~restcOff~
 READ_SHORT ~0x0C8~ ~#ofAutom~
 READ_SHORT ~0x0C4~ ~automOff~
//Increase the number of TRIGGERS and correct the offsets
 WRITE_SHORT 0x05a (~%#ofTrigg%~ + 1)
 WRITE_SHORT 0x060 (~%spawnOff%~ + 196)
 WRITE_SHORT 0x068 (~%entraOff%~ + 196)
 WRITE_SHORT 0x070 (~%contaOff%~ + 196)
 WRITE_SHORT 0x078 (~%itemsOff%~ + 196)
 WRITE_SHORT 0x07c (~%vertiOff%~ + 196)
 WRITE_SHORT 0x084 (~%ambiaOff%~ + 196)
 WRITE_SHORT 0x088 (~%variaOff%~ + 196)
 WRITE_SHORT 0x0A8 (~%doorsOff%~ + 196)
//Complete the prep work by adding a bunch of blank bytes.
 INSERT_BYTES (~%triggOff%~ + ~%#ofTrigg%~ * 196) 196
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.

//Set up the vertices you'll be adding.
 WRITE_SHORT 0x080 (~%#ofVerti%~ + 8)
//NOTE: YOU CAN CHANGE THE "8" TO HOWEVER NUMBER OF VERTICES YOU ARE
// ADDING FOR YOUR TRIGGER.
 INSERT_BYTES (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196) 32
//In the above two lines, only change the "32". That numeral should be
//THE NUMBER OF VERTICES YOU'RE ADDING TIMES 4.

//Correct the offsets
 WRITE_SHORT 0x0A0 (~%exploOff%~ + 228)
 WRITE_SHORT 0x0B0 (~%animaOff%~ + 228)
 WRITE_SHORT 0x0B8 (~%tiledOff%~ + 228)
 WRITE_SHORT 0x0BC (~%songsOff%~ + 228)
 WRITE_SHORT 0x0C0 (~%restcOff%~ + 228)
 WRITE_SHORT 0x0C4 (~%automOff%~ + 228)
//IN THE ABOVE SECTION, THE "228"s CAN BE CHANGED.
//IT SHOULD BE (196 + (~#newVertices~ * 4)), so this example adds 8 vertices.
//196 + 8*4 = 228.


//-------------------------------------INSERT SPECIFICS BELOW.
//Now, you can start adding in the actual code for whatever you are inserting.

//Name
 WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196) ~Your_New~
 WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 8) ~Trigger1~
 WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 16) ~~
 WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 24) ~~

//Trigger Type
 WRITE_SHORT (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 32) 01
//01=Info
//02=Travel
//03=Proximity

//Trigger Icon
 WRITE_SHORT (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 52) 22
//22=Info Question Mark
//28=Inside Exit (stair)
//30=Outside Exit (door)

//Destination Area RESREF
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 56) ~~

//Exit point
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 64) ~~

//Flags:
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 96) 04
//04=Party Required

//Trigger Text
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 100) 5185
//Replace the "5185" with your chosen dialog string for Info Points.
//You can use SAY here, just replace "WRITE_LONG" with "SAY" and "5185" with "@#"

//Trap Detection %
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 104) 00

//Trap Removal %
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 106) 00

//Is Trapped Flag
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 108) 00
//0=no
//1=yes

//Trap Already Detected Flag
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 110) 00
//same as above?

//Trap Location:
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 112) 244
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 114) 746

//Key Type
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 116) ~~

//Associated Script
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 124) ~~

//Associated Dialog
WRITE_ASCII (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 188) ~~

//Now, we've got to set up the vertices. I suggest you use IETME to make the graphical
// representation, then view the numbers with NI
//bounding box:
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 34) 568
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 36) 175
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 38) 676
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 40) 337
//CHANGE YOUR POINTS TO THE BOUNDING BOX.
//#vertices
 WRITE_SHORT (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 42) 8
//CHANGE THE "8" TO HOWEVER NUMBER OF NEW VERTICES YOU'LL BE ADDING.
//vertex index
 WRITE_LONG (~%triggOff%~ + ~%#ofTrigg%~ * 196 + 44) ~%#ofVerti%~

//Now, write the new vertices.
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196) 589
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 2) 332
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 4) 568
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 6) 235
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 8) 587
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 10) 189
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 12) 620
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 14) 174
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 16) 667
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 18) 182
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 20) 676
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 22) 217
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 24) 661
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 26) 337
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 28) 589
 WRITE_SHORT (~%vertiOff%~ + ~%#ofVerti%~ * 4 + 196 + 30) 332
//Of course, you can alter the points above to match your trigger
//as well as add new points, AS LONG AS EVERYTHING FOLLOWS THE PATTERN!
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Adding New Information Triggers?
« Reply #11 on: August 19, 2004, 03:31:45 PM »
hlid, thank you thank you thank you!  I have been seaching google for an archived copy, but couldn't find it.  Do you by any chance have the other examples as well?  I could figure it out myself, but it's always nicer to build on someone else's working examples.

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: Adding New Information Triggers?
« Reply #12 on: August 19, 2004, 06:15:03 PM »
Yeah, I have them. I've sent an email to CB to see if he minds if I put them back up. Shouldn't be a problem. ;)
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: Adding New Information Triggers?
« Reply #13 on: August 19, 2004, 11:10:45 PM »
Done, you can grab 'em here: Weidu Area Templates
« Last Edit: July 01, 2005, 08:50:39 AM by Bons »
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Adding New Information Triggers?
« Reply #14 on: August 19, 2004, 11:17:01 PM »
I'll pop right off and... oh, guess not.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Adding New Information Triggers?
« Reply #15 on: August 19, 2004, 11:21:35 PM »
Done, you can grab 'em here: Weidu Area Templates

* Ghreyfain clicks and clicks, 'til he can't click no more!

As the old saying goes, "Sorry, you are not permitted to use this board."  I think it was Mark Twain said that.
« Last Edit: July 01, 2005, 08:51:11 AM by Bons »
Earn Money Sleeping.

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: Adding New Information Triggers?
« Reply #16 on: August 19, 2004, 11:33:05 PM »
Check your email Ghrey.  :pirate
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Adding New Information Triggers?
« Reply #17 on: August 20, 2004, 04:40:49 AM »
Ah, they have taken their rightful place between IDW and a comment on IETME never being updated.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Adding New Information Triggers?
« Reply #18 on: January 10, 2005, 04:08:07 PM »
To bump, or not to bump?  Some other bits about slings and arrows.  To sleep, perchance to sticky?
Earn Money Sleeping.

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Adding New Information Triggers?
« Reply #19 on: January 10, 2005, 04:12:24 PM »
I'd rather reassemble all the templates. The link on Studios is dead.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Adding New Information Triggers?
« Reply #20 on: January 10, 2005, 04:28:09 PM »
Might as well, yeah.
Earn Money Sleeping.

Offline Rastor

  • Planewalker
  • *****
  • Posts: 271
  • Author of the book, "Being a Jerk for Dummies"
    • RPG Dungeon
Re: Adding New Information Triggers?
« Reply #21 on: January 10, 2005, 04:31:55 PM »
Forgotten Wars is now reporting this as being a 0 byte file.

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: Adding New Information Triggers?
« Reply #22 on: January 11, 2005, 05:12:13 AM »
The FW service provider no longer allows compressed file attachments. (zip, rar, etc...) I'll find a new local for them when I get my laptop back from the shop next week.
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Adding New Information Triggers?
« Reply #23 on: January 11, 2005, 05:41:36 AM »
They wouldn't be out of place in the WeiDU readme.

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: Adding New Information Triggers?
« Reply #24 on: January 11, 2005, 07:32:46 AM »
They wouldn't be out of place in the WeiDU readme.

Good call that, I doubt CBisson would mind either.
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

 

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