Jump to content

Patching doors?


Guest The_Swordalizer

Recommended Posts

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

Link to comment
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?

Link to comment
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).

Link to comment
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%")

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...