Jump to content


Photo

Adding lines to a .2da file


8 replies to this topic

#1 kreso

kreso
  • Modders
  • 2627 posts
  • Gender:Male
  • Location:Istra, Croatia

Posted 15 April 2017 - 02:44 AM

I want to add a spell to hidespl.2da, w/o overwriting the file. How to do it? I tried with SET_2DA_ENTRY but it doesn't work.



#2 subtledoctor

subtledoctor
  • Modders
  • 2145 posts
  • Gender:Male

Posted 15 April 2017 - 06:10 AM

ACTION_IF FILE_EXISTS_IN_GAME ~hidespl.2da~ BEGIN
    APPEND ~hidespl.2da~ ~blah	1	0~
END

Edited by subtledoctor, 15 April 2017 - 06:11 AM.

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 kreso

kreso
  • Modders
  • 2627 posts
  • Gender:Male
  • Location:Istra, Croatia

Posted 15 April 2017 - 07:23 AM

Great. Had to space it out a bit, but it works. Fwiw, I'll include this my SR fix/tweak. In short, Wish cheese will actually be balanced. You will only be able to cast it via scrolls - it won't be possible to write it down in your spellbook nor pick it for your sorcerer. Will remain an optional component, ofc. I'll see what I can do about making all options always available, rather than relying on random dice. 



#4 subtledoctor

subtledoctor
  • Modders
  • 2145 posts
  • Gender:Male

Posted 15 April 2017 - 08:49 AM

Sounds cool

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


#5 kreso

kreso
  • Modders
  • 2627 posts
  • Gender:Male
  • Location:Istra, Croatia

Posted 15 April 2017 - 08:57 AM

Yea, but I doubt many people will use it :). Btw, while you're here - I've just installed M&G mod. Why can't I install "scout and revised swashbuckler" component? I see a "FORBID" in .tp2, so that kinda explains the technicalities...but is there a reason to do so?



#6 Wisp

Wisp
  • Modders
  • 1087 posts
  • Gender:Male

Posted 15 April 2017 - 11:58 AM

INSERT_2DA_ROW offers a bit more control than APPEND does.


Edited by Wisp, 15 April 2017 - 11:59 AM.


#7 Galactygon

Galactygon

    Nostradoctopus

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

Posted 15 April 2017 - 02:09 PM

Note that there are different implementations of HIDESPL.2da; the ToBEx/Taimon implementation uses one less column than the EE implementation. I would do a COUNT_2DA_COLS check first i.e.

COPY_EXISTING "HIDESPL.2da" "override"
  COUNT_2DA_COLS hidespl_col_num
  PATCH_IF hidespl_col_num = 3 BEGIN // If EE version is used
    INSERT_2DA_ROW 0 3 ~myspell 1 0~
  END ELSE
  PATCH_IF hidespl_col_num = 2 BEGIN // If ToBEx version is used
    INSERT_2DA_ROW 0 2 ~myspell ****~
  END
  PRETTY_PRINT_2DA
IF_EXISTS

This will add your spell as the first row of HIDESPL.2da.


Edited by Galactygon, 15 April 2017 - 02:10 PM.

Posted Image

Posted Image

#8 kreso

kreso
  • Modders
  • 2627 posts
  • Gender:Male
  • Location:Istra, Croatia

Posted 15 April 2017 - 03:43 PM

That will do I guess. Tnx.



#9 Mike1072

Mike1072
  • Gibberling Poobah
  • 2359 posts
  • Gender:Male
  • Location:Canada

Posted 16 April 2017 - 12:28 AM

I think we planned to write one or more functions for modifying hidespl.2da because then we could deal with any differences from the different formats there.  (In the meantime, our shortcut was to include a pre-built hidespl.2da file for each format and install whichever one was appropriate.)

 

Doing it in a function would also make it possible to safely handle the situation where the spell is already listed in the file.





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users