Jump to content

Scripting troubles


Recommended Posts

So I'm trying to get a button toggle script to work, but the GECK refuses to even recognize the important part: the actual button press script. Every attempt at saving the script gives me a syntax error reading that it doesn't recognize the 'IsKeyPressed' line. Here's the script in question:

 

scn aa3EFdrgnvgscript

float timer;
short refresh;

begin GameMode
if refresh == 0
	if timer < .5
		set timer to timer + GetSecondsPassed;
	else
		set timer to 0;
		set refresh to 1;
	endif
else
	if IsKeyPressed == 87
		if aadrgNVGmode == 0
			set aadrgNVGmode to 1;
		else
			set aadrgNVGmode to 0;
			player.removespell, 3EFrcssEffectNVG
		endif
		set refresh to 0;
	endif
endif

end

 

Can anyone tell me what I'm doing wrong?

Link to comment
Share on other sites

Hurrah. My button toggles now work. I just have one little issue I still need to iron out. The mod's set up so that it plays the stealth boy's sound effect and electrical field play/appear when the player crouches with the armor worn. How would I set it up so that it happens with the toggle instead?

Script is thus:

scn aa3EFdrgsscript

float timer;
short refresh;

begin GameMode
    if refresh == 0
        if timer < .5
            set timer to timer + GetSecondsPassed;
        else
            set timer to 0;
            set refresh to 1;
        endif
    else
        if IsKeyPressed 88
            if aadrgplatesf == 0
                set aadrgplatesf to 1;
            else
                set aadrgplatesf  to 0;
            endif
            set refresh to 0;
        endif
    endif

end


Not sure what to add to that, or what to remove from other scripts (there's like two others I copied over from the original FO3 mod, I'll post 'em if I need to) or from spell effects or whatever.

EDIT: This is apparently the script handling the sfx and gfx for the cloaking, which is still attached to the sneak mode use.

scn StealthCloak3NVEffect

BEGIN SCRIPTEFFECTSTART
    PMS NightkinCloakFXShader 1
    PlaySound3D RCSS3NVsound01
    SMS NightkinCloakFXShader
END

BEGIN SCRIPTEFFECTFINISH
    PMS NightkinCloakFXShader 1
    PlaySound3D RCSS3NVsound01
    SMS NightkinCloakFXShader
END
Edited by RuaDragonheart
Link to comment
Share on other sites

Okay. Seems I didn't need to do any further tweaking--one of the actions of the enchantment controlling the sfx/gfx was set to a sneak check instead of a global value check. Changed that around and it works exactly how I want it to, so I'm pretty much good to go. Thanks again for your help, luthienanarion. Couldn't have gotten this far without your expertise.
Link to comment
Share on other sites

Okay. Seems I didn't need to do any further tweaking--one of the actions of the enchantment controlling the sfx/gfx was set to a sneak check instead of a global value check. Changed that around and it works exactly how I want it to, so I'm pretty much good to go. Thanks again for your help, luthienanarion. Couldn't have gotten this far without your expertise.

 

No problem; scripting is what I do. Glad to hear you got it working like you wanted it to.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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