Scripts / Adding sound to radar...

Author
Message
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 19th Feb 2017 20:22 Edited at: 20th Feb 2017 01:39
Hi guys, this maybe of interest to some of you who want to add a little sound to your radar object / objective items.
I have included the script and sounds in the zip below.

Step.1
From the zip below just copy the radar_sound.lua and objective_sound.lua to your radar directory located here:-

\Steam\steamapps\common\Game Guru\Files\scriptbank\radar

Step.2
Copy the audio files to here:-

\Steam\steamapps\common\Game Guru\Files\audiobank\misc - or where you want them.

Step.3
Add the new radar_sound.lua script to your Entity set to: Always Active - Yes, Static Mode - No.

Step.4
Add the new objective_sound.lua script to your Entity objective including the below audio sounds.

Step.5
You will need to add the audio files to the object / objective in the order below; unless you want to use others you already have.

Sound0 - audiobank\misc\ping.wav
Sound1 - audiobank\misc\objectivenearby.ogg
Sound2 - audiobank\misc\objectiveclose.ogg
Sound3 - audiobank\misc\objectivecloser.ogg

Sound0 would be your normal objective completed sound.
Sound1 lets you know your objective is nearby.
Sound2 will start to ping when you are in range of an objective.
Sound3 is when you are on top of the objective and the audio sound will start pinging at a faster rate.

All audio sounds are under 10KB except one which is below 20KB, very small files.

Step.6
Adding more objectives - I have include two other audio sounds for other objectives which are denoted by the letter T in the filename. These are at different pitches of sound. Add your own if not used.

Step.7
Save and test in the same way you would any other level.

I have also included a map level for this example called "_radar_sound.fpm" but you will need the Scifi Pack DLC to use this demo.

Notes
If you wish to change the distance of the objectives this can be done by editing the radar_sound.lua script on line 18. Also lines 101, 105 and 107.

Image attached



YouTube example

Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG

Attachments

Login to view attachments
PM
Freakon
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: UK
Posted: 20th Feb 2017 07:48
Pretty cool thanks! Can the same be done for enemies?
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 20th Feb 2017 08:02 Edited at: 20th Feb 2017 08:02
Is it possible to add the sound without displaying the radar? I'm thinking of ways to add an "easy mode" other than more health to my game, i was thinking that objectives could make sounds like this (while you are on the relevant mission) as well if you select easy, but i don't want the radar part as it doesn't fit into the game style.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 20th Feb 2017 19:51 Edited at: 20th Feb 2017 21:14
Hi guys,

Quote: "@Freakon - Can the same be done for enemies?"


Yes this can be done for enemies too. Just edit the file radar_sound.lua and copy and paste lines 100-110 to between 81-83 and follow the same steps to add sound to your enemies properties.

Example in the below YouTube of enemy hostiles nearby. Also three audio files attached. You will need to change the range of the enemy by editing the example script above which will now be on line 83 for the distance and line 84 for the text displayed on screen.



Quote: "Belidos - Is it possible to add the sound without displaying the radar?"


Yes Belidos , this is also possible too. Just by cutting out all the radar sprite code. I will look into this soon... but it is very easy to update the code yourself as you will need to keep some of the functions of the radar script. You just won't want the radar sprites to displayed on screen.

========================================================


Also working on a new radar system based on "Aliens Motion Tracker" like in the movies. Hopefully this will add a little fun and tension to games - Nothing like a fear factor to heighten your senses.

I'm also working on a menu system for the standalone version(s) to allow you to add functions for controller(s), music, radar, etc... So basically this will add an extra menu to config scripts before someone starts the game... it won't work in the editor test game but will on the standalone games.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG

Attachments

Login to view attachments
PM
Freakon
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: UK
Posted: 20th Feb 2017 21:54
Superb! Thanks very much for you informative answer and script!

gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 21st Feb 2017 08:52 Edited at: 21st Feb 2017 09:58
Hi guys, this next YouTube is a WIP for my "Alien Motion Tracker" which is based on the Alien movies. I still need to add a lot more to it...



Let me know what you think of it so far...
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Feb 2017 16:06
Eh! gd my wife is wondering if she can attach that radar to me.

Nice work mate! Thanks you very much for sharing.

I know you are waiting for feedbacks, I'll can give you as soon as I'm ready with my "beeper" to be use to get the righ way to ride mazes, and locate the creatures.

Idea is apart from sounds also the light becames green color when in right way, and red when does not.
Also you can see the maze number the player is.

If you are in zafe zone (green color light) - not sound here
If you are in zafe zone but creatures closest - alarm sound here

If you are in unsafe zone - normal beep-beep sound - (red color)
If you are in unsafe zone + creatures closest - intensive beep-beep-beep sound here. (red color)

Of course you will has to accomplish many missions, before you can enjoy this bundle.



All this becames to a new maze runner pack I'm working now for store. Thought.
Now working on level1, I'll back with news when done.

3com
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
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 21st Feb 2017 19:37
Hi 3com, that sound great I look forward to your updates.

Quote: "Eh! gd my wife is wondering if she can attach that radar to me."

I have also made a GPS version using an old Nokia Lumia 920, TOMTOM ONE and my 3D printer to track siblings. The only problem is it crashes when they are just in range. That's MS Windows for you. lol
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Feb 2017 19:42


Lol, I started this last year, never got around to finishing it. Couldn't find the right sounds to go with it.
Been there, done that, got all the T-Shirts!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 21st Feb 2017 20:37
Quote: "The only problem is it crashes when they are just in range. That's MS Windows for you. lol"

Nice workaround. lol

3com
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
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 22nd Feb 2017 01:10 Edited at: 22nd Feb 2017 01:12
Hi AmenMoses, Just been adding the pulsing scanner rings too. Now working on the distance readout.

Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2017 20:31 Edited at: 22nd Feb 2017 20:36
@gd, saw your post on the free scripts thread, see the attached.

This is the radar(s) script I was working on last year and abandoned so feel free to use any parts of it you need.

The function ground_radar_plot_enemies contains code that sorts the enemies in order of distance from player, if you look at line 189 you'll see where the magic happens.

When you say 'text', do you want to display the name of the ai character? If so you'll need to save the names to a list indexed by entity like this:
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 22nd Feb 2017 20:42 Edited at: 22nd Feb 2017 20:45
Hi AmenMoses, thank for the code. I will look through it

Quote: "When you say 'text' do you want to display the name of the ai character? If so you'll need to save the names to a list indexed by entity like this"

No, I just mean TextCenterOnXColor(x,y,size,closesEnemyDistance,255,255,255) as an example.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2017 21:05
Oh right, well in the bit of code I pointed to just take the square root of the sorted list entry and you'll have the distance to target.



Been there, done that, got all the T-Shirts!
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 22nd Feb 2017 21:11 Edited at: 22nd Feb 2017 21:14
Thanks, I'm also thinking of having an option for the device to malfunction so it can send players in the wrong direction into an ambush. Just like the Handlink device in Quantum leap - give it a few bashes and it works again lol
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 SLI mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3


A new competition running for GG
PM
warlock12
8
Years of Service
User Offline
Joined: 12th Sep 2016
Location: Argentina
Posted: 22nd Feb 2017 23:01
Wow excellent jobs!!! Amazing... Felicitations!
The game is a serious thing (El juego es una cosa seria)

Login to post a reply

Server time is: 2024-12-23 03:39:03
Your offset time is: 2024-12-23 03:39:03