Jump to content

Photo

Weidu macro libraries

weidu tp2 coding tutorial

77 replies to this topic

#31 Taimon

Taimon
  • Modders
  • 544 posts
  • Gender:Not Telling

Posted 16 July 2008 - 12:40 PM

I get the ever-so-helpful "Patching Failed (COPY) (Invalid_argument("String.sub"))" error when using the ADD_SPELL_EFFECT on spells with multiple effects and multiple headers

This is OCaml telling you the offset for the INSERT_BYTES is out of bounds. :)

I think this line
PATCH_IF (___#1effect_index > ___#index1) BEGIN //if ability after current effect
should read
PATCH_IF (___#1effect_index > ___#abil_fx_idx) BEGIN //if ability after current effect
but who knows for sure, what he's doing there.

#32 Miloch

Miloch

    Barbarian

  • Modders
  • 4803 posts
  • Gender:Male
  • Location:At Large

Posted 16 July 2008 - 05:40 PM

Worked like a charm, cheers :). All that routine was doing is updating the indices for the added effects, but obviously was getting thrown off by loop conflicts or something.

Hopefully, these can make it into the next WeiDU ;).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett


#33 Taimon

Taimon
  • Modders
  • 544 posts
  • Gender:Not Telling

Posted 16 July 2008 - 09:23 PM

They are in (if you mean the macros). Not sure about the bugfixes, though.

#34 Taimon

Taimon
  • Modders
  • 544 posts
  • Gender:Not Telling

Posted 17 July 2008 - 12:16 PM

Bugs are fixed in v208. (ADD_ITEM_EFFECT had the same issues.)

#35 Miloch

Miloch

    Barbarian

  • Modders
  • 4803 posts
  • Gender:Male
  • Location:At Large

Posted 18 July 2008 - 05:47 AM

Bugs are fixed in v208. (ADD_ITEM_EFFECT had the same issues.)

Cool. Nice work on v208 btw - much quicker.

One little glitch in the macro documentation - I think someone missed a closing italics flag after "they aren't initialized automatically" because the rest of the document is in italics.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett


#36 Taimon

Taimon
  • Modders
  • 544 posts
  • Gender:Not Telling

Posted 18 July 2008 - 06:38 AM

Cool. Nice work on v208 btw - much quicker.

Well, don't thank me. The bigg did all the grammar hacks and cmorgan did an insane amount of testing, to make sure, that these changes don't break any existing mods.

One little glitch in the macro documentation - I think someone missed a closing italics flag after "they aren't initialized automatically" because the rest of the document is in italics.

Oh yeah, LaTeX error. :)
I actually never scroll that far down.

#37 Miloch

Miloch

    Barbarian

  • Modders
  • 4803 posts
  • Gender:Male
  • Location:At Large

Posted 18 July 2008 - 01:21 PM

Well, don't thank me. The bigg did all the grammar hacks and cmorgan did an insane amount of testing, to make sure, that these changes don't break any existing mods.

Well, that was for everyone involved. The SPRINT var @123 thing is definitely handy too - saves me an insane amount of hackery. Though I don't know if it lets me do SPRINT var1 @var2 or SPRINT var (@x ^ @y) or SAY offset @(x ^ y) or whatnot, heh... maybe that'll be next :). But at least I think I can avoid using this sort of pseudocode with the existing improvement.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett


#38 the bigg

the bigg

    The Avatar of F/Ts

  • Modders
  • 2337 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 18 July 2008 - 04:22 PM

`SPRINT var @2' is some downright stupid expression introduced by Wes (hint: thanks to that, `SPRINT var foo' gets traified). @(expression) or even @var is not possible without some significant code rewrite, so very unlikely.
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#39 Icendoan

Icendoan

    King of Parsing Errors

  • Modders
  • 1704 posts
  • Gender:Male
  • Location:The hall of 1000 posts!

Posted 19 July 2008 - 03:33 AM

What happened to Wes anyway?

Unless he is using an alias, I haven't seen or heard of him in ages.

Icen
Mods in development: Keeping Yoshimo
Posted Image

#40 the bigg

the bigg

    The Avatar of F/Ts

  • Modders
  • 2337 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 19 July 2008 - 05:03 PM

What happened to Wes anyway?

Unless he is using an alias, I haven't seen or heard of him in ages.

He's single-handedly writing the game engine for JCompton's Broken Hourglass. He also advocates comunity trolling to his students.
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#41 Galactygon

Galactygon

    Nostradoctopus

  • Modders
  • 728 posts
  • Gender:Male
  • Location:Sweden

Posted 25 July 2008 - 05:23 AM

Here is one I just wrote. Many mods that add projectiles via patching often overlook the MISSIE.ids. The purpose of the MISSILE.ids is more modder-related than player related. It simply assigns a name for each projectile in the game, so that you can find your projectile without memorizing the filename and projectl entry. Also, because not all mods append both the PROJECTL and MISSILE IDS files, you may not append the MISSILE.IDS without first updating the last line to be in unison with the PROJECTL.ids

And this is what this (small) macro does. This code replaces all non-updated entries in the MISSILE.IDS with "Unnamed", so that you can proceed to patch the MISSILE.IDS along with the PROJECTL.IDS.

For those mods that use ADD_PROJECTILE, it is reccommended that you APPEND the MISSILE.ids. You may use this to add entries in the MISSILE.ids
COPY_EXISTING ~MISSILE.ids~ ~override~
COUNT_2DA_ROWS 0 "rowcount"
SET "rowcount" += 1
INNER_ACTION BEGIN
	APPEND ~MISSILE.IDS~ ~%rowcount% Cone of Cold~
END
BUT_ONLY_IF_IT_CHANGES

And this macro to update the missile.ids before you patch the missile.ids

DEFINE_ACTION_MACRO ~update_missile_ids~ BEGIN

COPY_EXISTING ~PROJECTL.ids~ ~override~
	COUNT_2DA_ROWS 1 "projectl"
	SET projectl += 105 // To account for hardcoded projectiles skipped in PROJECTL.ids
BUT_ONLY_IF_IT_CHANGES

COPY_EXISTING ~MISSILE.ids~ ~override~
	COUNT_2DA_ROWS 1 "missile"
	WHILE ( missile < projectl ) BEGIN
		SET missile += 1
		INNER_ACTION BEGIN
			APPEND ~MISSILE.IDS~ ~%missile% Unnamed~
		END
	END
BUT_ONLY_IF_IT_CHANGES
END

Edited by Galactygon, 25 July 2008 - 06:57 AM.

Posted Image

Posted Image

#42 the bigg

the bigg

    The Avatar of F/Ts

  • Modders
  • 2337 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 25 July 2008 - 05:27 AM

Actually, there's an ADD_PROJECTILE command already. Is it not enough?
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#43 Galactygon

Galactygon

    Nostradoctopus

  • Modders
  • 728 posts
  • Gender:Male
  • Location:Sweden

Posted 25 July 2008 - 05:41 AM

The ADD_PROJECTILE command patches the PROJECTL.IDS, but does not patch the MISSILE.IDS. Therefore, mods do not patch the MISSILE.IDS, while still patching the PROJECTILE.IDS.

-Galactygon
Posted Image

Posted Image

#44 the bigg

the bigg

    The Avatar of F/Ts

  • Modders
  • 2337 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 25 July 2008 - 05:44 AM

OK. Automatic patching for MISSILE.IDS is coming up in WeiDU 209 then - better than doing so manually :fish:
Your code is very much broken though - what value should go into MISSILE.IDS?
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#45 Galactygon

Galactygon

    Nostradoctopus

  • Modders
  • 728 posts
  • Gender:Male
  • Location:Sweden

Posted 25 July 2008 - 06:58 AM

OK. Automatic patching for MISSILE.IDS is coming up in WeiDU 209 then - better than doing so manually :fish:


Nice. We still need to run the update macro due to old mods, though.

Your code is very much broken though - what value should go into MISSILE.IDS?

Whoops, forgot the +1 increment. Corrected now.

-Galactygon
Posted Image

Posted Image



Reply to this topic



  



Also tagged with one or more of these keywords: weidu tp2 coding, tutorial

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users