Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Externalised Merchants
Re: New feature: Externalised Merchants[message #360388 is a reply to message #360386]
|
Wed, 17 June 2020 01:06
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
As expected, it works fine. I'm using a lua function that looks like this:
-- functions used here:
--
-- path: path and name of soundfile we want to play (in .wav, .ogg or .mp3 format)
-- volume: optional sound volume (65: medium volume, 127: loud), default 65
-- PlaySound(path, volume)
-- handle
-- sSectorX, sSectorY and bSectorZ indicate the sector coordinates
-- ubMerchantID is the ID of the merchant for whom this is called
-- usQuoteNum is the event of the dialogue that is supposed to be called
function HandleNPCMerchantQuote(sSectorX, sSectorY, bSectorZ, ubMerchantID, usQuoteNum )
-- test sounds
choicenr = math.random(1, 7)
if ( choicenr == 1 ) then PlaySound("Sounds//Weapons//38//38 CALIBER.ogg")
elseif ( choicenr == 2 ) then PlaySound("Sounds//Weapons//38//38SUPER PISTOL SINGLE SHOT.ogg")
elseif ( choicenr == 3 ) then PlaySound("Sounds//Weapons//38//380 MAC11 BURST 5.ogg")
elseif ( choicenr == 4 ) then PlaySound("Sounds//Weapons//RIFLE SILENCER BURST 5.ogg")
elseif ( choicenr == 5 ) then PlaySound("Sounds//Weapons//PUMP-ACTION.ogg")
elseif ( choicenr == 6 ) then PlaySound("Sounds//Weapons//BOLT-ACTION SPRINGFIELD.ogg")
elseif ( choicenr == 7 ) then PlaySound("Sounds//Weapons//50CAL.WAV")
end
end
As I assume the plan isn't to have the merchants double as firearms, this is where the sounds would go. ubMerchantID is the ID used when placing a merchant in HandleSectorTacticalEntry(...) in strategicmap.lua:
-- armour store (Skin Tight Fashions)
CreateCivilian(13010, CivGroup.KINGPIN_CIV_GROUP, 67, Bodytype.MINICIV, -1, -1, -1, -1, -1, -1, -1, -1)
so in this case it would be 67. usQuoteNum meanwhile is number of the quote that would be played if this were a profile-based merchant, which I posted earlier.
I could add extra arguments but am not that hopeful about it. Due to the way this lua function is accessed deep in the code, I'd prefer not having to drag in extra arguments, like stats of the merchant themself, though one should already know their bodytype and thus gender as we set that ourselves via CreateCivilian(...)
The only thing I'm unsure of is whether to add any sounds from movies/games/etc. you find to the GameDir trunk. That feels... unsafe, which is one of the reasons the mercs I made are not part of 1.13.
But even then nothing would stop one from simply packing the sounds as an addon.
[Updated on: Wed, 17 June 2020 01:09]
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
|
New feature: Externalised Merchants
By: Flugente on Thu, 20 December 2012 02:04
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Tue, 04 June 2019 06:02
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: ZedJA2 on Thu, 16 January 2020 02:37
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Mon, 15 June 2020 12:02
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Tue, 16 June 2020 00:14
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Tue, 16 June 2020 02:00
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Tue, 16 June 2020 16:54
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Wed, 17 June 2020 11:32
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Wed, 24 June 2020 20:17
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Thu, 25 June 2020 11:00
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Mon, 29 June 2020 03:38
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Mon, 29 June 2020 12:35
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Mon, 29 June 2020 23:33
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: kodamaqq on Mon, 08 August 2022 03:12
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Tue, 25 July 2023 01:27
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: smeagol on Thu, 20 December 2012 11:26
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Wil473 on Thu, 20 December 2012 18:44
|
|
|
Re: New feature: Externalised Merchants
By: Clarkew on Fri, 21 December 2012 03:59
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Clarkew on Fri, 29 March 2013 07:41
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Thu, 27 August 2015 19:21
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Flugente on Thu, 27 August 2015 20:22
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Thu, 27 August 2015 21:59
|
|
|
Re: New feature: Externalised Merchants
By: Flugente on Fri, 28 August 2015 02:22
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Fri, 28 August 2015 16:38
|
|
|
Re: New feature: Externalised Merchants
By: Flugente on Fri, 28 August 2015 22:22
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Sat, 29 August 2015 01:33
|
|
|
Re: New feature: Externalised Merchants
By: 88vs1984 on Sun, 31 December 2017 21:06
|
|
|
Re: New feature: Externalised Merchants
By: todd0001 on Fri, 05 January 2018 05:00
|
Goto Forum:
Current Time: Fri Mar 29 07:49:07 GMT+2 2024
Total time taken to generate the page: 0.02486 seconds
|