Jump to content

Newbie trying to script and now asks for help.


kadzooks

Recommended Posts

Can anyone check if this will work?

scn WhatIsThisIDontEven

array_var Equip
array_var temparr

ref actorRef
ref equipref

short WhatGender
short Bodcheck
short Boobytrap
short position 

string_var path1
string_var path2
string_var BodyCode
string_var whichone

Begin Function {actorRef BodyCode}
	;Example script for DMRA?
	;Gendercheck?
	set WhatGender to (IsFemale actorRef)
	if (WhatGender == 1)
		if (sv_Find "DMRABU" BodyCode != -1) ; Upperbody DMRA FTW

			if (sv_Find "BU3M" BodyCode != -1) || (sv_Find "BURAH" BodyCode != -1) ;Big Ass Titteh that is probably a heavenly body if it ever reaches space.
				set Boobytrap to 2
			elseif (sv_Find "BUMEGA" BodyCode != -1) || (sv_Find "BURAK" BodyCode != -1) ;WTF Titteh that is probably a solar system if it ever reaches space.
				set Boobytrap to 3
			else
				set Boobytrap to 1
			endif

			let Equip := actorRef.GetEquippedItems
			ForEach (temparr <- Equip)
				let equipref := temparr["value"]
					if (IsArmor equipref) || (IsClothing equipref)
						let path1 := GetBipedModelPath 1 equipref
						let position := (sv_Length path1) - 4

						if (Boobytrap == 1)
							set whichone to "_DMRA1"
						elseif (Boobytrap == 2)
							set whichone to "_DMRA2"
						elseif (Boobytrap == 3)
							set whichone to "_DMRA3"
						endif

						sv_insert := whichone path1 position
						let path2 := "Data\Meshes\" + $path1
						if (FileExists $path2)
							SetBipedModelPathEX $path1 1 equipref
						endif
					endif
			loop

		elseif (insert other general bodycode here)

			if (insert more specific bodycode here)
				(morestuff code like above?)
			endif

		endif

	else ;for the dudes
		(shorter, less if..elseif for men than I don't bother adding because who cares?)
	endif
End

Welp, that's all there is. The gist of the script is already there and all I want are opinions and maybe help in optimizing it?

I'm pretty sure there are things up there that are abominations to the natural order.

 

I think anyone with any kind of scripting experience could probably guess what I'm trying to do. If you do please wish me luck....I'll need lots of it. :sad:

Edited by kadzooks
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...