Aller au contenu

Photo

action taken conversation script not playing sounds


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
qworty

qworty
  • Members
  • 11 messages
Just coming back after a very long time and wanted to try a litel scripting.

Was trying to make a script fro the action taken part of a conversation that would play some sounds but Im not having much luck


// a_DoStuff (string sTarget)
/*
    Description:
   
    Parameters:
        sTarget -  Tag of the target object.  Default is OWNER.

       
    === Action Script general Info ===
    This is a conversation action script template. 
    Action script names are usually prefixed as follows:
        "ga_" - global action script
        "ka_" - campaign action script
        "<moduleID>a_" - module action script
    Conversation actions and conditions are the only scripts that can have parameters.
    Any number and many types of parameters can be passed.
*/
// Name_Date

#include "ginc_param_const"

void main(string sTarget)
{
    // Get the PC Speaker - if used from command line, then use OBJECT_SELF
    // In a conversation, OBJECT_SELF refers to the NPC.
    // From the command line, OBJECT_SELF refers to the currently possesed character.
    object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());

    // Find a target by Tag - also supports "$PC", "$OWNED_CHAR", etc. (see list in ginc_param_const)
    // Optional second parameter can be added to change the default target.
    object oTarget = GetTarget(sTarget);

    // If debug text is on, this will let you know the script fired.
    PrettyDebug("Script Fired on target: " + GetName(oTarget) + "!");
   
    // Do stuff here
    PlaySound("vs_safiya_slct");
    PlaySound("vs_safiya_slct");
    PlaySound("vs_safiya_slct");
    PlaySound("vs_safiya_slct");
    PlaySound("vs_safiya_hit1");
    PlaySound("vs_safiya_hit2");
    PlaySound("vs_safiya_slct");
    PlaySound("vs_safiya_hit3");
    PlaySound("vs_safiya_dead");
    PlaySound("vs_safiya_good");

}

#2
Orion7486

Orion7486
  • Members
  • 161 messages
I'm guessing you're just trying to do your own script rather than the one that's already written, ga_play_sound. What have you placed in sTarget field. Is it an npc that is nearby? I believe the level of sound for PlaySound is location based. If sTarget is blank, then the convo owner will play the sound. Also, PlaySound has to be used as a command on that character, using AssignCommand. See ga_play_sound for an example.

#3
qworty

qworty
  • Members
  • 11 messages
Thanks for the tips Ill look into them right now :D