Samuel - sounds PASSED

Here i will list the apprentices and their learning tasks, so others also can follow how it goes.
Please DONT POST HERE any solutions on the given task earlier than the apprentice, you can ask questions from him tough.
Post Reply
Stratego (dev)
Site Admin
Posts: 9992
Joined: Fri Apr 25, 2014 9:28 pm

Samuel - sounds PASSED

Post by Stratego (dev) » Sat Sep 23, 2017 6:52 pm

In AOW there are no sounds implemented yet in json, so
task 1: put in this sound to json form:

the defaultSoundUh means "unit_selected_small4.ogg" file, and its weight is given by its number of occurence - never ask why was it :)

Code: Select all


		int defaultSoundUh = SoundsDef.addSound("unit_selected_small4.ogg");
		
		// -----------------------
		// UNIT ATTACK SOUNDS
		// -----------------------
		
		SoundsDef.packs.append(SOUND_PACK_UNIT_ATTACK_TANK_SHOOT, 
				new int[] { 
				SoundsDef.addSound("unit_tank_shoot.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_ATTACK_VEHICLE_SHOOT, 
				new int[] { 
				SoundsDef.addSound("unit_tank_shoot.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_ATTACK_SHIP_SHOOT, 
				new int[] { 
				SoundsDef.addSound("unit_tank_shoot.ogg"),
				}
		);
		
		SoundsDef.packs.append(SOUND_PACK_UNIT_ATTACK_PLANE_SHOOT, 
				new int[] { 
				SoundsDef.addSound("unit_tank_shoot.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_ATTACK_INF_SHOOT, 
				new int[] { 
				SoundsDef.addSound("unit_tank_shoot.ogg"),
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_ATTACK_AA_SHOOT, 
				new int[] { 
				SoundsDef.addSound("unit_tank_shoot.ogg"),
				}
		);
		// -----------------------
		// UNIT SELECT SOUNDS
		// -----------------------
		SoundsDef.packs.append(SOUND_PACK_UNIT_SELECT_US, 
				new int[] { 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				SoundsDef.addSound("unit_selected_us_yes.ogg"),
				SoundsDef.addSound("unit_selected_us_yes_sir.ogg"),
				SoundsDef.addSound("unit_selected_us_your_orders.ogg"),				
				}
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_SELECT_GER, 
				new int[] { 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				SoundsDef.addSound("unit_selected_ger_raus_out.ogg"),
				}
		
		
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_SELECT_RU, 
				new int[] { 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,	
				SoundsDef.addSound("unit_selected_rus.ogg"),
				}
		
		
		);
		SoundsDef.packs.append(SOUND_PACK_UNIT_SELECT_JP, 
				new int[] { 
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				defaultSoundUh,
				SoundsDef.addSound("unit_selected_us_yes.ogg"),
				SoundsDef.addSound("unit_selected_us_yes_sir.ogg"),
				SoundsDef.addSound("unit_selected_us_your_orders.ogg"),				
				}
		
		
		);



User avatar
samuelch
Posts: 1607
Joined: Thu May 01, 2014 7:43 am
Location: Batavia

Re: Samuel - sounds

Post by samuelch » Sat Sep 23, 2017 7:09 pm

Sounds.
Attachments
sounds.json
(1.8 KiB) Downloaded 53 times
My pfp is made by Chiefchirpa.
Hugs and love FUR eFURRYone!Murr

Stratego (dev)
Site Admin
Posts: 9992
Joined: Fri Apr 25, 2014 9:28 pm

Re: Samuel - sounds

Post by Stratego (dev) » Sat Sep 23, 2017 8:12 pm

seems good!

comment: the weights are everywhere 1, the weight needs to be increased if you want it to sound more frequently
(
sample:
soundA weight 80
soundB weight 20

means AoundA will have 80% to be heard, while B is only 20%

same result if you set this:
soundA weight 4
soundB weight 1

)

eg: on SOUND_PACK_UNIT_SELECT_US
the
- unit_selected_small4.ogg should be weight 21
- unit_selected_us_yes.ogg weight 1
- unit_selected_us_yes_sir.ogg weight 1
- unit_selected_us_your_orders.ogg weight 1

User avatar
samuelch
Posts: 1607
Joined: Thu May 01, 2014 7:43 am
Location: Batavia

Re: Samuel - sounds

Post by samuelch » Sun Sep 24, 2017 9:08 am

Fix.
Attachments
sounds.json
(1.81 KiB) Downloaded 45 times
My pfp is made by Chiefchirpa.
Hugs and love FUR eFURRYone!Murr

Stratego (dev)
Site Admin
Posts: 9992
Joined: Fri Apr 25, 2014 9:28 pm

Re: Samuel - sounds

Post by Stratego (dev) » Sun Sep 24, 2017 1:27 pm

there were "comma" errors while compiling in, i have fixed them:

"packIDString": "SOUND_PACK_UNIT_SELECT_US",
"items": [
{"fileName": "unit_selected_small4.ogg", "weight": 21},
{"fileName": "unit_selected_us_yes.ogg", "weight": 1},
{"fileName": "unit_selected_us_yes_sir.ogg", "weight": 1},
{"fileName": "unit_selected_us_your_orders.ogg", "weight": 1} (HERE WERE a COMMA that is not needed)
]


and were some in similar places:
key point: that is a list, and tha last item has no commas in the end.

here is the fixed, check where the unwanted commas were - you will get same error when you design in UFO game and left there commas.
sounds.json
(1.8 KiB) Downloaded 50 times
other than this it was impeccable!
-----------
SECOND PASSED item!

Post Reply

Return to “Under the Hood studies”