Noob Modder needs help: Player Controls

Post » Sun Jun 24, 2012 2:22 am

So I'm trying to make my first mod and i need help finding the info on where to start.

I'm completely new to this and I can't find any resource for editing user events. Basically I want to change the player controls.

I want equipping from the hotkeyed items on the quick (favorites) menu to change priority from the right hand to the left. Basically this will be a left-hander mod.

For example:
I have empty hands and three hotkeys mapped in my quick menu.
1) shield, 2) fireball, 3) fast healing.
Normally when I hit 2 it will equip to the right hand. What I'm proposing would equip it to the left.

But the reason I'm doing this is for something else: shield mage controls. Under the proposed method, I can keep my shield equipped and switch my right-hand spells easilly.
I have empty hands and the above hotkeys mapped. I hit 1 and my shield gets equipped to my left hand. Now I hit 2 and my right hand is equipped with fireball. I get wounded in a fight and need to heal. I hit 3 and fast healing replaces fireball in my right hand

I already know the logic of what I want to do. However, I don't know the functions that I need to call in order to make it happen. I also don't know how to tell the game to activate my script on a user event (player presses hotkey).

Here's my psudocode:
Function ReverseEquip(Form akItem)
If lefthand == full
If righthand == full
Unequip(rightHand)
EndIf
Equip(akItem, rightHand)
EndIf
Else Equip(akItem, leftHand)
EndFunction

Note: none of the above functions actually exist. I made them up to show the logic

I've tried doing searches in several scripting wikis and mod forums for "controls" "user event" "left hand" "equip" etc. and I can't find the functions I need to call in order to make this thing. The easiest fix would be to alter the native functions. It'd be basically no work at all if i could do that with the Creation Kit. But something tells me that's impossible and I'll have to make a workaround. Probably use SKSE, for which I also don't know where to start looking.

Please, any help would make a huge difference. I just need a starting place to start looking. A guide on player input, source code of a similar mod, anything. I've spent a week trying to figure this out with nothing to show for it.
User avatar
NIloufar Emporio
 
Posts: 3366
Joined: Tue Dec 19, 2006 6:18 pm

Post » Sun Jun 24, 2012 5:33 pm

http://www.creationkit.com/GetEquippedItemType_-_Actor

This should help get you started.
User avatar
Emmi Coolahan
 
Posts: 3335
Joined: Wed Jan 24, 2007 9:14 pm

Post » Sun Jun 24, 2012 8:21 am

This should help get you started.
Hmm... It's not what I was looking for but i see what you mean. I could make a huge list of commands based on what I already have equipped. Thanks.

So I guess the next question is "how do I make the game do something on a key press?" I'll want to overwrite the quick slot controls... hmm... maybe I'd have to make a custom menu... I hope not.
User avatar
Cat
 
Posts: 3451
Joined: Mon Dec 18, 2006 5:10 am

Post » Sun Jun 24, 2012 7:10 am

Well after fiddling around with that I found other useful things. And I used them to make a script. I'm not sure I can do this but here it is.
Actor player = Game.GetPlayer()
ObjectReference myShield
Form newSpell

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
if (player.GetEquippedShield())
myShield = akReference
GotoState("ShieldMode")
endIf
endEvent

State ShieldMode
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
if (akBaseObject as Spell)
newSpell = akBaseObject
if(newSpell != player.GetEquippedSpell(1))
player.EquipSpell(newSpell, 1)
player.EquipItem(myShield)
endIf
endIf
endEvent
Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)
if (akReference == myShield)
GotoState("")
;event will not fire if unequipped via hotkey
endIf
endEvent
endState
So yeah. Now how do I implement this in the game so I can start finding out what I did wrong? lol
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm


Return to V - Skyrim