Author Topic: Adding entrances with WeiDU  (Read 3432 times)

The_Swordalizer

  • Guest
Adding entrances with WeiDU
« on: May 18, 2005, 07:12:58 AM »
I have a little problem whilst writing a new encounter: I need to add an entrance to the Bridge District. As I dont want to overwrite such a large area I need to add it with WeiDU, however I'm a complete patching noob. I looked at the tutorials I could find and think I have all the variables and such worked out, but checking in NI the "Name" field appears to be 20 bytes long?? Is there a "WRITE_REALLY_LONG" function? :o

It mentions in the Readme you can write long several times. How does this work? Do I "WRITE_LONG WRITE_LONG"? Do I have to break the value I am writing down somehow? Help!

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Adding entrances with WeiDU
« Reply #1 on: May 18, 2005, 07:31:25 AM »
You can use WRITE_EVALUATED_ASCII offset ascString  [ #requiredSize  ], since what you're writing is an ascii string.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #2 on: May 18, 2005, 08:55:16 AM »
Cheers!

You can use WRITE_EVALUATED_ASCII offset ascString [ #requiredSize ], since what you're writing is an ascii string.

What is the requiredSize? Would this be 20 as this is the size of the offset? Or is this only used when overwriting existing ASCII values?

Oh, and did I mention, Cheers!

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Adding entrances with WeiDU
« Reply #3 on: May 18, 2005, 09:13:08 AM »
If the space is long 20, then requiredsize is 20. Example:

WRITE_ASCII entrance_offset + entrance_count * 0x64  ~TriggerName~ #20

BTW, are you sure it's 20 and not 32?
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #4 on: May 18, 2005, 11:02:30 AM »
BTW, are you sure it's 20 and not 32?

Not entirely! I'm at work at the mo, I'll check tonight.

Are "entrance_offset" & "entrance_count" known WeiDU tokens? Or do I have to READ and WRITE "%entranceoffset%" ?

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Adding entrances with WeiDU
« Reply #5 on: May 18, 2005, 01:13:25 PM »
Are "entrance_offset" & "entrance_count" known WeiDU tokens? Or do I have to READ and WRITE "%entranceoffset%" ?
You'll have to read them, yes.
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #6 on: May 19, 2005, 05:25:21 AM »

Okay, Im confused:  :-\

I checked the IESDP and the "name" field is listed as 32 bytes. However, in NI the field is 20 bytes long, and in the IESDP list the name field starts at 0x00 and ends at 0x20??

I thought the length was the actual length in bytes..  ???

Also, when I try to patch it I end up with file unreadable in NI. If I insert 68 bytes at the Entrances Offset * 0x68, do I need to increase all the offsets after it?

In short, are there any good "patching for Noobs" tutorials around??

Offline Idobek

  • Dust Bunny
  • Planewalker
  • *****
  • Posts: 431
  • Gender: Male
Re: Adding entrances with WeiDU
« Reply #7 on: May 19, 2005, 05:38:31 AM »
32 (decimal) = 0x20 (hexadecimal)
The Gibberlings Three Forums

<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #8 on: May 19, 2005, 06:08:22 AM »
 :-[

So do I need to convert all hex values to decimal before INSERTing BYTEs and things? If the entrances are 0x68 in length, do I need to insert 104 BYTEs?

Offline Idobek

  • Dust Bunny
  • Planewalker
  • *****
  • Posts: 431
  • Gender: Male
Re: Adding entrances with WeiDU
« Reply #9 on: May 19, 2005, 09:38:51 AM »
WeiDU will take both hex and decimal values.
The Gibberlings Three Forums

<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #10 on: May 23, 2005, 11:25:03 AM »
Thanks all for your help!

I am now trying to patch it, but I always end up with an unreadable file  :'(  Could someone have a quick look at this logic and see if there are any glaring errors: (I don't have the exact code available here)

An entrance is 0x68 long. So...

Read "entrances offset" and "Entrance number"

increase ent. number by 1. INSERT 0x68 bytes at (Ent. offset + (Ent no x 0x68)

WRITE the info I need into the bytes. Increase all offsets after the ent offset by 0x68.

Is there any reason the above wouldn't work?

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Adding entrances with WeiDU
« Reply #11 on: May 23, 2005, 11:34:20 AM »
You also have to update the offsets of all sections that follow the entrances, since they now begin 0x68 byte later.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #12 on: May 23, 2005, 11:40:41 AM »
I had that in there: "Increase all offsets after the ent offset by 0x68." - maybe not as clear as it should have been.  ;D other than that this should work, yeah?

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Adding entrances with WeiDU
« Reply #13 on: May 23, 2005, 12:50:31 PM »
I had that in there: "Increase all offsets after the ent offset by 0x68." - maybe not as clear as it should have been.  ;D other than that this should work, yeah?


Ah, OK, it should. try posting the code if you're still experiencing trouble though  :)
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #14 on: May 25, 2005, 04:36:09 AM »
It worked!

My First Patch. Isn't he sweet! I'm so proud. ;D

Cheers all for the help and advice!!

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Adding entrances with WeiDU
« Reply #15 on: May 25, 2005, 05:19:01 AM »
Just for the non-WeiDU ninjas & newbies, er, meaning me, would you be so kind as to post your working patching code?

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #16 on: May 25, 2005, 05:39:45 AM »

@ Jastey - I'd love to - unfortunately Im not internet connected at home and make all my posts from work - hence the perma-guest status! I'll try and bring it in tomorrow.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Adding entrances with WeiDU
« Reply #17 on: June 03, 2005, 06:58:16 AM »
Ah, no problem. You can email me and I'll post it. Err, you know... (Still haven't given up hope to see the code) :)

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #18 on: June 03, 2005, 07:39:27 AM »
Sorry about that, my printer is offline and I can't be arsed to write the code out by hand and bring it in :D Its nothing major tho - anyone who knows a little about patching can follow the logic above and write out the code...

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Adding entrances with WeiDU
« Reply #19 on: June 03, 2005, 05:23:38 PM »
Sorry about that, my printer is offline and I can't be arsed to write the code out by hand and bring it in :D Its nothing major tho - anyone who knows a little about patching can follow the logic above and write out the code...
Can I suggest a USB memorystick, a cd (although that seems like overkill) or even an archaic diskette? If you've done it, sharing it with others is quite nice. There's not really a point of reinventing the wheel, you know. ;)
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

The_Swordalizer

  • Guest
Re: Adding entrances with WeiDU
« Reply #20 on: June 04, 2005, 12:57:21 AM »
@SConrad:  I dont own a USB, a CD is kinda over kill, and a diskette!!  :o  I thought they went extinct years ago. I'll have to raid my local museum for one...  ;D

Honestly, I'll try and get it here, but as I've said I post from work, and they're kinda funny about sticking random CD's in the comp's. Maybe I'll post it from my bro's machine.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Adding entrances with WeiDU
« Reply #21 on: June 04, 2005, 11:38:57 AM »
If you've done it, sharing it with others is quite nice. There's not really a point of reinventing the wheel, you know. ;)

How true! Does that mean I can hope to see your template concerning inserting travel triggers with WeiDU here soon? :) :)

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
Re: Adding entrances with WeiDU
« Reply #22 on: June 04, 2005, 02:42:06 PM »
If you've done it, sharing it with others is quite nice. There's not really a point of reinventing the wheel, you know. ;)

How true! Does that mean I can hope to see your template concerning inserting travel triggers with WeiDU here soon? :) :)

Uhh... I believe this is what people call irony.

Look at that topic again. ;)
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Adding entrances with WeiDU
« Reply #23 on: June 05, 2005, 01:23:20 PM »
Uhh... I believe this is what people call irony.

Look at that topic again. ;)

 ;D Sorry, couldn't resist. Thank you!

Honestly, I'll try and get it here, but as I've said I post from work, and they're kinda funny about sticking random CD's in the comp's. Maybe I'll post it from my bro's machine.

That would be cool!

 

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