[WIPz/RELz] Drake's Anthro-Dragon Race (#3)

Post » Fri May 27, 2011 4:13 pm

Now here we are! That's exactly what I needed!

Every variable or array is still "0", which means "not even created or initialized". Under these circumstances the tokens and all other scripts will skip processing right at the start as a safety measure, until this state has changed into a valid situation.
Now I also know why forcing the config didn't help either. "init" is "-1", which means there was a major error when checking for the requirements!
I'm a little bit stumped as to why no error pop-up appeared, but maybe I simply messed these up. I always had all requirements on my system, so it was hard to thoroughly test these. I guess just copying mechanisms from the wiki wasn't the perfect solution.

The only way to get "init" set to "-1" would be by having the condition "getOBSEVersion < 17" met. But then you shouldn't have got the pop-up telling "Dragon Race: All requirements met. Arrays initialized successfully." to begin with!
All other scripts are checking for "init == 1" to do their own initializations. So that's why nothing's working.
Now we only have to figure out why it says "-1" and why it didn't pop-up the error message but the success message!

Judging by the other runtime-errors there definitely is a sufficiently high version of OBSE running, so that shouldn't be the case...


edit: Wait a sec... you got it working now? Hurray!
...now I only have to figure out how two conflicting alternate start mods could cause this simple check for OBSE functionality to fail... :confused:
...and how could they possibly screw with my scripts either?... It's just getting more and more confusing... :wacko:

Ah well, at least you now can enjoy the race in its whole at last... or so I hope!
User avatar
Karl harris
 
Posts: 3423
Joined: Thu May 17, 2007 3:17 pm

Post » Fri May 27, 2011 4:19 am

Can we have a link to the latest working version? Or is it still the one in the first thread?
User avatar
Anna S
 
Posts: 3408
Joined: Thu Apr 19, 2007 2:13 am

Post » Fri May 27, 2011 6:38 am

Can we have a link to the latest working version? Or is it still the one in the first thread?

It's still the last two, the full package plus the fixed ESP.
If anything else will be released, it will get added there, too, at the same time I'll post an update.
User avatar
Rowena
 
Posts: 3471
Joined: Sun Nov 05, 2006 11:40 am

Post » Fri May 27, 2011 11:54 am

...now I only have to figure out how two conflicting alternate start mods could cause this simple check for OBSE functionality to fail... :confused:
...and how could they possibly screw with my scripts either?... It's just getting more and more confusing... :wacko:

Well, I somehow got both Alternate Start by Robert Evrae and Kobu's Skip Intro Mod running at once, taking off Alternate Start cause your scripts to function again, but no conflict with your mod was detected, so it must have been their conflict shutting out your scripts? I dunno. At least your scripts work now :hehe:
User avatar
Anna Krzyzanowska
 
Posts: 3330
Joined: Thu Aug 03, 2006 3:08 am

Post » Fri May 27, 2011 5:04 am

I had the same problem, but it was between MOE Alternate Start and UOP's alt start function. Same problem, same fix. MOE is gone, everything works.
User avatar
MR.BIGG
 
Posts: 3373
Joined: Sat Sep 08, 2007 7:51 am

Post » Fri May 27, 2011 3:00 pm

I'm still stumped as to how this could possibly "kill" the "getOBSEversion" function though...

However... I think I should start fixing a few of the reported issues in my scripts when I find some time to do it.

Today we finished backing up all files from the Windows partition of my laptop's drive. They're still out of reach, but at least they're safe now.
I'm waiting for the package from Dell to arrive, to pack my laptop inside and send it back for repairs and check-up.
Round-about 400? is not few, but considering the thing is probably 4 years old and far beyond any warranty already, it's actually not too much for receiving a completely repaired laptop with a new warranty as well...
...ahem, I can dream, can't I? :embarrass:
Well, at least chances are good they find out what it is and will be able to fix it once and for all... again dreaming of course... but then it would be some money spent well.
Hey, what am I halluzinating about? It's not too unlikely they won't have any replacement parts for the old machine anymore either... :rolleyes:
User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm

Post » Fri May 27, 2011 1:56 pm

I have a bit of an issue

I finally got Oblivion working today on my own computer (YAY) and so I was downloading mods like crazy all last night and most of the day that's gone by. unfortunately, Filefront is screwy, so I don't have the availability of Fearil's clothing meshes for dragon legs (note - I do have the armor, no need to worry about that, as I got it from megaupload). would someone mind doing a re-upload?

EDIT: oh yes, and what I did find was something interesting about the dragon wings and other body parts. if you change your race using the menu at the end of the dungeon or 'showracemenu' then the dragon parts stay. I was running around as an imperial with Wings, a tail, and three fingered hands for a little bit there. I'm sure this is something that we can all live with, I just find it fairly interesting is all.
User avatar
Strawberry
 
Posts: 3446
Joined: Thu Jul 05, 2007 11:08 am

Post » Fri May 27, 2011 4:16 pm

Oh yes, it is, and thanks for reporting it!

Seems quite a few things were left out on rewriting from scratch. But fortunately I know exactly what's causing it and how to fix it.
I was about to post some revised scripts here (as I can't put them into the CS myself and try them out currently), but let me see if I can't eliminate that little annoyance as well before doing so.

...will be back soon...
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am

Post » Fri May 27, 2011 4:23 pm

And here we are!

Well, it won't do anything about "three-fingered hands", as those aren't part of my mod, the dragons in my vision have 5 fingers :P ... but it should now remove any dragon bodyparts from non-dragons.
Also there's a regular check for your race, just in case you somehow manage to change it, which will react accordingly when you end your draconic existance and clean up after itself, but it's still not doing any rather complex tests each run.
Combined-slot items now should work properly as well... or so I hope... tell me, if they still aren't.

Here's the quest script:
scn DrakeDragonRaceQuestScriptlong adaptedItemsArraylong itemsDCpartcArraylong itemsDCpartfArraylong itemsDCpartcfArraylong itemsDCpartArraylong itemsDCpartfoArraylong itemsDCpartfcArrayshort showclawsshort showfeetshort showtailshort showwingsshort showhelmetshort forcehelmetshort forceuppershort forcelowershort forcehandsshort forcefeetshort forcetailshort forcecombinedshort initshort debugshort debugShowRaceTokenshort debugShowRevTokenshort doConfigshort choicearray_var confArrayarray_var itemArrayarray_var defaultItemArrayarray_var replacerTemplateArrayarray_var tempArrayarray_var itemstring_var raceIdlong framesToSkiplong itemsRevertPerFrameref sourcefloat timerfloat playerXfloat playerYfloat playerZfloat fQuestDelayTimebegin gameMode	set fQuestDelayTime to 0.5		if(init == 0)		if(getOBSEVersion < 17)			MessageBoxEX "Dragon Race:%rCurrent release requires OBSE v0017 or higher to run.%rYou don't have a proper version of OBSE!"			set init to -1			return		endif		set showhelmet to 1		set showclaws to 1		set showfeet to 1		set showtail to 1		set showwings to 1		set forcehelmet to 0		set forceupper to 0		set forcelower to 1		set forcehands to 1		set forcefeet to 1		set forcetail to 1		set forcecombined to 0		let confArray := ar_Construct StringMap		let confArray["races"] := ar_Construct StringMap		let confArray["races"]["dragon"] := DrakeDragon		let confArray["races"]["dragonblack"] := DrakeDragonBlack		let confArray["races"]["dragonredgold"] := DrakeDragonRedGold				foreach item <- confArray["races"]			let raceId := item["key"]						let confArray[raceId] := ar_Construct StringMap			let confArray[raceId]["hair"] := ar_Construct StringMap			let confArray[raceId]["hair"]["slotmask"] := 2			let confArray[raceId]["hair"]["combinations"] := ar_Construct Array			let confArray[raceId]["hair"]["combinations"][0] := ar_Construct StringMap			let confArray[raceId]["hair"]["combinations"][0]["tag"] := "dcpart"			let confArray[raceId]["hair"]["combinations"][0]["req"] := showhelmet			let confArray[raceId]["hair"]["forced"] := forcehelmet			let confArray[raceId]["upperbody"] := ar_Construct StringMap			let confArray[raceId]["upperbody"]["slotmask"] := 4			let confArray[raceId]["upperbody"]["combinations"] := ar_Construct Array			let confArray[raceId]["upperbody"]["combinations"][0] := ar_Construct StringMap			let confArray[raceId]["upperbody"]["combinations"][0]["tag"] := "dcpartc"			let confArray[raceId]["upperbody"]["combinations"][0]["req"] := eval (showclaws == 1 && showfeet == 0)			let confArray[raceId]["upperbody"]["combinations"][1] := ar_Construct StringMap			let confArray[raceId]["upperbody"]["combinations"][1]["tag"] := "dcpartf"			let confArray[raceId]["upperbody"]["combinations"][1]["req"] := eval (showclaws == 0 && showfeet == 1)			let confArray[raceId]["upperbody"]["combinations"][2] := ar_Construct StringMap			let confArray[raceId]["upperbody"]["combinations"][2]["tag"] := "dcpartcf"			let confArray[raceId]["upperbody"]["combinations"][2]["req"] := eval (showclaws == 1 && showfeet == 1)			let confArray[raceId]["upperbody"]["combinations"][3] := ar_Construct StringMap			let confArray[raceId]["upperbody"]["combinations"][3]["tag"] := "dcpart"			let confArray[raceId]["upperbody"]["combinations"][3]["req"] := showclaws			let confArray[raceId]["upperbody"]["forced"] := forceupper			let confArray[raceId]["lowerbody"] := ar_Construct StringMap			let confArray[raceId]["lowerbody"]["slotmask"] := 8			let confArray[raceId]["lowerbody"]["combinations"] := ar_Construct Array			let confArray[raceId]["lowerbody"]["combinations"][0] := ar_Construct StringMap			let confArray[raceId]["lowerbody"]["combinations"][0]["tag"] := "dcpart"			let confArray[raceId]["lowerbody"]["combinations"][0]["req"] := showfeet			let confArray[raceId]["lowerbody"]["forced"] := forcelower			let confArray[raceId]["hands"] := ar_Construct StringMap			let confArray[raceId]["hands"]["slotmask"] := 16			let confArray[raceId]["hands"]["combinations"] := ar_Construct Array			let confArray[raceId]["hands"]["combinations"][0] := ar_Construct StringMap			let confArray[raceId]["hands"]["combinations"][0]["tag"] := "dcpart"			let confArray[raceId]["hands"]["combinations"][0]["req"] := showclaws			let confArray[raceId]["hands"]["forced"] := forcehands			let confArray[raceId]["feet"] := ar_Construct StringMap			let confArray[raceId]["feet"]["slotmask"] := 32			let confArray[raceId]["feet"]["combinations"] := ar_Construct Array			let confArray[raceId]["feet"]["combinations"][0] := ar_Construct StringMap			let confArray[raceId]["feet"]["combinations"][0]["tag"] := "dcpart"			let confArray[raceId]["feet"]["combinations"][0]["req"] := showfeet			let confArray[raceId]["feet"]["forced"] := forcefeet			let confArray[raceId]["tail"] := ar_Construct StringMap			let confArray[raceId]["tail"]["slotmask"] := 32768			let confArray[raceId]["tail"]["combinations"] := ar_Construct Array			let confArray[raceId]["tail"]["combinations"][0] := ar_Construct StringMap			let confArray[raceId]["tail"]["combinations"][0]["tag"] := "dcpartt"			let confArray[raceId]["tail"]["combinations"][0]["req"] := eval (showtail == 1 && showwings == 0)			let confArray[raceId]["tail"]["combinations"][1] := ar_Construct StringMap			let confArray[raceId]["tail"]["combinations"][1]["tag"] := "dcpartw"			let confArray[raceId]["tail"]["combinations"][1]["req"] := eval (showtail == 0 && showwings == 1)			let confArray[raceId]["tail"]["combinations"][2] := ar_Construct StringMap			let confArray[raceId]["tail"]["combinations"][2]["tag"] := "dcpartwt"			let confArray[raceId]["tail"]["combinations"][2]["req"] := eval (showtail == 1 && showwings == 1)			let confArray[raceId]["tail"]["combinations"][3] := ar_Construct StringMap			let confArray[raceId]["tail"]["combinations"][3]["tag"] := "dcpart"			let confArray[raceId]["tail"]["combinations"][3]["req"] := eval (showtail == 1 && showwings == 1)			let confArray[raceId]["tail"]["forced"] := forcetail		Loop			let itemArray := ar_Construct StringMap		let itemArray["original"] := ar_Construct StringMap		;let itemArray["original"][x] := original_BaseId		let itemArray["dcpartc"] := ar_Construct StringMap		let itemArray["dcpartf"] := ar_Construct StringMap		let itemArray["dcpartcf"] := ar_Construct StringMap		let itemArray["dcpartw"] := ar_Construct StringMap		let itemArray["dcpartt"] := ar_Construct StringMap		let itemArray["dcpartwt"] := ar_Construct StringMap		let itemArray["dcpart"] := ar_Construct StringMap		;let itemArray[tagCode][x] := adapted_BaseId		;matching indices "x"!			let defaultItemArray := ar_Construct StringMap		let defaultItemArray["hair"] := ar_Construct StringMap		let defaultItemArray["hair"]["dcpart"] := 0		let defaultItemArray["upperbody"] := ar_Construct StringMap		let defaultItemArray["upperbody"]["dcpartc"] := DrakeEmptyItem ;no default item needed for upperbody		let defaultItemArray["upperbody"]["dcpartf"] := DrakeEmptyItem		let defaultItemArray["upperbody"]["dcpartcf"] := DrakeEmptyItem		let defaultItemArray["upperbody"]["dcpart"] := DrakeEmptyItem		let defaultItemArray["lowerbody"] := ar_Construct StringMap		let defaultItemArray["lowerbody"]["dcpart"] := DrakeDragonLegs		let defaultItemArray["hands"] := ar_Construct StringMap		let defaultItemArray["hands"]["dcpart"] := DrakeDragonClaws		let defaultItemArray["feet"] := ar_Construct StringMap		let defaultItemArray["feet"]["dcpart"] := DrakeDragonFeet		let defaultItemArray["tail"] := ar_Construct StringMap		let defaultItemArray["tail"]["dcpartt"] := DrakeDragonTail		let defaultItemArray["tail"]["dcpartw"] := DrakeDragonWings		let defaultItemArray["tail"]["dcpartwt"] := DrakeDragonWingsTail		let defaultItemArray["tail"]["dcpart"] := DrakeEmptyItem		;replacer templates		let replacerTemplateArray := ar_Construct StringMap		let replacerTemplateArray["hair"] := ar_Construct StringMap		let replacerTemplateArray["hair"]["dcpart"] := DrakeEmptyItem		let replacerTemplateArray["upperbody"] := ar_Construct StringMap		let replacerTemplateArray["upperbody"]["dcpartc"] := DrakeEmptyItem ;no replacer templates needed for upperbody		let replacerTemplateArray["upperbody"]["dcpartf"] := DrakeEmptyItem		let replacerTemplateArray["upperbody"]["dcpartcf"] := DrakeEmptyItem		let replacerTemplateArray["upperbody"]["dcpart"] := DrakeEmptyItem		let replacerTemplateArray["lowerbody"] := ar_Construct StringMap		let replacerTemplateArray["lowerbody"]["dcpart"] := DrakeDragonLegWraps		let replacerTemplateArray["hands"] := ar_Construct StringMap		let replacerTemplateArray["hands"]["dcpart"] := DrakeDragonHandWraps		let replacerTemplateArray["feet"] := ar_Construct StringMap		let replacerTemplateArray["feet"]["dcpart"] := DrakeDragonFootWraps		let replacerTemplateArray["tail"] := ar_Construct StringMap		let replacerTemplateArray["tail"]["dcpartt"] := DrakeEmptyItem		let replacerTemplateArray["tail"]["dcpartw"] := DrakeEmptyItem		let replacerTemplateArray["tail"]["dcpartwt"] := DrakeEmptyItem		let replacerTemplateArray["tail"]["dcpart"] := DrakeEmptyItem				let tempArray := ar_Construct StringMap				set framesToSkip to 10		set itemsRevertPerFrame to 100		MessageBoxEX "Dragon Race:%rAll requirements met. Arrays initialized successfully."		set doConfig to -1		set init to 1	endif	if(doConfig == 1)		MessageBoxEX "Dragon Race > Do You want to keep all default settings?|Yes|No"		set doConfig to -2		return	elseif(doConfig == -2)		set choice to getButtonPressed		if(choice == 0) ;stick to defaults			MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No"			set doConfig to 12		elseif(choice == 1) ;customize			MessageBoxEX "Dragon Race > Select Your shape:%rDo You want to be Full-Dragon shape?|Yes|No"			set doConfig to 2		endif		return	elseif(doConfig == 2) ;full-dragon or custom?		set choice to getButtonPressed		if(choice == 0) ;stay full-dragon			set showclaws to 1			set showfeet to 1			set showtail to 1			set showwings to 1			MessageBoxEX "Dragon Race > Select Your shape:%rDo You want controlled helmet slot,%rnot actually force-equipping anything%rbut keeping non-fitting helmets unequipped?|Yes|No"			set doConfig to 5		elseif(choice == 1) ;further customize			MessageBoxEX "Dragon Race > Select Your shape:%rWhich wings & tail combination do You prefer?|Wings and tail|Only wings|Only tail|None at all"			set doConfig to 3		endif		return	elseif(doConfig == 3) ;tail & wings options		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;both				set showtail to 1				set showwings to 1			elseif(choice == 1) ;only wings				set showtail to 0				set showwings to 1			elseif(choice == 2) ;only tail				set showtail to 1				set showwings to 0			elseif(choice == 3) ;neither wings nor tail				set showtail to 0				set showwings to 0			endif			MessageBoxEX "Dragon Race > Select Your shape:%rWhich hands & feet/legs combination do You prefer?|Dragon hands and feet/legs|Dragon hands but human feet/legs|Human hands but dragon feet/legs|Human hands and human feet/legs"			set doConfig to 4		endif		return	elseif(doConfig == 4) ;hands & feet options		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;both				set showclaws to 1				set showfeet to 1			elseif(choice == 1) ;dragon hands, human feet				set showclaws to 1				set showfeet to 0			elseif(choice == 2) ;humand hands, dragon feet				set showclaws to 0				set showfeet to 1			elseif(choice == 3) ;all human				set showclaws to 0				set showfeet to 0			endif			MessageBoxEX "Dragon Race > Select Your shape:%rDo You want controlled helmet slot,%rnot actually force-equipping anything%rbut keeping non-fitting helmets unequipped?|Yes|No"			set doConfig to 5		endif		return	elseif(doConfig == 5) ;helmet options		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;controlled helmet				set showhelmet to 1			elseif(choice == 1) ;keep hairstyles				set showhelmet to 0			endif			MessageBoxEX "Dragon Race > Forced unequipping:%rBy default unequipping of non-fitting items%ris forced for all slots but upperbody.%rThis includes visual replacement while keeping stats.%rWhich settings do You prefer?|Keep default (All)|None at all|Customize..."			set doConfig to 6		endif		return	elseif(doConfig == 6)		set choice to getButtonPressed		if(choice > -1)			if(choice == 0); all slots				set forcehelmet to 1				set forceupper to 0				set forcehands to 1				set forcelower to 1				set forcefeet to 1				set forcetail to 1				MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No"				set doConfig to 12			elseif(choice == 1) ;none at all				set forcehelmet to 0				set forceupper to 0				set forcehands to 0				set forcelower to 0				set forcefeet to 0				set forcetail to 0				MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No"				set doConfig to 12			elseif(choice == 2) ;customize				MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the helmet/hair slot to be forced?%r(Only relevant, if it is controlled.)|Yes|No"				set doConfig to 7			endif		endif		return	elseif(doConfig == 7)		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;yes				set forcehelmet to 1			elseif(choice == 1) ;no				set forcehelmet to 0			endif			MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the lowerbody/legs slot to be forced?%r(Only relevant, if it is in Dragon shape.)|Yes|No"			set doConfig to 8		endif		return	elseif(doConfig == 8) ;lowerbody		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;yes				set forcelower to 1			elseif(choice == 1) ;no				set forcelower to 0			endif			MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the hands slot to be forced?%r(Only relevant, if it is in Dragon shape.)|Yes|No"			set doConfig to 9		endif		return	elseif(doConfig == 9) ;hands		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;yes				set forcehands to 1			elseif(choice == 1) ;no				set forcehands to 0			endif			MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the feet slot to be forced?%r(Only relevant, if it is in Dragon shape.)|Yes|No"			set doConfig to 10		endif		return	elseif(doConfig == 10) ;feet		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;yes				set forcefeet to 1			elseif(choice == 1) ;no				set forcefeet to 0			endif			MessageBoxEX "Dragon Race > Forced unequipping:%rDo You want the tail slot to be forced?%r(Only relevant, if tail or wings were selected.)|Yes|No"			set doConfig to 11		endif		return	elseif(doConfig == 11) ;tail		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;yes				set forcetail to 1			elseif(choice == 1) ;no				set forcetail to 0			endif			MessageBoxEX "Dragon Race > Forced unequipping:%rBy default this will also affect items%rcovering more than 1 slot at once,%r(e.g. The Arena Raiments or DB Armor)%rleaving actors running around naked,%rif they weren't adapted yet.%rDo You wish to make an exception%rto allow non-fitting combined-slot items?|Yes|No"			set doConfig to 12		endif		return	elseif(doConfig == 12) ;combined-slot items exception		set choice to getButtonPressed		if(choice > -1)			if(choice == 0) ;yes				set forcecombined to 0			elseif(choice == 1) ;no				set forcecombined to 1			endif			set doConfig to 13		endif		return	elseif(doConfig == 13) ;finish		MessageBoxEX "Dragon Race: Thank You for your time.%rYour Dragon race should now be successfully configured.%rIf You wish to do this again, just type%r'set DragonStartQuest.doConfig to 1'%rinto the console.%rIf You called this in the middle of a game,%rYou might need to reequip your clothing,%rfor the changes to take effect!"		set doConfig to 0	elseif(doConfig == -1) ;prepare for next frame		set doConfig to 1		return	endif		foreach item <- confArray["races"]		let raceId := item["key"]				;update shape shift settings, just in case		let confArray[raceId]["hair"]["combinations"][0]["req"] := showhelmet		let confArray[raceId]["upperbody"]["combinations"][0]["req"] := eval (showclaws == 1 && showfeet == 0)		let confArray[raceId]["upperbody"]["combinations"][1]["req"] := eval (showclaws == 0 && showfeet == 1)		let confArray[raceId]["upperbody"]["combinations"][2]["req"] := eval (showclaws == 1 && showfeet == 1)		let confArray[raceId]["upperbody"]["combinations"][3]["req"] := showclaws		let confArray[raceId]["lowerbody"]["combinations"][0]["req"] := showfeet		let confArray[raceId]["hands"]["combinations"][0]["req"] := showclaws		let confArray[raceId]["feet"]["combinations"][0]["req"] := showfeet		let confArray[raceId]["tail"]["combinations"][0]["req"] := eval (showtail == 1 && showwings == 0)		let confArray[raceId]["tail"]["combinations"][1]["req"] := eval (showtail == 0 && showwings == 1)		let confArray[raceId]["tail"]["combinations"][2]["req"] := eval (showtail == 1 && showwings == 1)				;update forced unequipping, just in case		let confArray[raceId]["hair"]["forced"] := forcehelmet		let confArray[raceId]["upperbody"]["forced"] := forceupper		let confArray[raceId]["lowerbody"]["forced"] := forcelower		let confArray[raceId]["hands"]["forced"] := forcehands		let confArray[raceId]["feet"]["forced"] := forcefeet		let confArray[raceId]["tail"]["forced"] := forcetail	Loop		let raceId := ar_Find (player.getRace) confArray["races"]	if eval (raceId != "")		if(player.getItemCount DrakeDragonRaceToken < 1)			player.addItemNS DrakeDragonRaceToken 1		endif	else		if(player.getItemCount DrakeDragonRaceReverterToken < 1)			player.addItemNS DrakeDragonRaceReverterToken 1		endif	endif		set source to DrakeDragonRaceScanner	;move into new cell with player and reset count so spell is cast immediately	if(source.getInSameCell player != 1)		source.moveTo player		set timer to 0	endif		if(timer <= 0)		set playerX to player.getPos X		source.setPos X playerX		set playerY to player.getPos Y		source.setPos Y playerY		set playerZ to player.getPos Z		source.setPos Z playerZ		source.cast DrakeDragonRaceScannerAura player		set timer to 1	else		set timer to (timer - getSecondsPassed)	endifend


Here's the token script:
scn DrakeDragonRaceTokenScriptref actorRefref actorRaceref actslotContentref oldslotContentref tempItemshort initshort actorFemaleshort switchItemsshort wearsAdaptedshort foundAdaptedshort requirementshort foundRequirementshort currentRequirementshort slotCodeshort index2long frameNumlong slotMaskarray_var confArrayarray_var itemArrayarray_var defaultItemArrayarray_var replacerTemplateArrayarray_var slotArrayarray_var repeatArrayarray_var keysArrayarray_var itemarray_var item2string_var indexstring_var tagIdstring_var tagCodestring_var currentlyWearingstring_var shouldBeWearingstring_var slotIdstring_var raceIdfloat healthBufferbegin gameMode	if eval(-1 == ar_Size confArray)		set init to 0	endif	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let confArray := DrakeDragonRaceQuest.confArray		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray		let slotArray := ar_Construct StringMap		let repeatArray := ar_Construct StringMap		set frameNum to 0		set actorFemale to -1		set init to 1	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif		if(actorRace != actorRef.getRace)		set actorRace to actorRef.getRace		let confArray := DrakeDragonRaceQuest.confArray		let raceId := ar_Find (actorRef.getRace) confArray["races"]		if eval (raceId != "")			let confArray := confArray[raceId] ;race-specific part of confArray			let keysArray := ar_Keys confArray			ForEach item <- keysArray				let slotId := item["value"]				let slotArray[slotId] := DrakeEmptyItem ;initialize empty				let repeatArray[slotId] := 0			Loop		else			;is not a dragon, remove bodyparts, if present!			ForEach item <- defaultItemArray				ForEach item2 <- item["value"]					let tempItem := item2["value"]					if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0)						actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem)					endif				Loop			Loop			removeMe ;is not a dragon, should not have this!		endif			endif		if(actorFemale == -1)		set actorFemale to actorRef.isFemale	endif	if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	else		set frameNum to 0	endif	if(actorRef.getInSameCell player != 1)		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR		endif		set init to 0		removeMe	endif	if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)		actorRef.playMagicShaderVisuals DrakeDEFriendlyDetectedXR	else		actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR	endif	;provide with bodyparts	ForEach item <- defaultItemArray		ForEach item2 <- item["value"]			let tempItem := item2["value"]			if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1)				actorRef.addItemNS tempItem 1			endif		Loop	Loop	ForEach item <- confArray		let slotId := item["key"]		let oldslotContent := slotArray[slotId]					;check slot for changes		let slotMask := confArray[slotId]["slotmask"]		set actslotContent to (actorRef.getEquipmentSlotMask slotMask)		if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1)			let index := ""			let index2 := ar_First confArray[slotId]["combinations"]			While eval ((index == "") && (index2 != ar_BadNumericIndex))				let tagId := confArray[slotId]["combinations"][index2]["tag"]				let index := ar_Find oldslotContent itemArray[tagId]				let index2 := ar_Next confArray[slotId]["combinations"] index2			Loop							if eval (index != "") ;needs exchange				if(actorRef.getItemCount oldslotContent > 0)					let tempItem := itemArray["original"][index]					actorRef.removeItemNS oldslotContent 1					actorRef.addItemNS tempItem 1				endif			endif						let shouldBeWearing := "original"			set foundAdapted to 0			set foundRequirement to 0			ForEach item2 <- confArray[slotId]["combinations"]				let tagId := item2["value"]["tag"]				if eval (item2["key"] == ar_Last confArray[slotId]["combinations"])					let tagCode := "_" + tagId				else					let tagCode := "_" + tagId + ".nif"				endif				let requirement := item2["value"]["req"]								if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1)					set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent				else					set wearsAdapted to compareMaleBipedPath $tagCode actslotContent				endif								if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one					set foundAdapted to 1					let currentlyWearing := tagId					set currentRequirement to requirement				endif				if(requirement == 1 && foundRequirement != 1) ;always take the 1st one					set foundRequirement to 1					let shouldBeWearing := tagId				endif			Loop						set switchItems to 0			if(foundAdapted == 1) ;is wearing an adapted item				if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape					if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape						let index := ar_Find actslotContent itemArray[currentlyWearing]						if eval (index != "") ;safety check							let tempItem := itemArray[shouldBeWearing][index]							set switchItems to 1						endif					endif				else ;is wearing adapted item or bodypart but should not					let index := ar_Find actslotContent itemArray[currentlyWearing]					if eval (index != "") ;no bodypart						let tempItem := itemArray["original"][index]						set switchItems to 1					else ;bodypart						set tempItem to 0						set switchItems to 2					endif				endif			else ;not wearing any adapted item				if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape					if(actslotContent != 0) ;normal clothing						let index := ar_Find actslotContent itemArray["original"]						if eval (index != "") ;already an adapted present							if eval (ar_HasKey itemArray[shouldBeWearing] index)								let tempItem := itemArray[shouldBeWearing][index]							else								let tempItem := itemArray[(ar_Last itemArray)][index]							endif							set switchItems to 1						else ;try to find adapted item							set switchItems to 3						endif					else ;empty						let tempItem := defaultItemArray[slotId][shouldBeWearing]						set switchItems to 2					endif				endif			endif			;handle updates			let repeatArray[slotId] := 0			if(switchItems == 1 && tempItem != 0) ;just swap				set slotCode to getEquipmentSlot actslotContent				set healthBuffer to actorRef.getEquippedCurrentHealth slotCode				actorRef.addItemNS tempItem 1				actorRef.equipItemNS tempItem				actorRef.removeItemNS actslotContent 1				actorRef.setEquippedCurrentHealth healthBuffer slotCode			elseif(switchItems == 2) ;equip bodyparts				if(tempItem == 0)					actorRef.unequipItemNS actslotContent				else					actorRef.equipItemNS tempItem				endif			elseif(switchItems == 3) ;check for presence of alternatives				let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach				ForEach item2 <- confArray[slotId]["combinations"]					let tagId := item2["value"]["tag"]					let tagCode := ".nif|_" + tagId + ".nif"										if(isBipedModelPathValid 0 actslotContent == 1)						copyMaleBipedPath actslotContent DrakeTempItem					else						setMaleBipedPath "empty" DrakeTempItem					endif					modMaleBipedPath $tagCode DrakeTempItem					if(isBipedModelPathValid 1 actslotContent == 1)						copyFemaleBipedPath actslotContent DrakeTempItem					else						setFemaleBipedPath "empty" DrakeTempItem					endif					modFemaleBipedPath $tagCode DrakeTempItem					if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender						if eval ((ar_HasKey itemArray["original"] index) == 0)							let itemArray["original"][index] := actslotContent ;do this only once						endif						set tempItem to cloneForm actslotContent						if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist							copyMaleBipedPath DrakeTempItem tempItem						endif						if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist							copyFemaleBipedPath DrakeTempItem tempItem						endif						let itemArray[tagId][index] := tempItem					else ;use replacer templates instead						if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot							if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off								let tempItem := replacerTemplateArray[slotId][tagId]								if(tempItem != DrakeEmptyItem)									if(isBipedModelPathValid 0 tempItem == 1)										copyMaleBipedPath tempItem DrakeTempItem									else										setMaleBipedPath "empty" DrakeTempItem									endif									if(isBipedModelPathValid 1 tempItem == 1)										copyFemaleBipedPath tempItem DrakeTempItem									else										setFemaleBipedPath "empty" DrakeTempItem									endif									if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender										if eval ((ar_HasKey itemArray["original"] index) == 0)											let itemArray["original"][index] := actslotContent ;do this only once										endif										set tempItem to cloneForm actslotContent										if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist											copyMaleBipedPath DrakeTempItem tempItem										endif										if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist											copyFemaleBipedPath DrakeTempItem tempItem										endif										let itemArray[tagId][index] := tempItem									endif								endif							endif						endif					endif				Loop				if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach					let repeatArray[slotId] := 1 ;do exchange next frame				else ;no adapted clothing found					if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot						if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off							let tempItem := defaultItemArray[slotId][shouldBeWearing]							if(tempItem == 0)								actorRef.unequipItemNS actslotContent							else								actorRef.equipItemNS tempItem							endif						endif					endif				endif			endif		endif		set oldslotContent to (actorRef.getEquipmentSlotMask slotMask)		let slotArray[slotId] := oldslotContent	Loopendbegin menuMode 1002 || 1008	if eval(-1 == ar_Size confArray)		set init to 0	endif	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let confArray := DrakeDragonRaceQuest.confArray		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray		let slotArray := ar_Construct StringMap		let repeatArray := ar_Construct StringMap		set frameNum to 0		set actorFemale to -1		set init to 1	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(actorRace != actorRef.getRace)		set actorRace to actorRef.getRace		let confArray := DrakeDragonRaceQuest.confArray		let raceId := ar_Find (actorRef.getRace) confArray["races"]		if eval (raceId != "")			let confArray := confArray[raceId] ;race-specific part of confArray			let keysArray := ar_Keys confArray			ForEach item <- keysArray				let slotId := item["value"]				let slotArray[slotId] := DrakeEmptyItem ;initialize empty				let repeatArray[slotId] := 0			Loop		else			;is not a dragon, remove bodyparts, if present!			ForEach item <- defaultItemArray				ForEach item2 <- item["value"]					let tempItem := item2["value"]					if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0)						actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem)					endif				Loop			Loop			removeMe ;is not a dragon, should not have this!		endif			endif	if(actorRef.getIsReference player != 1)		return ;NPCs don't need control during MenuMode	endif	if(actorFemale == -1)		set actorFemale to actorRef.isFemale	endif	if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	else		set frameNum to 0	endif	if(actorRef.getInSameCell player != 1)		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR		endif		set init to 0		removeMe	endif	;provide with bodyparts	ForEach item <- defaultItemArray		ForEach item2 <- item["value"]			let tempItem := item2["value"]			if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1)				actorRef.addItemNS tempItem 1			endif		Loop	Loop	ForEach item <- confArray		let slotId := item["key"]		let oldslotContent := slotArray[slotId]					;check slot for changes		let slotMask := confArray[slotId]["slotmask"]		set actslotContent to (actorRef.getEquipmentSlotMask slotMask)		if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1)			let index := ""			let index2 := ar_First confArray[slotId]["combinations"]			While eval ((index == "") && (index2 != ar_BadNumericIndex))				let tagId := confArray[slotId]["combinations"][index2]["tag"]				let index := ar_Find oldslotContent itemArray[tagId]				let index2 := ar_Next confArray[slotId]["combinations"] index2			Loop							if eval (index != "") ;needs exchange				if(actorRef.getItemCount oldslotContent > 0)					let tempItem := itemArray["original"][index]					actorRef.removeItemNS oldslotContent 1					actorRef.addItemNS tempItem 1				endif			endif						let shouldBeWearing := "original"			set foundAdapted to 0			set foundRequirement to 0			ForEach item2 <- confArray[slotId]["combinations"]				let tagId := item2["value"]["tag"]				if eval (item2["key"] == ar_Last confArray[slotId]["combinations"])					let tagCode := "_" + tagId				else					let tagCode := "_" + tagId + ".nif"				endif				let requirement := item2["value"]["req"]								if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1)					set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent				else					set wearsAdapted to compareMaleBipedPath $tagCode actslotContent				endif								if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one					set foundAdapted to 1					let currentlyWearing := tagId					set currentRequirement to requirement				endif				if(requirement == 1 && foundRequirement != 1) ;always take the 1st one					set foundRequirement to 1					let shouldBeWearing := tagId				endif			Loop						set switchItems to 0			if(foundAdapted == 1) ;is wearing an adapted item				if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape					if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape						let index := ar_Find actslotContent itemArray[currentlyWearing]						if eval (index != "") ;safety check							let tempItem := itemArray[shouldBeWearing][index]							set switchItems to 1						endif					endif				else ;is wearing adapted item or bodypart but should not					let index := ar_Find actslotContent itemArray[currentlyWearing]					if eval (index != "") ;no bodypart						let tempItem := itemArray["original"][index]						set switchItems to 1					else ;bodypart						set tempItem to 0						set switchItems to 2					endif				endif			else ;not wearing any adapted item				if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape					if(actslotContent != 0) ;normal clothing						let index := ar_Find actslotContent itemArray["original"]						if eval (index != "") ;already an adapted present							if eval (ar_HasKey itemArray[shouldBeWearing] index)								let tempItem := itemArray[shouldBeWearing][index]							else								let tempItem := itemArray[(ar_Last itemArray)][index]							endif							set switchItems to 1						else ;try to find adapted item							set switchItems to 3						endif					else ;empty						let tempItem := defaultItemArray[slotId][shouldBeWearing]						set switchItems to 2					endif				endif			endif			;handle updates			let repeatArray[slotId] := 0			if(switchItems == 1 && tempItem != 0) ;just swap				set slotCode to getEquipmentSlot actslotContent				set healthBuffer to actorRef.getEquippedCurrentHealth slotCode				actorRef.addItemNS tempItem 1				actorRef.equipItemNS tempItem				actorRef.removeItemNS actslotContent 1				actorRef.setEquippedCurrentHealth healthBuffer slotCode			elseif(switchItems == 2) ;equip bodyparts				if(tempItem == 0)					actorRef.unequipItemNS actslotContent				else					actorRef.equipItemNS tempItem				endif			elseif(switchItems == 3) ;check for presence of alternatives				let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach				ForEach item2 <- confArray[slotId]["combinations"]					let tagId := item2["value"]["tag"]					let tagCode := ".nif|_" + tagId + ".nif"										if(isBipedModelPathValid 0 actslotContent == 1)						copyMaleBipedPath actslotContent DrakeTempItem					else						setMaleBipedPath "empty" DrakeTempItem					endif					modMaleBipedPath $tagCode DrakeTempItem					if(isBipedModelPathValid 1 actslotContent == 1)						copyFemaleBipedPath actslotContent DrakeTempItem					else						setFemaleBipedPath "empty" DrakeTempItem					endif					modFemaleBipedPath $tagCode DrakeTempItem					if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender						if eval ((ar_HasKey itemArray["original"] index) == 0)							let itemArray["original"][index] := actslotContent ;do this only once						endif						set tempItem to cloneForm actslotContent						if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist							copyMaleBipedPath DrakeTempItem tempItem						endif						if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist							copyFemaleBipedPath DrakeTempItem tempItem						endif						let itemArray[tagId][index] := tempItem					else ;use replacer templates instead						if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot							if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off								let tempItem := replacerTemplateArray[slotId][tagId]								if(tempItem != DrakeEmptyItem)									if(isBipedModelPathValid 0 tempItem == 1)										copyMaleBipedPath tempItem DrakeTempItem									else										setMaleBipedPath "empty" DrakeTempItem									endif									if(isBipedModelPathValid 1 tempItem == 1)										copyFemaleBipedPath tempItem DrakeTempItem									else										setFemaleBipedPath "empty" DrakeTempItem									endif									if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender										if eval ((ar_HasKey itemArray["original"] index) == 0)											let itemArray["original"][index] := actslotContent ;do this only once										endif										set tempItem to cloneForm actslotContent										if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist											copyMaleBipedPath DrakeTempItem tempItem										endif										if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist											copyFemaleBipedPath DrakeTempItem tempItem										endif										let itemArray[tagId][index] := tempItem									endif								endif							endif						endif					endif				Loop				if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach					let repeatArray[slotId] := 1 ;do exchange next frame				else ;no adapted clothing found					if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot						if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off							let tempItem := defaultItemArray[slotId][shouldBeWearing]							if(tempItem == 0)								actorRef.unequipItemNS actslotContent							else								actorRef.equipItemNS tempItem							endif						endif					endif				endif			endif		endif		set oldslotContent to (actorRef.getEquipmentSlotMask slotMask)		let slotArray[slotId] := oldslotContent	Loopend


And this one's for the reverter token:
scn DrakeDragonRaceReverterTokenScriptref actorRefref tempItemref tempItem2array_var itemarray_var item2long numItemslong endilong istring_var tagIdstring_var indexlong frameNumarray_var itemArrayarray_var defaultItemArrayshort equippedshort initshort init2float healthBuffershort slotCodebegin menuMode 1002 || 1008	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		set frameNum to 0		set init2 to 0		set init to 1	endif	if eval (-1 == ar_Size itemArray) ;shouldn't happen, but just in case		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		removeMe	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(init2 != 1)		set numItems to actorRef.getNumItems		set i to (numItems - 1)		set init2 to 1	endif		if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	else		set frameNum to 0		set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame)	endif	label	if(i >= endi && i >= 0)		set tempItem to actorRef.getInventoryObject i		if((isArmor tempItem == 1) || (isClothing tempItem == 1))			ForEach item <- itemArray				if eval (item["key"] == "original")					Continue				endif				let tagId := item["key"]				let index := ar_Find tempItem itemArray[tagId]				if eval (index != "") ;needs exchange					let tempItem2 := itemArray["original"][index]					set equipped to (actorRef.getEquipped tempItem)					if(equipped == 1)						set slotCode to getEquipmentSlot tempItem						set healthBuffer to actorRef.getEquippedCurrentHealth slotCode					endif					actorRef.removeItemNS tempItem 1					actorRef.addItemNS tempItem2 1					if(equipped == 1)						actorRef.equipItemNS tempItem2						actorRef.setEquippedCurrentHealth healthBuffer slotCode					endif				endif			Loop		endif		set i to (i - 1)		goto	endif	if(i < 0)		set init to 0		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		;remove bodyparts, if present!		ForEach item <- defaultItemArray			ForEach item2 <- item["value"]				let tempItem := item2["value"]				if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0)					actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem)				endif			Loop		Loop		removeMe ;we're done, remove us	endifendbegin gameMode	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		set frameNum to 0		set init2 to 0		set init to 1	endif	if eval (-1 == ar_Size itemArray) ;shouldn't happen, but just in case		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		removeMe	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(init2 != 1)		set numItems to actorRef.getNumItems		set i to (numItems - 1)		set init2 to 1	endif		if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	else		set frameNum to 0		set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame)	endif	if(DrakeDragonRaceQuest.debug == 1)		if(DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.playMagicShaderVisuals DrakeDEHostileDetectedXR		else			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif	endif	label	if(i >= endi && i >= 0)		set tempItem to actorRef.getInventoryObject i		if((isArmor tempItem == 1) || (isClothing tempItem == 1))			ForEach item <- itemArray				if eval (item["key"] == "original")					Continue				endif				let tagId := item["key"]				let index := ar_Find tempItem itemArray[tagId]				if eval (index != "") ;needs exchange					let tempItem2 := itemArray["original"][index]					set equipped to (actorRef.getEquipped tempItem)					if(equipped == 1)						set slotCode to getEquipmentSlot tempItem						set healthBuffer to actorRef.getEquippedCurrentHealth slotCode					endif					actorRef.removeItemNS tempItem 1					actorRef.addItemNS tempItem2 1					if(equipped == 1)						actorRef.equipItemNS tempItem2						actorRef.setEquippedCurrentHealth healthBuffer slotCode					endif				endif			Loop		endif		set i to (i - 1)		goto	endif	if(i < 0)		set init to 0		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		;remove bodyparts, if present!		ForEach item <- defaultItemArray			ForEach item2 <- item["value"]				let tempItem := item2["value"]				if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem > 0)					actorRef.removeItemNS tempItem (actorRef.getItemCount tempItem)				endif			Loop		Loop		removeMe ;we're done, remove us	endifend


I'll take another look into the token providing spell script and see if it needs any attention as well, but I think these should do already.
Whoever wants to put them into the ESP and try them out for me, feel free to upload the updated ESP somewhere and provide a link in here.
I can't do it myself until my laptop gets repaired unfortunately. :nope:

However, please give me feedback... especially if I made some silly compiler errors in there... I don't have any means to syntax-check these at hand right now.
User avatar
Deon Knight
 
Posts: 3363
Joined: Thu Sep 13, 2007 1:44 am

Post » Fri May 27, 2011 1:40 pm

Good news, Bad news.

Good news; the construction set likes the new quest script, and I'm going to test that out by itself in a moment.

Bad news, I'm getting a "could not compile" on both of the token scripts. Quite frankly, I am too lazy to actually type out what the message said, so you get a screenshot.
http://i317.photobucket.com/albums/mm390/polojilarious/compileerror.jpg
I was getting that error on the race token, and the same error on the reverter token, but on line 101.

And yeah, when you get everything to work, I'll throw up a fixed esp.

EDIT: Tried the quest script out, multi-slot items now work, possibly better than expected. Meaning; the arena raiment scripts work after the swap. You can go into the arena with an adapted mesh.

I'm not sure if you tried anything to change it, but everything stills slows down every couple of seconds when near NPCs.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Fri May 27, 2011 1:48 pm

Thanks for the feedback!

I expected as much. It never worked using a function call as a parameter for another function call, not even when in brackets.
I just wanted to give it a try, as it's less code and less complications, but I guess I better should have believed my own knowledge at that.
Alright, that's not hard to fix though, just needs another temporary variable, no big deal.

I didn't try anything against this stuttering specifically yet, but I replaced a rather complex "ar_Find" call by a rather simple "actorRef.getRace == XXX" comparison. That should save a little bit on FPS, but only really little. However, every little 0.0001 frame per second saved might as well summarize up to some 10 or 20 FPS in the end... whatever you can save is a win.

As for the Arena Raiments script... I can't remember anymore, did I include my little change to this in this mod? I know I did it for SAF and included it in there... so it's not unlikely I also included it here...
You could take a look at the list of changes in the details when you select the plugin from the data files in TES CS. If anything was altered in the arena raiment script, you know why it's working.
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Fri May 27, 2011 4:42 am

And here you go. That should fix it.

Race token script:
scn DrakeDragonRaceTokenScriptref actorRefref actorRaceref actslotContentref oldslotContentref tempItemshort initshort actorFemaleshort switchItemsshort wearsAdaptedshort foundAdaptedshort requirementshort foundRequirementshort currentRequirementshort slotCodeshort index2long frameNumlong slotMasklong tempNumarray_var confArrayarray_var itemArrayarray_var defaultItemArrayarray_var replacerTemplateArrayarray_var slotArrayarray_var repeatArrayarray_var keysArrayarray_var itemarray_var item2string_var indexstring_var tagIdstring_var tagCodestring_var currentlyWearingstring_var shouldBeWearingstring_var slotIdstring_var raceIdfloat healthBufferbegin gameMode	if eval(-1 == ar_Size confArray)		set init to 0	endif	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let confArray := DrakeDragonRaceQuest.confArray		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray		let slotArray := ar_Construct StringMap		let repeatArray := ar_Construct StringMap		set frameNum to 0		set actorFemale to -1		set init to 1	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(actorFemale == -1)		set actorFemale to actorRef.isFemale	endif		if(actorRace != actorRef.getRace)		set actorRace to actorRef.getRace		let confArray := DrakeDragonRaceQuest.confArray		let raceId := ar_Find (actorRef.getRace) confArray["races"]		if eval (raceId != "")			let confArray := confArray[raceId] ;race-specific part of confArray			let keysArray := ar_Keys confArray			ForEach item <- keysArray				let slotId := item["value"]				let slotArray[slotId] := DrakeEmptyItem ;initialize empty				let repeatArray[slotId] := 0			Loop		else			;is not a dragon, remove bodyparts, if present!			ForEach item <- defaultItemArray				ForEach item2 <- item["value"]					let tempItem := item2["value"]					set tempNum to actorRef.getItemCount tempItem					if(tempItem != DrakeEmptyItem && tempNum > 0)						actorRef.removeItemNS tempItem tempNum					endif				Loop			Loop			removeMe ;is not a dragon, should not have this!		endif			endif	if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	endif	if eval (slotId == "" || slotId == ar_Last confArray)		let slotId := ar_First confArray		set frameNum to 0		return ;finished all slots this run	else		let slotId := ar_Next confArray	endif	if(actorRef.getInSameCell player != 1)		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR		endif		set init to 0		removeMe	endif	if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)		actorRef.playMagicShaderVisuals DrakeDEFriendlyDetectedXR	else		actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR	endif		;provide with bodyparts	ForEach item2 <- defaultItemArray[slotId]		let tempItem := item2["value"]		if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1)			actorRef.addItemNS tempItem 1		endif	Loop	let oldslotContent := slotArray[slotId]			;check slot for changes	let slotMask := confArray[slotId]["slotmask"]	set actslotContent to (actorRef.getEquipmentSlotMask slotMask)	if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1)		let index := ""		let index2 := ar_First confArray[slotId]["combinations"]		While eval ((index == "") && (index2 != ar_BadNumericIndex))			let tagId := confArray[slotId]["combinations"][index2]["tag"]			let index := ar_Find oldslotContent itemArray[tagId]			let index2 := ar_Next confArray[slotId]["combinations"] index2		Loop					if eval (index != "") ;needs exchange			if(actorRef.getItemCount oldslotContent > 0)				let tempItem := itemArray["original"][index]				actorRef.removeItemNS oldslotContent 1				actorRef.addItemNS tempItem 1			endif		endif				let shouldBeWearing := "original"		set foundAdapted to 0		set foundRequirement to 0		ForEach item2 <- confArray[slotId]["combinations"]			let tagId := item2["value"]["tag"]			if eval (item2["key"] == ar_Last confArray[slotId]["combinations"])				let tagCode := "_" + tagId			else				let tagCode := "_" + tagId + ".nif"			endif			let requirement := item2["value"]["req"]						if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1)				set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent			else				set wearsAdapted to compareMaleBipedPath $tagCode actslotContent			endif						if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one				set foundAdapted to 1				let currentlyWearing := tagId				set currentRequirement to requirement			endif			if(requirement == 1 && foundRequirement != 1) ;always take the 1st one				set foundRequirement to 1				let shouldBeWearing := tagId			endif		Loop				set switchItems to 0		if(foundAdapted == 1) ;is wearing an adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape					let index := ar_Find actslotContent itemArray[currentlyWearing]					if eval (index != "") ;safety check						let tempItem := itemArray[shouldBeWearing][index]						set switchItems to 1					endif				endif			else ;is wearing adapted item or bodypart but should not				let index := ar_Find actslotContent itemArray[currentlyWearing]				if eval (index != "") ;no bodypart					let tempItem := itemArray["original"][index]					set switchItems to 1				else ;bodypart					set tempItem to 0					set switchItems to 2				endif			endif		else ;not wearing any adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(actslotContent != 0) ;normal clothing					let index := ar_Find actslotContent itemArray["original"]					if eval (index != "") ;already an adapted present						if eval (ar_HasKey itemArray[shouldBeWearing] index)							let tempItem := itemArray[shouldBeWearing][index]						else							let tempItem := itemArray[(ar_Last itemArray)][index]						endif						set switchItems to 1					else ;try to find adapted item						set switchItems to 3					endif				else ;empty					let tempItem := defaultItemArray[slotId][shouldBeWearing]					set switchItems to 2				endif			endif		endif		;handle updates		let repeatArray[slotId] := 0		if(switchItems == 1 && tempItem != 0) ;just swap			set slotCode to getEquipmentSlot actslotContent			set healthBuffer to actorRef.getEquippedCurrentHealth slotCode			actorRef.addItemNS tempItem 1			actorRef.equipItemNS tempItem			actorRef.removeItemNS actslotContent 1			actorRef.setEquippedCurrentHealth healthBuffer slotCode		elseif(switchItems == 2) ;equip bodyparts			if(tempItem == 0)				actorRef.unequipItemNS actslotContent			else				actorRef.equipItemNS tempItem			endif		elseif(switchItems == 3) ;check for presence of alternatives			let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach			ForEach item2 <- confArray[slotId]["combinations"]				let tagId := item2["value"]["tag"]				let tagCode := ".nif|_" + tagId + ".nif"								if(isBipedModelPathValid 0 actslotContent == 1)					copyMaleBipedPath actslotContent DrakeTempItem				else					setMaleBipedPath "empty" DrakeTempItem				endif				modMaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 1 actslotContent == 1)					copyFemaleBipedPath actslotContent DrakeTempItem				else					setFemaleBipedPath "empty" DrakeTempItem				endif				modFemaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender					if eval ((ar_HasKey itemArray["original"] index) == 0)						let itemArray["original"][index] := actslotContent ;do this only once					endif					set tempItem to cloneForm actslotContent					if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist						copyMaleBipedPath DrakeTempItem tempItem					endif					if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist						copyFemaleBipedPath DrakeTempItem tempItem					endif					let itemArray[tagId][index] := tempItem				else ;use replacer templates instead					if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot						if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off							let tempItem := replacerTemplateArray[slotId][tagId]							if(tempItem != DrakeEmptyItem)								if(isBipedModelPathValid 0 tempItem == 1)									copyMaleBipedPath tempItem DrakeTempItem								else									setMaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 1 tempItem == 1)									copyFemaleBipedPath tempItem DrakeTempItem								else									setFemaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender									if eval ((ar_HasKey itemArray["original"] index) == 0)										let itemArray["original"][index] := actslotContent ;do this only once									endif									set tempItem to cloneForm actslotContent									if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist										copyMaleBipedPath DrakeTempItem tempItem									endif									if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist										copyFemaleBipedPath DrakeTempItem tempItem									endif									let itemArray[tagId][index] := tempItem								endif							endif						endif					endif				endif			Loop			if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach				let repeatArray[slotId] := 1 ;do exchange next frame			else ;no adapted clothing found				if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot					if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off						let tempItem := defaultItemArray[slotId][shouldBeWearing]						if(tempItem == 0)							actorRef.unequipItemNS actslotContent						else							actorRef.equipItemNS tempItem						endif					endif				endif			endif		endif	endif	set oldslotContent to (actorRef.getEquipmentSlotMask slotMask)	let slotArray[slotId] := oldslotContentendbegin menuMode 1002 || 1008	if eval(-1 == ar_Size confArray)		set init to 0	endif	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let confArray := DrakeDragonRaceQuest.confArray		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray		let slotArray := ar_Construct StringMap		let repeatArray := ar_Construct StringMap		set frameNum to 0		set actorFemale to -1		set init to 1	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(actorRef.getIsReference player != 1)		return ;NPCs don't need control during MenuMode	endif	if(actorFemale == -1)		set actorFemale to actorRef.isFemale	endif	if(actorRace != actorRef.getRace)		set actorRace to actorRef.getRace		let confArray := DrakeDragonRaceQuest.confArray		let raceId := ar_Find (actorRef.getRace) confArray["races"]		if eval (raceId != "")			let confArray := confArray[raceId] ;race-specific part of confArray			let keysArray := ar_Keys confArray			ForEach item <- keysArray				let slotId := item["value"]				let slotArray[slotId] := DrakeEmptyItem ;initialize empty				let repeatArray[slotId] := 0			Loop		else			;is not a dragon, remove bodyparts, if present!			ForEach item <- defaultItemArray				ForEach item2 <- item["value"]					let tempItem := item2["value"]					set tempNum to actorRef.getItemCount tempItem					if(tempItem != DrakeEmptyItem && tempNum > 0)						actorRef.removeItemNS tempItem tempNum					endif				Loop			Loop			removeMe ;is not a dragon, should not have this!		endif			endif	if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	endif	if eval (slotId == "" || slotId == ar_Last confArray)		let slotId := ar_First confArray		set frameNum to 0		return ;finished all slots this run	else		let slotId := ar_Next confArray	endif	if(actorRef.getInSameCell player != 1)		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR		endif		set init to 0		removeMe	endif	;provide with bodyparts	ForEach item2 <- defaultItemArray[slotId]		let tempItem := item2["value"]		if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1)			actorRef.addItemNS tempItem 1		endif	Loop	let oldslotContent := slotArray[slotId]			;check slot for changes	let slotMask := confArray[slotId]["slotmask"]	set actslotContent to (actorRef.getEquipmentSlotMask slotMask)	if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1)		let index := ""		let index2 := ar_First confArray[slotId]["combinations"]		While eval ((index == "") && (index2 != ar_BadNumericIndex))			let tagId := confArray[slotId]["combinations"][index2]["tag"]			let index := ar_Find oldslotContent itemArray[tagId]			let index2 := ar_Next confArray[slotId]["combinations"] index2		Loop					if eval (index != "") ;needs exchange			if(actorRef.getItemCount oldslotContent > 0)				let tempItem := itemArray["original"][index]				actorRef.removeItemNS oldslotContent 1				actorRef.addItemNS tempItem 1			endif		endif				let shouldBeWearing := "original"		set foundAdapted to 0		set foundRequirement to 0		ForEach item2 <- confArray[slotId]["combinations"]			let tagId := item2["value"]["tag"]			if eval (item2["key"] == ar_Last confArray[slotId]["combinations"])				let tagCode := "_" + tagId			else				let tagCode := "_" + tagId + ".nif"			endif			let requirement := item2["value"]["req"]						if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1)				set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent			else				set wearsAdapted to compareMaleBipedPath $tagCode actslotContent			endif						if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one				set foundAdapted to 1				let currentlyWearing := tagId				set currentRequirement to requirement			endif			if(requirement == 1 && foundRequirement != 1) ;always take the 1st one				set foundRequirement to 1				let shouldBeWearing := tagId			endif		Loop				set switchItems to 0		if(foundAdapted == 1) ;is wearing an adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape					let index := ar_Find actslotContent itemArray[currentlyWearing]					if eval (index != "") ;safety check						let tempItem := itemArray[shouldBeWearing][index]						set switchItems to 1					endif				endif			else ;is wearing adapted item or bodypart but should not				let index := ar_Find actslotContent itemArray[currentlyWearing]				if eval (index != "") ;no bodypart					let tempItem := itemArray["original"][index]					set switchItems to 1				else ;bodypart					set tempItem to 0					set switchItems to 2				endif			endif		else ;not wearing any adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(actslotContent != 0) ;normal clothing					let index := ar_Find actslotContent itemArray["original"]					if eval (index != "") ;already an adapted present						if eval (ar_HasKey itemArray[shouldBeWearing] index)							let tempItem := itemArray[shouldBeWearing][index]						else							let tempItem := itemArray[(ar_Last itemArray)][index]						endif						set switchItems to 1					else ;try to find adapted item						set switchItems to 3					endif				else ;empty					let tempItem := defaultItemArray[slotId][shouldBeWearing]					set switchItems to 2				endif			endif		endif		;handle updates		let repeatArray[slotId] := 0		if(switchItems == 1 && tempItem != 0) ;just swap			set slotCode to getEquipmentSlot actslotContent			set healthBuffer to actorRef.getEquippedCurrentHealth slotCode			actorRef.addItemNS tempItem 1			actorRef.equipItemNS tempItem			actorRef.removeItemNS actslotContent 1			actorRef.setEquippedCurrentHealth healthBuffer slotCode		elseif(switchItems == 2) ;equip bodyparts			if(tempItem == 0)				actorRef.unequipItemNS actslotContent			else				actorRef.equipItemNS tempItem			endif		elseif(switchItems == 3) ;check for presence of alternatives			let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach			ForEach item2 <- confArray[slotId]["combinations"]				let tagId := item2["value"]["tag"]				let tagCode := ".nif|_" + tagId + ".nif"								if(isBipedModelPathValid 0 actslotContent == 1)					copyMaleBipedPath actslotContent DrakeTempItem				else					setMaleBipedPath "empty" DrakeTempItem				endif				modMaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 1 actslotContent == 1)					copyFemaleBipedPath actslotContent DrakeTempItem				else					setFemaleBipedPath "empty" DrakeTempItem				endif				modFemaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender					if eval ((ar_HasKey itemArray["original"] index) == 0)						let itemArray["original"][index] := actslotContent ;do this only once					endif					set tempItem to cloneForm actslotContent					if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist						copyMaleBipedPath DrakeTempItem tempItem					endif					if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist						copyFemaleBipedPath DrakeTempItem tempItem					endif					let itemArray[tagId][index] := tempItem				else ;use replacer templates instead					if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot						if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off							let tempItem := replacerTemplateArray[slotId][tagId]							if(tempItem != DrakeEmptyItem)								if(isBipedModelPathValid 0 tempItem == 1)									copyMaleBipedPath tempItem DrakeTempItem								else									setMaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 1 tempItem == 1)									copyFemaleBipedPath tempItem DrakeTempItem								else									setFemaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender									if eval ((ar_HasKey itemArray["original"] index) == 0)										let itemArray["original"][index] := actslotContent ;do this only once									endif									set tempItem to cloneForm actslotContent									if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist										copyMaleBipedPath DrakeTempItem tempItem									endif									if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist										copyFemaleBipedPath DrakeTempItem tempItem									endif									let itemArray[tagId][index] := tempItem								endif							endif						endif					endif				endif			Loop			if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach				let repeatArray[slotId] := 1 ;do exchange next frame			else ;no adapted clothing found				if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot					if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off						let tempItem := defaultItemArray[slotId][shouldBeWearing]						if(tempItem == 0)							actorRef.unequipItemNS actslotContent						else							actorRef.equipItemNS tempItem						endif					endif				endif			endif		endif	endif	set oldslotContent to (actorRef.getEquipmentSlotMask slotMask)	let slotArray[slotId] := oldslotContentend


Race reverter token script:
scn DrakeDragonRaceReverterTokenScriptref actorRefref tempItemref tempItem2array_var itemarray_var item2long numItemslong endilong ilong tempNumstring_var tagIdstring_var indexlong frameNumarray_var itemArrayarray_var defaultItemArrayshort equippedshort initshort init2float healthBuffershort slotCodebegin menuMode 1002 || 1008	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		set frameNum to 0		set init2 to 0		set init to 1	endif	if eval (-1 == ar_Size itemArray) ;shouldn't happen, but just in case		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		removeMe	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(init2 != 1)		set numItems to actorRef.getNumItems		set i to (numItems - 1)		set init2 to 1	endif		if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	else		set frameNum to 0		set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame)	endif	label	if(i >= endi && i >= 0)		set tempItem to actorRef.getInventoryObject i		if((isArmor tempItem == 1) || (isClothing tempItem == 1))			ForEach item <- itemArray				if eval (item["key"] == "original")					Continue				endif				let tagId := item["key"]				let index := ar_Find tempItem itemArray[tagId]				if eval (index != "") ;needs exchange					let tempItem2 := itemArray["original"][index]					set equipped to (actorRef.getEquipped tempItem)					if(equipped == 1)						set slotCode to getEquipmentSlot tempItem						set healthBuffer to actorRef.getEquippedCurrentHealth slotCode					endif					actorRef.removeItemNS tempItem 1					actorRef.addItemNS tempItem2 1					if(equipped == 1)						actorRef.equipItemNS tempItem2						actorRef.setEquippedCurrentHealth healthBuffer slotCode					endif				endif			Loop		endif		set i to (i - 1)		goto	endif	if(i < 0)		set init to 0		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		;remove bodyparts, if present!		ForEach item <- defaultItemArray			ForEach item2 <- item["value"]				let tempItem := item2["value"]				set tempNum to actorRef.getItemCount tempItem				if(tempItem != DrakeEmptyItem && tempNum > 0)					actorRef.removeItemNS tempItem tempNum				endif			Loop		Loop		removeMe ;we're done, remove us	endifendbegin gameMode	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		set frameNum to 0		set init2 to 0		set init to 1	endif	if eval (-1 == ar_Size itemArray) ;shouldn't happen, but just in case		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		removeMe	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(init2 != 1)		set numItems to actorRef.getNumItems		set i to (numItems - 1)		set init2 to 1	endif		if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	else		set frameNum to 0		set endi to (i - DrakeDragonRaceQuest.itemsRevertPerFrame)	endif	if(DrakeDragonRaceQuest.debug == 1)		if(DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.playMagicShaderVisuals DrakeDEHostileDetectedXR		else			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif	endif	label	if(i >= endi && i >= 0)		set tempItem to actorRef.getInventoryObject i		if((isArmor tempItem == 1) || (isClothing tempItem == 1))			ForEach item <- itemArray				if eval (item["key"] == "original")					Continue				endif				let tagId := item["key"]				let index := ar_Find tempItem itemArray[tagId]				if eval (index != "") ;needs exchange					let tempItem2 := itemArray["original"][index]					set equipped to (actorRef.getEquipped tempItem)					if(equipped == 1)						set slotCode to getEquipmentSlot tempItem						set healthBuffer to actorRef.getEquippedCurrentHealth slotCode					endif					actorRef.removeItemNS tempItem 1					actorRef.addItemNS tempItem2 1					if(equipped == 1)						actorRef.equipItemNS tempItem2						actorRef.setEquippedCurrentHealth healthBuffer slotCode					endif				endif			Loop		endif		set i to (i - 1)		goto	endif	if(i < 0)		set init to 0		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRevToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEHostileDetectedXR		endif		;remove bodyparts, if present!		ForEach item <- defaultItemArray			ForEach item2 <- item["value"]				let tempItem := item2["value"]				set tempNum to actorRef.getItemCount tempItem				if(tempItem != DrakeEmptyItem && tempNum > 0)					actorRef.removeItemNS tempItem tempNum				endif			Loop		Loop		removeMe ;we're done, remove us	endifend


I hope I didn't make any mistakes this time. It's hard to fly blind...

If everything's working now, we might have also got rid of the stuttering.
Now I splitted the whole algorithm up into 1-slot-per-frame, then it waits N frames to start over. I also realized previously there was a ForEach loop over all slots once to check presence of all defaultItems (body parts), and then a second time each run to do the actual work... why I did this then is beyond me now... but this time there's only 1 loop for both and this loop is even distributed over several frames, 1 step PER frame, not ALL steps EACH frame anymore.
I would be quite surprised when this won't have any effect on framerate!

Now give it a try and me some feedback again... I hope all's well this time.
User avatar
Nick Swan
 
Posts: 3511
Joined: Sat Dec 01, 2007 1:34 pm

Post » Fri May 27, 2011 1:14 pm

The construction set now likes the reverter token scripts, but still getting an error with the race token script.
http://i317.photobucket.com/albums/mm390/polojilarious/racetokenerror.jpg

I'm a little worried about running Oblivion with only one token script, but the worst thing that could happen is a crash to desktop, right? I'll test out the reverter token scripts with the racequest ones in a bit.
User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Fri May 27, 2011 7:06 am

Alright. It took me some time to figure that one out.
Apparently "Error line 107: Missing required parameter 'ar_Next' for parameter #'3'" translated into common sense means as much as "The function 'ar_Next' in line 107 is missing its required 3rd parameter".
I guarantee you, a few more of these and I will be able to read the tongue the TES CS is speaking fluently! :grad:

Anyways, I should have known this parameter would be missing, although I never used this function before nor did I have the OBSE manual at hand while writing these new lines.
However, from the not-so-little I know about OBSE's functions already I really shouldn't have expected a behavior similar to a function in C or an other programming language.
OBSE's functionality is most times really straight forward, easy to understand, easy to use.
What made me think these functions would, like their counterparts in other languages, have an internal pointer pointing at the current index of the array and when I call "next" it will iterate forwards one step and return the new index?... Of course I instead have to tell this function what the current index IS for it to be able to return the NEXT one!

Oh well, here's the fixed script. Hopefully this one will do now!
scn DrakeDragonRaceTokenScriptref actorRefref actorRaceref actslotContentref oldslotContentref tempItemshort initshort actorFemaleshort switchItemsshort wearsAdaptedshort foundAdaptedshort requirementshort foundRequirementshort currentRequirementshort slotCodeshort index2long frameNumlong slotMasklong tempNumarray_var confArrayarray_var itemArrayarray_var defaultItemArrayarray_var replacerTemplateArrayarray_var slotArrayarray_var repeatArrayarray_var keysArrayarray_var itemarray_var item2string_var indexstring_var tagIdstring_var tagCodestring_var currentlyWearingstring_var shouldBeWearingstring_var slotIdstring_var raceIdfloat healthBufferbegin gameMode	if eval(-1 == ar_Size confArray)		set init to 0	endif	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let confArray := DrakeDragonRaceQuest.confArray		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray		let slotArray := ar_Construct StringMap		let repeatArray := ar_Construct StringMap		set frameNum to 0		set actorFemale to -1		set init to 1	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(actorFemale == -1)		set actorFemale to actorRef.isFemale	endif		if(actorRace != actorRef.getRace)		set actorRace to actorRef.getRace		let confArray := DrakeDragonRaceQuest.confArray		let raceId := ar_Find (actorRef.getRace) confArray["races"]		if eval (raceId != "")			let confArray := confArray[raceId] ;race-specific part of confArray			let keysArray := ar_Keys confArray			ForEach item <- keysArray				let slotId := item["value"]				let slotArray[slotId] := DrakeEmptyItem ;initialize empty				let repeatArray[slotId] := 0			Loop		else			;is not a dragon, remove bodyparts, if present!			ForEach item <- defaultItemArray				ForEach item2 <- item["value"]					let tempItem := item2["value"]					set tempNum to actorRef.getItemCount tempItem					if(tempItem != DrakeEmptyItem && tempNum > 0)						actorRef.removeItemNS tempItem tempNum					endif				Loop			Loop			removeMe ;is not a dragon, should not have this!		endif			endif	if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	endif	if eval (slotId == "" || slotId == ar_Last confArray)		let slotId := ar_First confArray		set frameNum to 0		return ;finished all slots this run	else		let slotId := ar_Next confArray slotId	endif	if(actorRef.getInSameCell player != 1)		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR		endif		set init to 0		removeMe	endif	if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)		actorRef.playMagicShaderVisuals DrakeDEFriendlyDetectedXR	else		actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR	endif		;provide with bodyparts	ForEach item2 <- defaultItemArray[slotId]		let tempItem := item2["value"]		if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1)			actorRef.addItemNS tempItem 1		endif	Loop	let oldslotContent := slotArray[slotId]			;check slot for changes	let slotMask := confArray[slotId]["slotmask"]	set actslotContent to (actorRef.getEquipmentSlotMask slotMask)	if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1)		let index := ""		let index2 := ar_First confArray[slotId]["combinations"]		While eval ((index == "") && (index2 != ar_BadNumericIndex))			let tagId := confArray[slotId]["combinations"][index2]["tag"]			let index := ar_Find oldslotContent itemArray[tagId]			let index2 := ar_Next confArray[slotId]["combinations"] index2		Loop					if eval (index != "") ;needs exchange			if(actorRef.getItemCount oldslotContent > 0)				let tempItem := itemArray["original"][index]				actorRef.removeItemNS oldslotContent 1				actorRef.addItemNS tempItem 1			endif		endif				let shouldBeWearing := "original"		set foundAdapted to 0		set foundRequirement to 0		ForEach item2 <- confArray[slotId]["combinations"]			let tagId := item2["value"]["tag"]			if eval (item2["key"] == ar_Last confArray[slotId]["combinations"])				let tagCode := "_" + tagId			else				let tagCode := "_" + tagId + ".nif"			endif			let requirement := item2["value"]["req"]						if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1)				set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent			else				set wearsAdapted to compareMaleBipedPath $tagCode actslotContent			endif						if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one				set foundAdapted to 1				let currentlyWearing := tagId				set currentRequirement to requirement			endif			if(requirement == 1 && foundRequirement != 1) ;always take the 1st one				set foundRequirement to 1				let shouldBeWearing := tagId			endif		Loop				set switchItems to 0		if(foundAdapted == 1) ;is wearing an adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape					let index := ar_Find actslotContent itemArray[currentlyWearing]					if eval (index != "") ;safety check						let tempItem := itemArray[shouldBeWearing][index]						set switchItems to 1					endif				endif			else ;is wearing adapted item or bodypart but should not				let index := ar_Find actslotContent itemArray[currentlyWearing]				if eval (index != "") ;no bodypart					let tempItem := itemArray["original"][index]					set switchItems to 1				else ;bodypart					set tempItem to 0					set switchItems to 2				endif			endif		else ;not wearing any adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(actslotContent != 0) ;normal clothing					let index := ar_Find actslotContent itemArray["original"]					if eval (index != "") ;already an adapted present						if eval (ar_HasKey itemArray[shouldBeWearing] index)							let tempItem := itemArray[shouldBeWearing][index]						else							let tempItem := itemArray[(ar_Last itemArray)][index]						endif						set switchItems to 1					else ;try to find adapted item						set switchItems to 3					endif				else ;empty					let tempItem := defaultItemArray[slotId][shouldBeWearing]					set switchItems to 2				endif			endif		endif		;handle updates		let repeatArray[slotId] := 0		if(switchItems == 1 && tempItem != 0) ;just swap			set slotCode to getEquipmentSlot actslotContent			set healthBuffer to actorRef.getEquippedCurrentHealth slotCode			actorRef.addItemNS tempItem 1			actorRef.equipItemNS tempItem			actorRef.removeItemNS actslotContent 1			actorRef.setEquippedCurrentHealth healthBuffer slotCode		elseif(switchItems == 2) ;equip bodyparts			if(tempItem == 0)				actorRef.unequipItemNS actslotContent			else				actorRef.equipItemNS tempItem			endif		elseif(switchItems == 3) ;check for presence of alternatives			let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach			ForEach item2 <- confArray[slotId]["combinations"]				let tagId := item2["value"]["tag"]				let tagCode := ".nif|_" + tagId + ".nif"								if(isBipedModelPathValid 0 actslotContent == 1)					copyMaleBipedPath actslotContent DrakeTempItem				else					setMaleBipedPath "empty" DrakeTempItem				endif				modMaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 1 actslotContent == 1)					copyFemaleBipedPath actslotContent DrakeTempItem				else					setFemaleBipedPath "empty" DrakeTempItem				endif				modFemaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender					if eval ((ar_HasKey itemArray["original"] index) == 0)						let itemArray["original"][index] := actslotContent ;do this only once					endif					set tempItem to cloneForm actslotContent					if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist						copyMaleBipedPath DrakeTempItem tempItem					endif					if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist						copyFemaleBipedPath DrakeTempItem tempItem					endif					let itemArray[tagId][index] := tempItem				else ;use replacer templates instead					if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot						if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off							let tempItem := replacerTemplateArray[slotId][tagId]							if(tempItem != DrakeEmptyItem)								if(isBipedModelPathValid 0 tempItem == 1)									copyMaleBipedPath tempItem DrakeTempItem								else									setMaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 1 tempItem == 1)									copyFemaleBipedPath tempItem DrakeTempItem								else									setFemaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender									if eval ((ar_HasKey itemArray["original"] index) == 0)										let itemArray["original"][index] := actslotContent ;do this only once									endif									set tempItem to cloneForm actslotContent									if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist										copyMaleBipedPath DrakeTempItem tempItem									endif									if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist										copyFemaleBipedPath DrakeTempItem tempItem									endif									let itemArray[tagId][index] := tempItem								endif							endif						endif					endif				endif			Loop			if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach				let repeatArray[slotId] := 1 ;do exchange next frame			else ;no adapted clothing found				if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot					if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off						let tempItem := defaultItemArray[slotId][shouldBeWearing]						if(tempItem == 0)							actorRef.unequipItemNS actslotContent						else							actorRef.equipItemNS tempItem						endif					endif				endif			endif		endif	endif	set oldslotContent to (actorRef.getEquipmentSlotMask slotMask)	let slotArray[slotId] := oldslotContentendbegin menuMode 1002 || 1008	if eval(-1 == ar_Size confArray)		set init to 0	endif	if(init != 1)		set actorRef to 0		if(DrakeDragonRaceQuest.init != 1)			return		endif		let confArray := DrakeDragonRaceQuest.confArray		let itemArray := DrakeDragonRaceQuest.itemArray		let defaultItemArray := DrakeDragonRaceQuest.defaultItemArray		let replacerTemplateArray := DrakeDragonRaceQuest.replacerTemplateArray		let slotArray := ar_Construct StringMap		let repeatArray := ar_Construct StringMap		set frameNum to 0		set actorFemale to -1		set init to 1	endif	if(actorRef == 0)		set actorRef to getContainer		return	endif	if(actorRef.getIsReference player != 1)		return ;NPCs don't need control during MenuMode	endif	if(actorFemale == -1)		set actorFemale to actorRef.isFemale	endif	if(actorRace != actorRef.getRace)		set actorRace to actorRef.getRace		let confArray := DrakeDragonRaceQuest.confArray		let raceId := ar_Find (actorRef.getRace) confArray["races"]		if eval (raceId != "")			let confArray := confArray[raceId] ;race-specific part of confArray			let keysArray := ar_Keys confArray			ForEach item <- keysArray				let slotId := item["value"]				let slotArray[slotId] := DrakeEmptyItem ;initialize empty				let repeatArray[slotId] := 0			Loop		else			;is not a dragon, remove bodyparts, if present!			ForEach item <- defaultItemArray				ForEach item2 <- item["value"]					let tempItem := item2["value"]					set tempNum to actorRef.getItemCount tempItem					if(tempItem != DrakeEmptyItem && tempNum > 0)						actorRef.removeItemNS tempItem tempNum					endif				Loop			Loop			removeMe ;is not a dragon, should not have this!		endif			endif	if(frameNum < DrakeDragonRaceQuest.framesToSkip)		set frameNum to (frameNum + 1)		return ;dont run every frame	endif	if eval (slotId == "" || slotId == ar_Last confArray)		let slotId := ar_First confArray		set frameNum to 0		return ;finished all slots this run	else		let slotId := ar_Next confArray slotId	endif	if(actorRef.getInSameCell player != 1)		if(DrakeDragonRaceQuest.debug == 1 && DrakeDragonRaceQuest.debugShowRaceToken == 1)			actorRef.stopMagicShaderVisuals DrakeDEFriendlyDetectedXR		endif		set init to 0		removeMe	endif	;provide with bodyparts	ForEach item2 <- defaultItemArray[slotId]		let tempItem := item2["value"]		if(tempItem != DrakeEmptyItem && actorRef.getItemCount tempItem < 1)			actorRef.addItemNS tempItem 1		endif	Loop	let oldslotContent := slotArray[slotId]			;check slot for changes	let slotMask := confArray[slotId]["slotmask"]	set actslotContent to (actorRef.getEquipmentSlotMask slotMask)	if eval (actslotContent != oldslotContent || repeatArray[slotId] == 1)		let index := ""		let index2 := ar_First confArray[slotId]["combinations"]		While eval ((index == "") && (index2 != ar_BadNumericIndex))			let tagId := confArray[slotId]["combinations"][index2]["tag"]			let index := ar_Find oldslotContent itemArray[tagId]			let index2 := ar_Next confArray[slotId]["combinations"] index2		Loop					if eval (index != "") ;needs exchange			if(actorRef.getItemCount oldslotContent > 0)				let tempItem := itemArray["original"][index]				actorRef.removeItemNS oldslotContent 1				actorRef.addItemNS tempItem 1			endif		endif				let shouldBeWearing := "original"		set foundAdapted to 0		set foundRequirement to 0		ForEach item2 <- confArray[slotId]["combinations"]			let tagId := item2["value"]["tag"]			if eval (item2["key"] == ar_Last confArray[slotId]["combinations"])				let tagCode := "_" + tagId			else				let tagCode := "_" + tagId + ".nif"			endif			let requirement := item2["value"]["req"]						if(actorFemale == 1 && isBipedModelPathValid 1 actslotContent == 1)				set wearsAdapted to compareFemaleBipedPath $tagCode actslotContent			else				set wearsAdapted to compareMaleBipedPath $tagCode actslotContent			endif						if(wearsAdapted == 1 && foundAdapted != 1) ;always take the 1st one				set foundAdapted to 1				let currentlyWearing := tagId				set currentRequirement to requirement			endif			if(requirement == 1 && foundRequirement != 1) ;always take the 1st one				set foundRequirement to 1				let shouldBeWearing := tagId			endif		Loop				set switchItems to 0		if(foundAdapted == 1) ;is wearing an adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(currentRequirement == 0) ;in case of shape shifting races and worn adapted item not fitting selected shape					let index := ar_Find actslotContent itemArray[currentlyWearing]					if eval (index != "") ;safety check						let tempItem := itemArray[shouldBeWearing][index]						set switchItems to 1					endif				endif			else ;is wearing adapted item or bodypart but should not				let index := ar_Find actslotContent itemArray[currentlyWearing]				if eval (index != "") ;no bodypart					let tempItem := itemArray["original"][index]					set switchItems to 1				else ;bodypart					set tempItem to 0					set switchItems to 2				endif			endif		else ;not wearing any adapted item			if(foundRequirement == 1) ;only if slot in question should be controlled according to selected shape				if(actslotContent != 0) ;normal clothing					let index := ar_Find actslotContent itemArray["original"]					if eval (index != "") ;already an adapted present						if eval (ar_HasKey itemArray[shouldBeWearing] index)							let tempItem := itemArray[shouldBeWearing][index]						else							let tempItem := itemArray[(ar_Last itemArray)][index]						endif						set switchItems to 1					else ;try to find adapted item						set switchItems to 3					endif				else ;empty					let tempItem := defaultItemArray[slotId][shouldBeWearing]					set switchItems to 2				endif			endif		endif		;handle updates		let repeatArray[slotId] := 0		if(switchItems == 1 && tempItem != 0) ;just swap			set slotCode to getEquipmentSlot actslotContent			set healthBuffer to actorRef.getEquippedCurrentHealth slotCode			actorRef.addItemNS tempItem 1			actorRef.equipItemNS tempItem			actorRef.removeItemNS actslotContent 1			actorRef.setEquippedCurrentHealth healthBuffer slotCode		elseif(switchItems == 2) ;equip bodyparts			if(tempItem == 0)				actorRef.unequipItemNS actslotContent			else				actorRef.equipItemNS tempItem			endif		elseif(switchItems == 3) ;check for presence of alternatives			let index := $(ar_Size itemArray["original"]) ;prepare this outside of foreach			ForEach item2 <- confArray[slotId]["combinations"]				let tagId := item2["value"]["tag"]				let tagCode := ".nif|_" + tagId + ".nif"								if(isBipedModelPathValid 0 actslotContent == 1)					copyMaleBipedPath actslotContent DrakeTempItem				else					setMaleBipedPath "empty" DrakeTempItem				endif				modMaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 1 actslotContent == 1)					copyFemaleBipedPath actslotContent DrakeTempItem				else					setFemaleBipedPath "empty" DrakeTempItem				endif				modFemaleBipedPath $tagCode DrakeTempItem				if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;adapted clothing exists for at least one gender					if eval ((ar_HasKey itemArray["original"] index) == 0)						let itemArray["original"][index] := actslotContent ;do this only once					endif					set tempItem to cloneForm actslotContent					if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist						copyMaleBipedPath DrakeTempItem tempItem					endif					if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist						copyFemaleBipedPath DrakeTempItem tempItem					endif					let itemArray[tagId][index] := tempItem				else ;use replacer templates instead					if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot						if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off							let tempItem := replacerTemplateArray[slotId][tagId]							if(tempItem != DrakeEmptyItem)								if(isBipedModelPathValid 0 tempItem == 1)									copyMaleBipedPath tempItem DrakeTempItem								else									setMaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 1 tempItem == 1)									copyFemaleBipedPath tempItem DrakeTempItem								else									setFemaleBipedPath "empty" DrakeTempItem								endif								if(isBipedModelPathValid 0 DrakeTempItem == 1 || isBipedModelPathValid 1 DrakeTempItem == 1) ;replacer template exists for at least one gender									if eval ((ar_HasKey itemArray["original"] index) == 0)										let itemArray["original"][index] := actslotContent ;do this only once									endif									set tempItem to cloneForm actslotContent									if(isBipedModelPathValid 0 DrakeTempItem == 1) ; male does exist										copyMaleBipedPath DrakeTempItem tempItem									endif									if(isBipedModelPathValid 1 DrakeTempItem == 1) ; female does exist										copyFemaleBipedPath DrakeTempItem tempItem									endif									let itemArray[tagId][index] := tempItem								endif							endif						endif					endif				endif			Loop			if eval (ar_HasKey itemArray["original"] index) ;at least 1 adapted clothing was found during foreach				let repeatArray[slotId] := 1 ;do exchange next frame			else ;no adapted clothing found				if eval (confArray[slotId]["forced"] == 1) ;forced unequipping for this slot					if eval (getBipedSlotMask actslotContent == slotMask || DrakeDragonRaceQuest.forcecombined == 1) ;must not be a combined-slot item or combined-slot items exception must be turned off						let tempItem := defaultItemArray[slotId][shouldBeWearing]						if(tempItem == 0)							actorRef.unequipItemNS actslotContent						else							actorRef.equipItemNS tempItem						endif					endif				endif			endif		endif	endif	set oldslotContent to (actorRef.getEquipmentSlotMask slotMask)	let slotArray[slotId] := oldslotContentend


Oh and to answer your question, RIF (hope you don't mind me appreviating it), it shouldn't hurt when the race tokens' scripts don't work... there just won't be any dragons... that's all.
But because this is besides the point of the mod in general, it's better to have the race tokens working properly of cause.


P.S.: I can't wait to get my hands on the new OBSE v0018 functions... especially the animation-related ones really make me curious now! :hubbahubba:
User avatar
Kayleigh Williams
 
Posts: 3397
Joined: Wed Aug 23, 2006 10:41 am

Post » Fri May 27, 2011 3:03 pm

The Construction set doesn't find errors with the script, but we now have a new problem. Items don't get swapped (or forced) at all anymore. And there's still the slowdown every couple of seconds. I have everything set to default.

One step forward, two steps back, eh?

Edit; I don't mind you abbreviating the name. Most places don't even let me have a nick this long, and I have to go with some variant of RIF. As for the crash expectancy, I've had crashes from the most random things, I've learned that it's generally a good idea to assume a crash is a possibility whenever testing things.
User avatar
lolly13
 
Posts: 3349
Joined: Tue Jul 25, 2006 11:36 am

Post » Fri May 27, 2011 1:09 pm

Hmm... not working at all anymore now, eh? :banghead:

I'm afraid this will take a while longer to figure out now... I can't even go ingame and use the debug measures I implemented to locate the exact point of failure as I usually would... and no, I doubt it would work to guide someone through this step-by-step... heck, I don't even know where to start! I need to play myself to get the ideas...

Maybe by tomorrow I will have an idea what possibly could be a cause... if it's a mistake in my code, it should be easy to anolyze... but if it's something like the script dying at a certain point, I'm afraid there's no easy way for me to realize this... especially without the possibility to use the CS and the game.
I would usually start by anolyzing runtime behavior of the scripts to locate the exact point in execution where it breaks down... but again this will never work without me playing!
So it's just random guessing and a hell of a lot of luck which could possibly help me solve this particular issue now... I'm sorry. :nope:
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am

Post » Fri May 27, 2011 4:57 pm

How is the computer coming along drake? I am really looking foreword to playing this race.
User avatar
Queen Bitch
 
Posts: 3312
Joined: Fri Dec 15, 2006 2:43 pm

Post » Fri May 27, 2011 10:24 am

*facepalm*

Duh. Despite not knowing how to do a full debug like you'd be able to, I can still run the token debug. Interesting results.
http://i317.photobucket.com/albums/mm390/polojilarious/debugresults.jpg
Apparently, somewhere along the way I didn't get a token.

I hope this narrows down the search a bit.
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Fri May 27, 2011 1:33 am

Hey there Drake. Your mod basicaly inspired me to get Oblivion just so I could use your dragon race. I'm having a world of trouble with it, despite the fact I've dealt with complicated mods and all manner of computer issues before; I'm fairly pc literate. I was wondering if you might use some sort of instant messenger service I could use to contact you? I've looked through here and not found anyone having the same issues I am. Thanks!
User avatar
Julie Ann
 
Posts: 3383
Joined: Thu Aug 23, 2007 5:17 am

Post » Fri May 27, 2011 2:34 am

How is the computer coming along drake? I am really looking foreword to playing this race.

To answer your question, the parcel service fetched it this morning, so it should be on its way to Dell right now. I can only hope they find the faulty component (or, god beware, components) and will be able to fix it.
Then it should only be a matter of weeks or months till I'll get it back... I don't know... for 4 years now I never had to send my laptop in once!
Guess it just had to happen now...

Hey there Drake. Your mod basicaly inspired me to get Oblivion just so I could use your dragon race. I'm having a world of trouble with it, despite the fact I've dealt with complicated mods and all manner of computer issues before; I'm fairly pc literate. I was wondering if you might use some sort of instant messenger service I could use to contact you? I've looked through here and not found anyone having the same issues I am. Thanks!

While I have a Skype account and mostly will be online the whole day (that is 12PM to 6AM here in Germany, GMT+1), most of the time I will be occupied working for my part-time job, although Skype certainly will tell otherwise (online and available for chat). This is for business contacts mainly during this time.
Actually "available" I could be in the night, after 3AM, but not always, as sometimes I'm also working then still.

I can always help with knowledge, advice or instructions... but apart from that I can't do anything else at the moment... without my laptop or even access to the files...
However, you can always post your issues right here, for me and all the others to help you ruling them out.
After all that's the purpose of this thread, isn't it?


RIF, this is really valuable information, thank you yet again.
I'm hesitant to believe you really didn't get a race token though. If I could I would find out the FormId of the race tokens and check it with a "player.getItemCount xxx" call in the console to be sure.
I think the fault must be somewhere along the lines of the conditions to proceed into the inner spheres of the code, those parts I recently altered significantly.
I'm thinking this because the actual code for applying the debug shaders to you is inside the inner sphere as well, so when those conditions don't meet you won't get the shader effects playing either.
That's way more likely than the token-providing code suddenly failing out of nowhere... though it still could be that one as well...
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Fri May 27, 2011 7:13 am

Is there anything I can do to help wile the computer is away? Run debugs or what not? Course I am not sure how to...plus its early in the morning and I got two hours of sleep.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Fri May 27, 2011 1:40 pm

I know that situation. :hubbahubba:

Well, in all honesty I can't really tell how exactly anybody could help me. When the beta's finally out and working flawlessly I can reread all offers and contact the posters if they're still interested, so the race would become a little bit more fleshed-out once it's available for everyone.

What you always could do however would be play-testing my releases (with the proper precautions of course, as they're obviously not yet finished) and reporting me any bugs, malfunctions, issues or similar findings you stumble upon. While it's a pain to hear of these while being unable to do anything against it, it's still the most vital part of development. Apparently all issues reported till now didn't happen on my system for some strange and unknown cause... so I depend on your feedback to find them and rule them out.

Whenever I post a revised script you could go and replace the old one in the plugin with the new one (a really most easy task in the CS) and give it a short (or more detailed, if you like) try ingame and report back with all problems and issues still left or even just created by it.
If anybody reports an issue, bug, flaw or whatever, it also can't hurt to have somebody else copy this find (or negate, this could happen, too, of course).

And in general the more feedback and the more detailed information I receive from these testings, the easier it will be for me to find the cause and rule it out.
Being unable to test things myself or even to alter my plugin in any way (heck, I can't even give it a quick look to recall how I designed certain things) working with you as my testers and your feedback as the results is the only way for this project to make any progress currently.

Oh, and on a completely different account, if there are any modders capable of modeling items and eager/willing to adapt a few clothing/armor items from other mods (with the proper permissions for later release of course), using the latest state of the art of my meshes as included in the beta release, this would help immensely to make the mod more usable for you and all others. The more adapted meshes are available the more likely it is your own favorite set is among them.

What of course also always stays valid is that you can request/recommend/suggest everything you think might be a nice/useful/interesting feature or aspect to be added in the future. If nothing else, then it will at least definitely fuel my inspiration for new things to come.
Pictures of your chars using my race are also always welcome, to exactly the same purpose. B)
User avatar
CArlos BArrera
 
Posts: 3470
Joined: Wed Nov 21, 2007 3:26 am

Post » Fri May 27, 2011 3:30 pm

Just a quick update:

I got feedback from Dell today. Seems there was a lot more damaged than I initially expected.

They replaced the graphics card (said something along the lines of "inevitable step as it was very close to total death"), diagnosed the fan my brother repaired by thoroughly cleaning its interiors as "fully functional", and then reported a "damaged hard-drive" as well as "DVD-drive" to the customer-service, which then called me to ask if I want these to be replaced as well for additional 110? round-about...

Oh well, now that I sent it in once I of course want it fully repaired and faultlessly working again... so I confirmed I wish all damaged parts to be replaced, once and for all, and now have to wait for the additional bill to make another invoice, which should arrive any hour. When I then fax a receipt of the issued invoice back to Dell, I could, with a little bit of luck, get my laptop back by tomorrow already!
Hey, I expected a delay of about a month or more... I never thought I would get it back that early! :woot:

Now I can only hope they really fixed everything and there won't be any more issues shortly after I got it back... then it would really be some 400-500? spent well!

This certainly won't happen a second time though. Before the next upcoming issue I'll hopefully have a new laptop!
User avatar
Smokey
 
Posts: 3378
Joined: Mon May 07, 2007 11:35 pm

Post » Fri May 27, 2011 8:53 am

good to hear it, drake! things should be working a lot smoother once you get that back
User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Fri May 27, 2011 5:24 am

I have a request for anybody who'd like to fulfill it.

Fearils clothing meshes were uploaded onto filefront, which, in its revamping, has lost the file. as such, I'd appreciate it if someone would reupload the clothing meshes for the dragon legs, as I don't have them now, due to a reinstall. I mentioned this in my last report, but it seems to have been glossed over to deal with the issue (don't get me wrong, I'm fine with that, but this has been bugging me non-stop for a while now.)
User avatar
christelle047
 
Posts: 3407
Joined: Mon Apr 09, 2007 12:50 pm

PreviousNext

Return to IV - Oblivion