Jump to content

Rename not working


Recommended Posts

Hey guys,

I made this simple script to rename 3 cre files

// Rune Mage rename

	ACTION_FOR_EACH cre IN ~TANWIZ02~ ~TANWIZ03~ ~TANWIZ04~
		BEGIN
		ACTION_IF FILE_EXISTS_IN_GAME ~%cre%~ BEGIN
			COPY_EXISTING ~%cre%~ ~override~
				LPF SANITIZE_CRE RET ok = ok END
				PATCH_IF ok BEGIN
					SAY NAME1 @1004
					SAY NAME2 @1004
				END
			BUT_ONLY
		END
	END

 

Problem is... it doesn't work. The names never get changed. Is it because SAY cannot be nested like this? I use it frequently after COPY and it always works.

@1004 in tra file is 

@1004 = ~Rune Mage~

Or is there a better and faster way to do it? Thanks!

Link to comment

I fixed it by stating cre right from the getgo (first line)

	ACTION_FOR_EACH cre IN ~TANWIZ02.cre~ ~TANWIZ03.cre~ ~TANWIZ04.cre~
	BEGIN
		ACTION_IF FILE_EXISTS_IN_GAME ~%cre%~ BEGIN
			COPY_EXISTING ~%cre%~ ~override~
				LPF SANITIZE_CRE RET ok = ok END
				PATCH_IF ok BEGIN
					SAY NAME1 @1004
					SAY NAME2 @1004
				END
			BUT_ONLY
		END
	END

 

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...