MWSE Scripting Help: Replacing names

Post » Tue Mar 11, 2014 11:04 am

So, I'm trying to do something silly and simple in concept: I want to replace the name of every single non-Dunmer NPC in the game with "N'wah".

Obviously this has to be done with the help of MWSE if I don't just want to do it in the CS (that'd be a lot of work!). Or perhaps it could be done with an external program that I haven't thought of...

I'm open to better ways to do this. For now, I was going to try replacing them on the fly using a makeshift version of Fliggerty's Detect Life script. Right now it just freezes the game (I can still mess around in the console and stuff, but nobody moves, if I try teleporting to an exterior cell the game crashes). I'm a sorry excuse for a scripter and so I'm coming here for help.

begin NWAH	long anref	long temp	long pccell	if ( MenuMode )		return	endif		ifx ( anref )		setx anref to xNextRef anref ;working through list	else		setx anref to xFirstNPC ;top of list	endif	if ( anref == 0 ) ;end of list		return	endif		setx temp to anref->xRefType ;check to see if reference is an NPC	if ( temp != 1598246990 ) ;it's not an NPC		return	endif	xSetRef anref	set temp to GetDisabled	if ( temp == 1 )		return	endif	xSetRef anref	set temp to GetDistance Player ;see how far away it is	if ( temp > 3500 )		return	endif	xSetRef anref	set temp to GetRace "Dark Elf"	if ( temp == 1 )		return	endif	xSetRef anref	set temp to xGetName "N'wah"	if ( temp == 1 )		return	endif		;this far means we've found a non-Dunmer which is close enough	xSetRef anref	xSetName "N'wah"endifend
User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Return to III - Morrowind

cron