Jump to content
Guest The_Swordalizer

Patching doors?

Recommended Posts

I'll just point out that *real* leet moddars all work on TC's, and don't have to actually release anything due to frequent hard disk crashes.

Share this post


Link to post
Guest The_Swordalizer

I'll modify the script for the entrance to the compound then.

 

However, I still need to add a new travel trigger inside the compound that leads to a new area, also key operated.

 

But first I have to make the new area. :)

 

A modders job is never done. I thought this would be such a simple first project - a couple of new dialogues, an item or two. Now I'm adding doors, area's, NPC's, how does this happen??

Share this post


Link to post
Guest The_Swordalizer

Not to sound ungrateful but... noone has actually answered my question!

 

How do i add a door to an existing area? I need to add a new door to AR0906 (Guarded Compound First floor). Do I have to overwrite the area?

 

Also, does anyone have links to a tutorial on how to add a travel trigger to an area using WeiDU?

Share this post


Link to post

SConrad: My link was referring to The_Swordalizer's question for adding a travel trigger to an area using WeiDU. :)

And I never said you can use the template as it is without having to adjust it to your needs.

Share this post


Link to post
And I never said you can use the template as it is without having to adjust it to your needs.

It's not a question of having to adjust it a bit. You're better off with coding it from scratch (trust me, I've tried).

Share this post


Link to post
:) I never used the template. I would be very interested in seeing the template you came up with that actually worked. :)

Share this post


Link to post

Yeah, sure, I'll put it up at some point. It's horrible syntax, but meh, it works. :)

Share this post


Link to post
SConrad: Did you put it up somewhere in the meantime? :)

Eh, sorry. I totally forgot about this.

 

Disclaimer: Don't do this at home, children. (Yeah, it's that horrible.)

 

COPY_EXISTING ~ar0709.are~ ~override~

// We start by reading offsets and numbers
READ_SHORT 0x5a "trig_num"
READ_LONG  0x5c "trig_off"
READ_LONG  0x60 "spawn_off"
READ_LONG  0x68 "ent_off"
READ_LONG  0x70 "cont_off"
READ_LONG  0x78 "item_off"
READ_LONG  0x7c "vert_off"
READ_SHORT 0x80 "vert_num"
READ_LONG  0x84 "amb_off"
READ_LONG  0x88 "var_off"
READ_LONG  0xa0 "bmp_off"
READ_LONG  0xa8 "door_off"
READ_LONG  0xb0 "anim_off"
READ_LONG  0xb8 "tiled_off"
READ_LONG  0xbc "song_off"
READ_LONG  0xc0 "rest_off"
READ_LONG  0xc4 "note_off"

// Add 4 vertices
INSERT_BYTES  ("%vert_off%" + ("%vert_num%" * 4)      ) 0x10
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4)      ) 736
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0x2) 683
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0x4) 826
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0x6) 617
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0x8) 887
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0xa) 674
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0xc) 780
 WRITE_SHORT ("%vert_off%" + ("%vert_num%" * 4) + 0xe) 742

// First, we insert the new trigger by adding 196 bytes at a specific location in the file
INSERT_BYTES  ("%trig_off%" + ("%trig_num%" * 0xc4)       ) 0xc4

// Let's start patching the new trigger
 WRITE_ASCII ("%trig_off%" + ("%trig_num%" * 0xc4)       ) ~TranJZ00~   // Name of the new trigger
 WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x20) 0x02         // Which trigger type?
 WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x22) 736          // Bounding box
 WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x24) 617          // Bounding box
 WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x26) 887          // Bounding box
 WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x28) 742          // Bounding box
 WRITE_SHORT ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x2a) 0x04         // Number of vertices
 WRITE_LONG  ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x2c) "%vert_num%" // First vertex index
 WRITE_LONG  ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x34) 0x2a         // Cursor index
 WRITE_ASCII ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x38) ~ARJZ00~     // Destination area
 WRITE_ASCII ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x40) ~Exit0709~   // Exit point
 WRITE_LONG  ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x60) 0x04         // Flags
 SAY         ("%trig_off%" + ("%trig_num%" * 0xc4) + 0x64) #-1          // Trigger Text

// Code wrapup - need to adjust numbers of vertices and triggers and adjust offsets
WRITE_SHORT 0x80 ("%vert_num%" + 0x04) // four new vertices
WRITE_SHORT 0x5a ("%trig_num%" + 0x01) // one new trigger

SET "adj" = 0xc4

WRITE_LONG 0x60 ("%spawn_off%" + "%adj%")
WRITE_LONG 0x68 ("%ent_off%"   + "%adj%")
WRITE_LONG 0x70 ("%cont_off%"  + "%adj%")
WRITE_LONG 0x78 ("%item_off%"  + "%adj%")
WRITE_LONG 0x7c ("%vert_off%" + "%adj%")
WRITE_LONG 0x84 ("%amb_off%"   + "%adj%")
WRITE_LONG 0x88 ("%var_off%"   + "%adj%")
WRITE_LONG 0xa8 ("%door_off%"  + "%adj%")
WRITE_LONG 0xb8 ("%tiled_off%" + "%adj%")

SET "adj" = (0xc4 + 0x10)
WRITE_LONG 0xa0 ("%bmp_off%"   + "%adj%")
WRITE_LONG 0xb0 ("%anim_off%"  + "%adj%")
WRITE_LONG 0xbc ("%song_off%"  + "%adj%")
WRITE_LONG 0xc0 ("%rest_off%"  + "%adj%")
WRITE_LONG 0xc4 ("%note_off%"  + "%adj%")

Share this post


Link to post

Thank you, SConrad! :) Maybe one day I'll be able to see why you put that disclaimer on. :)

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...