Jump to content

Scripting Help - NVSE


LuckyMouse

Recommended Posts

Alright, so I'm relatively unaccustomed to making scripts in GECK in general, but this one is giving me a really hard time.

 

I'm trying to make a pretty simple script:

 

ref cont
short active
short anim

begin onequip
set cont to getcontainer
set active to 1
end

begin onunequip
set active to 0
end

begin ondrop
set cont to 0
end

begin gamemode
if(cont)
if(active)
	if(cont.GetAnimAction == 2 && anim == 0)
		set anim to 1
	elseif(cont.getanimaction != 2 && anim == 1)
		;WEAPON FIRED
		set anim to 0
		cont.fireweapon WHATEVER
	endif
endif
else
set cont to getcontainer
if(cont)
	if(cont.getequipped THISWEAPON)
		set active to 1
	endif
endif
endif
end

 

As it is now it causes a weapon to fire the same projectile as another weapon when it's used to attack. I'm basically using it to make melee weapons fire lasers when they're swung.

 

It does that just fine, but I want to make a small revision so that the laser only fires if you attack with the weapon while you're guarding.

 

I've been told the NVSE command IsControlPressed can be used for that, but I've never used NVSE before now so I have no clue how it works or how to add it into my existing script.

 

If someone could show me what revisions to make I'd be totally grateful. I'd really like to get this script finished today so I can start my new run.

Edited by LuckyMouse
Link to comment
Share on other sites

That could probably work too from the looks of it, but the issue is that I've never looked at these script extender functions before either.

 

I know IsControlPressed will work because that function was suggested to me by someone who did a code like this, but I don't know how to tie that function to the guard key and add it in to the script I already have.

 

I hate to admit it but I'm not very good with scripting because I rarely have to use it for my normal GECK projects and I only got my melee projectile script working through luck and tinkering.

 

I guess to be a bit more direct I'm wondering if anyone could actually give me the lines of script I need to add and tell me where to put them in. Script extender functions are way out of my league.

Edited by LuckyMouse
Link to comment
Share on other sites

Aww, feelin' small in the saddle? Ol' Nekh is here to help ya get back on the trail! Basically, do what them helpful folks at the NVSE site say about downloadin' and installin' it right. Then, start the GECK usin' NVSE. Now you oughta be able to use them fancy NVSE functions, like IsControlPressed.

 

Them pages here:

http://geck.bethsoft.com/index.php/Function_Page

http://fose.silverlock.org/fose_command_doc.html

is your new best friends.

 

Now, once you're cookin' with NVSE, you'll wanna be attaching this little script here to that six-shooter of yours:

 

scn DumbScript

ref rUser

int bGuarding
int bAttacking

begin gamemode

set rUser to getContainer;
if (rUser)
else
return;
endif

if (iscontrolpressed 6)
set bGuarding to 1;
else
set bGuarding to 0;
endif
if (iscontrolpressed 4)
set bAttacking to 1;
else
set bAttacking to 0;
endif

if (bGuarding)
if (bAttacking)
 rUser.fireweapon SomeWeapon;
endif
endif

end

 

Now, I can't tell ya for sure whether this script here's totally bona fide, but by my reckoning it oughta be just fine. So there ya have it!

Edited by Nekhanimal
Link to comment
Share on other sites

  • Recently Browsing   0 members

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