Detecting Zooom?

Post » Tue Mar 15, 2011 4:43 am

Hello I was wondering if there is a way to have a script on a weapon that detects when the weapon zooms in and then performs an action.

like

if

getzoomed =1

then

do this
User avatar
Mandi Norton
 
Posts: 3451
Joined: Tue Jan 30, 2007 2:43 pm

Post » Mon Mar 14, 2011 7:22 pm

you can take a look at http://www.fallout3nexus.com/downloads/file.php?id=11312 for reference, zooming is detected there. i used fose to poll the zoom/block key.
User avatar
Amber Ably
 
Posts: 3372
Joined: Wed Aug 29, 2007 4:39 pm

Post » Mon Mar 14, 2011 8:11 pm

you can take a look at http://www.fallout3nexus.com/downloads/file.php?id=11312 for reference, zooming is detected there. i used fose to poll the zoom/block key.



Thanx but I am looking for a way to detect zoom. and I do not use FOSE which your mod requires.

would something like this work?
scn kasdarnightvisonscopescript	Short ButtonBegin GameMode		Set Button to GetButtonPressed		if ( Button == 0 )			Activate		endif				elseif ( Button == 1 )			imod kasdarnightvisionscope		endifEnd


will the effect stop if the button is not pressed? if not how would I do that?
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Tue Mar 15, 2011 1:38 am

Thanx but I am looking for a way to detect zoom. and I do not use FOSE which your mod requires.

Well as i said, this detects zoom (but with fose).

would something like this work?

no, getButtonPressed refers to menu buttons.

You can try if it works like this:
scn kasdarnightvisonscopescriptshort stateshort equippedBegin OnEquipset equipped to 1EndBegin OnUnEqupset equipped to 0EndBegin GameModeif state == 0	if equipped == 0		return	endif		set state to 1	returnelseif state == 1	if equipped == 0		set state to 0		return	endif		if player.getAnimAction 7 == 0		return	endif		imod kasdarnightvisionscope	set state to 2	returnelseif state == 2	if equipped == 1 && player.getAnimAction 7 == 1		return	endif		rimod kasdarnightvisionscope	set state to 1	return	endifEnd


I haven't tested it so you probably have to debug a little :)
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am


Return to Fallout 3