Author Topic: Weidu'ing Areas and Codes  (Read 1523 times)

Ryder

  • Guest
Weidu'ing Areas and Codes
« on: May 20, 2004, 11:11:25 PM »
CBisson
Posted: Apr 12 2004, 08:44 PM


I've cleaned up my codes and I'm posting the ones that are complete and working.

 //******************************************************************
//*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 Actors To ARE files With Weidu.~

//Choose the area file to modify:
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 Actors and correct the offsets
WRITE_SHORT 0x058 (~%#ofActor%~ + 1)
WRITE_SHORT 0x05c (~%triggOff%~ + 272)
WRITE_SHORT 0x060 (~%spawnOff%~ + 272)
WRITE_SHORT 0x068 (~%entraOff%~ + 272)
WRITE_SHORT 0x070 (~%contaOff%~ + 272)
WRITE_SHORT 0x078 (~%itemsOff%~ + 272)
WRITE_SHORT 0x07c (~%vertiOff%~ + 272)
WRITE_SHORT 0x084 (~%ambiaOff%~ + 272)
WRITE_SHORT 0x088 (~%variaOff%~ + 272)
WRITE_SHORT 0x0A0 (~%exploOff%~ + 272)
WRITE_SHORT 0x0A8 (~%doorsOff%~ + 272)
WRITE_SHORT 0x0B0 (~%animaOff%~ + 272)
WRITE_SHORT 0x0B8 (~%tiledOff%~ + 272)
WRITE_SHORT 0x0BC (~%songsOff%~ + 272)
WRITE_SHORT 0x0C0 (~%restcOff%~ + 272)
WRITE_SHORT 0x0C4 (~%automOff%~ + 272)
//Complete the prep work by adding a bunch of blank bytes.
INSERT_BYTES (~%actorOff%~ + ~%#ofActor%~ * 272) 272
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.

//Modify the specifics for your actor below.
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 0) ~Your Actor Name~
//You can change the 'Your Actor Name' but do not go above 32 characters.
WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 32) 520
WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 34) 540
//You can change the location by putting in your own points where the 520 and 540 is. Use decimal points.
WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 36) 520
WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 38) 540
//As above, you can change the location by altering 520 and 540. Use decimal points.
WRITE_SHORT (~%actorOff%~ + ~%#ofActor%~ * 272 + 40) 01
WRITE_SHORT (~%actorOff%~ + ~%#ofActor%~ * 272 + 52) 04
//At the above 04, use a decimal representation 1-15 for the facing direction of your actor. 0 is directly south, 7 is directly north.

//Animation from ANIMATE.IDS
WRITE_SHORT (~%actorOff%~ + ~%#ofActor%~ * 272 + 56) 24832
//That one's a bit tougher. First, know what your creature's animation is. Check it against the ANIMATE.IDS file. Convert the hex number to decimal. For this example, we've got a Fighter_Male_Human

//Visibility schedule- REM out or delete the groups you won't be using.
//ALL HOURS:
WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 64) 65535
WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 66) 65535
//DAY ONLY:
// WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 64) 65472
// WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 66) 63
//NIGHT ONLY:
// WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 64) 63
// WRITE_LONG (~%actorOff%~ + ~%#ofActor%~ * 272 + 66) 65472
//You can also get other combinations in 0x0h from NI, but remember to convert the hex bytes to decimals.

//Dialog File RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 72) ~~
//Override Script RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 80) ~~
//Class Script RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 88) ~~
//Race Script RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 96) ~~
//General Script RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 104) ~~
//Default Script RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 112) ~~
//Specific Script RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 120) ~~
//Note: for the above RESREFs, don't put anything between the tildes unless you want to actually override the .CRE's resrefs.

//Creature File RESREF
WRITE_ASCII (~%actorOff%~ + ~%#ofActor%~ * 272 + 128) ~FTOWN1~

Ryder

  • Guest
Re: Weidu'ing Areas and Codes
« Reply #1 on: May 20, 2004, 11:12:01 PM »
CBisson
Posted: Apr 12 2004, 08:45 PM 


//******************************************************************
//*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 Ambiants To ARE files With Weidu.~

//Choose the area file to modify:
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 Actors and correct the offsets
WRITE_SHORT 0x082 (~%#ofAmbia%~ + 1)
WRITE_SHORT 0x07c (~%vertiOff%~ + 212)
WRITE_SHORT 0x088 (~%variaOff%~ + 212)
WRITE_SHORT 0x0A0 (~%exploOff%~ + 212)
WRITE_SHORT 0x0A8 (~%doorsOff%~ + 212)
WRITE_SHORT 0x0B0 (~%animaOff%~ + 212)
WRITE_SHORT 0x0B8 (~%tiledOff%~ + 212)
WRITE_SHORT 0x0BC (~%songsOff%~ + 212)
WRITE_SHORT 0x0C0 (~%restcOff%~ + 212)
WRITE_SHORT 0x0C4 (~%automOff%~ + 212)
//Complete the prep work by adding a bunch of blank bytes.
INSERT_BYTES (~%ambiaOff%~ + ~%#ofAmbia%~ * 212) 212
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.

//Modify the specifics for your Ambiant below.
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 0) ~Your Ambiants Name~
//You can change the 'Your Ambiants Name' but do not go above 32 characters.
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 32) 282
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 34) 787
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 36) 500
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 46) 100
//Above, in order, X, Y, Radius, Volume %.
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 48) ~AM1200B~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 56) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 64) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 72) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 80) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 88) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 96) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 104) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 112) ~~
WRITE_ASCII (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 120) ~~
//Insert the RESREFs of what sounds you want between the above tildes.
// REMEMBER, the sound you pick may be keyed in a different biff than what the game
// reads for the area file, so if you're not careful, you could cause a crash.
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 128) 1
//Match the written decimal with the number of sounds you want.
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 130) 1
//Match the written decimal with the number of sounds you want.
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 132) 10
//The number of seconds between each sound.
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 136) 1
//Number of sounds to use in each 'set'

//Visibility schedule- REM out or delete the groups you won't be using.
//ALL HOURS:
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 140) 65535
WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 142) 65535
//DAY ONLY:
// WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 140) 65472
// WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 142) 63
//NIGHT ONLY:
// WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 140) 63
// WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 142) 65472
//You can also get other combinations in 0x0h from NI, but remember to convert the hex bytes to decimals.

WRITE_LONG (~%ambiaOff%~ + ~%#ofAmbia%~ * 212 + 144) 7
//Common flags that control the ambiant:
//Enabled, Point: 3
//Enabled, Point, Main: 7
//Enabled, Main, Area: 13

Ryder

  • Guest
Re: Weidu'ing Areas and Codes
« Reply #2 on: May 20, 2004, 11:12:40 PM »
CBisson
Posted: Apr 12 2004, 08:46 PM


//******************************************************************
//*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 Animations To ARE files With Weidu.~

//Choose the area file to modify:
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 Actors and correct the offsets
WRITE_SHORT 0x0AC (~%#ofAnima%~ + 1)
WRITE_SHORT 0x0B8 (~%tiledOff%~ + 76)
WRITE_SHORT 0x0BC (~%songsOff%~ + 76)
WRITE_SHORT 0x0C0 (~%restcOff%~ + 76)
WRITE_SHORT 0x0C4 (~%automOff%~ + 76)
//Complete the prep work by adding a bunch of blank bytes.
INSERT_BYTES (~%animaOff%~ + ~%#ofAnima%~ * 76) 76
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.


//Modify the specifics for your Animation below.
WRITE_ASCII (~%animaOff%~ + ~%#ofAnima%~ * 76 + 0) ~Your Animation Name~
//You can change the 'Your Animation Name' but do not go above 32 characters.
WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 32) 282
WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 34) 787
//Above, the point where this animation will appear.

//Visibility schedule- REM out or delete the groups you won't be using.
//ALL HOURS:
WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 36) 65535
WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 38) 65535
//DAY ONLY:
// WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 36) 65472
// WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 38) 63
//NIGHT ONLY:
// WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 36) 63
// WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 38) 65472
//You can also get other combinations in 0x0h from NI, but remember to convert the hex bytes to decimals.

WRITE_ASCII (~%animaOff%~ + ~%#ofAnima%~ * 76 + 40) ~FLAME2L~
//The RESREF of the .BAM to play.

WRITE_LONG (~%animaOff%~ + ~%#ofAnima%~ * 76 + 52) 3
//Common flags that control the animation:
//Is Shown=1
//Is Shown, No Shades=3
//Is Shown, No Shades, Shown In Combat=67 

Ryder

  • Guest
Re: Weidu'ing Areas and Codes
« Reply #3 on: May 20, 2004, 11:13:16 PM »
CBisson
Posted: Apr 12 2004, 08:46 PM


//******************************************************************
//*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 Entrances To ARE files With Weidu.~

//Choose the area file to modify:
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 Entrances and correct the offsets
WRITE_SHORT 0x06c (~%#ofEntra%~ + 1)
WRITE_SHORT 0x070 (~%contaOff%~ + 104)
WRITE_SHORT 0x078 (~%itemsOff%~ + 104)
WRITE_SHORT 0x07c (~%vertiOff%~ + 104)
WRITE_SHORT 0x084 (~%ambiaOff%~ + 104)
WRITE_SHORT 0x088 (~%variaOff%~ + 104)
WRITE_SHORT 0x0A0 (~%exploOff%~ + 104)
WRITE_SHORT 0x0A8 (~%doorsOff%~ + 104)
WRITE_SHORT 0x0B0 (~%animaOff%~ + 104)
WRITE_SHORT 0x0B8 (~%tiledOff%~ + 104)
WRITE_SHORT 0x0BC (~%songsOff%~ + 104)
WRITE_SHORT 0x0C0 (~%restcOff%~ + 104)
WRITE_SHORT 0x0C4 (~%automOff%~ + 104)
//Complete the prep work by adding a bunch of blank bytes.
INSERT_BYTES (~%entraOff%~ + ~%#ofEntra%~ * 104) 104
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.

//Modify the specifics for your Entrance below.
WRITE_ASCII (~%entraOff%~ + ~%#ofEntra%~ * 104 + 0) ~YourExit~
//You can change the 'YourExit' but do not go above 32 characters.
WRITE_LONG (~%entraOff%~ + ~%#ofEntra%~ * 104 + 32) 520
WRITE_LONG (~%entraOff%~ + ~%#ofEntra%~ * 104 + 34) 540
//You can change the location by putting in your own points where the 520 and 540 is. Use decimal points.
WRITE_LONG (~%entraOff%~ + ~%#ofEntra%~ * 104 + 36) 12
//At the above 04, use a decimal representation 1-15 for the facing direction of the party upon entering this area. 0 is directly south, 7 is directly north. 

Ryder

  • Guest
Re: Weidu'ing Areas and Codes
« Reply #4 on: May 20, 2004, 11:13:59 PM »
CBisson
Posted: Apr 12 2004, 08:47 PM 


//******************************************************************
//*Notes:
//*
//* WARNING: MOST ORIGINAL BG II AREAS DO NOT HAVE MAPNOTES, AND THE
//* OFFSET BY DEFAULT FOR THOSE AREAS IS 0x00. IF YOU USE THIS TO ADD
//* MAPNOTES TO SUCH AN AREA, YOU'LL CRASH THE GAME. ONLY ADD NEW
//* MAPNOTES TO AN AREA CREATED BY IETME, DLTCEP, OR A BG II ORIGINAL
//* AREA THAT ALREADY HAS MAPNOTES.
//* 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 MapNotes To ARE files With Weidu.~

//Choose the area file to modify:
COPY_EXISTING ~AR1200.ARE~ ~override/AR1200.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 Actors and correct the offsets
WRITE_SHORT 0x0C8 (~%#ofAutom%~ + 1)
//Complete the prep work by adding a bunch of blank bytes.
INSERT_BYTES (~%automOff%~ + ~%#ofAutom%~ * 52) 52
//Prep work is done.
//-----------------------------DO NOT ALTER ANYTHING ABOVE HERE TO THE TOP BREAK.

//Modify the specifics for your MapNote below.
WRITE_LONG (~%automOff%~ + ~%#ofAutom%~ * 52 + 0) 568
WRITE_LONG (~%automOff%~ + ~%#ofAutom%~ * 52 + 2) 175
//The X,Y location of the mapnote.
WRITE_SHORT (~%automOff%~ + ~%#ofAutom%~ * 52 + 4) 5185
//The actual Display String to use for the text of this mapnote. Of course, you can use weidu's @# .tra options to make your own dialog.tlk text.
WRITE_SHORT (~%automOff%~ + ~%#ofAutom%~ * 52 + 10) 4
//The color of this mapnote. See IESDP for decimals and corresponding colors.

Ryder

  • Guest
Re: Weidu'ing Areas and Codes
« Reply #5 on: May 20, 2004, 11:15:06 PM »
CBisson
Posted: Apr 12 2004, 08:53 PM 


I've still got to fix up the Spawn scripts and see if I can do the AutomapNotes for all areas- minor issues- but the Trigger, container, and door codes seem to be giving me trouble due to the vertice issue. I'll keep trying, but it's not as simple as I thought. If you have any ideas for those, let me know in the other topic.

*****

Guest
Posted: Apr 14 2004, 12:03 AM


Just a question, why do you force the use decimal numbers in write_long.
Is this a WeiDU restriction? - in this case, Weimer could help you.
Or your personal decision, then i wonder  :)
If Weidu is used for this extent of hacking existing areas then probably setting bits, deleting bits, increasing counters in offsets, etc, could have separate statements. 

 

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