Jump to content


Photo

Toss your semi-useful WeiDU macros here


21 replies to this topic

#16 argent77

argent77
  • Modders
  • 649 posts
  • Gender:Male

Posted 20 July 2017 - 01:44 AM

The majority of my own functions and macros are too specific to be of (general) use. But there is a small number of functions that might be helpful.

TO_HEX_NUMBER:
A decimal to hexadecimal number converter. May be useful when dealing with IDS or INI files.
Spoiler

FIND_FREE_ANIM_SLOT:
This function attempts to find a free creature animation slot in a given range, so that it can be used to install custom creature animations. I'm using it quite extensively in my Golem Construction mod (example code). This function requires EE games patched to v1.4 or higher. It also makes use of the function TO_HEX_NUMBER mentioned above.
Spoiler


#17 K4thos

K4thos
  • Modders
  • 948 posts
  • Gender:Male

Posted 20 July 2017 - 04:23 AM

TO_HEX_NUMBER:
A decimal to hexadecimal number converter. May be useful when dealing with IDS or INI files.

there is actually a hidden SPRINTF command in weidu that can do it. Example:

SET dec_value = 3
SPRINTF hex_value ~%x~ (dec_value)
PATCH_PRINT ~%hex_value%~

Edited by K4thos, 20 July 2017 - 04:23 AM.


#18 argent77

argent77
  • Modders
  • 649 posts
  • Gender:Male

Posted 20 July 2017 - 05:14 AM

You're right. There is a (patch-only) SPRINTF command available which supports %s, %d and %x format specifiers. However, the command doesn't properly convert negative values into hexadecimal format, always prefixes the result with "0x" and you can't specify minimum number of digits, which forces me to do a lot of editing either way for my purposes.



#19 Angel

Angel
  • Members
  • 83 posts
  • Gender:Not Telling
  • Location:Netherlands

Posted 20 July 2017 - 06:06 AM

FIND_FREE_ANIM_SLOT:
This function attempts to find a free creature animation slot in a given range, so that it can be used to install custom creature animations. I'm using it quite extensively in my Golem Construction mod (example code). This function requires EE games patched to v1.4 or higher. It also makes use of the function TO_HEX_NUMBER mentioned above.
 
Ah, if only I knew how to create new animations and add them to the game.  It's been a long-time wish of mine to add griffins, (black) unicorns and nightmares, to name but a few. :-)


#20 Gwendolyne

Gwendolyne
  • Members
  • 139 posts
  • Gender:Male
  • Location:France

Posted 20 July 2017 - 08:35 AM

 

FIND_FREE_ANIM_SLOT:
This function attempts to find a free creature animation slot in a given range, so that it can be used to install custom creature animations. I'm using it quite extensively in my Golem Construction mod (example code). This function requires EE games patched to v1.4 or higher. It also makes use of the function TO_HEX_NUMBER mentioned above.
 
Ah, if only I knew how to create new animations and add them to the game.  It's been a long-time wish of mine to add griffins, (black) unicorns and nightmares, to name but a few. :-)

 

 

Sorry for the off-topic, but you won't have to wait too long, at least for unicorns (regular and black ones) and nightmares. ;)


Edited by Gwendolyne, 20 July 2017 - 08:36 AM.

CARPE DIEM...



In progress : Menace sur le Royaume de Diamant Éternel

#21 Angel

Angel
  • Members
  • 83 posts
  • Gender:Not Telling
  • Location:Netherlands

Posted Yesterday, 12:03 AM

 

 

FIND_FREE_ANIM_SLOT:
This function attempts to find a free creature animation slot in a given range, so that it can be used to install custom creature animations. I'm using it quite extensively in my Golem Construction mod (example code). This function requires EE games patched to v1.4 or higher. It also makes use of the function TO_HEX_NUMBER mentioned above.
 
Ah, if only I knew how to create new animations and add them to the game.  It's been a long-time wish of mine to add griffins, (black) unicorns and nightmares, to name but a few. :-)

 

 

Sorry for the off-topic, but you won't have to wait too long, at least for unicorns (regular and black ones) and nightmares. ;)

 

 

Interesting, I will certainly keep an eye on that.  Please tell me they will work with non-EE games as well! And I'd pay you to make a griffin animation.  (Seriously, I would.)



#22 Gwendolyne

Gwendolyne
  • Members
  • 139 posts
  • Gender:Male
  • Location:France

Posted Yesterday, 03:44 AM

End of the off-topic : my mod is written for BG2 and BGT and will be EE compatible. ;)

The ironic point is that I can use huge tarasque animations (640x640 px) with IA but not in BG2:EE because the enhanced dragon animation format seems to be buggy and does not allow to add new effective slots to ANIMATE.IDS.


CARPE DIEM...



In progress : Menace sur le Royaume de Diamant Éternel



Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users