Jump to content

Poses for Creatures


xyzman

Recommended Posts

Hi !

 

I made a simple standing pose for a troll with Blender.

Nothing special and I did this for characters before and it was ok.

But i cant use CTAddpose to make the troll show the new pose.

In the CTAddpose scripts it is querried, if the target is an actor and I think creatures are actors.

And I think it schould work for creatures.

Look here: http://cs.elderscrolls.com/index.php/IsActor

So I can't see, why my troll dont pose for me.

 

Here the script, maybe it helps to help me :-)

ScriptName a000CTAddPoseScript

Begin ScriptEffectStart
if a000CTAddPoseQuest.target == 0
	if IsActor
		set a000CTAddPoseQuest.target to GetSelf
		startQuest a000CTAddPoseQuest
	else
		Message "CTAddPose failed. target must be actor."
	endif
else
		Message "CTAddPose failed. busy."
endif
End

 

ScriptName a000CTAddPoseQuestScript

float fQuestDelayTime

short onece
short menu
ref target
short major
short minor

Begin GameMode
if onece== 0
	set onece to 1
	Player.addSpell a000CTAddPose
	Player.addItem a000CTAddPoseCrystal, 1
	set fQuestDelayTime to 0.2
endif

if target == 0
	set menu to 0
	set major to -1
	set minor to -1
	StopQuest a000CTAddPoseQuest
	return
endif

if menu == 0
	if MenuMode == 1
		return
	endIf

	set menu to 1

	if major == -1
		MessageBox "== Male Main Menu ==", "[ Exit Menu ]", "[ Reset Current Pose ]", "< Anim01 >", "< Anim02>", "< Anim03>", "< Anim04>", "< Anim05>", "< Anim06>", "< Anim07>", "< Anim08>"

	elseif major == 0
		MessageBox "==[ Anim01]==", "[ Back to Main ]", "< Anim0101 >", "< Anim0102 >", "< Anim0103 >", "< Anim0104 >", "< Anim0105 >", "< Anim0106 >", "< Anim0107 >", "< Anim0108 >", "< Anim0109 >"

	elseif major == 1
		MessageBox "==[ Anim02]==", "[ Back to Main ]", "< Anim0201 >", "< Anim0202 >", "< Anim0203 >", "< Anim0204 >", "< Anim0205 >", "< Anim0206 >", "< Anim0207 >", "< Anim0208 >", "< Anim0209 >"

	elseif major == 2
		MessageBox "==[ Anim03]==", "[ Back to Main ]", "< Anim0301 >", "< Anim0302 >", "< Anim0303 >", "< Anim0304 >", "< Anim0305 >", "< Anim0306 >", "< Anim0307 >", "< Anim0308 >", "< Anim0309 >"

	elseif major == 3
		MessageBox "==[ Anim04]==", "[ Back to Main ]", "< Anim0401 >", "< Anim0402 >", "< Anim0403 >", "< Anim0404 >", "< Anim0405 >", "< Anim0406 >", "< Anim0407 >", "< Anim0408 >", "< Anim0409 >"

	elseif major == 4
		MessageBox "==[ Anim05]==", "[ Back to Main ]", "< Anim0501 >", "< Anim0502 >", "< Anim0503 >", "< Anim0504 >", "< Anim0505 >", "< Anim0506 >", "< Anim0507 >", "< Anim0508 >", "< Anim0509 >"

	elseif major == 5
		MessageBox "==[ Anim06]==", "[ Back to Main ]", "< Anim0601 >", "< Anim0602 >", "< Anim0603 >", "< Anim0604 >", "< Anim0605 >", "< Anim0606 >", "< Anim0607 >", "< Anim0608 >", "< Anim0609 >"

	elseif major == 6
		MessageBox "==[ Anim07]==", "[ Back to Main ]", "< Anim0701 >", "< Anim0702 >", "< Anim0703 >", "< Anim0704 >", "< Anim0705 >", "< Anim0706 >", "< Anim0707 >", "< Anim0708 >", "< Anim0709 >"

	elseif major == 7
		MessageBox "==[ Anim08]==", "[ Back to Main ]", "< Anim0801 >", "< Anim0802 >", "< Anim0803 >", "< Anim0804 >", "< Anim0805 >", "< Anim0806 >", "< Anim0807 >", "< Anim0808 >", "< Anim0809 >"

	else
		MessageBox "Illegal State Error: Menu == %g, Major == %g, Minor == %g", menu, major, minor
		set target to 0
	endif	

elseif menu == 1

	if major == -1
		short button
		set button to GetButtonPressed

		if button == -1
			return
		elseif button == 0 ;;; Cancel
			set target to 0
		elseif button == 1	;;; Clear pose
			set major to 999
			set minor to 999
			target.AddSpell a000CTPickIdle
			set menu to 999 ;; dummy
		else
			set major to ( button - 2)
			set menu to 0
		endif

	else if major >= 0 && major <= 7

		short button
		set button to GetButtonPressed

		if button == -1
			return
		elseif button == 0 ;;; Back to Main
			set major to -1
			set menu to 0
		else
			set minor to (button - 1)
			target.AddSpell a000CTPickIdle
			set menu to 999 ;; dummy
		endif

	else
		MessageBox "Illegal State Error: Menu == %g, Major == %g, Minor == %g", menu, major, minor
		set target to 0
	endif
endif 
End

 

ScriptName a000CTPickIdleScript

Begin ScriptEffectStart
if a000CTAddPoseQuest.target == GetSelf
	pickIdle
;		Message "pickidle: target=%g, major=%g, minor=%g", a000CTAddPoseQuest.target, a000CTAddPoseQuest.major, a000CTAddPoseQuest.minor
else
	MessageBox "CTKeepPoseScript start: Illegal State Error."
endif
End

Begin ScriptEffectUpdate
;	Message "finish: target=%g, major=%g, minor=%g", a000CTAddPoseQuest.target, a000CTAddPoseQuest.major, a000CTAddPoseQuest.minor
set a000CTAddPoseQuest.target to 0
set a000CTAddPoseQuest.major to -1
set a000CTAddPoseQuest.minor to -1
RemoveSpell a000CTPickIdle
End

 

ScriptName a000CTAddPoseCrystalScript

Begin OnEquip Player
if  a000CTAddPoseQuest.target == 0
	set a000CTAddPoseQuest.target to Player
	StartQuest  a000CTAddPoseQuest
else
	Message "CTAddPose failed. busy"
endif
End

 

Please help.

Thank you !

Edited by xyzman
Link to comment
Share on other sites

Yes, creatures are actors, and yes, it looks like you can call PickIdle on creatures, if I read that right.

The part of the CTAddPose scripts up to this point should also be working fine on creatures.

 

However, the scripts show no sign of how the actual idle animations were set up in the Idle Manager and if at all even. The Idle Manager is where you define the individual idle animations and the KF files to use and under which conditions they should be picked. Calling PickIdle will make the Idle Manager choose the according idle by checking through the individual conditions until a matching idle is found. This is likely where the "major" and "minor" choices come into play, being used as conditions to choose between a predefined set of idles.

 

If there was no idles set up for your creature in the Idle Manager, the CTAddPose scripts are of no use to you. If the according KF animation isn't meant to be used on the creature even (bone names differ from creature to creature or humanoid actor, if they don't match, things will go haywire or not work at all), the results can be very unpredictable. For example you can't just use a regular NPC idle from some CTAddPose mod on a creature right away. The skeleton and bones differ too much, the KF doesn't fit.

 

First of all though, check if the idle animation was properly set up in the Idle Manager and the conditions will indeed be fulfilled by the scripts for it to be selected.

For testing purposes you can call PickIdle on the creature yourself, by selecting it while the console is open and typing it in. Then you might even get some feedback which idle was chosen, if you're lucky. But I think the CTAddPose scripts work in a way so the conditions are only fulfilled while PickIdle gets called and afterwards reset or something, so it'd be a little hard to test the scripts or conditions that way.

Link to comment
Share on other sites

Thank you !

I will have a look at Pickidle and the conditions in the idles.

I wonder, why a "npc_id".playidle "idle_id" does'nt work in Oblivion.

This i used in Fallout.

The command itself is not wrong, only the parameter is not accepted as a valid idle id.

And i tried it with " and without, with the written name and with the id number, that i see in Tes4Edit with the modnumber before ... you know.

Is it possible to use playidle with oblivion and what i have to do for this ?

Link to comment
Share on other sites

Well, I haven't had a look into the PlayIdle command that close myself, yet, but the OBSE docs say following about it:

 

PlayIdle - attempts to make the calling actor play the specified idle animation. The animation must be one defined in the editor's Gameplay > Idle Animations window. Pass 1 for the forceIdle parameter to force the actor to play the idle regardless of any other animations currently playing.

(idlePlayed:bool) ref.PlayIdle idleAnim:ref forceIdle:bool

 

For the "ref" in Oblivion you use the EditorID of the target, like "player.PlayIdle", but for actors I think it must be an actual reference and not the BaseObjectID, so maybe you need to give your creature a "persistent" reference id, or have this be called in a script where the reference is known. There are no quotes or it'll be mistaken for a string or something.

 

The "idleAnim:ref" I'm not sure about, but it sounds like the idle has a name or EditorID in the manager they're talking of. Whether this can be used right away now or you have to trick it via a "ref animRef", "set animRef to MySuperCoolNewIdle" and then "PlayIdle animRef", I can't tell for certain, but again I doubt quotes will do any good here.

 

Most important though, this is an OBSE function, and as such it isn't certain it can be called "via console" at all even. You might have to use it in a script by all means for it to work, if you tried it via console. Then again, it didn't say it doesn't know the function but only a parameter, so I guess it can be used via console after all. But I don't know which regulations might apply then, outside of a script's context.

 

For what it's worth, you likely cannot use any id to your creature in console but have to select it first and then just call the command without a reference at the beginning. But if the "ref" variable trick has to be used for this function to work, in console you're out of luck anyways.

Link to comment
Share on other sites

For what it's worth, you likely cannot use any id to your creature in console but have to select it first and then just call the command without a reference at the beginning. But if the "ref" variable trick has to be used for this function to work, in console you're out of luck anyways.

 

Its possible.

If you select a npc or creature in console, at the top of the screen in the middle is an id or ref.

Use this with quotes like this: "19000800".getscale

This works very well.

"14".gescale is the same as player.getscale

The rest of your answer I can have a closer look at home later.

Thank you again !

Link to comment
Share on other sites

For what it's worth, you likely cannot use any id to your creature in console but have to select it first and then just call the command without a reference at the beginning. But if the "ref" variable trick has to be used for this function to work, in console you're out of luck anyways.

 

Its possible.

If you select a npc or creature in console, at the top of the screen in the middle is an id or ref.

Use this with quotes like this: "19000800".getscale

This works very well.

"14".gescale is the same as player.getscale

The rest of your answer I can have a closer look at home later.

Thank you again !

 

And that's exactly why I keep saying "likely" in cases I'm not 100% sure of the truth of my statement. :sweat:

 

I did know you can use those references in "some" cases, but I didn't want to explicitly state it could be done in "this" case, while I wasn't sure about it myself anymore.

 

(I'm always playing safe. You will never get a definitive statement from me ever, unless I'm absolutely sure it's true... and even then I still avoid giving definitive statements, as chances are I could still be wrong. So if I don't say something definitively, the answer likely isn't that definitive and to be taken with all neccessary precautions and doubts. I'm not infallible, and I won't make myself sound like I were... but that's off-topic now.)

Edited by DrakeTheDragon
Link to comment
Share on other sites

To be sure, because i'm not native english speaking:

My last answer was only ment as a feedback, so you know now, it works.

Did not want to bother you with this.

I thought it could help you or somebody else to know this.

I hope thats the way you understand me :-)

 

And to the topic:

In the CTAddPose Mods (there are many) are several objects in "Idle Animation".

After i set the path to the kf-file in every object named CTAddPose and CTAddPose00-CTAddPose07 to "creatures\troll\idleanims" and

CTAddPose0000 to a specific file inside this folder, for example: "creatures\troll\idleanims\t1\t01.kf", it works !!

At first i had the kf-file inside the same folder as for humanoids "Characters\_Male\IdleAnims\...".

In Fallout this didn't matter, in oblivion it seems to matter.

 

Thank you for the answers !

Edited by xyzman
Link to comment
Share on other sites

To be sure, because i'm not native english speaking:

My last answer was only ment as a feedback, so you know now, it works.

Did not want to bother you with this.

I thought it could help you or somebody else to know this.

I hope thats the way you understand me :-)

 

Don't worry. That's "exactly" the way I understood it. ;)

I'm not a native speaker either.

I always welcome standing corrected as it only improves my knowledge or fixes some flaws. The more I get corrected, the more I know.

...weird, I know. :rolleyes:

 

And to the topic:

In the CTAddPose Mods (there are many) are several objects in "Idle Animation".

After i set the path to the kf-file in every object named CTAddPose and CTAddPose00-CTAddPose07 to "creatures\troll\idleanims" and

CTAddPose0000 to a specific file inside this folder, for example: "creatures\troll\idleanims\t1\t01.kf", it works !!

At first i had the kf-file inside the same folder as for humanoids "Characters\_Male\IdleAnims\...".

In Fallout this didn't matter, in oblivion it seems to matter.

 

Thank you for the answers !

 

You're welcome!

 

Always glad I could be of help.

And now I, too, know how all this works exactly, so in the end I profit, too.

 

And you're right, in Oblivion animations can't be outside of the folder their skeleton is in. In fact you can even swap the whole set of movement and whatever animations the player uses, simply by swapping the skeleton. Swapping this ingame though sadly isn't yet fully implemented. 1st person skeleton still can't be swapped through scripts. But I was using this for the latest state of my dragon race mod already (still highly WIP and not released, yet!), and limited to 3rd person skeleton and animations only it works like a charm. No skeleton "replacements" needed anymore for custom races with custom bodyparts like wings and such sure is a goal worth looking forwards to, considering there can only be "1" skeleton file used for the player ("meshes/characters/skeleton|beast.nif") and in the past every custom race replaced it with its own one, inevitably messing up all others. But that's just some interesting sidenotes for now. :sweat:

Edited by DrakeTheDragon
Link to comment
Share on other sites

  • Recently Browsing   0 members

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