Jump to content


Photo

Code for changing door settings in .are files


  • Please log in to reply
8 replies to this topic

#1 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 25 May 2014 - 03:35 PM

Hi! I have a pretty specific need for a code that would allow me to add a key to an existing set of doors, which, as far as I know, would be editing the 0x78 part of a specific door in game. However, I've learned my lesson about raw editing. Plus, it's a pain in the ass to manually count all the stuff. So I tried repurposing the gifted code for adding stuff to worldmaps... only to get stumped by the part of .are files that define vertices. Could anybody help me, please?



#2 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 25 May 2014 - 03:44 PM

Because from what I know it should be something like

(OUTER_SET every part's length)

COPY_EXISTING

READ_LONG all the counts and offsets, including vertices/bitmask which works in a weird way

and then it's magic.



#3 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 26 May 2014 - 06:22 AM

I managed to make a working one! It's

OUTER_SET doors_length = 0xc8
COPY_EXISTING ar0500.are override
READ_LONG 0xa4 doors_count
READ_LONG 0xa8 doors_offset
FOR (i = 0; i < doors_count; ++i) BEGIN
current_doors_offset = doors_offset + i * doors_length
READ_ASCII current_doors_offset doors_name
PATCH_IF "%doors_name%" STRING_EQUAL_CASE door0507 BEGIN
WRITE_ASCIIE current_doors_offset + 0x78 misc5i #8
END
END
BUT_ONLY
if people care



#4 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 26 May 2014 - 07:26 AM

Wish I would have seen this earlier.
COPY_EXISTING ar0500.are override
  LPF ALTER_AREA_DOOR STR_VAR door_name  = "door0507" door_key = "misc5i" END
  BUT_ONLY

would have saved you a lot of time.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#5 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 26 May 2014 - 08:54 AM

Huh, that... really is easier, thanks. At least I can say I know how to write higher-level weidu code.

 

Also, I don't know who's taking care of weidu now, but I found a bug: putting SET_WEIGHT and REPLACE_STATE_TRIGGER in the same .d file fill cause the R_S_T to be ignored.



#6 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5155 posts

Posted 26 May 2014 - 10:29 AM

Also, I don't know who's taking care of weidu now...

That would be Wisp. Weidu's forum...


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#7 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 26 May 2014 - 10:50 AM

PPG hasn't approved my registration for at lewst a year now so I'll just hope he reads it here. Maybe I'll sacrifice a goat

#8 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 26 May 2014 - 11:18 AM

I'm a vegetarian, but I'll take a look at it anyway.



#9 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 26 May 2014 - 01:28 PM

Bleh. Until WeiDU 237, you can give the filename to SET_WEIGHT in uppercase.