Post reply

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:
Subject:
Message icon:

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

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: jastey
« on: October 05, 2010, 09:38:55 AM »

Quote
30 posts of extremely detailed instructions
Thank you, that example was very vivid.  ;D

Quote
That's what happens if you used ALLOW_MISSING on iusw1hxx. Without ALLOW_MISSING, WeiDU will fail the installation as usual.
So I am the idiot if i program this? Ah, and with the file size check it works because 0 byte / missing files are left out. Comprende. (At last). :)

Thank you all again!
Posted by: the bigg
« on: October 05, 2010, 08:15:00 AM »

So, does that mean I take the line "PATCH_IF SOURCE_SIZE > 0x28f BEGIN" out?
It doesn't really matter in the end - with the notable exception of iplot01k.itm, no file will ever be that badly broken. If a file was indeed so badly broken, you can be assured that the user is computer illiterate, writes in moron speak, and you'll need 30 posts of extremely detailed instructions before you can get him to upload the debug file.

Quote
COPY_EXISTING ~iusw1hxx~ ~override~
  WRITE_LONG 0x4c 100

and the file is not there, why is it initialized to an empty string? I thought COPY_EXISTING fails if the file is not there?
That's what happens if you used ALLOW_MISSING on iusw1hxx. Without ALLOW_MISSING, WeiDU will fail the installation as usual.
Posted by: jastey
« on: October 05, 2010, 07:57:35 AM »

So, does that mean I take the line "PATCH_IF SOURCE_SIZE > 0x28f BEGIN" out?

the bigg: If I do

COPY_EXISTING ~iusw1hxx~ ~override~
  WRITE_LONG 0x4c 100

and the file is not there, why is it initialized to an empty string? I thought COPY_EXISTING fails if the file is not there?
Posted by: the bigg
« on: October 05, 2010, 04:54:25 AM »

What is BUT_ONLY in comparison to BUT_ONLY_IF_IT_CHANGES?
They're synonims.

Re: SOURCE_SIZE checks, ALLOW_MISSING works by copying an empty file in stead of the missing file. If you copy a single file it doesn't matter, but in more complex cases it might. Consider a mod that makes Celestial Fury weight 100 and wants to patch Item Upgrade's copy (without using ACTION_IF). The following would fail (unless you use the SOURCE_SIZE check) because iusw1hxx.itm is missing and thus initialized to an empty string instead:

ALLOW_MISSING ~iusw1hxx.itm~ // Celestial Fury +5 from IU
<...>
COPY_EXISTING ~sw1hxx.itm~ ~override~
    ~iusw1hxx~ ~override~
  WRITE_LONG 0x4c 100
Posted by: Miloch
« on: October 05, 2010, 04:15:13 AM »

I actually think it's a mistake to use it in this context: if those core-game areas don't exist, you want to know about it.
I tend to agree... blame the fixpackers for that bad habit.
Posted by: jastey
« on: October 05, 2010, 02:11:57 AM »

Thank you for the explanations.
Posted by: DavidW
« on: October 05, 2010, 02:04:48 AM »

What does "PATCH_IF SOURCE_SIZE > 0x28f BEGIN" do?

It checks whether the file is larger than 655 bytes. I think it has something to do with some corrupted files in BG2.

Specifically, it makes sure the code doesn't fail to install if the area files in question are drastically corrupted.

(I actually think it's a mistake to use it in this context: if those core-game areas don't exist, you want to know about it. (Though perhaps I'm missing something.) It's more commonly used when you're doing COPY_EXISTING_REGEXP)
Posted by: Echon
« on: October 05, 2010, 01:42:48 AM »

What does "PATCH_IF SOURCE_SIZE > 0x28f BEGIN" do?

It checks whether the file is larger than 655 bytes. I think it has something to do with some corrupted files in BG2.

Quote
What is BUT_ONLY in comparison to BUT_ONLY_IF_IT_CHANGES?

Miloch not wanting to type it all, I imagine.
Posted by: jastey
« on: October 05, 2010, 01:31:38 AM »

Okay... (trying to understand)
What does "PATCH_IF SOURCE_SIZE > 0x28f BEGIN" do?

What is BUT_ONLY in comparison to BUT_ONLY_IF_IT_CHANGES?
Posted by: Miloch
« on: October 04, 2010, 11:41:53 PM »

If you use them as functions, you don't need to initialise zero values. You don't need to set charges except for stackable items or items with actual charges (wands etc.).
Code: [Select]
//Add item
COPY_EXISTING ar0413.are override //Engine Room
  PATCH_IF SOURCE_SIZE > 0x28f BEGIN
    LAUNCH_PATCH_FUNCTION ADD_AREA_ITEM
      INT_VAR container_to_add_to = 1
      STR_VAR item_to_add = aggem08 //Fire Opal
    END
  END
BUT_ONLY

//Replace item
COPY_EXISTING ar0413.are override //Engine Room
  PATCH_IF SOURCE_SIZE > 0x28f BEGIN
    LAUNCH_PATCH_FUNCTION REPLACE_AREA_ITEM
      STR_VAR old_item = misc38 //Black Opal
      new_item = aggem08 //Fire Opal
    END
  END
BUT_ONLY
Posted by: jastey
« on: October 04, 2010, 04:43:41 PM »

Great, thank you!
EDIT: Wait - how do I tell which are this goes to? Should there be an "COPY_EXISTING ~%ESewers%.ARE~ ~override~" above?
Posted by: Echon
« on: October 04, 2010, 04:38:04 PM »

There is a typo. It should say: SPRINT item_to_add ...

An example with default flags:

Code: [Select]
SPRINT item_to_add ~rndtre02~
SET container_to_add_to = "2"
SET charges1 = "0"
SET charges2 = "0"
SET charges3 = "0"
LAUNCH_PATCH_MACRO ADD_AREA_ITEM
Posted by: jastey
« on: October 04, 2010, 04:33:19 PM »

Huzzah for who wrote the macros. Yet, I need an example. I have no clue what I have to write, and how.
From the WeiDU readme:
Quote
ADD_AREA_ITEM: adds an item to a container of an area. This is a PATCH macro and function.

    * SET item_to_add to the item you want to add
    * SET container_to_add_to to number of container the item should be added to.
    * SPRINT flags to flags the item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.
    * SET charges1 to amount in stock/number of charges of first magical ability (default 0)
    * SET charges2 to number of charges of second magical ability (default 0)
    * SET charges3 to number of charges of third magical ability (default 0)