Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Posted

The only trouble with music is it might not be turned on. (Like me, I always have music volume set to zero.) This is more like the old lady that plays the violin in FO3. That was set up as a.......  

 

I should really see how they did that. She plays different songs! :angel:

Posted

Creating an own radio station may be a bit circumstantial but is certainly doable. Just have a look at some of vanilla's simpler ones like the strip radio or whatever. I built SOFORadio entirely on that. You need a talking activator & place that in the world, a bunch of sound entries, and link to them from a quest's lines under the "radiohello" topic.

Posted

I'm pretty much sure that when a radio doesn't play the only issue (if you configured well the quest) is in the file format. You must follow some specifics and I suggest you to follow a tutorial for that. If you must use a 16 bit, be careful that when you convert them with some softwares (like Audacity), re-open the file after saving it and double check: probably it will be again at 32. It's a bit tricky, that was my main fault at least.

Radio allows a nice trick, you can make an activator playing, like a jukebox, or a speaker etc. The only "visual downside" is when you enter in the place you will see "<name of radio> signal has been found". Then if you marked the radio to not show, it won't show under the radio pipboy, still that message will appear. Anyway it's just a message.

Posted

I didn't have any trouble setting up the radio station itself. It was simpler because there was no announcer. (Just do the talking activator thing and set up the songs.) I got songs to play if I used existing FONV songs. But no matter what format I tried, my music simply refused to play. Wav, ogg, mp3, nothing worked. And I tried various encoding options for each. The most mystifying was the wav format. That has 12 million varieties and I tried each stupid one. All to no avail. Oddly wav WILL work as long as I make a normal sound object and play that.

 

It should be noted that on my install ONLY FONV stations work. All the TTW vanilla stations refuse to play as well. Likely this is some kind of codec thing that also extends to custom stations. (Though I have very few codecs installed...)

 

It seems Agatha has only one song and it would have the same issue as the radio stations. That is, it requires a "dialog sound" which under my setup apparently doesn't work.

 

I'm actually considering either: looping one song only or just tossing the band entirely. It was fun with the NPC's up there with instruments but this is a lot of hassle for something that isn't really plot related. :angel:

 

EDIT: OK, I may have it working, kind of. Provided you pick the right wav format (seems to be 8-bit unsigned stereo) the following should work provided you can figure out what the duration is.

 

 

; *********************
; ** Cloud Nine Band **
; *********************

int iDuration
int iTimer
int iLastSongPlayed
int iLastSongPlayed2
int iLastSongPlayed3
int iLastSongPlayed4
int iLastSongPlayed5

    if iTimer >= iDuration
        print "iDuration Reached!"
        let iTimer := 0

        ; ** Shift the list **
        let iLastSongPlayed5 := iLastSongPlayed4
        let iLastSongPlayed4 := iLastSongPlayed3
        let iLastSongPlayed3 := iLastSongPlayed2
        let iLastSongPlayed2 := iLastSongPlayed
        
        if iLastSongPlayed != 1 && iLastSongPlayed2 != 1 && iLastSongPlayed3 != 1 && iLastSongPlayed4 != 1 && iLastSongPlayed5 != 1
            ; ** Song 1 **
            RobarTTWC9LienaREF.playsound3D RobarTTWSoundC9FloatingCloud
            let iDuration := 10000
            print "Playing 1 now"
            let iLastSongPlayed := 1

        elseif iLastSongPlayed != 2 && iLastSongPlayed2 != 2 && iLastSongPlayed3 != 2 && iLastSongPlayed4 != 2 && iLastSongPlayed5 != 2
            ; ** Song 2 **
            RobarTTWC9LienaREF.playsound3D RobarTTWSoundC9AprilSunlight
            let iDuration := 10000
            print "Playing 2 now"
            let iLastSongPlayed := 2

        elseif iLastSongPlayed != 3 && iLastSongPlayed2 != 3 && iLastSongPlayed3 != 3 && iLastSongPlayed4 != 3 && iLastSongPlayed5 != 3
            ; ** Song 3 **
            RobarTTWC9LienaREF.playsound3D RobarTTWSoundC9Celeste
            let iDuration := 10000
            print "Playing 3 now"
            let iLastSongPlayed := 3

        elseif iLastSongPlayed != 4 && iLastSongPlayed2 != 4 && iLastSongPlayed3 != 4 && iLastSongPlayed4 != 4 && iLastSongPlayed5 != 4
            ; ** Song 4 **
            RobarTTWC9LienaREF.playsound3D RobarTTWSoundC9MorningLight
            let iDuration := 10000
            print "Playing 4 now"
            let iLastSongPlayed := 4

        elseif iLastSongPlayed != 5 && iLastSongPlayed2 != 5 && iLastSongPlayed3 != 5 && iLastSongPlayed4 != 5 && iLastSongPlayed5 != 5
            ; ** Song 5 **
            RobarTTWC9LienaREF.playsound3D RobarTTWSoundC9ForgottenWorld
            let iDuration := 10000
            print "Playing 5 now"
            let iLastSongPlayed := 5

        elseif iLastSongPlayed != 6 && iLastSongPlayed2 != 6 && iLastSongPlayed3 != 6 && iLastSongPlayed4 != 6 && iLastSongPlayed5 != 6
            ; ** Song 6 **
            RobarTTWC9LienaREF.playsound3D RobarTTWSoundC9VelvetSunrise
            let iDuration := 10000
            print "Playing 6 now"
            let iLastSongPlayed := 6
        endif
        
    else
        let iTimer += 1
    endif

 

 

 

Of course, the songs play in the same order every time and currently I'm having a really hard time figuring out what the heck the duration time should be for each song.

 

Any ideas for improvement? :angel:

Guest tomm434
Posted

so you didn't RAND?

Scriptname Questscript

int Song

int LastPlayedSong


begin gamemode

if timer>=Duration
call mySongFunction

if Song ==1
playsound song1
let LastPlayedSong :=1
elseif Song ==2
playsound song2
let LastPlayedSong :=2
let



Scriptname mySongFunction

int Chance
int stage

Begin Function

While Stage ==0
let Chance := RAND 0 100

if Chance >=0 && Chance <=10 ; 0 to 10 -song #1

  if Quest.LastPlayedSong ==1 ; if last song was 1
   ; do nothing, script will return to the loop start "let Chance := RAND 0 100"  because stage is still 0
  else ; Proceed
   let stage :=1
   let Quest.Song :=1
  endif

endif

if Chance >10 && Chance <=20 ; 0 to 10 -song #2

  if Quest.LastPlayedSong ==2 ; if last song was 2
   ; do nothing, script will return to the loop start "let Chance := RAND 0 100" because stage is still 0
  else ; Proceed
   let stage :=1
   let Quest.Song :=2
  endif

endif

..etc

loop


end

but in shis script you have 1\10000000000000 chance that it will loop forever. (if every time Rand will hit (0:10) and last song will be 1 )
Also you can do

Scriptname mySongFunction

int Chance
int stage

Begin Function



if Quest.LastPlayedSong ==1 ; if last song was 1
let Chance := RAND 0 100

if Chance >=0 && Chance <=10
let MyQuest.Song :=2
elseif Chance >10 && Chance <=20
let MyQuest.Song :=3
endif

elseif iQuest.LastPlayedSong ==2 ; if last song was 2

let Chance := RAND 0 100

if Chance >=0 && Chance <=10
let MyQuest.Song :=1
elseif Chance >10 && Chance <=20
let MyQuest.Song :=3
endif

elseif iQuest.LastPlayedSong ==3 ; if last song was 3

let Chance := RAND 0 100

if Chance >=0 && Chance <=10
let MyQuest.Song :=1
elseif Chance >10 && Chance <=20
let MyQuest.Song :=2
endif

;you got the idea. Of course you should change RAND value depending on how much songs you have


end
Posted

Now there's an idea. I didn't even know RAND existed! :blush:  Sure beats playing with stupid old GetRandomPercent!! The documentation for the GECK isn't the greatest. I'll factor in those changes and make things randomized.

 

I think I got a handle on what the duration for each song should be but....  say the player goes into the console? The timer won't update during that right? Also, would the timer update during MenuMode I wonder?

 

Best I can do at the moment at least. :angel:

Posted

 

It should be noted that on my install ONLY FONV stations work. All the TTW vanilla stations refuse to play as well. Likely this is some kind of codec thing that also extends to custom stations. (Though I have very few codecs installed...)

 

This could confirm the format issue I was referring. I remember FO3 has something different from NV, there was a codec icon popping out in my systray everytime I was playing it. Radio guides are very well explained but reading at the comments I remember that everyone had the issue with finding the right format (me too...) :P

Strange thing is TTW, I thought it was pretty much like NV. One day when you're bored would you PM me a random song directly from TTW? I want to try it on my NV and see if it happens like for you.

Guest tomm434
Posted

I introduced RAND to you a page ago :)

 

Quest only works in gamemode (gamemode block) -------------> Timer does too. Timer doesn't even goes if player waits(Wait menu != gamemode)

Also about waiting - didn't think about that. Can you check if sound will still play if player waits?

Posted

GetType: someone knows the difference between 42 - NPCs -  and 200 - Actor (for ref walking only) ?

Guest tomm434
Posted

200 = creatures + NPC together if I'm not mistaken.

 

S scanner uses gettype "200" as far as I remember.

 

Posted

Thank you Tomm, that's what I was wondering. But while I trust your judgement, still there's something that makes me feel uncertain: NVSE documentation says "Actor" and usually they speak about actors when it's NPC_ and not CREA. I really would love to hear more confirmations about this :-O

Guest tomm434
Posted

You need confirmation?  I don't recognize you. AJ I knew would have already checked it herself. :P

Posted

Oh but checking things can lead to mistakes and wrong interpretation of values, from my part. I more trust documentation, people who writes documentation is someone to be trusted more than my tests who are based by feelings, you know ;)

Guest tomm434
Posted

I can't agree with "feelings" part - do a "Print $ActorRef" after each search result and you'll see each NPC who is picked by the scanner.

Posted

I can't agree with "feelings" part - do a "Print $ActorRef" after each search result and you'll see each NPC who is picked by the scanner.

 

... Which doesn't mean every _NPC and CREA, unless you have a clue on how to compare that result with the effective refs presence in 9 cells...

Guest tomm434
Posted

I thought you needed to know who will scanner pick if you use 200 instead of 42\43. Place a dog and Sunny Smiles in your cell and scan for 200. if they are picked up both, then scanner will pick all walking references( NPC and creatures- who else is there?). Then change GetType to 42 and see if Dog is stil picked up to make sure that 42 doesn't works on creatures. Am I missing something?

Posted

I ended up using 200 because 42 didn't get everyone I wanted, 200 gets Creatures and Actors, you also need to do a GetFirstRef too or you will miss closest actor

 

Set iCnt to 0

Set iNumRefs to GetNumRefs 200 1

Label 1

if iCnt < 1

Set rTemp to rZActor.GetFirstRef 200 1 1

else

Set rTemp to rZActor.GetNextRef

endif

Set fTargDist to rZActor.GetDistance rTemp

Set iCnt to iCnt + 1

if iCnt < iNumRefs

goto 1

endif

Posted

yes sorry, I wasn't very precise.

 

There are 4 kinds of Types, in GetType. Actors, Creatures, Leveled Actors and Leveled Creatures. 200's description talks about Actors, I was wondering if it was including all the 4 kinds because it was making sense to re-unite them all in the same type, but I wanted a confirmation.

 

I started to take care about leveled things since I count to put TTW in some next future... I re-bought FO3 GOTY for Steam just to switch language :) (never managed to do that with Live)

Wohooo! can't wait to see TrickyVein's DC station...

Guest tomm434
Posted

Ok. While people think about AJ's problem, can I ask about coordinates - are they all the same for all game copies\languages? In my other mod I avoid editing vanilla cells at all by placing every object there is by coordinates(X,Y,Z, ANgleZ) and I'd like to know if that's reliable.

Posted

Tomm, I don't think it's an easy answer without some specific test. We could ask Odessa to compare her dump with mine, for what concerns coordinates

Guest tomm434
Posted

hm. Then I'll make a simple esp which will dump coordinates and upload it here when I get home, hope someone will find time to launch it. Think I'll be dumping some random persistent references in cells and in gameworld. thk for the idea.

Posted

hm. Then I'll make a simple esp which will dump coordinates and upload it here when I get home, hope someone will find time to launch it. Think I'll be dumping some random persistent references in cells and in gameworld. thk for the idea.

 

Oh wait I forgot, you are using TTW, are you using russian version?

Guest tomm434
Posted

Yes, TTW and not, not Russian.

 

I don't think there will be difference whether player has TTW running - Lunette is for vanilla NV and I use coordinates without TTW loaded in GECK. But in game I have TTW active and so far everything is placed where it is supposted to be placed.

Posted

So my dump would be fine to compare with. But I miss Odessa's program for comparison...

Guest tomm434
Posted
But I miss Odessa's program for comparison...

what programm?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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