Jump to content

Weidu - REMOVE_KNOWN_SPELL_KNOWN vs CRE edit


Zoerkus

Recommended Posts

Hi all,

I'm very, very new to Weidu modding but not new to coding. I've a newbie question I'd like input on.

If setting up a new NPC (this one is a dummy NPC, I'm about the way of doing things) I'd like to modify (say, remove spells) I can either

a) make a copy of an .cre file, edit that in NearInfinity, and copy the result to override

b) use Weidu and script things:

in setup-IZquest.tp2

COPY ~IZquest/CRE/IZMendak.cre~ ~override/IZMendak.cre~
    SAY NAME1 @10
    SAY NAME2 @10
    SAY INITIAL_MEETING #4699
    SAY SELECT_COMMON1  #4699
REMOVE_KNOWN_SPELL ~SPWI112~ ~SPWI205~ ~SPWI212~
REMOVE_MEMORIZED_SPELL ~SPWI112~ ~SPWI205~ ~SPWI212~

WRITE_ASCII SCRIPT_DEFAULT ~IZMendak~
WRITE_ASCII DIALOG ~IZmendak~

 

What is the most compatible/preferred way? 'raw' editing of the .cre and simply providing that, or scripting the modifications I'd make in NearInfinity by hand?

Oh, while I'm at it, should I wrap the above in a patch statement and end it with BUT_ONLY_IF_IT_CHANGES? I've not figured that part out either.

Thanks all!

Link to comment
2 minutes ago, Zoerkus said:

If setting up a new NPC (this one is a dummy NPC, I'm about the way of doing things) I'd like to modify (say, remove spells) I can either

a) make a copy of an .cre file, edit that in NearInfinity, and copy the result to override

b) use Weidu and script things:

Well, this being a new NPC, you could make the character in game, by creating it in a new game, export it ingame, and then edit that .cre/.chr with Near Infinity. This is the super easy approach. Up to a point of course.

If you want to modify an existing creature, you need to use weidu's patching functions. With COPY_EXISTING to start from.

 

The BUT_ONLY -yes that's the same but shorter version of the same thing- works only in the COPY_EXISTING, so not with a new NPC.

Ask more, please, if you found this helpful.

Link to comment

Hi Jarno,

now that was quick!

Ok so if I understand you right, there's nothing 'wrong' with using NearInfinity to modify the .cre and use that output instead of patching?

For sake of learning, I could also do this:

COPY_EXISTING ~arlin.cre~ ~override/IZMendak.cre~
    SAY NAME1 @10
    SAY NAME2 @10
    SAY INITIAL_MEETING #4699
    SAY SELECT_COMMON1  #4699
WRITE_ASCII SCRIPT_DEFAULT ~IZMendak~
WRITE_ASCII DIALOG ~IZmendak~

PATCH_IF (SOURCE_SIZE > 0x2d3) BEGIN
  REMOVE_KNOWN_SPELL ~SPWI112~ ~SPWI205~ ~SPWI212~
  REMOVE_MEMORIZED_SPELL ~SPWI112~ ~SPWI205~ ~SPWI212~
 END
BUT_ONLY_IF_IT_CHANGES

It works fine, and it's a better way to undertand things under the hood, but the end result is the same as using NearInfinity to work off a copy of arlin.cre, modify, and just copy that to override?

Kiiti!

 

Link to comment
1 hour ago, Zoerkus said:

What is the most compatible/preferred way? 'raw' editing of the .cre and simply providing that, or scripting the modifications I'd make in NearInfinity by hand?

Whichever is easiest for you to maintain.

There are some values (like the name of the script and dialogue files) that are unlikely to ever change, so it might be confusing for debugging if the value in the .cre file is not actually used and is instead replaced at install-time.  But there's no real harm in setting them via code if you prefer.  If you decide you want to change any of the values, editing text is easier.

Proficiencies or spell memorizations might be things you decide to swap around as you work on the mod, so that may be a reason to consider setting them using code.  Or you may decide later you want to incorporate adjustments to them based on the presence of other mods, which would be easier to do if they were being set using code from the start.

1 hour ago, Zoerkus said:

Oh, while I'm at it, should I wrap the above in a patch statement and end it with BUT_ONLY_IF_IT_CHANGES? I've not figured that part out either.

When using BUT_ONLY_IF_IT_CHANGES, if your patches make no changes to the file, it will NOT be copied into the game.  When you're trying to clone a file, you definitely want the new file to be created, so there's little sense in using BUT_ONLY_IF_IT_CHANGES.

45 minutes ago, Zoerkus said:

Ok so if I understand you right, there's nothing 'wrong' with using NearInfinity to modify the .cre and use that output instead of patching?

It's fine and is probably most widely used method for adding new files to the game.

45 minutes ago, Zoerkus said:

For sake of learning, I could also do this:

COPY_EXISTING ~arlin.cre~ ~override/IZMendak.cre~

Yes, you could.

The benefit of doing this is that it will pick up changes that other mods have made to that creature.

The downside of doing this is that it will pick up changes that other mods have made to that creature.

For creating a new (joinable...?) NPC, I don't see a need for it.  There's a good chance it would cause you grief rather than solve any problems, if it ever came up.

Link to comment

I wanted to say 'Thank you!' for the fast, and detailed, responses. It's actually pretty amazing as I'd guess alot of things I did ask are covered in tutorials somewhere, but I find a lot of dead links (given the age of things) so I appreciate the help.

I still find the games, the engine, and the setting beautiful and while I don't think I'll ever produce anything of significant value, working in the world is enjoyable.

Thanks all for helping out!

I do have a followup question but will create a new thread in case someone's trying to achieve similar things.

Link to comment
8 minutes ago, Mike1072 said:

When using BUT_ONLY_IF_IT_CHANGES, if your patches make no changes to the file, it will NOT be copied into the game.  When you're trying to clone a file, you definitely want the new file to be created, so there's little sense in using BUT_ONLY_IF_IT_CHANGES.

And the side effect of this is that it doesn't make a copy of the file into the mods backup folder. That has no significant benefit to others, but fair few people will definitely not like if you don't use it to avoid clutter.

Link to comment
6 hours ago, Jarno Mikkola said:

And the side effect of this is that it doesn't make a copy of the file into the mods backup folder. That has no significant benefit to others, but fair few people will definitely not like if you don't use it to avoid clutter.

My comments were directed specifically to cloning, aka creating a new file from an existing one.  There are very good reasons to use it in other situations.

6 hours ago, Zoerkus said:

I wanted to say 'Thank you!' for the fast, and detailed, responses. It's actually pretty amazing as I'd guess alot of things I did ask are covered in tutorials somewhere, but I find a lot of dead links (given the age of things) so I appreciate the help.

I still find the games, the engine, and the setting beautiful and while I don't think I'll ever produce anything of significant value, working in the world is enjoyable.

Thanks all for helping out!

No worries.  I would write tutorials if I weren't so lazy but I feel like there will always be specific questions that need specific responses.  Good luck on your modding adventure!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...