forked from 0ad/0ad
Use voices for infantry/cavalry units.
Make arrows quieter. Handle order-related sounds via the GUI instead of simulation, to make them player-specific and to reduce latency. This was SVN commit r8254.
This commit is contained in:
parent
aa32677784
commit
59c8ecfa3d
@ -9,8 +9,8 @@
|
|||||||
<Looping>0</Looping>
|
<Looping>0</Looping>
|
||||||
<RandOrder>1</RandOrder>
|
<RandOrder>1</RandOrder>
|
||||||
<RandGain>1</RandGain>
|
<RandGain>1</RandGain>
|
||||||
<GainUpper>1</GainUpper>
|
<GainUpper>0.5</GainUpper>
|
||||||
<GainLower>0.8</GainLower>
|
<GainLower>0.4</GainLower>
|
||||||
<RandPitch>1</RandPitch>
|
<RandPitch>1</RandPitch>
|
||||||
<PitchUpper>1.1</PitchUpper>
|
<PitchUpper>1.1</PitchUpper>
|
||||||
<PitchLower>0.9</PitchLower>
|
<PitchLower>0.9</PitchLower>
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
|
||||||
|
<SoundGroup>
|
||||||
|
<Gain>1</Gain>
|
||||||
|
<Pitch>1</Pitch>
|
||||||
|
<Priority>100</Priority>
|
||||||
|
<ConeGain>1</ConeGain>
|
||||||
|
<ConeInner>360</ConeInner>
|
||||||
|
<ConeOuter>360</ConeOuter>
|
||||||
|
<Looping>0</Looping>
|
||||||
|
<RandOrder>1</RandOrder>
|
||||||
|
<RandGain>1</RandGain>
|
||||||
|
<GainUpper>1</GainUpper>
|
||||||
|
<GainLower>0.8</GainLower>
|
||||||
|
<RandPitch>1</RandPitch>
|
||||||
|
<PitchUpper>1.1</PitchUpper>
|
||||||
|
<PitchLower>0.9</PitchLower>
|
||||||
|
<Threshold>1</Threshold>
|
||||||
|
<Decay>3</Decay>
|
||||||
|
<Replacement>civ_male_Asyouwish_1.ogg</Replacement>
|
||||||
|
<Path>audio/voice/hellenes/civ</Path>
|
||||||
|
<Sound>civ_male_Asyouwish_1.ogg</Sound>
|
||||||
|
</SoundGroup>
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
|
||||||
|
<SoundGroup>
|
||||||
|
<Gain>1</Gain>
|
||||||
|
<Pitch>1</Pitch>
|
||||||
|
<Priority>100</Priority>
|
||||||
|
<ConeGain>1</ConeGain>
|
||||||
|
<ConeInner>360</ConeInner>
|
||||||
|
<ConeOuter>360</ConeOuter>
|
||||||
|
<Looping>0</Looping>
|
||||||
|
<RandOrder>1</RandOrder>
|
||||||
|
<RandGain>1</RandGain>
|
||||||
|
<GainUpper>1</GainUpper>
|
||||||
|
<GainLower>0.8</GainLower>
|
||||||
|
<RandPitch>1</RandPitch>
|
||||||
|
<PitchUpper>1.1</PitchUpper>
|
||||||
|
<PitchLower>0.9</PitchLower>
|
||||||
|
<Threshold>1</Threshold>
|
||||||
|
<Decay>3</Decay>
|
||||||
|
<Replacement>civ_male_attack_10.ogg</Replacement>
|
||||||
|
<Path>audio/voice/hellenes/civ</Path>
|
||||||
|
<Sound>civ_male_attack_10.ogg</Sound>
|
||||||
|
</SoundGroup>
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
|
||||||
|
<SoundGroup>
|
||||||
|
<Gain>1</Gain>
|
||||||
|
<Pitch>1</Pitch>
|
||||||
|
<Priority>100</Priority>
|
||||||
|
<ConeGain>1</ConeGain>
|
||||||
|
<ConeInner>360</ConeInner>
|
||||||
|
<ConeOuter>360</ConeOuter>
|
||||||
|
<Looping>0</Looping>
|
||||||
|
<RandOrder>1</RandOrder>
|
||||||
|
<RandGain>1</RandGain>
|
||||||
|
<GainUpper>1</GainUpper>
|
||||||
|
<GainLower>0.8</GainLower>
|
||||||
|
<RandPitch>1</RandPitch>
|
||||||
|
<PitchUpper>1.1</PitchUpper>
|
||||||
|
<PitchLower>0.9</PitchLower>
|
||||||
|
<Threshold>1</Threshold>
|
||||||
|
<Decay>3</Decay>
|
||||||
|
<Replacement>civ_male_yes_1.ogg</Replacement>
|
||||||
|
<Path>audio/voice/hellenes/civ</Path>
|
||||||
|
<Sound>civ_male_yes_1.ogg</Sound>
|
||||||
|
</SoundGroup>
|
@ -202,6 +202,7 @@ function tryPlaceBuilding(queued)
|
|||||||
"entities": selection,
|
"entities": selection,
|
||||||
"queued": queued
|
"queued": queued
|
||||||
});
|
});
|
||||||
|
Engine.GuiInterfaceCall("PlaySound", { "name": "order_repair", "entity": selection[0] });
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -504,19 +505,23 @@ function handleInputAfterGui(ev)
|
|||||||
case "move":
|
case "move":
|
||||||
var target = Engine.GetTerrainAtPoint(ev.x, ev.y);
|
var target = Engine.GetTerrainAtPoint(ev.x, ev.y);
|
||||||
Engine.PostNetworkCommand({"type": "walk", "entities": selection, "x": target.x, "z": target.z, "queued": queued});
|
Engine.PostNetworkCommand({"type": "walk", "entities": selection, "x": target.x, "z": target.z, "queued": queued});
|
||||||
|
Engine.GuiInterfaceCall("PlaySound", { "name": "order_walk", "entity": selection[0] });
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "attack":
|
case "attack":
|
||||||
Engine.PostNetworkCommand({"type": "attack", "entities": selection, "target": action.target, "queued": queued});
|
Engine.PostNetworkCommand({"type": "attack", "entities": selection, "target": action.target, "queued": queued});
|
||||||
|
Engine.GuiInterfaceCall("PlaySound", { "name": "order_attack", "entity": selection[0] });
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "build": // (same command as repair)
|
case "build": // (same command as repair)
|
||||||
case "repair":
|
case "repair":
|
||||||
Engine.PostNetworkCommand({"type": "repair", "entities": selection, "target": action.target, "queued": queued});
|
Engine.PostNetworkCommand({"type": "repair", "entities": selection, "target": action.target, "queued": queued});
|
||||||
|
Engine.GuiInterfaceCall("PlaySound", { "name": "order_repair", "entity": selection[0] });
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "gather":
|
case "gather":
|
||||||
Engine.PostNetworkCommand({"type": "gather", "entities": selection, "target": action.target, "queued": queued});
|
Engine.PostNetworkCommand({"type": "gather", "entities": selection, "target": action.target, "queued": queued});
|
||||||
|
Engine.GuiInterfaceCall("PlaySound", { "name": "order_gather", "entity": selection[0] });
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "set-rallypoint":
|
case "set-rallypoint":
|
||||||
@ -640,6 +645,7 @@ function handleMinimapEvent(target)
|
|||||||
{
|
{
|
||||||
case "move":
|
case "move":
|
||||||
Engine.PostNetworkCommand({"type": "walk", "entities": selection, "x": target.x, "z": target.z, "queued": queued});
|
Engine.PostNetworkCommand({"type": "walk", "entities": selection, "x": target.x, "z": target.z, "queued": queued});
|
||||||
|
Engine.GuiInterfaceCall("PlaySound", { "name": "order_walk", "entity": selection[0] });
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case "set-rallypoint":
|
case "set-rallypoint":
|
||||||
|
@ -16,6 +16,18 @@ Formation.prototype.GetMemberCount = function()
|
|||||||
return this.members.length;
|
return this.members.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the 'primary' member of this formation (typically the most
|
||||||
|
* important unit type), for e.g. playing a representative sound.
|
||||||
|
* Returns undefined if no members.
|
||||||
|
* TODO: actually implement something like that; currently this just returns
|
||||||
|
* the arbitrary first one.
|
||||||
|
*/
|
||||||
|
Formation.prototype.GetPrimaryMember = function()
|
||||||
|
{
|
||||||
|
return this.members[0];
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise the members of this formation.
|
* Initialise the members of this formation.
|
||||||
* Must only be called once.
|
* Must only be called once.
|
||||||
|
@ -362,6 +362,10 @@ GuiInterface.prototype.SetBuildingPlacementPreview = function(player, cmd)
|
|||||||
|
|
||||||
GuiInterface.prototype.PlaySound = function(player, data)
|
GuiInterface.prototype.PlaySound = function(player, data)
|
||||||
{
|
{
|
||||||
|
// Ignore if no entity was passed
|
||||||
|
if (!data.entity)
|
||||||
|
return;
|
||||||
|
|
||||||
PlaySound(data.name, data.entity);
|
PlaySound(data.name, data.entity);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,9 +51,8 @@ var UnitFsmSpec = {
|
|||||||
// ignore when we're not in FORMATIONMEMBER
|
// ignore when we're not in FORMATIONMEMBER
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Called when being told to walk as part of a formation
|
||||||
"Order.FormationWalk": function(msg) {
|
"Order.FormationWalk": function(msg) {
|
||||||
this.PlaySound("walk");
|
|
||||||
|
|
||||||
var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
|
var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
|
||||||
cmpUnitMotion.MoveToFormationOffset(msg.data.target, msg.data.x, msg.data.z);
|
cmpUnitMotion.MoveToFormationOffset(msg.data.target, msg.data.x, msg.data.z);
|
||||||
|
|
||||||
@ -65,15 +64,11 @@ var UnitFsmSpec = {
|
|||||||
// (these will switch the unit out of formation mode)
|
// (these will switch the unit out of formation mode)
|
||||||
|
|
||||||
"Order.Walk": function(msg) {
|
"Order.Walk": function(msg) {
|
||||||
this.PlaySound("walk");
|
|
||||||
|
|
||||||
this.MoveToPoint(this.order.data.x, this.order.data.z);
|
this.MoveToPoint(this.order.data.x, this.order.data.z);
|
||||||
this.SetNextState("INDIVIDUAL.WALKING");
|
this.SetNextState("INDIVIDUAL.WALKING");
|
||||||
},
|
},
|
||||||
|
|
||||||
"Order.WalkToTarget": function(msg) {
|
"Order.WalkToTarget": function(msg) {
|
||||||
this.PlaySound("walk");
|
|
||||||
|
|
||||||
var ok = this.MoveToTarget(this.order.data.target);
|
var ok = this.MoveToTarget(this.order.data.target);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
@ -707,9 +702,24 @@ UnitAI.prototype.GetRunSpeed = function()
|
|||||||
return cmpMotion.GetRunSpeed();
|
return cmpMotion.GetRunSpeed();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Play a sound appropriate to the current entity.
|
||||||
|
*/
|
||||||
UnitAI.prototype.PlaySound = function(name)
|
UnitAI.prototype.PlaySound = function(name)
|
||||||
{
|
{
|
||||||
|
// If we're a formation controller, use the sounds from our first member
|
||||||
|
if (this.IsFormationController())
|
||||||
|
{
|
||||||
|
var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation);
|
||||||
|
var member = cmpFormation.GetPrimaryMember();
|
||||||
|
if (member)
|
||||||
|
PlaySound(name, member);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Otherwise use our own sounds
|
||||||
PlaySound(name, this.entity);
|
PlaySound(name, this.entity);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
UnitAI.prototype.SelectAnimation = function(name, once, speed, sound)
|
UnitAI.prototype.SelectAnimation = function(name, once, speed, sound)
|
||||||
|
@ -62,6 +62,11 @@
|
|||||||
</Vision>
|
</Vision>
|
||||||
<Sound>
|
<Sound>
|
||||||
<SoundGroups>
|
<SoundGroups>
|
||||||
|
<select>voice/hellenes/civ/civ_male_select.xml</select>
|
||||||
|
<order_walk>voice/hellenes/civ/civ_male_ack.xml</order_walk>
|
||||||
|
<order_attack>voice/hellenes/civ/civ_male_attack.xml</order_attack>
|
||||||
|
<order_gather>voice/hellenes/civ/civ_male_ack.xml</order_gather>
|
||||||
|
<order_repair>voice/hellenes/civ/civ_male_ack.xml</order_repair>
|
||||||
<walk>actor/mounted/movement/walk.xml</walk>
|
<walk>actor/mounted/movement/walk.xml</walk>
|
||||||
<run>actor/mounted/movement/walk.xml</run>
|
<run>actor/mounted/movement/walk.xml</run>
|
||||||
<attack>attack/weapon/sword.xml</attack>
|
<attack>attack/weapon/sword.xml</attack>
|
||||||
|
@ -83,6 +83,11 @@
|
|||||||
</Builder>
|
</Builder>
|
||||||
<Sound>
|
<Sound>
|
||||||
<SoundGroups>
|
<SoundGroups>
|
||||||
|
<select>voice/hellenes/civ/civ_male_select.xml</select>
|
||||||
|
<order_walk>voice/hellenes/civ/civ_male_ack.xml</order_walk>
|
||||||
|
<order_attack>voice/hellenes/civ/civ_male_attack.xml</order_attack>
|
||||||
|
<order_gather>voice/hellenes/civ/civ_male_ack.xml</order_gather>
|
||||||
|
<order_repair>voice/hellenes/civ/civ_male_ack.xml</order_repair>
|
||||||
<walk>actor/human/movement/walk.xml</walk>
|
<walk>actor/human/movement/walk.xml</walk>
|
||||||
<run>actor/human/movement/run.xml</run>
|
<run>actor/human/movement/run.xml</run>
|
||||||
<attack>attack/weapon/sword.xml</attack>
|
<attack>attack/weapon/sword.xml</attack>
|
||||||
|
@ -54,6 +54,11 @@
|
|||||||
</Vision>
|
</Vision>
|
||||||
<Sound>
|
<Sound>
|
||||||
<SoundGroups>
|
<SoundGroups>
|
||||||
|
<select>voice/hellenes/civ/civ_male_select.xml</select>
|
||||||
|
<order_walk>voice/hellenes/civ/civ_male_ack.xml</order_walk>
|
||||||
|
<order_attack>voice/hellenes/civ/civ_male_attack.xml</order_attack>
|
||||||
|
<order_gather>voice/hellenes/civ/civ_male_ack.xml</order_gather>
|
||||||
|
<order_repair>voice/hellenes/civ/civ_male_ack.xml</order_repair>
|
||||||
<walk>actor/human/movement/walk.xml</walk>
|
<walk>actor/human/movement/walk.xml</walk>
|
||||||
<run>actor/human/movement/walk.xml</run>
|
<run>actor/human/movement/walk.xml</run>
|
||||||
<attack>attack/weapon/sword.xml</attack>
|
<attack>attack/weapon/sword.xml</attack>
|
||||||
|
Loading…
Reference in New Issue
Block a user