Author Topic: Getting WiH's betty  (Read 2731 times)

0 Members and 1 Guest are viewing this topic.

Offline Firartix

  • 27
  • Random Noob
Say you're suicidal and you want to have the annoying betty voices on other mods.

Would it be possible to get it in a separate mod folder that you could enable on other mods (using the -mod option on the launcher) ?
Or would it have some sort of compatibility issues and stuff ?
If you can - any clue of which files that would be ? I saw the audio ones, but i have no idea at all about the script stuff...

 

Offline IronBeer

  • 29
  • (Witty catchphrase)
Couldn't you just FRED Betty voices in? Dunno how WiH did it, but that seems like a simple solution.
"I have approximate knowledge of many things."

Ridiculous, the Director's Cut

Starlancer Head Animations - Converted

 

Offline Firartix

  • 27
  • Random Noob
No the point wasn't to use it for some release or something, it's for end user use on any and all mod  :cool:

I did a directory search in the mod folder, and it sounds like you actually only need a TBL that trigger some kind of script or whatever - the betty itself, the sound files, and a section of the sounds.tbl that defines the sounds.

Now, i guess we can include that one tbm without problem from it's look but... what about the sounds?
I guess the sound number thingy could conflict with other mods ones...
So like, is it possible to turn this into a tbm, and make the sound ids eg. 1234560+ so that nobody would be idiot enough to look thair  ? :nervous:

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
I'm going to take a random guess and say that if you put bp2-betty-sct.tbm into data/tables
and the related betty sound files (bettyeject.ogg etc) into data/sounds that it will probably work with everything.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
I'm going to take a random guess and say that if you put bp2-betty-sct.tbm into data/tables
and the related betty sound files (bettyeject.ogg etc) into data/sounds that it will probably work with everything.

Problem is the betty only works with UEF ships - you'll notice if you take a GTVA ship in Aristeia it's not present.

You may need to edit the script to remove this restriction.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Can somebody who knows how the script works make a tutorial on how to add Betty to other ships?
Atmospheric flight mods could use this.

 

Offline Colonol Dekker

  • HLP is my mistress
  • 213
  • Aken Tigh Dekker- you've probably heard me
    • My old squad sub-domain
Or a retail (GTVA default) template so people can construct their own?
Campaigns I've added my distinctiveness to-
- Blue Planet: Battle Captains
-Battle of Neptune
-Between the Ashes 2
-Blue planet: Age of Aquarius
-FOTG?
-Inferno R1
-Ribos: The aftermath / -Retreat from Deneb
-Sol: A History
-TBP EACW teaser
-Earth Brakiri war
-TBP Fortune Hunters (I think?)
-TBP Relic
-Trancsend (Possibly?)
-Uncharted Territory
-Vassagos Dirge
-War Machine
(Others lost to the mists of time and no discernible audit trail)

Your friendly Orestes tactical controller.

Secret bomb God.
That one time I got permabanned and got to read who was being bitxhy about me :p....
GO GO DEKKER RANGERSSSS!!!!!!!!!!!!!!!!!
President of the Scooby Doo Model Appreciation Society
The only good Zod is a dead Zod
NEWGROUNDS COMEDY GOLD, UPDATED DAILY
http://badges.steamprofile.com/profile/default/steam/76561198011784807.png

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Can somebody who knows how the script works make a tutorial on how to add Betty to other ships?
Atmospheric flight mods could use this.

At the end of the file "bp2-betty-sct.tbm", you will see a condition which trigger the Betty script on a specific race. Per default, it's set to UEF. Just replace UEF by whatever race you want. So, all the ships from that specific race will got Betty voice.
You should also modify the script in top of the files since there are Hardcoded condition for specific weapons (ammunition).

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
And what if I wanted to give it to more than one race?

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Just add a new condition with an or operator.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Or, you know, ask the guy who wrote it.

Which would be me.

Here's my quick-and-dirty guide to the betty script.

Part 1: Components.

The betty script has three components, all of which must be present in order for the script to work. The script itself (obviously), the sound files, and the entries in sounds.tbl.

Part 2: Customization

Here, I will highlight the areas of the script where you will need or want to make alterations.

Code: [Select]
betty.queueprocessdelay = 2 --Minimum delay for queue processing
betty.comms = 500 --see sounds.tbl
betty.engine = 501
betty.nav = 502
betty.sensors = 503
betty.weapons = 504
betty.hull = 505
betty.eject = 506
betty.primary = {}
betty.primary[1] = 507
betty.primary[2] = 508
betty.primary[3] = 509
betty.secondary = {}
betty.secondary[1] = 510
betty.secondary[2] = 511
betty.secondary[3] = 512
betty.secondary[4] = 513
betty.secondaryempty = {}
betty.secondaryempty[1] = 514
betty.secondaryempty[2] = 515
betty.secondaryempty[3] = 516
betty.secondaryempty[4] = 517
betty.primaryempty = {}
betty.primaryempty[1] = 518
betty.primaryempty[2] = 519
betty.primaryempty[3] = 520
betty.subspace = 521

This is where you need to put your sounds.tbl indices, if you use your own. Note that the "subspace" warning does not work at this time. "betty.queueprocessdelay" is measured in seconds, and denotes the minimum time between two betty messages.

Code: [Select]
if not betty.subsystems.comms then
if betty.plrship["communications"]:isValid() then
betty.subsystems.comms = betty.plrship["communications"]
end
end

if not betty.subsystems.engine then
if betty.plrship["engine"]:isValid() then
betty.subsystems.engine = betty.plrship["engine"]
betty.enginenum = 0
end
if betty.plrship["engines"]:isValid() then
betty.subsystems.engine = betty.plrship["engines"]
betty.enginenum = 0
end
end

if not betty.subsystems.engine01 then
if betty.plrship["engine01"]:isValid() then
betty.subsystems.engine01 = betty.plrship["engine01"]
betty.enginenum = 1
end
end

if not betty.subsystems.engine02 then
if betty.plrship["engine02"]:isValid() then
betty.subsystems.engine02 = betty.plrship["engine02"]
betty.enginenum = 2
end
end

if not betty.subsystems.engine03 then
if betty.plrship["engine03"]:isValid() then
betty.subsystems.engine03 = betty.plrship["engine03"]
betty.enginenum = 3
end
end

if not betty.subsystems.engine04 then
if betty.plrship["engine04"]:isValid() then
betty.subsystems.engine04 = betty.plrship["engine04"]
betty.enginenum = 4
end
end

if not betty.subsystems.engine01 then
if betty.plrship["engine01a"]:isValid() then
betty.subsystems.engine01 = betty.plrship["engine01a"]
betty.enginenum = 1
end
end

if not betty.subsystems.engine02 then
if betty.plrship["engine02a"]:isValid() then
betty.subsystems.engine02 = betty.plrship["engine02a"]
betty.enginenum = 2
end
end

if not betty.subsystems.engine03 then
if betty.plrship["engine03a"]:isValid() then
betty.subsystems.engine03 = betty.plrship["engine03a"]
betty.enginenum = 3
end
end

if not betty.subsystems.engine04 then
if betty.plrship["engine04a"]:isValid() then
betty.subsystems.engine04 = betty.plrship["engine04a"]
betty.enginenum = 4
end
end

if not betty.subsystems.nav then
if betty.plrship["navigation"]:isValid() then
betty.subsystems.nav = betty.plrship["navigation"]
end
end

if not betty.subsystems.sensors then
if betty.plrship["sensors"]:isValid() then
betty.subsystems.sensors = betty.plrship["sensors"]
end
end

if not betty.subsystems.weapons then
if betty.plrship["weapons"]:isValid() then
betty.subsystems.weapons = betty.plrship["weapons"]
end
end

This is where the script gets pointers to the player's subsystems. You may need to add to or alter this section to adjust the script for your mods' models.

This next section handles the various triggers. Alter the conditions to adjust when a warning will occur; but take note how the trigger reset works. The script is set up to play a warning if a given subsystem falls below 1% health. Once that happens, a boolean variable by the name of betty.status.<bla>warned is set to true, in order to stop the script from throwing warnings every frame. Given that subsystems can be repaired and ammo restocked, the script is set up to reset that trigger if the subsys health is above 10 %. Ammo warnings are conceptually the same.
Code: [Select]
function processTriggers()
if betty.subsystems.comms then
if betty.subsystems.comms.HitpointsLeft/betty.subsystems.comms.HitpointsMax < 0.01 and not betty.status.commwarned then
queueWarning(betty.comms)
betty.status.commwarned = true
elseif betty.subsystems.comms.HitpointsLeft/betty.subsystems.comms.HitpointsMax > 0.1 then
betty.status.commwarned = false
end
end

getenginehealth()

if betty.enginehealth < 0.01 and not betty.status.enginewarned then
queueWarning(betty.engine)
betty.status.enginewarned = true
elseif betty.enginehealth > 0.1 then
betty.status.enginewarned = false
end

if betty.subsystems.nav then
if betty.subsystems.nav.HitpointsLeft/betty.subsystems.nav.HitpointsMax < 0.01 and not betty.status.navwarned then
queueWarning(betty.nav)
betty.status.navwarned = true
elseif betty.subsystems.nav.HitpointsLeft/betty.subsystems.nav.HitpointsMax > 0.1 then
betty.status.navwarned = false
end
end

if betty.subsystems.sensors then
if betty.subsystems.sensors.HitpointsLeft/betty.subsystems.sensors.HitpointsMax < 0.01 and not betty.status.sensorswarned then
queueWarning(betty.sensors)
betty.status.sensorswarned = true
elseif betty.subsystems.sensors.HitpointsLeft/betty.subsystems.sensors.HitpointsMax > 0.1 then
betty.status.sensorswarned = false
end
end

if betty.subsystems.weapons then
if betty.subsystems.weapons.HitpointsLeft/betty.subsystems.weapons.HitpointsMax < 0.01 and not betty.status.weaponswarned then
queueWarning(betty.weapons)
betty.status.weaponswarned = true
elseif betty.subsystems.weapons.HitpointsLeft/betty.subsystems.weapons.HitpointsMax > 0.1 then
betty.status.weaponswarned = false
end
end

if betty.plrship.HitpointsLeft/betty.plrship.HitpointsMax < 0.41 and not betty.status.hullwarned then
queueWarning(betty.hull)
betty.status.hullwarned = true
elseif betty.plrship.HitpointsLeft/betty.plrship.HitpointsMax > 0.41 then
betty.status.hullwarned = false
end

if betty.plrship.HitpointsLeft/betty.plrship.HitpointsMax < 0.1 and not betty.status.ejectwarned then
queueWarning(betty.eject)
betty.status.ejectwarned = true
elseif betty.plrship.HitpointsLeft/betty.plrship.HitpointsMax > 0.1 then
betty.status.ejectwarned = false
end

As MetalDestroyer pointed out, this is where you need to put your own weapon names for ballistic primaries.
Code: [Select]
for i = 1, 3, 1 do
if betty.plrship.PrimaryBanks[i]:isValid() then
if betty.plrship.PrimaryBanks[i].WeaponClass.Name == "Gattler" or betty.plrship.PrimaryBanks[i].WeaponClass.Name == "Archer" or betty.plrship.PrimaryBanks[i].WeaponClass.Name == "UX Accelerator" or betty.plrship.PrimaryBanks[i].WeaponClass.Name == "Redeemer" or betty.plrship.PrimaryBanks[i].WeaponClass.Name == "Vajra" then
if betty.plrship.PrimaryBanks[i].AmmoLeft/betty.plrship.PrimaryBanks[i].AmmoMax < 0.26 and not betty.status.primarywarned[i] then
queueWarning(betty.primary[i])
betty.status.primarywarned[i] = true
elseif betty.plrship.PrimaryBanks[i].AmmoLeft/betty.plrship.PrimaryBanks[i].AmmoMax > 0.27 then
betty.status.primarywarned[i] = false
end

if betty.plrship.PrimaryBanks[i].AmmoLeft == 0 and not betty.status.primaryemptywarned[i] then
queueWarning(betty.primaryempty[i])
betty.status.primaryemptywarned[i] = true
elseif betty.plrship.PrimaryBanks[i].AmmoLeft > 0 then
betty.status.primaryemptywarned[i] = false
end
end
end
end

for i = 1, 4, 1 do
if betty.plrship.SecondaryBanks[i]:isValid() then
if betty.plrship.SecondaryBanks[i].AmmoLeft/betty.plrship.SecondaryBanks[i].AmmoMax < 0.26 and not betty.status.secondarywarned[i] then
queueWarning(betty.secondary[i])
betty.status.secondarywarned[i] = true
elseif betty.plrship.SecondaryBanks[i].AmmoLeft/betty.plrship.SecondaryBanks[i].AmmoMax > 0.27 then
betty.status.secondarywarned[i] = false
end

if betty.plrship.SecondaryBanks[i].AmmoLeft == 0 and not betty.status.secondaryemptywarned[i] then
queueWarning(betty.secondaryempty[i])
betty.status.secondaryemptywarned[i] = true
elseif betty.plrship.SecondaryBanks[i].AmmoLeft > 0 then
betty.status.secondaryemptywarned[i] = false
end
end
end
end

Finally, we come to the on-frame business.

Code: [Select]
if not BettyOverride then
ttime = mn.getMissionTime()

if ttime ~= 0 then
if not bettyinited then
initbetty()
else
if betty.plrship.Class.Species.Name == "UEF" then
processTriggers()
printQueue()
processQueue()
else
betty = nil
bettyinited = false
BettyOverride = true
end
end
end
end

As was pointed out, the "if betty.plrship.Class.Species.Name == "UEF" then   " conditional is what you need to alter/remove in order to use this on non-UEF ships.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Is there some kind of technical documentation about the lua scripting in fs 2 SCP ? I'm wondering how you know which attribute you can use for the betty object.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
There's the scripting.tbl page on the wiki, which will tell you some of the basics. A more complete reference for all the various fields you can use can be obtained by starting the exe with the "-output_scripting" parameter (Found in the Launcher's Dev Tools section, "output scripting to scripting.html"), which will generate an html file listing all the various fields and methods available for all objects that the scripting code can handle currently.

As for the betty object, it is defined in its entirety in the script.
The important bits are: betty.plr, which is the player's handle, betty.subsystems, which is an array holding pointers to the subsystems betty tracks, betty.queue, which is a queue where messages get lined up for playback, and a bunch of variables holding sounds.tbl indices.
« Last Edit: December 20, 2010, 05:19:54 am by The E »
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Thanks.