Jump to content

WeiDU question


Galactygon

Recommended Posts

*ahem* w00t! :)

 

Finally, I got myself motivated to learn WeiDU and write a mini-WeiDU mod with a spell or two waay into the night. :) It seems everything worked out flawlessly for me, and I was able to create a perfectly working WeiDU mod on my first try. Now I have a question:

 

How do you install multiple files from the same directory at once to the override? I am very afraid on having to copy and paste and rename thousands and thousands of files.

 

-Galactygon

Link to comment

There are two ways to accomplish multi-file copies. You can either place all of the files into a single folder and copy the folder:

 

COPY ~MyMod/folder~ ~override~

 

Alternatively the various flavors of COPY accept multiple file arguments:

 

COPY ~MyMod/spell1.spl~ ~override~
     ~MyMod/spell2.spl~ ~override~
     ~MyMod/item1.itm~  ~override~

Link to comment
I think you can use the one COPY command if you want to give them all the same text, though.

 

Correct.

 

If you want to copy several files from the same directory, but also give each file some text (i.e. using SAY), then you *do* need to copy each file individually, afaik.

 

Perhaps the --automate command could come in handy here?

Link to comment

Thanks for answering my questions, and yes, giving text would have been my next question, but it seems to me it has been answered.

 

Also, I seem to be having trouble with the ADD_PROJECTILE synthax; in the examples, it lists it for the item, not a spell. And what if I want to add different projectiles for different extension headers?

 

*uploads his first WeiDU mod into his workroom*

 

-Galactygon

Link to comment

*Bump*

 

I have been trying to patch spells so they use the old BGI fireball projectile (#38) instead of the new BGII one (#234). But nothing gets patched.

COPY_EXISTING ~SPWI304.spl~ ~override~
 READ_LONG  0x64 "offset_abil"			 		// reads offset of first ability
 READ_SHORT  0x68 "num_abil"			   		// reads total number of abilities
 WHILE (0 < "%num_abil%")						  // loops once for every ability
BEGIN
PATCH_IF (("%offset_abil%" + 0x26) + (("%num_abil%" - 1) * 0x28) = 234) // If projectile is set to new fireball
  BEGIN
	  WRITE_LONG (("%offset_abil%" + 0x26) + (("%num_abil%" - 1) * 0x28)) 38 // Set projectile to old fireball
  END
  SET "num_abil" = ("%num_abil%" - 1)
END
 BUT_ONLY_IF_IT_CHANGES

 

-Galactygon

Link to comment
*Bump*

 

I have been trying to patch spells so they use the old BGI fireball projectile (#38) instead of the new BGII one (#234). But nothing gets patched.

Talk about necroposting :). Try this:

COPY_EXISTING ~spwi304.spl~ ~override~ //Fireball
 PATCH_IF (SOURCE_SIZE > 0x71) BEGIN //Protects against invalid files
READ_LONG 0x64 oa //Abilities offset
READ_SHORT 0x68 na //Abilities count
FOR (lp = (oa + ((na -1) * 0x28); lp > (oa - 1); lp -= 0x28) BEGIN
  READ_SHORT (lp + 0x26) pj //Projectile
  PATCH_IF (pj = 234) BEGIN //If projectile set to new fireball
	WRITE_SHORT (lp + 0x26) 38 //Set projectile to old fireball
  END
END
 END
BUT_ONLY_IF_IT_CHANGES

Should work unless I fat-fingered something. Sorry for changing all the varnames but I'm lazy and can't actually read code like this - I can just write it sometimes if I'm lucky (weird, I know).

Link to comment

I corrected a missing ")" in the FOR loop. But now it works, Miloch.

 

-Galactygon

 

COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN 	//Protects against invalid files
READ_LONG 0x64 oa 			//Abilities offset
	READ_SHORT 0x68 na 		//Abilities count
	FOR ( lp = (oa + ((na -1) * 0x28)); lp > (oa - 1); lp -= 0x28) BEGIN
		READ_SHORT (lp + 0x26) pj 	//Projectile
		PATCH_IF (pj = 234) BEGIN 	//If projectile set to new fireball
		WRITE_SHORT (lp + 0x26) 38 	//Set projectile to old fireball
	END
END
END
BUT_ONLY_IF_IT_CHANGES

Link to comment

Another question I have:

 

When my mod flips through the components, I do not have the option of quitting: the same component gets prompted over and over again.

 

But if I indicate I do not want to install the component after I make an attempt to quit, the exe quits the way it's supposed to.

 

BEGIN @1
REQUIRE_FILE ~Data/25Dialog.bif~ @2 // ToB  check
FORBID_FILE ~override/LC_FULL.xxx~ @4 // Lost Crossroads may not be installed

....

BEGIN @10
FORBID_FILE ~override/LC_FULL.xxx~ @4 // Lost Crossroads may not be installed

 

Not that this is gamebreaking, but it's rather annoying for the casual gamer.

 

-Galactygon

Link to comment

You should always be able to quit. Is there a particular component causing problems? If so, we may need to see more of the code, since I don't see any real issues with what you provided.

 

I vaguely remember a bug of this nature during Level 1 NPCs testing - apparently an inherent glitch in WeiDU. I'm not sure that's been fixed or is even fixable. But I don't know if that's related to your issue.

Link to comment

The problem resolved itself - but I have another one:

 

This error comes up, when someone tries to install SpellPack: it happens exactly when 2 scripts are compiled. Instead of compiling them, the exe looks for dw#ajant.d (included in the Swordcoast Stratagames mod). And I have nowehere included dw#ajant.d or even look for that file when I patch/compile/whatever.

 

[override/dw#ajant.d]  ERROR at line 21 column 12-15
Near Text: @801
Not_found
ERROR: parsing [override/dw#ajant.d]: Not_found
ERROR: compiling [override/dw#ajant.d]!
Stopping installation because of error

 

I am guessing ALLOW_MISSING is the way to go, but what really, is the purpose of ALLOW_MISSING, if you do not specifically look for a single file?

 

And how would I know (aside from trying out every single mod) what to include for ALLOW_MISSING?

 

-Galactygon

Link to comment
[override/dw#ajant.d]  ERROR at line 21 column 12-15
Near Text: @801
Not_found
ERROR: parsing [override/dw#ajant.d]: Not_found
ERROR: compiling [override/dw#ajant.d]!
Stopping installation because of error

This seems to suggest the translation for string @801 is not present on that install. That string should be: ~I don't need your help right now, but we'll travel together again soon. Until then, wait for me at the Friendly Arm Inn.~ Maybe someone deleted or changed it manually.

 

Now I don't know why Spell Pack would be looking for that, but since it seems to be part of the SCS NPCs Wait at Inn component or whatever, it might be pretty widely used. So it isn't so much your mod, but sounds more like a botched SCS install.

Link to comment

ALLOW_MISSING isn't going to help you if you're not explicitly doing something with the file in question, even if you were doing something like COMPILE override, which you're probably not :) Really, it's designed for COPY_EXISTING.

 

I'd ask if the player in question was doing a chain reinstall or something of that nature after removing parts of an install. While adding .d files to the override is an avoidable practice (ask DavidW to use COPY - for this in future releases of SCS, I doubt he'll mind) it shouldn't be causing any problems unless you're using a very obsolete version of WeiDU.

Link to comment

Archived

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

×
×
  • Create New...