NVSE Scripting

Post » Fri Feb 18, 2011 10:56 pm

How do you move a post, this was meant for the GECK, sorry guys, though I was posting in that section.

hello, I am working on a mod that requires at least using 4-5 extra keys so I wanted to know if there was a way for me to make it so the user has to holding down one key well pressing the other

L-Shift + W = Preform this action
L-Shift + S = Preform this action
ect..
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Sat Feb 19, 2011 4:23 am

GetKeyPress can get multiple keys that are being held down

GetKeyPress index

GetKeyPress 0 returns the first key held
GetKeyPress 1 returns the next key held down

GetKeyPress returns -1 if no keys are held down
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Fri Feb 18, 2011 11:47 pm

I would think it'd be easier to use iskeypressed - it shouldn't matter what order the keys are pressed in, just that both keys are pressed at the same time. So your code would be more like:

if iskeypressed myModifierKey && iskeypressed myHotKey1
...

or more likely this if you've got multiple hotkeys:

if iskeypressed myModifierKey    if iskeypressed myHotKey1        ; do stuff    elseif iskeypressed myHotKey2        ; do other stuff    endifendif

User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Fri Feb 18, 2011 11:12 pm

Thank you both. That will work perfectly.
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Sat Feb 19, 2011 8:20 am

I realise this post is a little late, but if you're interested I've written a tutorial on how to set up different types of keypress detection scripts. You can find it here - http://www.cipscis.com/fallout/tutorials/detecting_keypresses.aspx

Cipscis
User avatar
Matt Gammond
 
Posts: 3410
Joined: Mon Jul 02, 2007 2:38 pm

Post » Sat Feb 19, 2011 7:56 am

oh its never to late for extra help. Thank you Cipscis. here is what I am trying to do.

There is going to be this power armor. (WOW another power armor mod, i know)
It is going to allow the play to increase and decrease the players speed, jump height, and strength using hot-keys.
To balance the suit only works well the player has energy cells.

I have the hot-key part done all I have left to figure out is the following:

1.)Figure out how to consume energy cells, figured I would just look into FOOK for that though.
2.)Force the play to only be allowed to walk, no jumping or running <- not sure I can do that. (basically penalize the player when they have no energy cells for the suit to use)

If anyone has any ideas on these two that would be great as well, mainly the second one!
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Sat Feb 19, 2011 3:43 am

You can use http://geck.gamesas.com/index.php/RemoveItem to remove the energy cells from the player's inventory, and you should be able to force the player to walk by decreasing their carry weight so that they're over-encumbered, although there's likely a better method of doing this which I haven't thought of.

Cipscis
User avatar
neil slattery
 
Posts: 3358
Joined: Wed May 16, 2007 4:57 am

Post » Sat Feb 19, 2011 9:46 am

You can use http://geck.gamesas.com/index.php/RemoveItem to remove the energy cells from the player's inventory, and you should be able to force the player to walk by decreasing their carry weight so that they're over-encumbered, although there's likely a better method of doing this which I haven't thought of.

Cipscis


Well for background purposes, I could always say the suit helps you move when it is powered, and when its not powered it just weights a ton. thanks.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm


Return to Fallout: New Vegas