Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script resource- Find/Post a script
12-15-2008, 04:55 PM,
#1
Script resource- Find/Post a script
Hello All

I wanted to have a single location of scripts we will need, want, or use
for this project. The official forums and Wiki are great, but it seems someone always finds a more simple version and we want this mod to run at the best performance possible.

If you need a script, please post as much detail as you can so the scripters can understand fully what you are trying to achieve.
Reply
12-15-2008, 06:52 PM,
#2
RE: Script resource- Find/Post a script
I'll start since I know I'll need this script in the not so far future.
I'm sure this one is simple and I have a working version, but I've heard there are certain commands that bog the system.

I have a old fashioned water pump. The lever is a seperate .nif that actually goes up or down when you click on it. I also have a spout of water .nif with an animated texture placed right below the fountain. (disabled)


I would like when the fountain lever is in the "up" postion to enable the
water spout .nif

Thanks
Reply
12-15-2008, 10:47 PM,
#3
RE: Script resource- Find/Post a script
Quote:Originally posted by ra5946
I'll start since I know I'll need this script in the not so far future.
I'm sure this one is simple and I have a working version, but I've heard there are certain commands that bog the system.

I have a old fashioned water pump. The lever is a seperate .nif that actually goes up or down when you click on it. I also have a spout of water .nif with an animated texture placed right below the fountain. (disabled)


I would like when the fountain lever is in the "up" postion to enable the
water spout .nif

Thanks
It's much of a muchness, but rather than disabling the water mesh, you could animate to be invisible with a vis controller, then trigger the normal running water animation with the PlayGroup script command.
Reply
12-16-2008, 01:55 AM,
#4
RE: Script resource- Find/Post a script
i can write the script but depending on how you set up the lever animation, theres a few ways to do it.
Heres one i wrote up for a light switch using the fortruinlever (same principle idea). all you need to do is make the water mesh have a persistent ref ID and change [MylightRef] to your water refID. Like i said, depending how the animation of the lever is, this may not work.

Code:
scn xxxleverlightswitch

short next
short busy
short opened
float timer

begin onActivate
    if busy == 0
        set next to 1
        if ( opened == 0 )
            playgroup forward 0
            set opened to 1
        else
            playgroup backward 0
            set opened to 0
        endif
        set timer to 0.5
        set busy to 1
    endif
end

begin gameMode

    if ( timer <= 0 ) && next == 1
        if [MylightRef].getdisabled == 1
            [MylightRef].enable
        else
            [MylightRef].disable
        endif

        set next to 0
    endif

    if busy == 1 && isAnimPlaying == 0
        set busy to 0
    endif

    if timer > 0
        set timer to timer - getSecondsPassed
    endif

end

begin onReset

    reset3DState
    set opened to 0
    set next to 0
    set busy to 0

end

btw, i actually have a scripting template thread here - http://ljosa.proboards57.com/index.cgi?b...523&page=1 but you need to sign up to use it. But you guys are more than welcome to ask here. And since i'm away for a month in jan, its best to ask now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)