Jump to content

Photo

Copy spl description and apply to an item


6 replies to this topic

#1 Grammarsalad

Grammarsalad
  • Modders
  • 491 posts
  • Gender:Male

Posted 17 October 2018 - 01:43 PM

Solved.  See 3rd post

 

I'm trying to create a number of cleric scrolls.  In order to increase compatibility (especially with Spell Revisions), I would like to be able to copy the spell description and then apply it to the scroll description.  I can do this will the file name, no problem.  So, for example, for the scroll of detect evil, I have this: 

 

//get spl name: Detect Evil
COPY_EXISTING ~SPPR104.spl~ ~override~
          READ_ASCII 0x0008 name


COPY_EXISTING ~B_PS104.itm~ ~override~ //scroll of detect evil (etc.)
       WRITE_ASCIIE 0x0008 ~%name%~
       WRITE_ASCIIE 0x000c ~%name%~

Great, it copies the spell text/string ref--not sure which--from the spell and applies it to the scroll.  That is, this doesn't work:

//get spl name: Detect Evil
COPY_EXISTING ~SPPR104.spl~ ~override~
          READ_ASCII 0x0054 desc


COPY_EXISTING ~B_PS104.itm~ ~override~ //scroll of detect evil (etc.)
       WRITE_ASCIIE 0x0054 ~%desc%~

What am I doing wrong?  

 


Edited by Grammarsalad, 17 October 2018 - 02:57 PM.


#2 subtledoctor

subtledoctor
  • Modders
  • 2838 posts
  • Gender:Male

Posted 17 October 2018 - 02:18 PM

Just use the strrefs?

COPY spl
READ_LONG 0x50 desc
COPY itm
WRITE_LONG 0x54 desc

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#3 Grammarsalad

Grammarsalad
  • Modders
  • 491 posts
  • Gender:Male

Posted 17 October 2018 - 02:57 PM

Oh spit!  Simple mistake.  I was copying the wrong descriptor from the spl file (i.e. 0x0054 when it should have been 0x0050)--thanks for that Subtle.  This worked:

 

Edit: this is lightly better:


//Scroll of Detect evil


COPY_EXISTING ~SPPR104.spl~ ~override~
          READ_ASCII 0x0008 name
          READ_ASCII  0x0050 desc


COPY ~%mod_folder%/data/scrolls/priest_1/B_PS104.itm~ ~override~   //Actual scroll
       WRITE_ASCIIE 0x0008 ~%name%~
       WRITE_ASCIIE 0x000c ~%name%~
       WRITE_ASCIIE 0x0054 ~%desc%~
 

Edited by Grammarsalad, 17 October 2018 - 03:02 PM.


#4 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Gibberling Poobah
  • 9746 posts
  • Gender:Not Telling

Posted 17 October 2018 - 03:48 PM

The name and description fields are string references (read: numeric), so READ/WRITE_LONG is a better fit than READ/WRITE_ASCII.


Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.


#5 subtledoctor

subtledoctor
  • Modders
  • 2838 posts
  • Gender:Male

Posted 17 October 2018 - 03:48 PM

Can't WRITE_ASCII screw things up if you don't specify the length of the string, or something? Should it instead be SAY EVAL?

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#6 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2624 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 17 October 2018 - 04:09 PM

It's eight characters by default, so unless you need different length (or to null-terminate) it's fine.


Retired from modding.


#7 Grammarsalad

Grammarsalad
  • Modders
  • 491 posts
  • Gender:Male

Posted 18 October 2018 - 04:11 PM

Ah okay. I'll change it to read/write long



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users