Jump to content

OBSE Scripting Tutorial?


Recommended Posts

I'm looking for a decent tutorial on on the OBSE scripting syntax. Like how OBSE scripts start, make arguments-stuff like that. Any recommendations?

 

To be more specific i need some code that swap 3rd person .kf animation files when a player equips a weapon.

 

I ran across this, but it seems to be more for a pose mod, or something on those lines.

 

ToggleSpecialAnim - adds or removes an animation from the base actor's animation list. For creatures, the animations must appear in the creature's model folder; for NPCs they must be located in the Special Anims folder. Changes made using this command have no effect on the animations of reference's to the base actor which are currently in middle-high or high process.

 

(bSucceeded:bool) reference.ToggleSpecialAnim animFileName:string toggleOn:bool actorBase:ref

 

 

 

 

Any help is appreciated.

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

For that you would do something like this I think:

 

scn SwitchAnimsonEquip ;QUEST

Begin GameMode 

If Player.GetEquipped WEAPON
Player.ToggleSpecialAnim ANIMFILENAME ToggleOn ;EDIT: You would probably duplicate this for every animation, this line I mean with the new animation.
elseif Player.GetEquipped WEAPON == 0
Player.ToggleSpecialAnim ANIMFILENAME ToggleOff ;EDIT: Same as above to toggle them off.
endif
end

 

The animation would have to be in Data\Meshes\Characters\_male\SpecialAnims. I think that's how you would do it at least. I've never done it before, but based on that reference they gave it should work. They almost never give non-confusing examples for OBSE :P Experiment and eventually you'll get it.

 

It may be for poses, but it depends on what animation you use... I don't know too much about animations though, so someone else would have to help you there.

Edited by Guest
Link to comment
Share on other sites

I tried it the "English" way and the script wouldn't compile. I switched a few lines around and it does compile but nothing works in game. I tried blocking out the if statements just to see if the new animations would load but they don't. Heres what I ended up with.

 

Scn FBDC2AniTest

ref weapon

Begin Function {weapon}

;If Player.GetEquipped  FBDarkCrusader2SDWristBlade == 1
	Player.ToggleSpecialAnim "onehandequip.kf" 1
	Player.ToggleSpecialAnim "onehandidle.kf" 1

;elseif Player.GetEquipped FBDarkCrusader2SDWristBlade == 0
	;Player.ToggleSpecialAnim "onehandequip.kf" 0
	;Player.ToggleSpecialAnim "onehandidle.kf" 0

;endif
end

 

Maybe I'm not calling for the script / function correctly?

Link to comment
Share on other sites

I tested that script, and it compiles for me.

 

EDIT: Ah, so it doesn't work ingame... Is the weapon already a one handed weapon? If that's the case then it will use all of them, as this just toggles them to be used (IE a two handed weapon would use one of these animations if I'm not mistaken on how this works)

Edited by Guest
Link to comment
Share on other sites

I tested that script, and it compiles for me.

 

EDIT: Ah, so it doesn't work ingame... Is the weapon already a one handed weapon? If that's the case then it will use all of them, as this just toggles them to be used (IE a two handed weapon would use one of these animations if I'm not mistaken on how this works)

 

Yes. This script is for a wrist blade type weapon. In game its set up like a dagger. Right now in v 3.8 everything works well, but when the player draws, or puts away the wrist blade it plays the 1 had away / draw animation. What I'm trying to do is when the player equips the weapon, then the game starts calling for a replacement array of animations. (id probably like to use 4-6 new ones) loaded from the specialanims folder.

 

 

So far, even though CS will compile I cant get anything to work in game. For testing I've even gotten rid of the animations and just tried to call for a [message " "] but still no luck. I also picked apart Deadly Reflex 6 to find similar scrips but not much luck there either.

 

I found you can call from OBSE using _Game mode instead of GameMode. I tried this, and also replaced Player. with Actor. and put ref Actor at the top, but sill no luck. I also replaced the old "GetEquipped" with OBSE "IsEquipped" but nothing. Ive never in my life seen a script that will compile but does absolutely nothing when run. At this point I'd jump out of my seat with joy if the game would even CTD when the script is run so I know at least something is happening. lol

 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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