[REQ] Scripting help for a mod

Post » Mon Dec 07, 2009 6:57 am

I'm working on an expansion to Reznod's Mannequins, that will provide flesh-toned mannequins for 8 races, both sixes. But...I'm having a problem with an adjustment to one of Reznod's scripts, that absolutely should compile, but won't. I don't know what's wrong, and I've exhausted what tiny knowledge I've got, so if anybody who knows scripting can help, it would be most appreciated. And the mod will get done, too. :)
User avatar
michael flanigan
 
Posts: 3449
Joined: Thu Jun 14, 2007 2:33 pm

Post » Mon Dec 07, 2009 6:39 am

I'm working on an expansion to Reznod's Mannequins, that will provide flesh-toned mannequins for 8 races, both sixes. But...I'm having a problem with an adjustment to one of Reznod's scripts, that absolutely should compile, but won't. I don't know what's wrong, and I've exhausted what tiny knowledge I've got, so if anybody who knows scripting can help, it would be most appreciated. And the mod will get done, too. :)

There are a large number of things that could be causing the problem, but without more information, we won't be able to help. If you post your current script and a description of what you want it to do, we may be able to see where it's going wrong and help you fix it.
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Mon Dec 07, 2009 8:15 pm

There are a large number of things that could be causing the problem, but without more information, we won't be able to help. If you post your current script and a description of what you want it to do, we may be able to see where it's going wrong and help you fix it.


Certainly.

I created a new base object, ReznodMannequinRedguardM, and two reference objects for it in the Reznod Holder Cell. Now, when I go to save a copy of ReznodMannequinRedguardMScript which I've created, I get the message:

"Invalid inventory object "ReznodMannequinRedguardM" for parameter ObjectID. Compiled script not saved!"

Which is odd, because I have created the base object, ReznodMannequinRedguardM, already. This also matches up to the way Reznod did his objects and scripts. I'm not a natural to this, but I'd like to give something back to the modding community besides the NPC dialog I've contributed to a few mods over the years, and this seems to me to fill a real void at the moment, since both Morrowind and Fallout 3 offer flesh-toned mannequins in all race flavors.

I'm including a copy of Reznod's script. I take no credit for any of it. All I've done is slotted in one or two differences:

ScriptName ReznodMannequinRedguardMScriptRef MySelfShort MessageStatusShort MessageAnswerShort CurrentStateShort MyAlertShort EditShort PoseShort SneakShort AlertShort UpdatePoseFloat TimerShort DummyCountFloat MyXFloat MyYFloat MyZFloat MyRotBegin OnLoadif ( MyX == 0 )if ( MyY == 0 )if ( MyZ == 0 )if ( MyRot == 0 )	set MyX to Player.GetPos X	set MyY to Player.GetPos Y	set MyZ to Player.GetPos Z	set MyRot to Player.GetAngle Z	set Pose to 0	set Sneak to 0	set Alert to 0endifendifendifendifSetForceSneak Sneakif ( Pose == 0 )	PlayGroup Idle 1elseif ( Pose == 1 )	PlayGroup BlockIdle 1elseif ( Pose == 2 )	PlayGroup CastSelf 1			; leftelseif ( Pose == 3 )	PlayGroup CastSelfAlt 1		; rightelseif ( Pose == 4 )	PlayGroup CastTarget 1		; leftelseif ( Pose == 5 )	PlayGroup CastTargetAlt 1	; rightelseif ( Pose == 6 )	PlayGroup CastTouch 1		; two handedelseif ( Pose == 7 )	PlayGroup CastTouchAlt 1	; right	endifset Timer to 0SetGhost 1EndBegin OnActivateset MessageStatus to 1set MyX to GetPos Xset MyY to GetPos Yset MyZ to GetPos Zset MyRot to GetAngle ZEndBegin GameModeif ( Edit == 0 )if ( UpdatePose == 1 )	set MySelf to GetSelf	if ( CurrentState == 0 )		set CurrentState to 1	endifelseif ( UpdatePose == 2 )	set UpdatePose to 0	set ReznodMannequinPoseActiveRef.MyRef to MySelf	ReznodMannequinPoseActiveRef.MoveTo MySelf	MoveTo ReznodMannequinContainerObjectendifendifif ( Timer < 0.8 )	set Timer to ( Timer + GetSecondsPassed )else	SetUnconscious 0	SkipAnimendifif ( GetItemCount ReznodMannequinDummyWeapon > 1 )	set DummyCount to ( GetItemCount ReznodMannequinDummyWeapon - 1 )	RemoveItem ReznodMannequinDummyWeapon DummyCountelseif ( GetItemCount ReznodMannequinDummyWeapon == 0 )	AddItem ReznodMannequinDummyWeapon 1endifif ( CurrentState > 0 )	if ( CurrentState == 1 )		RemoveAllItems ReznodMannequinContainerObject		set CurrentState to 2		Return	elseif ( CurrentState == 2 )		SetUnconscious 0		ReznodMannequinContainerObject.RemoveAllItems MySelf		SetAV Luck 0		set CurrentState to 3		Return	elseif ( CurrentState == 3 )		EvaluatePackage ReznodMannequinActorAIWearable		set CurrentState to 4		Return	elseif ( CurrentState == 4 )		SetAV Luck 1		set CurrentState to 5		Return	elseif ( CurrentState == 5 )		EvaluatePackage ReznodMannequinActorAIArmor		SetAlert Alert		set CurrentState to 6		Return	elseif ( CurrentState < 10 )		set CurrentState to ( CurrentState + 1 )		Return	else		SetUnconscious 1		set UpdatePose to 2		set CurrentState to 0	endifelse	SetPos X MyX	SetPos Y MyY	SetPos Z MyZ	SetAngle Z MyRotendifif ( MessageStatus == 0 )	Returnelseif ( MessageStatus == 1 )	MessageBox "What would you like to do?" "Return" "Modify Inventory" "Pick Up" "Pose"	set Edit to 1	set MessageStatus to 2elseif ( MessageStatus == 2 )	set MessageAnswer to GetButtonPressed	if ( MessageAnswer == -1 )		Return	elseif ( MessageAnswer == 0 )		set Edit to 0		set MessageStatus to 0		Return	elseif ( MessageAnswer == 1 )		RemoveItem ReznodMannequinDummyWeapon 1		RemoveAllItems ReznodMannequinContainerObject		ReznodMannequinContainerObject.Activate Player 1		set UpdatePose to 1		set MessageStatus to 1		Return	elseif ( MessageAnswer == 2 )		RemoveItem ReznodMannequinDummyWeapon 1		RemoveAllItems Player		Player.AddItem ReznodMannequinRedguardMObject 1		set MyX to 0		set MyY to 0		set MyZ to 0		set MyRot to 0		MoveTo ReznodMannequinContainerObject		Return	elseif ( MessageAnswer == 3 )		set MessageStatus to 3		Return	endifelseif ( MessageStatus == 3 )	if ( Sneak == 1 )		if ( Alert == 1 )			if ( Pose == 1 )				MessageBox "What pose would you like?" "Return" "Face" "* Toggle Sneak" "* Toggle Weapon Drawn" "* Toggle Sheild Raised" "Casting Options"			elseif ( Pose == 0 )				MessageBox "What pose would you like?" "Return" "Face" "* Toggle Sneak" "* Toggle Weapon Drawn" "Toggle Sheild Raised" "Casting Options"			else				MessageBox "What pose would you like?" "Return" "Face" "* Toggle Sneak" "* Toggle Weapon Drawn" "Toggle Sheild Raised" "* Casting Options"			endif		else			if ( Pose == 1 )				MessageBox "What pose would you like?" "Return" "Face" "* Toggle Sneak" "Toggle Weapon Drawn" "* Toggle Sheild Raised" "Casting Options"			elseif ( Pose == 0 )				MessageBox "What pose would you like?" "Return" "Face" "* Toggle Sneak" "Toggle Weapon Drawn" "Toggle Sheild Raised" "Casting Options"			else				MessageBox "What pose would you like?" "Return" "Face" "* Toggle Sneak" "Toggle Weapon Drawn" "Toggle Sheild Raised" "* Casting Options"			endif		endif	else		if ( Alert == 1 )			if ( Pose == 1 )				MessageBox "What pose would you like?" "Return" "Face" "Toggle Sneak" "* Toggle Weapon Drawn" "* Toggle Sheild Raised" "Casting Options"			elseif ( Pose == 0 )				MessageBox "What pose would you like?" "Return" "Face" "Toggle Sneak" "* Toggle Weapon Drawn" "Toggle Sheild Raised" "Casting Options"			else				MessageBox "What pose would you like?" "Return" "Face" "Toggle Sneak" "* Toggle Weapon Drawn" "Toggle Sheild Raised" "* Casting Options"			endif		else			if ( Pose == 1 )				MessageBox "What pose would you like?" "Return" "Face" "Toggle Sneak" "Toggle Weapon Drawn" "* Toggle Sheild Raised" "Casting Options"			elseif ( Pose == 0 )				MessageBox "What pose would you like?" "Return" "Face" "Toggle Sneak" "Toggle Weapon Drawn" "Toggle Sheild Raised" "Casting Options"			else				MessageBox "What pose would you like?" "Return" "Face" "Toggle Sneak" "Toggle Weapon Drawn" "Toggle Sheild Raised" "* Casting Options"			endif		endif	endif	set MessageStatus to 4elseif ( MessageStatus == 4 )	set MessageAnswer to GetButtonPressed	if ( MessageAnswer == -1 )		Return	elseif ( MessageAnswer == 0 )		set MessageStatus to 1		Return	elseif ( MessageAnswer == 1 )		set MyRot to ( Player.GetAngle Z - 180 )		set UpdatePose to 1		set MessageStatus to 3		Return	elseif ( MessageAnswer == 2 )		if ( Sneak == 0 )			set Sneak to 1		else			set Sneak to 0		endif		set UpdatePose to 1		set MessageStatus to 3		Return	elseif ( MessageAnswer == 3 )		if ( Alert == 0 )			set Alert to 1		else			set Alert to 0		endif		set UpdatePose to 1		set MessageStatus to 3		Return	elseif ( MessageAnswer == 4 )		if ( Pose == 1 )			set Pose to 0		else			set Pose to 1		endif		set UpdatePose to 1		set MessageStatus to 3		Return	elseif ( MessageAnswer == 5 )		set MessageStatus to 5		Return	endifelseif ( MessageStatus == 5 )	if ( Pose == 2 || Pose == 3 )		MessageBox "What type of casting would you like to pose?" "Return" "* Self" "Target" "Touch"	elseif ( Pose == 4 || Pose == 5 )		MessageBox "What type of casting would you like to pose?" "Return" "Self" "* Target" "Touch"	elseif ( Pose == 6 || Pose == 7 )		MessageBox "What type of casting would you like to pose?" "Return" "Self" "Target" "* Touch"	else		MessageBox "What type of casting would you like to pose?" "Return" "Self" "Target" "Touch"	endif	set MessageStatus to 6elseif ( MessageStatus == 6 )	set MessageAnswer to GetButtonPressed	if ( MessageAnswer == -1 )		Return	elseif ( MessageAnswer == 0 )		set MessageStatus to 3		Return	elseif ( MessageAnswer == 1 )		set MessageStatus to 7		Return	elseif ( MessageAnswer == 2 )		set MessageStatus to 9		Return	elseif ( MessageAnswer == 3 )		set MessageStatus to 11		Return	endifelseif ( MessageStatus == 7 )	if ( Pose == 2 )		MessageBox "What variation of cast on self would you like to pose?" "Return" "* Left Handed" "Right Handed"	elseif ( Pose == 3 )		MessageBox "What variation of cast on self would you like to pose?" "Return" "Left Handed" "* Right Handed"	else		MessageBox "What variation of cast on self would you like to pose?" "Return" "Left Handed" "Right Handed"	endif	set MessageStatus to 8elseif ( MessageStatus == 8 )	set MessageAnswer to GetButtonPressed	if ( MessageAnswer == -1 )		Return	elseif ( MessageAnswer == 0 )		set MessageStatus to 5		Return	elseif ( MessageAnswer == 1 )		set Pose to 2		set UpdatePose to 1		set MessageStatus to 7		Return	elseif ( MessageAnswer == 2 )		set Pose to 3		set UpdatePose to 1		set MessageStatus to 7		Return	endifelseif ( MessageStatus == 9 )	if ( Pose == 4 )		MessageBox "What variation of cast on target would you like to pose?" "Return" "* Left Handed" "Right Handed"	elseif ( Pose == 5 )		MessageBox "What variation of cast on target would you like to pose?" "Return" "Left Handed" "* Right Handed"	else		MessageBox "What variation of cast on target would you like to pose?" "Return" "Left Handed" "Right Handed"	endif	set MessageStatus to 10elseif ( MessageStatus == 10 )	set MessageAnswer to GetButtonPressed	if ( MessageAnswer == -1 )		Return	elseif ( MessageAnswer == 0 )		set MessageStatus to 5		Return	elseif ( MessageAnswer == 1 )		set Pose to 4		set UpdatePose to 1		set MessageStatus to 9		Return	elseif ( MessageAnswer == 2 )		set Pose to 5		set UpdatePose to 1		set MessageStatus to 9		Return	endifelseif ( MessageStatus == 11 )	if ( Pose == 6 )		MessageBox "What variation of cast on touch would you like to pose?" "Return" "* Two Handed" "Right Handed"	elseif ( Pose == 7 )		MessageBox "What variation of cast on touch would you like to pose?" "Return" "Two Handed" "* Right Handed"	else		MessageBox "What variation of cast on touch would you like to pose?" "Return" "Two Handed" "Right Handed"	endif	set MessageStatus to 12elseif ( MessageStatus == 12 )	set MessageAnswer to GetButtonPressed	if ( MessageAnswer == -1 )		Return	elseif ( MessageAnswer == 0 )		set MessageStatus to 5		Return	elseif ( MessageAnswer == 1 )		set Pose to 6		set UpdatePose to 1		set MessageStatus to 11		Return	elseif ( MessageAnswer == 2 )		set Pose to 7		set UpdatePose to 1		set MessageStatus to 11		Return	endifendifEnd 


The original for this script, meant for one of Reznod's marble or wooden mannequins, compiles fine. I've no idea why mine generates an error message.
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Mon Dec 07, 2009 11:47 am

See, this is the problem with actually showing the script. I probably had a better chance at getting help with it by simply asking for that, and showing it in PMs to whomever asked. As it is, the thread simply slipped to the next page. Lengthy scripts do not make for an easy read.

But if I can figure this one out, I'll be able to move ahead on getting this remake of Reznod's Mannequins done. Which will be something useful to quite a few people.
User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Mon Dec 07, 2009 8:22 pm

One thing I have found with persistent references..... if you want to use them in a script, you have to create the reference, make sure it exists somewhere, and then SAVE the mod. The problem isn't the script, its the reference. I think. :D
User avatar
Samantha Wood
 
Posts: 3286
Joined: Sun Oct 15, 2006 5:03 am

Post » Mon Dec 07, 2009 10:03 am

What type of object is "ReznodMannequinRedguardMObject". It seems to be the only new thing you are adding to the inventory.
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Mon Dec 07, 2009 7:52 pm

Hmm, yeah usually when there is an invalid inventory object error it has something to do with the reference.
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm

Post » Mon Dec 07, 2009 1:54 pm

What type of object is "ReznodMannequinRedguardMObject". It seems to be the only new thing you are adding to the inventory.


ReznodMannequinRedguardM is my flesh-toned male Redguard mannequin. Reznod used this label for the four mannequins he created: ReznodMannequinMarbleM, ReznodMannequinWoodF, etc. I'm following his syntax exactly. I've "dropped" two references to this object in the holding cell, appropriately labeled.

One thing I have found with persistent references..... if you want to use them in a script, you have to create the reference, make sure it exists somewhere, and then SAVE the mod. The problem isn't the script, its the reference. I think. :D


I learned that about a week ago, too. ;) Created the script, and discovered it wanted the persistent references, first. So I created the references, then tried the script--and got what I described, above. I've since kept the references, but every time I try copying and pasting in the script, I get the "Invalid etc" response.

I'll try copying out more content from both the objects and the references, later today. Perhaps that will help highlight the problem, and you smart scripting types will catch it.
User avatar
neen
 
Posts: 3517
Joined: Sun Nov 26, 2006 1:19 pm

Post » Mon Dec 07, 2009 2:31 pm

But the script has "Player.additem ReznodMannequinRedguardMObject 1".

Is that a typo, then?
User avatar
kiss my weasel
 
Posts: 3221
Joined: Tue Feb 20, 2007 9:08 am

Post » Mon Dec 07, 2009 7:10 pm

But the script has "Player.additem ReznodMannequinRedguardMObject 1".

Is that a typo, then?


That's a copy from the way Reznod did it. For example, Reznod had this:

ReznodMannequinWoodM

...as an NPC object, and placed 64 copies in his holding cell. His script for it has:

Player.AddItem ReznodMannequinWoodMObject 1
User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm

Post » Mon Dec 07, 2009 4:53 pm

Then he must also have created a scripted token with that name, which is placed in the players inventory to substitute for the mannequin.

Did you create a Misc Object with that name to serve the same purpose for your mannequin?
User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Mon Dec 07, 2009 9:43 pm

Then he must also have created a scripted token with that name, which is placed in the players inventory to substitute for the mannequin.

Did you create a Misc Object with that name to serve the same purpose for your mannequin?


No; you have a point. So you're suggesting that I've been looking in the wrong place, at the NPC objects, when I should be looking elsewhere, for ReznodMannequinRedguardMObject?

Hmmm...TESsnip shows something like that in MISC, and I just found them under MISCItem in the CS--so it looks like you get the gold ring for finding the problem. Many thanks!
User avatar
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm


Return to IV - Oblivion