Product Chat / [SOLVED] About LoadGlobalSound slots

Author
Message
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th Feb 2020 11:41
Do not mess around GlobalSounds, and need to clarify something about.
I am working on a conversation system in GG.
At the moment I am testing with the player, a man, and a woman in the same map; Both have their own script attached.

The script of the man loads the sounds (voices) as follows:

LoadGlobalSound (mysound.wav, 1)
LoadGlobalSound (mysound1.wav, 2)
LoadGlobalSound (mysound2.wav, 3)

And the woman's script:

LoadGlobalSound (mysound3.wav, 1)
LoadGlobalSound (mysound4.wav, 2)
LoadGlobalSound (mysound5.wav, 3)

Note: Notice slots, in both cases they are going from 1 to 3.

The man's script loads 3 buttons (sprites) and the mouse, after pressing the "E" key.
The player selects the text (button) and gets the corresponding question and answer.

The woman's script does the same but using the keyboard.
If the player presses the numeric key "1" he will get the question and answer number 1, and so on.

At the moment I have only applied the mouse, to the script of the man.

ISSUE
When I execute the man script (distance based), I press the "E" key, select a button and press the left mouse button,
The text changes color as expected, but I get a mix of sounds, that is, the player's question with the woman's answer.

First reaction was a surprise, as it is not possible, due the woman's sounds are executed by means of keys and not through the mouse.

QUESTION

Are the slots used by GlobalSound () on the same map are inclusive between them?

That is, if a script1 declares:

LoadGlobalSound (mysound.wav, 1)
LoadGlobalSound (mysound1.wav, 2)
LoadGlobalSound (mysound2.wav, 3)

A script2 on the same map should state:

LoadGlobalSound (mysound.wav, 4)
LoadGlobalSound (mysound1.wav, 5)
LoadGlobalSound (mysound2.wav, 6)

Tha's the right way, in order to avoid the mistake?

Note1: Notice slot going from 1 to 6.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

The author of this post has marked a post as an answer.

Go to answer
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Feb 2020 14:42
This post has been marked by the post author as the answer.
yes all indexes should be unique
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th Feb 2020 15:12
@ smallg
Thank you for confirming this information.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 12th Feb 2020 18:02
Thanks for posting this info, 3com, smallg. I assume sounds would
be nice to have in animated speech and gestures- so good to know.
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 12th Feb 2020 18:08 Edited at: 12th Feb 2020 18:10
If you are using Globals think of it as all possible entities are using your list of sounds. Its the global list of sounds and nobody owns them but the world.

If you use local sounds, for example, SoundSet slots. You can use 1,2,3,4 etc for all characters and the sounds would be different and unique , despite using the same slot number. Local sounds are owned and emitted by the characters assigned to them.

If you plan on having a ton of audio files you should have another script store all your sounds into one database. Basically a list of Load Global Sounds. Then have your entities reference them based on what type of character they are.

Store Assets - Store Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 12th Feb 2020 18:33
That's my first try, using keys here yet.



I just want to code some sort of conversation system I can use with CC when GGMax comes.
Idea is work with CC char, with lip-syn applied.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-11-23 19:42:22
Your offset time is: 2024-11-23 19:42:22