Author Topic: Local Area Shout  (Read 381 times)

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Local Area Shout
« on: April 06, 2011, 09:11:09 am »


               I know how to stop shout in all areas.  yet I seem to be unable to just make a Local area shout.  Is there a hook or 2da work.  or is it just so late my mind is mush? I've seen it done, well I thought maybe I had maybe all they did was disable it huh?
               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Local Area Shout
« Reply #1 on: April 06, 2011, 12:39:54 pm »


               You may be able to intercept them in the chat script, and send them in another form to each PC in the same Area.
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Local Area Shout
« Reply #2 on: April 06, 2011, 09:15:53 pm »


               /////////////////////////[  ]/////////////////////////////
//:: Name: md_plychat
//::
//:: Created By: Greyfort
//:: Created On: 04.05.2011
//:: Last Update:
//:: Version: 1.00
//::////////////////////////////////////////////// ////
/////////////////////////[ CUSTOM FUNTIONS ]/////////////////////////////

/////////////////////////////////////////////////////////////////
// this scans oObjects area for Player characters in
// oObjects area
void LocalAreaCheck (object oObject = OBJECT_SELF  );

void LocalAreaCheck (object oObject = OBJECT_SELF  )
{
string sPlySht = GetLocalString(oObject,"sPlyShout");

object oAreaPlayer = GetFirstObjectInArea( GetArea(oObject) );
while ( GetIsObjectValid(oAreaPlayer) )
    { // This is other PCs in area
    if(GetIsPC(oAreaPlayer)&& oAreaPlayer != oObject)
        {
        // local area shout emulation
        AssignCommand(oAreaPlayer ,ActionSpeakString("You hear !!!SHOUTING!!! "+sPlySht+"",TALKVOLUME_TALK) );
        FloatingTextStringOnCreature("You hear !!!SHOUTING!!! "+sPlySht+"",oAreaPlayer);
        }// this is PC shouting
    else if(GetIsPC(oAreaPlayer)&& oAreaPlayer == oObject)
        {
        // local area shout emulation
        AssignCommand(oAreaPlayer ,ActionSpeakString("You !!!SHOUT!!! "+sPlySht+"",TALKVOLUME_TALK) );
        FloatingTextStringOnCreature("You !!!SHOUT!!! "+sPlySht+"",oAreaPlayer);
        }

    oAreaPlayer = GetNextObjectInArea(GetArea(oObject));
    }
}
////////////////[ END OF LocalAreaCheck ]//////////////////////////////////////


//////////////////////////////////[ MAIN ]//////////////////////////////////////
void main()
{

object oPC = GetPCChatSpeaker();
SetLocalString(oPC,"sPlyShout",GetPCChatMessage() );

object oArea = GetArea(oPC);
// this will make no shout in All areas
if( GetTag( oArea ) != "ALLAREASNOSHOUT" )
    {
    int nChatVolume = GetPCChatVolume();
    // this will make player just talk
    if( nChatVolume == TALKVOLUME_SHOUT ) { SetPCChatVolume(TALKVOLUME_TALK); }

/*
    NOTE: Still trying to figure area only shout option but this emulates it.
*/
    // this will send shout to other players in area via a Floaty Text//
    LocalAreaCheck(oPC);
    }


////////////////////////////////////////////////
}//END OF SCRIPT



Yeah thats waht I thought so I made this script. Place it withn your module event "on player chat"
It emulates players shouting in your local area.  It also makes no shouting module wide.  If any need help adjusting it for there module send me a PM

EDITED ON 04.09.2011 //:: NEW SCRIPT CODE
               
               

               


                     Modifié par Greyfort, 10 avril 2011 - 04:07 .
                     
                  


            

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
Local Area Shout
« Reply #3 on: April 07, 2011, 04:33:02 am »


               Lol i read the topic kind of fast and thought it said local area sllut
               
               

               


                     Modifié par Builder_Anthony, 07 avril 2011 - 03:33 .
                     
                  


            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Local Area Shout
« Reply #4 on: April 10, 2011, 05:10:59 am »


               I made the above script recognize between the person shouting, and the persons hearing the shout.  The above code has been updated.  If anyone needs any help send me a PM.